init
This commit is contained in:
32
xor.py
Normal file
32
xor.py
Normal 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()
|
||||
|
||||
Reference in New Issue
Block a user