about summary refs log tree commit diff stats
path: root/miasm/jitter/loader/pe.py
diff options
context:
space:
mode:
authorAna María Martínez Gómez <anamaria.martinezgom@FireEye.com>2020-08-18 19:59:30 +0200
committerAna María Martínez Gómez <anamaria.martinezgom@FireEye.com>2020-08-18 19:59:30 +0200
commitdecd99ff56b2f12e896d68bc89694601be7e0e77 (patch)
tree3ba3cb411bd07a05b89945c83cf35545b2cf7551 /miasm/jitter/loader/pe.py
parenta01c29cd82f5a717e8dee622002e1ca3e189f420 (diff)
downloadfocaccia-miasm-decd99ff56b2f12e896d68bc89694601be7e0e77.tar.gz
focaccia-miasm-decd99ff56b2f12e896d68bc89694601be7e0e77.zip
Fix get_export_name_addr_list when there are no exports
If there are no exports, calling to `get_export_name_addr_list` raises
an exception at `miasm/jitter/loader/pe.py`, line 152:

```
AttributeError: 'DirExport' object has no attribute 'f_names'
```

Return an empty list instead.
Diffstat (limited to 'miasm/jitter/loader/pe.py')
-rw-r--r--miasm/jitter/loader/pe.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/miasm/jitter/loader/pe.py b/miasm/jitter/loader/pe.py
index 73cb1367..723cb06b 100644
--- a/miasm/jitter/loader/pe.py
+++ b/miasm/jitter/loader/pe.py
@@ -148,6 +148,9 @@ def get_export_name_addr_list(e):
         assert exports[0] == ('AcquireSRWLockExclusive', 0x6b89b22a)
     """
     out = []
+    if e.DirExport.expdesc is None:
+        return out
+
     # add func name
     for i, n in enumerate(e.DirExport.f_names):
         addr = e.DirExport.f_address[e.DirExport.f_nameordinals[i].ordinal]