feat(int3): added a script that replaces INT3 by NOPs
This commit is contained in:
33
removeint3.py
Normal file
33
removeint3.py
Normal 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()
|
||||
Reference in New Issue
Block a user