feat(int3): added a script that replaces INT3 by NOPs

This commit is contained in:
2022-10-10 18:54:29 +02:00
parent 4c8ce61952
commit b3b454dff7

33
removeint3.py Normal file
View File

@@ -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()