From 4c8ce61952092d2fb648a81cb57ad157a64cfde4 Mon Sep 17 00:00:00 2001 From: Alexandre CHAZAL Date: Fri, 7 Oct 2022 19:32:26 +0200 Subject: [PATCH] init --- xor.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 xor.py diff --git a/xor.py b/xor.py new file mode 100644 index 0000000..c13a368 --- /dev/null +++ b/xor.py @@ -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() +