【文章标题】: [HappyTown]第五个CrackMe
【文章作者】: qianyicy
【作者邮箱】: qgnck1999@163.com
【下载地址】: 置顶贴中有
【使用工具】: ollydbg
【作者声明】: 只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
--------------------------------------------------------------------------------
【详细过程】
老规矩,我们先看看有没有可用的字符串,还好,happytown这次又给我们开了一条捷径:),双击Congratulations,我们来
到以下地址:
004501AA |. 68 20024500 push KeyGenMe.00450220 ; |Title = "Congratulations"
004501AF |. 68 30024500 push KeyGenMe.00450230 ; |Text = "Good job,man!"
004501B4 |. 6A 00 push 0 ; |hOwner = NULL
004501B6 |. E8 E562FBFF call <jmp.&user32.MessageBoxA> ; \MessageBoxA
向上走几格来到:
004501A6 |. /75 13 jnz short KeyGenMe.004501BB
如果想爆破的话,把此跳转nop掉即可,
接着向上走,一至到:
0045007D |. BA F8014500 mov edx,KeyGenMe.004501F8 ; ASCII "~!@#$%^&*()_+|\=-/?.,><;:`"
00450082 |. E8 213EFBFF call KeyGenMe.00403EA8
00450087 |. 8D45 EC lea eax,dword ptr ss:[ebp-14]
各位看见那串字符了吗?那可不是Happytown无聊写进去玩的,那可是串好东东哦,注册码就靠他们了,:)
我们在此按F2设断点,F9运行程序,填入注册名,注册码,然后单击check,好了,程序被断下来了,我们接着分析:
0045009B |. E8 B8F2FDFF call KeyGenMe.0042F358 ; 计算注册名位数
004500A0 |. 8B45 F8 mov eax,dword ptr ss:[ebp-8]
004500A3 |. E8 2840FBFF call KeyGenMe.004040D0
004500A8 |. 8945 E8 mov dword ptr ss:[ebp-18],eax ; 位数送EBP-18
004500AB |. 837D E8 04 cmp dword ptr ss:[ebp-18],4 ; 位数必须于4比较
004500AF |. 0F8C 06010000 jl KeyGenMe.004501BB ; <4就跳,必须>=4
004500B5 |. 8D55 F4 lea edx,dword ptr ss:[ebp-C]
004500B8 |. 8B45 FC mov eax,dword ptr ss:[ebp-4]
004500BB |. 8B80 08030000 mov eax,dword ptr ds:[eax+308]
004500C1 |. E8 92F2FDFF call KeyGenMe.0042F358 ; 计算注册码位数
004500C6 |. 8B45 F4 mov eax,dword ptr ss:[ebp-C]
004500C9 |. E8 0240FBFF call KeyGenMe.004040D0
004500CE |. 8945 E4 mov dword ptr ss:[ebp-1C],eax ; 位数送EBP-1C
004500D1 |. 837D E4 00 cmp dword ptr ss:[ebp-1C],0 ; 位数必须>0
004500D5 |. 0F84 E0000000 je KeyGenMe.004501BB
004500DB |. 8B45 E8 mov eax,dword ptr ss:[ebp-18] ; 取得注册名位数
004500DE |. 25 01000080 and eax,80000001 ; 下面几句为判断注册名位数是奇还是偶;
004500E3 |. 79 05 jns short KeyGenMe.004500EA
004500E5 |. 48 dec eax
004500E6 |. 83C8 FE or eax,FFFFFFFE
004500E9 |. 40 inc eax
004500EA |> 85C0 test eax,eax
004500EC |. 74 0D je short KeyGenMe.004500FB
004500EE |. 8D45 F8 lea eax,dword ptr ss:[ebp-8]
004500F1 |. BA 1C024500 mov edx,KeyGenMe.0045021C ; 得到一个*
004500F6 |. E8 DD3FFBFF call KeyGenMe.004040D8 ; 把*连接到注册名后面,使注册名为偶数
004500FB |> 8B45 F8 mov eax,dword ptr ss:[ebp-8]
004500FE |. E8 CD3FFBFF call KeyGenMe.004040D0
00450103 |. 8945 E8 mov dword ptr ss:[ebp-18],eax
00450106 |. 8B45 E8 mov eax,dword ptr ss:[ebp-18]
00450109 |. D1E8 shr eax,1 ; eax/2
0045010B |. 8945 D8 mov dword ptr ss:[ebp-28],eax ; 获得循环次数?
0045010E |. 8B45 D8 mov eax,dword ptr ss:[ebp-28]
00450111 |. 85C0 test eax,eax ; 注册码>1?
00450113 |. 0F8E 82000000 jle KeyGenMe.0045019B
00450119 |. 8945 D4 mov dword ptr ss:[ebp-2C],eax
0045011C |. C745 E0 01000000 mov dword ptr ss:[ebp-20],1
00450123 |> 33C0 /xor eax,eax ; 循环开始
00450125 |. 8945 DC |mov dword ptr ss:[ebp-24],eax
00450128 |. 8B45 F8 |mov eax,dword ptr ss:[ebp-8]
0045012B |. 8B55 E0 |mov edx,dword ptr ss:[ebp-20]
0045012E |. 0FB64410 FF |movzx eax,byte ptr ds:[eax+edx-1] ; 注册名第一位送eax
00450133 |. C1E0 02 |shl eax,2 ; eax*4
00450136 |. B9 1A000000 |mov ecx,1A ; ECX=1A
0045013B |. 33D2 |xor edx,edx ; EDX清0
0045013D |. F7F1 |div ecx ; EAX/EDX
0045013F |. 8955 DC |mov dword ptr ss:[ebp-24],edx ; 余数送ebp-24
00450142 |. 8D45 CC |lea eax,dword ptr ss:[ebp-34]
00450145 |. 8B55 F0 |mov edx,dword ptr ss:[ebp-10] ; 字符串送edx
00450148 |. 8B4D DC |mov ecx,dword ptr ss:[ebp-24] ; 余数送ecx
0045014B |. 8A140A |mov dl,byte ptr ds:[edx+ecx] ; 根据余数数值按位取字符串字符
0045014E |. E8 A53EFBFF |call KeyGenMe.00403FF8 ; 存取得到的字符串
00450153 |. 8B55 CC |mov edx,dword ptr ss:[ebp-34]
00450156 |. 8D45 EC |lea eax,dword ptr ss:[ebp-14]
00450159 |. E8 7A3FFBFF |call KeyGenMe.004040D8 ; 把字符串的地址存入EBP-14
0045015E |. 8B45 F8 |mov eax,dword ptr ss:[ebp-8]
00450161 |. 8B55 E0 |mov edx,dword ptr ss:[ebp-20]
00450164 |. 0FB60410 |movzx eax,byte ptr ds:[eax+edx] ; 注册码第二位送eax
00450168 |. 8D0440 |lea eax,dword ptr ds:[eax+eax*2] ; EAX*3
0045016B |. B9 1A000000 |mov ecx,1A ; ecx=1A
00450170 |. 33D2 |xor edx,edx
00450172 |. F7F1 |div ecx ; 以下功能和上面相同
00450174 |. 8955 DC |mov dword ptr ss:[ebp-24],edx
00450177 |. 8D45 C8 |lea eax,dword ptr ss:[ebp-38]
0045017A |. 8B55 F0 |mov edx,dword ptr ss:[ebp-10]
0045017D |. 8B4D DC |mov ecx,dword ptr ss:[ebp-24]
00450180 |. 8A140A |mov dl,byte ptr ds:[edx+ecx]
00450183 |. E8 703EFBFF |call KeyGenMe.00403FF8
00450188 |. 8B55 C8 |mov edx,dword ptr ss:[ebp-38]
0045018B |. 8D45 EC |lea eax,dword ptr ss:[ebp-14]
0045018E |. E8 453FFBFF |call KeyGenMe.004040D8
00450193 |. FF45 E0 |inc dword ptr ss:[ebp-20]
00450196 |. FF4D D4 |dec dword ptr ss:[ebp-2C] ; 计数器自减
00450199 |.^ 75 88 \jnz short KeyGenMe.00450123
0045019B |> 8B45 EC mov eax,dword ptr ss:[ebp-14] ; ASCII")#$%:?:`"
0045019E |. 8B55 F4 mov edx,dword ptr ss:[ebp-C] ; 我们输入的假码
004501A1 |. E8 7640FBFF call KeyGenMe.0040421C
--------------------------------------------------------------------------------
【版权声明】: 本文原创于看雪技术论坛, 转载请注明作者并保持文章的完整, 谢谢!
2007年05月18日 0:11:50
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!