【文章标题】: vxin's CrackMe 2007 #01算法分析
【文章作者】: KuNgBiM
【作者邮箱】: kungbim@163.com
【作者主页】: http://www.crkcn.com
【软件名称】: vxin's CrackMe 2007 #01
【软件大小】: 176KB
【下载地址】: http://bbs.pediy.com/showthread.php?s=&postid=280537
【加壳方式】: N/A
【保护方式】: 序列号+KEYFILE
【编写语言】: Borland Delphi 6.0 - 7.0
【使用工具】: OD
【操作平台】: 100%标准盗版XPsp2
【软件介绍】: vxin's CrackMe 2007
【作者声明】: 只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
--------------------------------------------------------------------------------
【详细过程】
论坛闲逛,发现朋友vxin的CrackMe作品,小试一下!
OD载入分析如下:
00455B94 > \8D95 3CFDFFFF lea edx, dword ptr [ebp-2C4] ; 这里设断
00455B9A . 8B45 FC mov eax, dword ptr [ebp-4]
00455B9D . 8B80 4C030000 mov eax, dword ptr [eax+34C]
00455BA3 . E8 68B2FDFF call 00430E10 ; 取试炼码
00455BA8 . 8B85 3CFDFFFF mov eax, dword ptr [ebp-2C4]
00455BAE . 50 push eax
00455BAF . 8D95 34FDFFFF lea edx, dword ptr [ebp-2CC]
00455BB5 . 8B45 FC mov eax, dword ptr [ebp-4]
00455BB8 . 8B80 48030000 mov eax, dword ptr [eax+348]
00455BBE . E8 4DB2FDFF call 00430E10 ; 取用户名
00455BC3 . 8B85 34FDFFFF mov eax, dword ptr [ebp-2CC]
00455BC9 . BA 445D4500 mov edx, 00455D44 ; ASCII "0123456789abcdefABCDEF"
00455BCE . 8D8D 38FDFFFF lea ecx, dword ptr [ebp-2C8]
00455BD4 . E8 13EBFFFF call 004546EC ; 算法CALL跟进
00455BD9 . 8B95 38FDFFFF mov edx, dword ptr [ebp-2C8] ; 真码
00455BDF . 58 pop eax ; 假码
00455BE0 . E8 C7ECFAFF call 004048AC
00455BE5 . 75 25 jnz short 00455C0C ; 爆破点
00455BE7 . 6A 40 push 40
00455BE9 . B9 5C5D4500 mov ecx, 00455D5C
00455BEE . BA 645D4500 mov edx, 00455D64
00455BF3 . A1 44804500 mov eax, dword ptr [458044]
00455BF8 . 8B00 mov eax, dword ptr [eax]
00455BFA . E8 91AAFFFF call 00450690
00455BFF . 8B45 FC mov eax, dword ptr [ebp-4]
00455C02 . E8 6172FFFF call 0044CE68
00455C07 . E8 3CECFFFF call 00454848
00455C0C > 33C0 xor eax, eax
00455C0E . 5A pop edx
00455C0F . 59 pop ecx
00455C10 . 59 pop ecx
跟进00455BD4:
004546EC /$ 55 push ebp ; 算法开始
004546ED |. 8BEC mov ebp, esp
004546EF |. 83C4 DC add esp, -24
004546F2 |. 53 push ebx
004546F3 |. 56 push esi
004546F4 |. 57 push edi
004546F5 |. 33DB xor ebx, ebx
004546F7 |. 895D DC mov dword ptr [ebp-24], ebx
004546FA |. 895D EC mov dword ptr [ebp-14], ebx
004546FD |. 894D F4 mov dword ptr [ebp-C], ecx
00454700 |. 8955 F8 mov dword ptr [ebp-8], edx
00454703 |. 8945 FC mov dword ptr [ebp-4], eax
00454706 |. 8B45 FC mov eax, dword ptr [ebp-4]
00454709 |. E8 4202FBFF call 00404950
0045470E |. 8B45 F8 mov eax, dword ptr [ebp-8]
00454711 |. E8 3A02FBFF call 00404950
00454716 |. 33C0 xor eax, eax
00454718 |. 55 push ebp
00454719 |. 68 15484500 push 00454815
0045471E |. 64:FF30 push dword ptr fs:[eax]
00454721 |. 64:8920 mov dword ptr fs:[eax], esp
00454724 |. 8B45 F8 mov eax, dword ptr [ebp-8]
00454727 |. E8 3400FBFF call 00404760
0045472C |. 8945 F0 mov dword ptr [ebp-10], eax ; 密码表长度eax=00000016
0045472F |. 837D F0 00 cmp dword ptr [ebp-10], 0 ; 确定密码表不是空的
00454733 |. 75 0D jnz short 00454742
00454735 |. 8D45 F8 lea eax, dword ptr [ebp-8]
00454738 |. BA 2C484500 mov edx, 0045482C ; ASCII "Think Space"
0045473D |. E8 F6FDFAFF call 00404538
00454742 |> 33F6 xor esi, esi
00454744 |. BB 00010000 mov ebx, 100 ; 设定EBX为256以内的数
00454749 |. E8 52E3FAFF call 00402AA0
0045474E |. 8BC3 mov eax, ebx
00454750 |. E8 BFE8FAFF call 00403014 ; 取256以内的随机数?
00454755 |. 8BD8 mov ebx, eax ; 随机数入栈EBX待用
00454757 |. 8D45 EC lea eax, dword ptr [ebp-14]
0045475A |. 50 push eax ; /设置数据类型
0045475B |. 895D E0 mov dword ptr [ebp-20], ebx ; |
0045475E |. C645 E4 00 mov byte ptr [ebp-1C], 0 ; |
00454762 |. 8D55 E0 lea edx, dword ptr [ebp-20] ; |
00454765 |. 33C9 xor ecx, ecx ; |
00454767 |. B8 40484500 mov eax, 00454840 ; |ASCII "%1.2x"
0045476C |. E8 1B49FBFF call 0040908C ; \CrackMe2.0040908C
00454771 |. 8B45 FC mov eax, dword ptr [ebp-4]
00454774 |. E8 E7FFFAFF call 00404760
00454779 |. 8BF8 mov edi, eax
0045477B |. 85FF test edi, edi
0045477D |. 7E 60 jle short 004547DF
0045477F |. C745 E8 01000>mov dword ptr [ebp-18], 1 ; 计算用户名长度,以作循环运算次数
00454786 |> 8B45 FC /mov eax, dword ptr [ebp-4] ; 依次取用户名
00454789 |. 8B55 E8 |mov edx, dword ptr [ebp-18] ; 取上次运算后EDX中的结果(第一次这里为上面EBX中的随机数)
0045478C |. 0FB64410 FF |movzx eax, byte ptr [eax+edx-1] ; 计算用户名ASCII值备用在EAX中
00454791 |. 03C3 |add eax, ebx ; EBX加EAX结果送EAX
00454793 |. B9 FF000000 |mov ecx, 0FF
00454798 |. 99 |cdq
00454799 |. F7F9 |idiv ecx
0045479B |. 8BDA |mov ebx, edx
0045479D |. 3B75 F0 |cmp esi, dword ptr [ebp-10]
004547A0 |. 7D 03 |jge short 004547A5
004547A2 |. 46 |inc esi
004547A3 |. EB 05 |jmp short 004547AA
004547A5 |> BE 01000000 |mov esi, 1
004547AA |> 8B45 F8 |mov eax, dword ptr [ebp-8] ; 调用密码表“0123456789abcdefABCDEF”
004547AD |. 0FB64430 FF |movzx eax, byte ptr [eax+esi-1] ; 依次循环取密码表中一位字符的ASCII值作为异或数
004547B2 |. 33D8 |xor ebx, eax ; 上面EAX结果异或EBX后送EBX
004547B4 |. 8D45 DC |lea eax, dword ptr [ebp-24]
004547B7 |. 50 |push eax ; /设置数据类型
004547B8 |. 895D E0 |mov dword ptr [ebp-20], ebx ; |上面EBX结果保留内存
004547BB |. C645 E4 00 |mov byte ptr [ebp-1C], 0 ; |
004547BF |. 8D55 E0 |lea edx, dword ptr [ebp-20] ; |(设定随机数作为注册码第1、2位)
004547C2 |. 33C9 |xor ecx, ecx ; |
004547C4 |. B8 40484500 |mov eax, 00454840 ; |ASCII "%1.2x"
004547C9 |. E8 BE48FBFF |call 0040908C ; \CrackMe2.0040908C
004547CE |. 8B55 DC |mov edx, dword ptr [ebp-24] ; 每次计算后的结果送EDX备用
004547D1 |. 8D45 EC |lea eax, dword ptr [ebp-14]
004547D4 |. E8 8FFFFAFF |call 00404768
004547D9 |. FF45 E8 |inc dword ptr [ebp-18]
004547DC |. 4F |dec edi
004547DD |.^ 75 A7 \jnz short 00454786 ; 循环
004547DF |> 8B45 F4 mov eax, dword ptr [ebp-C]
004547E2 |. 8B55 EC mov edx, dword ptr [ebp-14] ; 随机数作为注册码第1、2位,其余由循环计算所得出并连接
004547E5 |. E8 0AFDFAFF call 004044F4
004547EA |. 33C0 xor eax, eax
004547EC |. 5A pop edx
004547ED |. 59 pop ecx
004547EE |. 59 pop ecx
004547EF |. 64:8910 mov dword ptr fs:[eax], edx
004547F2 |. 68 1C484500 push 0045481C
004547F7 |> 8D45 DC lea eax, dword ptr [ebp-24]
004547FA |. E8 A1FCFAFF call 004044A0
004547FF |. 8D45 EC lea eax, dword ptr [ebp-14]
00454802 |. E8 99FCFAFF call 004044A0
00454807 |. 8D45 F8 lea eax, dword ptr [ebp-8]
0045480A |. BA 02000000 mov edx, 2
0045480F |. E8 B0FCFAFF call 004044C4
00454814 \. C3 retn
00454815 .^ E9 8AF6FAFF jmp 00403EA4
0045481A .^ EB DB jmp short 004547F7
0045481C . 5F pop edi
0045481D . 5E pop esi
0045481E . 5B pop ebx
0045481F . 8BE5 mov esp, ebp
00454821 . 5D pop ebp
00454822 . C3 retn ; 返回上一步
我这里调试时随机数为05,那么计算出来的注册码就为:0560E4015BA92645
用户名:KuNgBiM
注册码:0560E4015BA92645
注册成功后用户信息以加密方式保存并替换目录下的d7r3.dat文件内容以便二次验证。
--------------------------------------------------------------------------------
【经验总结】
没什么好总结的,有基础的朋友应该能看懂,呵呵!
--------------------------------------------------------------------------------
【版权声明】: 本文原创于看雪技术论坛, 转载请注明作者并保持文章的完整, 谢谢!
2007年02月25日 PM 08:22:52
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)