Skip to content

Commit 7b276ae

Browse files
committed
Handle gracefully the case where PE files do not have DIRECTORY_ENTRY_EXPORT
1 parent 272a3da commit 7b276ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

qiling/loader/pe.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def load_dll(self, name: bytes, driver: bool = False) -> int:
142142
import_symbols = {}
143143
import_table = {}
144144

145-
for entry in dll.DIRECTORY_ENTRY_EXPORT.symbols:
145+
dll_symbols = getattr(getattr(dll, 'DIRECTORY_ENTRY_EXPORT', None), 'symbols', [])
146+
for entry in dll_symbols:
146147
import_symbols[image_base + entry.address] = {
147148
"name": entry.name,
148149
"ordinal": entry.ordinal,

0 commit comments

Comments
 (0)