diff options
author | n0p <0x90@n0p.cc> | 2018-03-07 21:28:30 +0100 |
---|---|---|
committer | n0p <0x90@n0p.cc> | 2018-03-07 21:28:30 +0100 |
commit | ce63c6edf4c54e317ce5de1bca972151c465b728 (patch) | |
tree | 88ce0faa468f386ce2367f734c532686de197802 | |
parent | 71fcf2286be5704a3d3c7bd157802e9b0c109f04 (diff) | |
download | idaSystemCalls-ce63c6edf4c54e317ce5de1bca972151c465b728.tar.gz idaSystemCalls-ce63c6edf4c54e317ce5de1bca972151c465b728.zip |
Fixed NOPing.
-rw-r--r-- | SystemCalls.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/SystemCalls.py b/SystemCalls.py index 7136194..6f4a0c7 100644 --- a/SystemCalls.py +++ b/SystemCalls.py @@ -19,7 +19,9 @@ except: import idaapi import idc +import ida_idaapi import ida_bytes +import ida_gdl import ida_idp import ida_search import ida_segment @@ -109,12 +111,11 @@ class SystemCallView(idaapi.Choose2): def OnCommand(self, n, cmd_id): if cmd_id == self.cmd_nop: start_ea = int(self.items[n][0], 16) - end_ea = start_ea + ItemSize(start_ea) + end_ea = start_ea + idc.get_item_size(start_ea) self.nop_items.append(self.items[n][0]) - for i in xrange(start_ea, end_ea): - PatchByte(i, 0x90) + ida_bytes.patch_bytes(start_ea, (end_ea - start_ea) * '\x90') def OnGetIcon(self, n): if not len(self.items) > 0: @@ -256,8 +257,8 @@ class SystemCall(): # Check if addr is in a basic block without an entry. if len(self.ir_arch.getby_offset(addr)) == 0: - fc = qflow_chart_t('', func.f, idaapi.BADADDR, - idaapi.BADADDR, idaapi.FC_PREDS) + fc = qflow_chart_t('', func.f, ida_idaapi.BADADDR, + ida_idaapi.BADADDR, ida_gdl.FC_PREDS) try: # Iterate through all basic blocks. @@ -315,7 +316,7 @@ class SystemCall(): addr = ida_search.find_binary( seg.startEA, seg.endEA, sbytes, 16, ida_search.SEARCH_DOWN) - while addr != idaapi.BADADDR: + while addr != ida_idaapi.BADADDR: if (ida_bytes.get_item_head(addr) == addr and ida_bytes.get_item_size(addr) == slength): self.__addCall(addr, sctype, arch) |