IDA打开。Main()函数就是关键算法
v6,v7,v8 是连续的 。可看成 L=[16,32,48]。输入的name每位分别于L[]异或 得到的值存在v13。然后清空v9的值 ,输入Serial储存在v9 再让v13与v9比较。
可还原算法:
#!usr/bin/env python
#!coding=utf-8 __author__ = 'zhengjim' name = raw_input()
L=[16,32,48]
flag =''
for i,name in enumerate(name):
f = hex(ord(name)^L[i%3]).replace('0x','')
flag+=f
print flag.upper()
暴力破解代码:
#!usr/bin/env python
#!coding=utf-8 __author__ = 'zhengjim' S = [0x5B,0x13,0x49,0x77,0x13,0x5E,0x7D,0x13]
L=[16,32,48]
flag =''
for i,s in enumerate(S):
for f in xrange(127):
if f^L[i%3] == s:
flag+=chr(f)
break
print flag