【破文标题】一个简单的CrackMe算法分析及注册机编写【申请邀请码】
【破文作者】chinasmu
【作者邮箱】chinasmu@163.com
【作者主页】
http://hi.baidu.com/hminku
【破解工具】DeDe,OD
【破解平台】Win7
【软件名称】kaiZer.exe
【软件大小】406KB
【原版下载】不记得了,提供个网盘地址:
http://down.qiannao.com/space/file/chinasmu1/share/2010/5/20/kaiZer.exe/.page
【软件简介】用Delphi写的,适合我等菜鸟^.^
上面的地址并不是原版地址,为了照顾像我一样的临时会员,就不在贴子中贴附件了,我放在网盘里供大家下载,为和我一样的临时会员省下那宝贵的2Kx^.^
【破解声明】
很简单,高手飘过,纯属菜鸟交流。
------------------------------------------------------------------------
【破解过程】
1.首先用用Peid查壳,无;算法,无;程序编写语言:Borland Delphi 6.0 - 7.0
2.运行CrackMe,00458815,在Name中输入:chinasmu,在Code中输入:123456789,点击OK,没有任何错误提示:
这样就不好用字符串搜索来查找关键位置了(其实也可以用,在OD里用超级字符串查找,把页面拉到最下面,就可以看到成功的提示,可以跟过去,然后找到段首),因为是用Delphi编写的,我们可以用DeDe来找到按钮事件!
我们在Procedures里看到3个按钮,进去经过简单判断,Button1就是OK按钮单击事件,记下00458815这个地址。
下面就是三个按钮事件:
这个应该是退出按钮了:
这个是关于按钮:
这个调用了很多函数,就是OK啦!
3.OD载入,F2在
00458815 |. 8BEC mov ebp,esp
处下断。F9运行,程序自然断在00458815这里,重新输入上面的Name和Code,F8单步,算法很简单,高手请静静地飘过,分析如下:
00458814 /. 55 push ebp
00458815 |. 8BEC mov ebp,esp
00458817 |. B9 04000000 mov ecx,0x4
0045881C |> 6A 00 /push 0x0
0045881E |. 6A 00 |push 0x0
00458820 |. 49 |dec ecx
00458821 |.^ 75 F9 \jnz short CrackMe_.0045881C
00458823 |. 51 push ecx
00458824 |. 53 push ebx
00458825 |. 56 push esi
00458826 |. 57 push edi
00458827 |. 8BD8 mov ebx,eax
00458829 |. 33C0 xor eax,eax
0045882B |. 55 push ebp
0045882C |. 68 A4894500 push CrackMe_.004589A4
00458831 |. 64:FF30 push dword ptr fs:[eax]
00458834 |. 64:8920 mov dword ptr fs:[eax],esp
00458837 |. 8D55 FC lea edx,[local.1]
0045883A |. 8B83 30030000 mov eax,dword ptr ds:[ebx+0x330]
00458840 |. E8 A79EFDFF call CrackMe_.004326EC ; 取得用户名chinasmu
00458845 |. 8B45 FC mov eax,[local.1]
00458848 |. E8 87B9FAFF call CrackMe_.004041D4 ; 取得用户名长度,这里是8
0045884D |. 8BF0 mov esi,eax ; 此时eax=8,将8给esi
0045884F |. 83FE 01 cmp esi,0x1 ; 用户名长度和1比较,大于等于1则跳
00458852 |. 7D 12 jge short CrackMe_.00458866
00458854 |. 33D2 xor edx,edx
00458856 |. 8B83 44030000 mov eax,dword ptr ds:[ebx+0x344]
0045885C |. E8 BB9EFDFF call CrackMe_.0043271C
00458861 E9 09010000 jmp CrackMe_.0045896F
00458866 |> 83FE 63 cmp esi,0x63 ; 用户名长度和63比较,小于等于63则跳
00458869 |. 7E 12 jle short CrackMe_.0045887D
0045886B |. 33D2 xor edx,edx
0045886D |. 8B83 44030000 mov eax,dword ptr ds:[ebx+0x344]
00458873 |. E8 A49EFDFF call CrackMe_.0043271C
00458878 E9 F2000000 jmp CrackMe_.0045896F
0045887D |> 6BFE 75 imul edi,esi,0x75 ; 用户名长度imul 0x75,值放在edi中
00458880 |. 81C7 3E150000 add edi,0x153E ; 继续加上0x153E
00458886 |. 81EF 74150000 sub edi,0x1574 ; 接着减去0x1574,放入edi中
0045888C |. 8BC6 mov eax,esi ; 将用户名长度8给eax
0045888E |. 83E8 22 sub eax,0x22 ; 减去0x22
00458891 |. 69C0 F0110000 imul eax,eax,0x11F0 ; 继续 imul 0x11F0,放入eax中
00458897 |. 03F8 add edi,eax ; edi eax两值相加
00458899 |. 81C7 4C520E00 add edi,0xE524C ; 再减去0xE52C,放入edi中
0045889F |. 68 BC894500 push CrackMe_.004589BC ; 将字符串:668r9\5233压栈
004588A4 |. 8D55 EC lea edx,[local.5]
004588A7 |. 8BC7 mov eax,edi
004588A9 |. E8 C6F5FAFF call CrackMe_.00407E74 ; 将EDI中的数据转成10进制,得到字符串:820062
004588AE |. FF75 EC push [local.5]
004588B1 |. 68 D0894500 push CrackMe_.004589D0
004588B6 |. 68 DC894500 push CrackMe_.004589DC ; 将字符串:k329[43}压入栈
004588BB |. 8D45 F0 lea eax,[local.4]
004588BE |. BA 04000000 mov edx,0x4
004588C3 |. E8 CCB9FAFF call CrackMe_.00404294 ; 将上面三个字符串连接,得到下面的字符串:
004588C8 |. 8B55 F0 mov edx,[local.4] ; edx=668r9\5233820062-k329[43}
004588CB |. 8B83 44030000 mov eax,dword ptr ds:[ebx+0x344]
004588D1 |. E8 469EFDFF call CrackMe_.0043271C
004588D6 |. 85F6 test esi,esi
004588D8 0F8E 91000000 jle CrackMe_.0045896F
004588DE |. BF 01000000 mov edi,0x1
004588E3 |> 8B45 FC /mov eax,[local.1] ; 用户名chinasmu放入eax中
004588E6 |. 0FB64438 FF |movzx eax,byte ptr ds:[eax+edi-0x1] ; 取eax第一个字符'c'的ASCII码:63【其实这也不完全对,到下面讲原因】
004588EB |. 8945 F4 |mov [local.3],eax
004588EE |. 8D4D F8 |lea ecx,[local.2]
004588F1 |. BA 02000000 |mov edx,0x2
004588F6 |. 8B45 F4 |mov eax,[local.3]
004588F9 |. E8 8AF6FAFF |call CrackMe_.00407F88
004588FE |. 8D55 E4 |lea edx,[local.7]
00458901 |. 8B83 44030000 |mov eax,dword ptr ds:[ebx+0x344]
00458907 |. E8 E09DFDFF |call CrackMe_.004326EC
0045890C |. FF75 E4 |push [local.7] ; 将668r9\5233820062-k329[43}压入栈
0045890F |. FF75 F8 |push [local.2] ; 将63压入栈
00458912 |. 68 F0894500 |push CrackMe_.004589F0 ; 将字符'$'压入栈
00458917 |. 8D45 E8 |lea eax,[local.6]
0045891A |. BA 03000000 |mov edx,0x3
0045891F |. E8 70B9FAFF |call CrackMe_.00404294 ; 将字符串连接起来,得:668r9\5233820062-k329[43}63$,即为真码!
00458924 |. 8B55 E8 |mov edx,[local.6]
00458927 |. 8B83 44030000 |mov eax,dword ptr ds:[ebx+0x344]
0045892D |. E8 EA9DFDFF |call CrackMe_.0043271C
00458932 |. 8D55 E0 |lea edx,[local.8]
00458935 |. 8B83 34030000 |mov eax,dword ptr ds:[ebx+0x334]
0045893B |. E8 AC9DFDFF |call CrackMe_.004326EC ; 读取假码:123456789
00458940 |. 8B45 E0 |mov eax,[local.8]
00458943 |. 50 |push eax ; 假码入栈
00458944 |. 8D55 DC |lea edx,[local.9]
00458947 |. 8B83 44030000 |mov eax,dword ptr ds:[ebx+0x344]
0045894D |. E8 9A9DFDFF |call CrackMe_.004326EC
00458952 |. 8B55 DC |mov edx,[local.9] ; 真码:668r9\5233820062-k329[43}63$
00458955 |. 58 |pop eax ; 假码:123456789
00458956 |. E8 C5B9FAFF |call CrackMe_.00404320 ; 真、假比较
0045895B 75 0A |jnz short CrackMe_.00458967 ; 关键跳,跳转则完蛋!
0045895D |. B8 FC894500 |mov eax,CrackMe_.004589FC ; Very good! You solved this crackme! Mail me!
OK,到此为止,我们得到了正确的一组注册码:
Name:chinasmu
Code:668r9\5233820062-k329[43}63$
试试看:
成功!!!
另外,上面讲到有一处不对的地方,是因为我写好KeyGen时,Name用look测试了一下,发现计算出来的Code不正确!!!
经过重载入OD,发现l的16进制AScII是6c,但是真正需要的是6C,因此,还要将ASCII中可能出现的小写字母转成大写!又多了一项工作,让我弄了好久啊!今天凌晨2点才弄了个七七八八,谁让咱的水平太差呢^.^
用C写的注册机,附上源码,代码也惨不忍睹,高手请见谅!
诚心欢迎各位的批评指证!
希望大家能共同进步!
注册机源码如下:
#include"stdio.h"
#include"string.h"
#include <windows.h>
int main()
{
int n=0;
char c='0';
char s[2]="0";
char name[80]="0";
SetConsoleTitle("KeyGen by chinasmu");
printf("╔═══════════╗\n");
printf("║首发看雪,转载请注明 ║\n");
printf("╚═══════════╝\n\n");
printf("Name:");
gets(name);
n=strlen(name);
n=(n*117+5438-5492)+((n-34)*4592)+938572;
itoa(name[0],s,16);
printf("\nCode:668r9\\5233%d-k329[43}%s$\n\n\n",n,strupr(s));
printf("该KeyGen对应CrackMe下载地址:\n\n");
printf("http://down.qiannao.com/space/file/chinasmu1/share/2010/5/20/kaiZer.exe/.page \n\n");
system("pause");
}
效果图:
KeyGen.exe下载地址:
http://down.qiannao.com/space/file/chinasmu1/share/2010/5/22/Keygen.exe/.page!!!MFC版的KeyGen在8楼!!!PS:大家都有DeDe了吧,没有的话就给大家一个网盘下载地址:
http://down.qiannao.com/space/file/chinasmu1/share/2010/5/20/DeDe.zip/.page
------------------------------------------------------------------------
【版权声明】本文首发看雪,转载请注明!
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课