- UID
- 315
注册时间2005-3-16
阅读权限20
最后登录1970-1-1
以武会友
该用户从未签到
|
ShowDep 4.0 beta 1 注册算法分析
【软件主页】:http://www.sowdep.com/
【破解工具】:OllyDbg、系统自带计算器
【本文作者】:好好学习(恨浩)
【目标下载】:http://bbs.pediy.com/upload/file/2005/1/ShowDep.rar_949.rar
1. 运行ShowDep
2. 用鼠标单击ShowDep菜单->“Help”, 然后再单击“About”
3. 待弹出对话框后请再单击“Register”按钮
输入:name:h
number:1-2-3-87654321
提示:“Invalid registration number”
4、运行OllyDbg加载ShowDep,搜索ASCII,找到“Invalid registration number”
5、代码向上看,找到可疑的地方:0041F1E1 E8 0AF9FFFF call chap70x6.0041EAF0
6、在0041F1E1处下断。
关键call:
①call chap70x6.0041EBD0
②call chap70x6.00421970
③call chap70x6.00421C10
④call chap70x6.00421BE0
=============================================================================================================================
0041F1E1 |. E8 0AF9FFFF call chap70x6.0041EAF0 ; \chap70x6.0041EAF0 //与注册码有关的call可以跟进去看看,把注册码1-2-3-87654321转换成0x1-2-3-87654321,后8位参与比较,前面的1-2-3参与计算。
0041F1E6 |. 83C4 08 add esp,8
0041F1E9 |. 85C0 test eax,eax //注册码为空就跳去出错,注册码应该是xxxx-xxxx-xxxx-xxxxxxxx的形式,如果不是这种形式在以后的比较中,比较地址内的值始终为0
0041F1EB |. 74 1D je short chap70x6.0041F20A
0041F1ED |. 8B95 F0FEFFFF mov edx,dword ptr ss:[ebp-110]
0041F1F3 |. 81C2 04010000 add edx,104
0041F1F9 |. 52 push edx ; /Arg2
0041F1FA |. 8B45 FC mov eax,dword ptr ss:[ebp-4] ; |
0041F1FD |. 50 push eax ; |Arg1
0041F1FE |. E8 CDF9FFFF call chap70x6.0041EBD0 ; \chap70x6.0041EBD0 //①跟进去,算法和比较都在里面
0041F203 |. 83C4 08 add esp,8
0041F206 |. 85C0 test eax,eax //测试eax
0041F208 75 1C jnz short chap70x6.0041F226 //为0就送你上西天
=============================================================================================================================
①call chap70x6.0041EBD0:
0041EBD0 55 push ebp
0041EBD1 8BEC mov ebp,esp
0041EBD3 83EC 0C sub esp,0C
0041EBD6 C745 F4 78563412 mov dword ptr ss:[ebp-C],12345678
0041EBDD |. C745 F8 89674523 mov dword ptr ss:[ebp-8],23456789
0041EBE4 |. C745 FC 90785634 mov dword ptr ss:[ebp-4],34567890
0041EBEB |. 8D45 F4 lea eax,dword ptr ss:[ebp-C]
0041EBEE |. 50 push eax
0041EBEF |. 8B4D 08 mov ecx,dword ptr ss:[ebp+8]
0041EBF2 |. 51 push ecx
0041EBF3 |. E8 48300000 call chap70x6.00421C40
0041EBF8 |. 83C4 04 add esp,4
0041EBFB |. 50 push eax ; |Arg2
0041EBFC |. 8B55 08 mov edx,dword ptr ss:[ebp+8] ; |
0041EBFF |. 52 push edx ; |Arg1
0041EC00 |. E8 6B2D0000 call chap70x6.00421970 ; \chap70x6.00421970 //②用户名的计算,跟进去
0041EC05 |. 83C4 0C add esp,0C
0041EC08 |. 8D45 F4 lea eax,dword ptr ss:[ebp-C]
0041EC0B |. 50 push eax ; /Arg3
0041EC0C |. 6A 0C push 0C ; |Arg2 = 0000000C
0041EC0E |. 8B4D 0C mov ecx,dword ptr ss:[ebp+C] ; |
0041EC11 |. 51 push ecx ; |Arg1
0041EC12 |. E8 592D0000 call chap70x6.00421970 ; \chap70x6.00421970 //②注册码的计算,跟进去
0041EC17 |. 83C4 0C add esp,0C
0041EC1A |. 8B55 0C mov edx,dword ptr ss:[ebp+C]
0041EC1D |. 8B45 FC mov eax,dword ptr ss:[ebp-4]
0041EC20 |. 3B42 0C cmp eax,dword ptr ds:[edx+C] //关键比较,eax里的值是上面计算的结果,[edx+c]是我输入的假码。其实在eax里看到的就是明码了,用它直接替换我的假码87654321,就注册成功了,哈哈!
0041EC23 75 07 jnz short chap70x6.0041EC2C //不相同就跳走,注册失败!(一般爆破点,7507-〉9090,每次运行都要重新注册)
0041EC25 |. B8 01000000 mov eax,1 //将1放入eax
0041EC2A |. EB 02 jmp short chap70x6.0041EC2E //无条件跳转
0041EC2C |> 33C0 xor eax,eax //eax与eax异或运算,就是eax清零
0041EC2E |> 8BE5 mov esp,ebp
0041EC30 |. 5D pop ebp
0041EC31 \. C3 retn //返回到:0041F203
=============================================================================================================================
②call chap70x6.00421970
00421970 /$ 55 push ebp
00421971 |. 8BEC mov ebp,esp
00421973 |. 83EC 10 sub esp,10
00421976 |. 8B4D 08 mov ecx,dword ptr ss:[ebp+8]
00421979 |. 53 push ebx
0042197A |. 56 push esi
0042197B |. 57 push edi
0042197C |. 85C9 test ecx,ecx
0042197E |. C745 FC 00000000 mov dword ptr ss:[ebp-4],0
00421985 |. 0F84 83000000 je chap70x6.00421A0E
0042198B |. 8B7D 10 mov edi,dword ptr ss:[ebp+10]
0042198E |. 85FF test edi,edi
00421990 |. 74 7C je short chap70x6.00421A0E
00421992 |. 8B45 0C mov eax,dword ptr ss:[ebp+C]
00421995 |. 85C0 test eax,eax
00421997 |. 75 07 jnz short chap70x6.004219A0
00421999 |. 5F pop edi
0042199A |. 5E pop esi
0042199B |. 5B pop ebx
0042199C |. 8BE5 mov esp,ebp
0042199E |. 5D pop ebp
0042199F |. C3 retn
004219A0 |> 8B35 78C14200 mov esi,dword ptr ds:[<&KERNEL32.IsBadR>; kernel32.IsBadReadPtr
004219A6 |. 50 push eax ; /DataSize
004219A7 |. 51 push ecx ; |DataAddress
004219A8 |. FFD6 call esi ; \IsBadReadPtr
004219AA |. 85C0 test eax,eax
004219AC |. 75 4F jnz short chap70x6.004219FD
004219AE |. 6A 0C push 0C ; /DataSize = C (12.)
004219B0 |. 57 push edi ; |DataAddress
004219B1 |. FFD6 call esi ; \IsBadReadPtr
004219B3 |. 85C0 test eax,eax
004219B5 |. 75 46 jnz short chap70x6.004219FD
004219B7 |. 8B07 mov eax,dword ptr ds:[edi]
004219B9 |. 8945 F0 mov dword ptr ss:[ebp-10],eax
004219BC |. 8B4F 04 mov ecx,dword ptr ds:[edi+4]
004219BF |. 894D F4 mov dword ptr ss:[ebp-C],ecx
004219C2 |. 8B57 08 mov edx,dword ptr ds:[edi+8]
004219C5 |. 8955 F8 mov dword ptr ss:[ebp-8],edx
004219C8 |. 60 pushad
004219C9 |. FC cld
004219CA |. 8B4D 0C mov ecx,dword ptr ss:[ebp+C]
004219CD |. 8DBD F0FFFFFF lea edi,dword ptr ss:[ebp-10]
004219D3 |. 8B75 08 mov esi,dword ptr ss:[ebp+8]
004219D6 |> AC /lods byte ptr ds:[esi] //取字符串元素,关循环,你的用户名有几位就循环几次,我偷懒,只输入了一位数,呵呵~~~
004219D7 |. E8 34020000 |call chap70x6.00421C10 //③核心计算部分,跟进!
004219DC |.^ E2 F8 \loopd short chap70x6.004219D6 //按字符元素循环
004219DE |. 61 popad
004219DF |. 8B45 10 mov eax,dword ptr ss:[ebp+10]
004219E2 |. 8B4D F0 mov ecx,dword ptr ss:[ebp-10]
004219E5 |. 8B55 F4 mov edx,dword ptr ss:[ebp-C]
004219E8 |. 8908 mov dword ptr ds:[eax],ecx
004219EA |. 8B4D F8 mov ecx,dword ptr ss:[ebp-8]
004219ED |. 8950 04 mov dword ptr ds:[eax+4],edx
004219F0 |. 8948 08 mov dword ptr ds:[eax+8],ecx
004219F3 |. 8B45 FC mov eax,dword ptr ss:[ebp-4]
004219F6 |. 5F pop edi
004219F7 |. 5E pop esi
004219F8 |. 5B pop ebx
004219F9 |. 8BE5 mov esp,ebp
004219FB |. 5D pop ebp
004219FC |. C3 retn //返回到:0041EC05
[ Last edited by 恨浩 on 2005-3-19 at 06:57 PM ] |
|