plasma-disassembler / plasma

Plasma is an interactive disassembler for x86/ARM/MIPS. It can generates indented pseudo-code with colored syntax.
GNU General Public License v3.0
3.05k stars 275 forks source link

Wrong parse ELF, without section name #84

Closed GH0st3rs closed 6 years ago

GH0st3rs commented 6 years ago

I found some bug, if into elf file doesnt contains section names, the parser may not see or display some sections. Example: First section in file has len(name) == 0 screenshot - 20 11 2017 - 14 45 19

diff --git a/plasma/lib/fileformat/elf.py b/plasma/lib/fileformat/elf.py
index c1349b8..2176ade 100644
--- a/plasma/lib/fileformat/elf.py
+++ b/plasma/lib/fileformat/elf.py
@@ -108,7 +108,8 @@ class ELF(Binary):
         # Load sections
         for s in self.elf.iter_sections():
             if not s.name:
-                continue
+                 s.name = '.unknow'
+            #    continue

             # Keep only sections R|W|X
             # TODO : is it sufficiant ?
plasma-disassembler commented 6 years ago

Thanks !