关键代码位置及断点:
[Asm] 纯文本查看 复制代码 00401050 | 81 7C 24 08 11 01 00 00 | cmp dword ptr ss:[esp+0x8], 0x111 |
00401058 | 75 42 | jne 破解我.40109C |
0040105A | 66 81 7C 24 0C EA 03 | cmp word ptr ss:[esp+0xC], 0x3EA |
00401061 | 75 39 | jne 破解我.40109C |
00401063 | E8 98 01 00 00 | call <破解我.sub_401200> | 关键call
00401068 | 83 F8 01 | cmp eax, 0x1 |
0040106B | 6A 00 | push 0x0 |
0040106D | 68 8C 50 40 00 | push 破解我.40508C | 40508C:"crackme"
00401072 | 75 16 | jne 破解我.40108A |
00401074 | A1 B8 56 40 00 | mov eax, dword ptr ds:[0x4056B8] |
00401079 | 68 44 50 40 00 | push 破解我.405044 | 405044:"Registration Successful!\nGood Job!\nPlease contact:xufeng0325@gmail.com"
IDA中反编译中显示,两层循环,算法得跟一会。
[C++] 纯文本查看 复制代码 signed int sub_401200()
{
int v0; // ebx
unsigned int v1; // ebp
signed int v2; // esi
unsigned int v3; // edi
int v4; // eax
unsigned __int64 v5; // rax
bool v6; // zf
unsigned int v7; // esi
unsigned __int64 v8; // kr00_8
signed int result; // eax
char *v10; // [esp+10h] [ebp-28h]
int v11; // [esp+14h] [ebp-24h]
int v12; // [esp+18h] [ebp-20h]
unsigned int v13; // [esp+20h] [ebp-18h]
CHAR String; // [esp+24h] [ebp-14h]
v0 = 0;
v1 = 0;
v13 = 0;
v2 = 1;
v3 = 0;
LOBYTE(v4) = GetDlgItemTextA(hDlg, 1000, &String, 20);
if ( !(_BYTE)v4 )
goto LABEL_13;
v4 = (char)v4;
v12 = (char)v4;
if ( (char)v4 > 0 )
{
v10 = (char *)&v13 + v4 + 3;
do
{
if ( v0 > 0 )
{
v11 = v0;
do
{
v5 = 10 * __PAIR__(v3, v2);
v2 *= 10;
v6 = v11 == 1;
v3 = HIDWORD(v5);
--v11;
}
while ( !v6 );
}
v8 = (*v10 - 48) * __PAIR__(v3, v2) + __PAIR__(v13, v1);
v7 = v8 >> 32;
v1 = v8;
v3 = 0;
++v0;
v13 = v7;
v2 = 1;
--v10;
}
while ( v0 < v12 );
}
if ( (v1 & 0xFF23301)
+ (unsigned __int64)((signed __int64)(3123612579u * __PAIR__(v13, v1)) / 0x800000000i64)
+ ~v1 * v1 == 0x86FFB5B8 )
result = 1;
else
LABEL_13:
result = 0;
return result;
} |