[Reversing.kr] Easy_KeygenMe Writeup - Zhengjim
2017-3-4 11:9:0 Author: www.cnblogs.com(查看原文) 阅读量:3 收藏

IDA打开。Main()函数就是关键算法

v6,v7,v8 是连续的 。可看成 L=[16,32,48]输入的name每位分别于L[]异或 得到的值存在v13。然后清空v9的值 ,输入Serial储存v9  再让v13v9比较。

可还原算法:

#!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

文章来源: https://www.cnblogs.com/zhengjim/p/6500804.html
如有侵权请联系:admin#unsafe.sh