-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathxorish.py
More file actions
27 lines (24 loc) Β· 767 Bytes
/
xorish.py
File metadata and controls
27 lines (24 loc) Β· 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# xorish.py
#
# Just playing around with fast and easy commenting for
# IDA Pro, mainly used on some ELF ARM binaries
#
# Tim Strazzere <diff@lookout.com>
#
def strxor(a, b):
return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b*100)])
def xor():
print ' ..'
ea = ScreenEA()
string = idc.GetString(idc.GetOperandValue(ea,1))
key = 'BB2FA36AAA9541F0'
xored_string = strxor(string, key)
print ' got %s ' % xored_string
comment = ''
if GetCommentEx(ea, 1) is not None:
comment = idc.GetCommentEx(ea, 1) + '\n'
MakeRptCmt(ea, comment + string + " xor'ed " + xored_string)
# Create something bindable
idaapi.CompileLine('static xorish() { RunPythonStatement("xor()"); }')
# Bind the hotkey
AddHotkey("/", 'xorish')