破解练习-CRACKME001
001-注册算法分析一、工具和调试环境
[*]动态调试工具:x64dbg
[*]系统环境:win10 1909
二、分析Serial/name的算法
由于Serial里面就是一个字符串比较,没有啥算法,这里就不详细说了,大概就是通过搜索字符串Failed,就能定位到关键位置,Serial直接可以在栈中观察到,为:Hello Dude!。所以我们主要分析Serial/name的注册算法。
直接使用提示字符串验证,得到错误提示如下
https://img2023.cnblogs.com/blog/2747704/202302/2747704-20230211194041866-1594028423.png
那么我们直接搜索字符串Sorry,得知有两个地方使用该字符串,都设置上断点,然后重新验证,成功断在0x0042F826处,先分析这个,另一个后面再说
https://img2023.cnblogs.com/blog/2747704/202302/2747704-20230211194055557-902726397.png
断下之后向上定位到关键算法如下
0042FA87 | 8B45 F0 | mov eax,dword ptr ss: | :"Please enter your name !" ; 获取name首地址
0042FA8A | 0FB600 | movzx eax,byte ptr ds: | ; eax = name 取出name的第一个字符存放在eax中
0042FA8D | F72D 50174300 | imul dword ptr ds: | 00431750:L")"; ")" aiscii码为 0x29eax = name * 0x29
0042FA93 | A3 50174300 | mov dword ptr ds:,eax | ; key = name * 0x29
0042FA98 | A1 50174300 | mov eax,dword ptr ds: | ;
0042FA9D | 0105 50174300 | add dword ptr ds:,eax | ; key = name * 0x29 * 2通过算法key = name * 0x29 * 2算出key后,紧接着拼接得到Serial,格式为:CW-key-CRACKED
三、算法核心代码模拟
char* GetSerial(char* szName)
{
static char szSerial = {};
if (strlen(szName) < 4)
{
MessageBox(NULL, "Name至少需要4位", "温馨提示", MB_OK);
return nullptr;
}
int key = szName * 0x29 * 2;
sprintf(szSerial, "CW-%d-CRACKED", key);
return szSerial;
}
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]