diff options
| author | Ana María Martínez Gómez <anamaria.martinezgom@FireEye.com> | 2020-08-18 19:59:30 +0200 |
|---|---|---|
| committer | Ana María Martínez Gómez <anamaria.martinezgom@FireEye.com> | 2020-08-18 19:59:30 +0200 |
| commit | decd99ff56b2f12e896d68bc89694601be7e0e77 (patch) | |
| tree | 3ba3cb411bd07a05b89945c83cf35545b2cf7551 /miasm/jitter/loader/pe.py | |
| parent | a01c29cd82f5a717e8dee622002e1ca3e189f420 (diff) | |
| download | focaccia-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.py | 3 |
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] |