- UID
- 34236
注册时间2007-8-13
阅读权限10
最后登录1970-1-1
周游历练
该用户从未签到
|
【文章标题】: crackme 算法分析
【文章作者】: anan
【作者邮箱】: [email protected]
【下载地址】: ...没法上传附件......还是去 看雪crackme2007上 下吧 (序列号\4nail \一只老虎)
【作者声明】: 没有任何反调试的东西 适合我等新手啊
--------------------------------------------------------------------------------
【详细过程】
0048C6D4 /. 55 push ebp
0048C6D5 |. 8BEC mov ebp, esp
0048C6D7 |. 83C4 84 add esp, -7C
0048C6DA |. 53 push ebx
0048C6DB |. 56 push esi
0048C6DC |. 57 push edi
0048C6DD |. 33C9 xor ecx, ecx
0048C6DF |. 894D 84 mov dword ptr [ebp-7C], ecx
0048C6E2 |. 894D FC mov dword ptr [ebp-4], ecx
0048C6E5 |. 894D F8 mov dword ptr [ebp-8], ecx
0048C6E8 |. 894D F4 mov dword ptr [ebp-C], ecx
0048C6EB |. 894D F0 mov dword ptr [ebp-10], ecx
0048C6EE |. 894D EC mov dword ptr [ebp-14], ecx
0048C6F1 |. 8BD8 mov ebx, eax
0048C6F3 |. 33C0 xor eax, eax
0048C6F5 |. 55 push ebp
0048C6F6 |. 68 67C84800 push 0048C867
0048C6FB |. 64:FF30 push dword ptr fs:[eax]
0048C6FE |. 64:8920 mov dword ptr fs:[eax], esp
0048C701 |. 8D55 FC lea edx, dword ptr [ebp-4]
0048C704 |. 8B83 04030000 mov eax, dword ptr [ebx+304]
0048C70A |. E8 E57EFAFF call 004345F4 ; 取用户名N
0048C70F |. 8D55 F8 lea edx, dword ptr [ebp-8]
0048C712 |. 8B83 08030000 mov eax, dword ptr [ebx+308]
0048C718 |. E8 D77EFAFF call 004345F4 ; 取注册码S
0048C71D |. 8D45 F4 lea eax, dword ptr [ebp-C]
0048C720 |. BA 80C84800 mov edx, 0048C880 ; 字符串Z1:i am bin laden
0048C725 |. E8 CA77F7FF call 00403EF4
0048C72A |. 8D45 F0 lea eax, dword ptr [ebp-10]
0048C72D |. BA 98C84800 mov edx, 0048C898 ; 字符串Z2:i am yi zhi lao hu
0048C732 |. E8 BD77F7FF call 00403EF4
0048C737 |. 8B45 FC mov eax, dword ptr [ebp-4]
0048C73A |. E8 DD79F7FF call 0040411C ; 取用户名N的位数
0048C73F |. 83F8 0A cmp eax, 0A ; N的位数要>=10
0048C742 |. 0F8C FC000000 jl 0048C844
0048C748 |. 8B45 FC mov eax, dword ptr [ebp-4] ; N送EAX
0048C74B |. E8 CC79F7FF call 0040411C ; 取用户名N的位数
0048C750 |. 83F8 10 cmp eax, 10 ; N的位数要<=16
0048C753 |. 0F8F EB000000 jg 0048C844
0048C759 |. 8B45 F8 mov eax, dword ptr [ebp-8] ; 注册码S送EAX
0048C75C |. E8 BB79F7FF call 0040411C
0048C761 |. 83F8 11 cmp eax, 11 ; S的位数>=17
0048C764 |. 0F8C DA000000 jl 0048C844
0048C76A |. 8B45 F8 mov eax, dword ptr [ebp-8]
0048C76D |. E8 AA79F7FF call 0040411C
0048C772 |. 83F8 16 cmp eax, 16 ; S的位数<=22
0048C775 |. 0F8F C9000000 jg 0048C844
0048C77B |. 8D45 FC lea eax, dword ptr [ebp-4] ; EAX指向N
0048C77E |. 8B55 F4 mov edx, dword ptr [ebp-C]
0048C781 |. E8 9E79F7FF call 00404124 ; N与Z1联接=N1
0048C786 |. BB 64000000 mov ebx, 64
0048C78B |. 8D45 88 lea eax, dword ptr [ebp-78]
0048C78E |> C600 2E /mov byte ptr [eax], 2E
0048C791 |. 40 |inc eax
0048C792 |. 4B |dec ebx
0048C793 |.^ 75 F9 \jnz short 0048C78E
0048C795 |. 8B45 FC mov eax, dword ptr [ebp-4] ; N1送EAX
0048C798 |. E8 7F79F7FF call 0040411C ; N1的位数(控制外循环)
0048C79D |. 8BF8 mov edi, eax
0048C79F |. 85FF test edi, edi
0048C7A1 |. 7E 47 jle short 0048C7EA
0048C7A3 |. BB 01000000 mov ebx, 1
0048C7A8 |> 8B45 F0 /mov eax, dword ptr [ebp-10] ; Z2送EAX(Z2的位数控制内循环)
0048C7AB |. E8 6C79F7FF |call 0040411C
0048C7B0 |. 8BF0 |mov esi, eax
0048C7B2 |. 85F6 |test esi, esi
0048C7B4 |. 7E 30 |jle short 0048C7E6
0048C7B6 |. B9 01000000 |mov ecx, 1
0048C7BB |> 8B45 FC |/mov eax, dword ptr [ebp-4] ; N1送EAX
0048C7BE |. 0FB64418 FF ||movzx eax, byte ptr [eax+ebx-1] ; N1按字节传送给EAX
0048C7C3 |. 8B55 F8 ||mov edx, dword ptr [ebp-8] ; S送EDX
0048C7C6 |. 0FB6540A FF ||movzx edx, byte ptr [edx+ecx-1] ; S按字节送EDX
0048C7CB |. F7EA ||imul edx ; N1[I]*S[I]
0048C7CD |. 51 ||push ecx
0048C7CE |. B9 1A000000 ||mov ecx, 1A
0048C7D3 |. 33D2 ||xor edx, edx
0048C7D5 |. F7F1 ||div ecx ; /1A
0048C7D7 |. 59 ||pop ecx
0048C7D8 |. 83C2 41 ||add edx, 41 ; 余数+41H
0048C7DB |. 8D0419 ||lea eax, dword ptr [ecx+ebx] (算出的数(0--1a)+41H实际上就是(大写字母的ASC范围)
0048C7DE |. 885405 87 ||mov byte ptr [ebp+eax-79], dl
0048C7E2 |. 41 ||inc ecx
0048C7E3 |. 4E ||dec esi
0048C7E4 |.^ 75 D5 |\jnz short 0048C7BB 注意内循环存放数据有覆盖的过程
0048C7E6 |> 43 |inc ebx
0048C7E7 |. 4F |dec edi
0048C7E8 |.^ 75 BE \jnz short 0048C7A8 得到新字符串Z3
0048C7EA |> 8D45 EC lea eax, dword ptr [ebp-14]
0048C7ED |. E8 6A76F7FF call 00403E5C
0048C7F2 |. 8B45 F8 mov eax, dword ptr [ebp-8]
0048C7F5 |. E8 2279F7FF call 0040411C
0048C7FA |. 8BF8 mov edi, eax
0048C7FC |. 85FF test edi, edi
0048C7FE |. 7E 1F jle short 0048C81F
0048C800 |. 8D5D 8E lea ebx, dword ptr [ebp-72]
0048C803 |> 8D45 84 /lea eax, dword ptr [ebp-7C]
0048C806 |. 8A13 |mov dl, byte ptr [ebx]
0048C808 |. E8 3778F7FF |call 00404044
0048C80D |. 8B55 84 |mov edx, dword ptr [ebp-7C]
0048C810 |. 8D45 EC |lea eax, dword ptr [ebp-14]
0048C813 |. 8B4D EC |mov ecx, dword ptr [ebp-14]
0048C816 |. E8 4D79F7FF |call 00404168
0048C81B |. 43 |inc ebx
0048C81C |. 4F |dec edi
0048C81D |.^ 75 E4 \jnz short 0048C803 ;Z3的第6位开始取与注册码相同位数
0048C81F |> 8B45 EC mov eax, dword ptr [ebp-14] 逆序存放
0048C822 |. 8B55 F8 mov edx, dword ptr [ebp-8] ;S送EDX
0048C825 |. E8 3E7AF7FF call 00404268 比较CALL
0048C82A |. 75 18 jnz short 0048C844
0048C82C |. 6A 40 push 40
0048C82E |. B9 ACC84800 mov ecx, 0048C8AC ; 恭喜你
0048C833 |. BA B4C84800 mov edx, 0048C8B4 ; 注册成功!请联系我!qq:609841314
0048C838 |. A1 D0EB4800 mov eax, dword ptr [48EBD0]
0048C83D |. 8B00 mov eax, dword ptr [eax]
0048C83F |. E8 F478FCFF call 00454138
0048C844 |> 33C0 xor eax, eax
0048C846 |. 5A pop edx
0048C847 |. 59 pop ecx
0048C848 |. 59 pop ecx
0048C849 |. 64:8910 mov dword ptr fs:[eax], edx
0048C84C |. 68 6EC84800 push 0048C86E
0048C851 |> 8D45 84 lea eax, dword ptr [ebp-7C]
0048C854 |. E8 0376F7FF call 00403E5C
0048C859 |. 8D45 EC lea eax, dword ptr [ebp-14]
0048C85C |. BA 05000000 mov edx, 5
0048C861 |. E8 1A76F7FF call 00403E80
0048C866 \. C3 retn
========================================================================
算法比较简单 注意点 :1个是 数据存放有个覆盖过程
还有一个就是 N1[I]*S[0]%0x1A+0x41=S[0](I由注册码的位数决定 写注册机时可以自己决定
但不能随便决定 如 10位用户名就不能对应18位注册码,为什么会这样 自己分析吧)
可以得到S[0] ,知道S[0]以后就没什么难的了(就这个S[0]我想了半天才弄明白。。。。。)
注册机 10位用户名对应19位注册码
#include "stdio.h"
#include "string.h"
main()
{ char name[20],z1[]="i am bin laden",z2[]="i am yi zhi lao hu",string[50],s[25];
int i=0,j,k;
printf("请输入用户名: ");
loop:scanf("%s",name);
while(name!='\0')i++;
if(i<10||i>16)
{printf("请重新输入用户名: ");
goto loop;}
strcpy(string,name);
strcat(string,z1);
for(i=65;i<=90;i++)
{if((string[23]*i)%0x1a+0x41==i)
k=i;}
for(i=5;i<=23;i++)
s=(string*k)%0x1a+0x41;
for(i=23;i>=5;i--)
printf("%c",s);
--------------------------------------------------------------------------------
【版权声明】: 转载请注明作者并保持文章的完整, 谢谢!
2007年09月01日 上午 09:42:22 |
|