diff --git a/removeint3.py b/removeint3.py new file mode 100644 index 0000000..be3adfa --- /dev/null +++ b/removeint3.py @@ -0,0 +1,33 @@ +# Replaces all INT3 instructions in the selection by NOPs +#@author AlxCzl +#@category Instructions +#@keybinding +#@menupath +#@toolbar + +def main(): + """Main""" + + if not currentSelection: + print("[!] Please select the range to be patched") + return + + print('[*] Patching instructions...') + + addrRange = currentSelection.getAddressRanges().next() + currAddr = addrRange.minAddress + count = 0 + + while currAddr < addrRange.maxAddress: + currVal = getByte(currAddr) + if currVal == 0xcc - 256: + count += 1 + setByte(currAddr, 0x90) + + currAddr = currAddr.add(1) + + print('[*] Removed {} int3.'.format(count)) + + +if __name__ == '__main__': + main()