- UID
- 14190
注册时间2006-5-26
阅读权限10
最后登录1970-1-1
周游历练
该用户从未签到
|
目标程序:双色球神手
下载地址:天空
作者:crack1946
1.脱壳
00401000 > B8 74856500 mov eax, 00658574 //壳的入口
00401005 50 push eax
00401006 64:FF35 0000000>push dword ptr fs:[0]
0040100D 64:8925 0000000>mov dword ptr fs:[0], esp
00401014 33C0 xor eax, eax
00401016 8908 mov dword ptr [eax], ecx
00401018 50 push eax
shift+f9,
00401016 8908 mov dword ptr [eax], ecx //停在这里
看堆栈:
0012FFBC 0012FFE0 指向下一个 SEH 记录的指针
0012FFC0 00658574 SE处理程序 //到这里下断,shift+f9
0012FFC4 7C816D4F 返回到 kernel32.7C816D4F
0012FFC8 7C930738 ntdll.7C930738
00658574 B8 737365F0 mov eax, F0657373 //停在这里
00658579 8D88 24120010 lea ecx, dword ptr [eax+10001224]
0065857F 8941 01 mov dword ptr [ecx+1], eax
00658582 8B5424 04 mov edx, dword ptr [esp+4]
00658586 8B52 0C mov edx, dword ptr [edx+C]
然后命令行下 bp IsDebuggerPresent,运行
7C812E03 > 64:A1 18000000 mov eax, dword ptr fs:[18]
7C812E09 8B40 30 mov eax, dword ptr [eax+30]
7C812E0C 0FB640 02 movzx eax, byte ptr [eax+2]
7C812E10 C3 retn
003E0CC9 85C0 test eax, eax //改EAX=0
003E0CCB 74 01 je short 003E0CCE
...........代码略,一路F8即可
00658621 8985 D0120010 mov dword ptr [ebp+100012D0], eax
00658627 8BF0 mov esi, eax
00658629 59 pop ecx
0065862A 5A pop edx
0065862B EB 0C jmp short 00658639
0065862D 03CA add ecx, edx
0065862F 68 00800000 push 8000
00658634 6A 00 push 0
00658636 57 push edi
00658637 FF11 call dword ptr [ecx]
00658639 8BC6 mov eax, esi
0065863B 5A pop edx
0065863C 5E pop esi
0065863D 5F pop edi
0065863E 59 pop ecx
0065863F 5B pop ebx
00658640 5D pop ebp
00658641 - FFE0 jmp eax ; ssQss.005CF204这里是OEP,
dump...程序由几百K变成2.5M,不管它,反正可以正常运行!
2.找注册码
载入脱壳后的文件,查找关键字眼:"注册失败"
00542854 /$ 55 push ebp
00542855 |. 8BEC mov ebp, esp
00542857 |. 6A 00 push 0
00542859 |. 6A 00 push 0
0054285B |. 53 push ebx
0054285C |. 8BD8 mov ebx, eax
0054285E |. 33C0 xor eax, eax
00542860 |. 55 push ebp
00542861 |. 68 BD285400 push 005428BD
00542866 |. 64:FF30 push dword ptr fs:[eax]
00542869 |. 64:8920 mov dword ptr fs:[eax], esp
0054286C |. 8D55 FC lea edx, dword ptr [ebp-4]
0054286F |. 8BC3 mov eax, ebx
00542871 |. E8 5EFCFFFF call 005424D4
00542876 |. 8B55 FC mov edx, dword ptr [ebp-4] ; 机器码到EDX
00542879 |. 8B43 0C mov eax, dword ptr [ebx+C]
0054287C |. E8 5322ECFF call 00404AD4
00542881 |. 75 17 jnz short 0054289A
00542883 |. 8D55 F8 lea edx, dword ptr [ebp-8]
00542886 |. 8BC3 mov eax, ebx
00542888 |. E8 1BFDFFFF call 005425A8 ; 算法call
0054288D |. 8B55 F8 mov edx, dword ptr [ebp-8] ; "7424-1156-1151",真正的注册码
00542890 |. 8B43 10 mov eax, dword ptr [ebx+10] ; [EBX+10]指向假码
00542893 |. E8 3C22ECFF call 00404AD4 ; 真假码比较的call
00542898 |. 74 04 je short 0054289E ; 一定要跳
0054289A |> 33C0 xor eax, eax
0054289C |. EB 02 jmp short 005428A0
0054289E |> B0 01 mov al, 1 ; al=1
005428A0 |> 8BD8 mov ebx, eax
005428A2 |. 33C0 xor eax, eax
005428A4 |. 5A pop edx
005428A5 |. 59 pop ecx
005428A6 |. 59 pop ecx
005428A7 |. 64:8910 mov dword ptr fs:[eax], edx
005428AA |. 68 C4285400 push 005428C4
005428AF |> 8D45 F8 lea eax, dword ptr [ebp-8]
005428B2 |. BA 02000000 mov edx, 2
005428B7 |. E8 201EECFF call 004046DC
005428BC \. C3 retn
算法分析的累,我没有这个毅力,而且我分析代码的能力也不是很强,经常不知道怎么回事,就到这里了,哈哈 |
|