This commit is contained in:
2022-10-07 19:32:26 +02:00
commit 4c8ce61952

32
xor.py Normal file
View File

@@ -0,0 +1,32 @@
# XORs the instructions in the current selection
#@author AlxCzl
#@category Instructions
#@keybinding
#@menupath
#@toolbar
#-------------------------------------------------------------------------------------------
def main():
"""Main"""
if not currentSelection:
print("[!] Please select the range to be xored")
return
print('[*] XORing byte range...')
addrRange = currentSelection.getAddressRanges().next()
currAddr = addrRange.minAddress
while currAddr < addrRange.maxAddress:
currVal = getByte(currAddr)
newVal = currVal ^ 0x42
setByte(currAddr, newVal)
currAddr = currAddr.add(1)
print('[*] Done.')
if __name__ == '__main__':
main()