@@ -717,7 +717,7 @@ def _all_exports(self):
717
717
def _parse_module_exports (self , module ):
718
718
try :
719
719
module_data = self .read (module .baseaddress , module .size )
720
- except UcError :
720
+ except IndexError :
721
721
self .error (f"Failed to read module data" )
722
722
return []
723
723
pe = PE (data = module_data , fast_load = True )
@@ -757,7 +757,7 @@ def _setup_modules(self):
757
757
try :
758
758
data = self .read (va , size )
759
759
mapped_data [rva :size ] = data
760
- except UcError :
760
+ except IndexError :
761
761
self .error (f"Failed to read section { name } from module { path } " )
762
762
# Load the PE dumped from memory
763
763
pe = PE (data = mapped_data , fast_load = True )
@@ -1325,9 +1325,9 @@ def _hook_code(uc: Uc, address, size, dp: Dumpulator):
1325
1325
instr = next (dp .cs .disasm (code , address , 1 ))
1326
1326
except StopIteration :
1327
1327
instr = None # Unsupported instruction
1328
- except UcError :
1329
- instr = None # Likely invalid memory
1330
- code = []
1328
+ except IndexError :
1329
+ instr = None # Likely invalid memory
1330
+ code = b""
1331
1331
address_name = dp .exports .get (address , "" )
1332
1332
1333
1333
module = ""
@@ -1361,13 +1361,13 @@ def _hook_code(uc: Uc, address, size, dp: Dumpulator):
1361
1361
def _unicode_string_to_string (dp : Dumpulator , arg : P (UNICODE_STRING )):
1362
1362
try :
1363
1363
return arg [0 ].read_str ()
1364
- except UcError :
1364
+ except IndexError :
1365
1365
return None
1366
1366
1367
1367
def _object_attributes_to_string (dp : Dumpulator , arg : P (OBJECT_ATTRIBUTES )):
1368
1368
try :
1369
1369
return arg [0 ].ObjectName [0 ].read_str ()
1370
- except UcError :
1370
+ except IndexError :
1371
1371
pass
1372
1372
return None
1373
1373
@@ -1555,6 +1555,6 @@ def _hook_invalid(uc: Uc, dp: Dumpulator):
1555
1555
return False # NOTE: returning True would stop emulation
1556
1556
except StopIteration :
1557
1557
pass # Unsupported instruction
1558
- except UcError :
1558
+ except IndexError :
1559
1559
pass # Invalid memory access (NOTE: this should not be possible actually)
1560
1560
raise NotImplementedError ("TODO: throw invalid instruction exception" )
0 commit comments