标 题: KeyGenMe:Crack入门系列(5)
作 者: tomenzi
时 间:
链 接:
工 具:OLLYICE for winxp
第一次发表这种文章,累!也许这就是破解之路......
1、用OLLYICE加载KeyGenMe_05.exe。
2、查找字符串Good job,man!。点右键反汇编跟踪一下。来到指定地!
3、在OLLYICE汇编窗口中找到0045004C下断。(在机器码55上双击即可)。
4、F9运行程序,将注册名/注册码写入,再点击程序CHECK,这时OLLYICE会断在所下的断点上。
分析如下:
********************************
上面代码省了,关键看下面:
0045004C /. 55 push ebp
0045004D |. 8BEC mov ebp, esp
0045004F |. 83C4 C8 add esp, -38
00450052 |. 33C9 xor ecx, ecx
00450054 |. 894D C8 mov dword ptr [ebp-38], ecx
00450057 |. 894D CC mov dword ptr [ebp-34], ecx
0045005A |. 894D F8 mov dword ptr [ebp-8], ecx
0045005D |. 894D F4 mov dword ptr [ebp-C], ecx
00450060 |. 894D F0 mov dword ptr [ebp-10], ecx
00450063 |. 894D EC mov dword ptr [ebp-14], ecx
00450066 |. 8955 D0 mov dword ptr [ebp-30], edx
00450069 |. 8945 FC mov dword ptr [ebp-4], eax
0045006C |. 33C0 xor eax, eax
0045006E |. 55 push ebp
0045006F |. 68 E3014500 push 004501E3
00450074 |. 64:FF30 push dword ptr fs:[eax]
00450077 |. 64:8920 mov dword ptr fs:[eax], esp
0045007A |. 8D45 F0 lea eax, dword ptr [ebp-10]
0045007D |. BA F8014500 mov edx, 004501F8 ; ASCII "~!@#$%^&*()_+|\=-/?.,><;:`"
00450082 |. E8 213EFBFF call 00403EA8
00450087 |. 8D45 EC lea eax, dword ptr [ebp-14]
0045008A |. E8 813DFBFF call 00403E10
0045008F |. 8D55 F8 lea edx, dword ptr [ebp-8]
00450092 |. 8B45 FC mov eax, dword ptr [ebp-4]
00450095 |. 8B80 00030000 mov eax, dword ptr [eax+300]
0045009B |. E8 B8F2FDFF call 0042F358
004500A0 |. 8B45 F8 mov eax, dword ptr [ebp-8]
004500A3 |. E8 2840FBFF call 004040D0
004500A8 |. 8945 E8 mov dword ptr [ebp-18], eax
004500AB |. 837D E8 04 cmp dword ptr [ebp-18], 4 ; 小于4跳
004500AF |. 0F8C 06010000 jl 004501BB
004500B5 |. 8D55 F4 lea edx, dword ptr [ebp-C]
004500B8 |. 8B45 FC mov eax, dword ptr [ebp-4]
004500BB |. 8B80 08030000 mov eax, dword ptr [eax+308]
004500C1 |. E8 92F2FDFF call 0042F358
004500C6 |. 8B45 F4 mov eax, dword ptr [ebp-C]
004500C9 |. E8 0240FBFF call 004040D0
004500CE |. 8945 E4 mov dword ptr [ebp-1C], eax ; [ebp-1c]=A
004500D1 |. 837D E4 00 cmp dword ptr [ebp-1C], 0 ; [ebp-1c]-0=0跳
004500D5 |. 0F84 E0000000 je 004501BB
004500DB |. 8B45 E8 mov eax, dword ptr [ebp-18]
004500DE |. 25 01000080 and eax, 80000001 ; 如果(eax=4)^80000001符号位为0跳
004500E3 |. 79 05 jns short 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 004500FB
004500EE |. 8D45 F8 lea eax, dword ptr [ebp-8]
004500F1 |. BA 1C024500 mov edx, 0045021C
004500F6 |. E8 DD3FFBFF call 004040D8
004500FB |> 8B45 F8 mov eax, dword ptr [ebp-8]
004500FE |. E8 CD3FFBFF call 004040D0
00450103 |. 8945 E8 mov dword ptr [ebp-18], eax
00450106 |. 8B45 E8 mov eax, dword ptr [ebp-18]
00450109 |. D1E8 shr eax, 1 ; eax=4 右移1位
0045010B |. 8945 D8 mov dword ptr [ebp-28], eax
0045010E |. 8B45 D8 mov eax, dword ptr [ebp-28] ; eax=2
00450111 |. 85C0 test eax, eax
00450113 |. 0F8E 82000000 jle 0045019B
00450119 |. 8945 D4 mov dword ptr [ebp-2C], eax
0045011C |. C745 E0 01000>mov dword ptr [ebp-20], 1 ; [ebp-20]=1
00450123 |> 33C0 /xor eax, eax
00450125 |. 8945 DC |mov dword ptr [ebp-24], eax ; [ebp-24]=0
00450128 |. 8B45 F8 |mov eax, dword ptr [ebp-8]
0045012B |. 8B55 E0 |mov edx, dword ptr [ebp-20] ; 1
0045012E |. 0FB64410 FF |movzx eax, byte ptr [eax+edx-1] ; A
00450133 |. C1E0 02 |shl eax, 2 ; EAX=A>>2
00450136 |. B9 1A000000 |mov ecx, 1A ; ECX=1A
0045013B |. 33D2 |xor edx, edx ; EDX清0
0045013D |. F7F1 |div ecx
0045013F |. 8955 DC |mov dword ptr [ebp-24], edx ; [EBP-24]=0
00450142 |. 8D45 CC |lea eax, dword ptr [ebp-34]
00450145 |. 8B55 F0 |mov edx, dword ptr [ebp-10] ; ////
00450148 |. 8B4D DC |mov ecx, dword ptr [ebp-24] ; 0
0045014B |. 8A140A |mov dl, byte ptr [edx+ecx] ; '~'
0045014E |. E8 A53EFBFF |call 00403FF8
00450153 |. 8B55 CC |mov edx, dword ptr [ebp-34] ; EDX=~
00450156 |. 8D45 EC |lea eax, dword ptr [ebp-14]
00450159 |. E8 7A3FFBFF |call 004040D8
0045015E |. 8B45 F8 |mov eax, dword ptr [ebp-8] ; EAX=AAAA
00450161 |. 8B55 E0 |mov edx, dword ptr [ebp-20] ; EDX=1
00450164 |. 0FB60410 |movzx eax, byte ptr [eax+edx] ; EAX=A+1
00450168 |. 8D0440 |lea eax, dword ptr [eax+eax*2] ; EAX=EAX+EAX*2
0045016B |. B9 1A000000 |mov ecx, 1A ; ECX=1A
00450170 |. 33D2 |xor edx, edx ; 清0
00450172 |. F7F1 |div ecx ; /
00450174 |. 8955 DC |mov dword ptr [ebp-24], edx ; [EBP-24]=D
00450177 |. 8D45 C8 |lea eax, dword ptr [ebp-38]
0045017A |. 8B55 F0 |mov edx, dword ptr [ebp-10]
0045017D |. 8B4D DC |mov ecx, dword ptr [ebp-24] ; ECX=D
00450180 |. 8A140A |mov dl, byte ptr [edx+ecx] ; DL='|'
00450183 |. E8 703EFBFF |call 00403FF8
00450188 |. 8B55 C8 |mov edx, dword ptr [ebp-38] ; EDX='|'
0045018B |. 8D45 EC |lea eax, dword ptr [ebp-14]
0045018E |. E8 453FFBFF |call 004040D8
00450193 |. FF45 E0 |inc dword ptr [ebp-20] ; 加1
00450196 |. FF4D D4 |dec dword ptr [ebp-2C] ; 减1
00450199 |.^ 75 88 \jnz short 00450123
0045019B |> 8B45 EC mov eax, dword ptr [ebp-14] ; eax=~|~|
0045019E |. 8B55 F4 mov edx, dword ptr [ebp-C] ; edx=1234567890
004501A1 |. E8 7640FBFF call 0040421C
004501A6 |. 75 13 jnz short 004501BB ; F7跟进去
004501A8 |. 6A 40 push 40 ; /Style = MB_OK|MB_ICONASTERISK|MB_APPLMODAL
004501AA |. 68 20024500 push 00450220 ; |Title = "Congratulations"
004501AF |. 68 30024500 push 00450230 ; |Text = "Good job,man!"
004501B4 |. 6A 00 push 0 ; |hOwner = NULL
004501B6 |. E8 E562FBFF call <jmp.&user32.MessageBoxA> ; \MessageBoxA
004501BB |> 33C0 xor eax, eax
004501BD |. 5A pop edx
004501BE |. 59 pop ecx
004501BF |. 59 pop ecx
F7跟进 call 0040421C如下:
0040421C /$ 53 push ebx
0040421D |. 56 push esi ; KeyGenMe.00428FD0
0040421E |. 57 push edi
0040421F |. 89C6 mov esi, eax ; // esi=~|~|
00404221 |. 89D7 mov edi, edx ; // edi=1234567890
00404223 |. 39D0 cmp eax, edx ; // 如果比较等于0跳
00404225 |. 0F84 8F000000 je 004042BA
0040422B |. 85F6 test esi, esi ;清0
0040422D |. 74 68 je short 00404297
0040422F |. 85FF test edi, edi ;清0
00404231 |. 74 6B je short 0040429E
00404233 |. 8B46 FC mov eax, dword ptr [esi-4]
00404236 |. 8B57 FC mov edx, dword ptr [edi-4]
00404239 |. 29D0 sub eax, edx ;如果(EAX=EAX-EDX)不小于0跳
0040423B |. 77 02 ja short 0040423F
0040423D |. 01C2 add edx, eax
0040423F |> 52 push edx
00404240 |. C1EA 02 shr edx, 2
00404243 |. 74 26 je short 0040426B
00404245 |> 8B0E /mov ecx, dword ptr [esi] ;ECX=~|~|
00404247 |. 8B1F |mov ebx, dword ptr [edi] ;EBX=1234567890
00404249 |. 39D9 |cmp ecx, ebx ;ECX与EBX比较不等0跳
0040424B |. 75 58 |jnz short 004042A5
0040424D |. 4A |dec edx
0040424E |. 74 15 |je short 00404265
00404250 |. 8B4E 04 |mov ecx, dword ptr [esi+4]
00404253 |. 8B5F 04 |mov ebx, dword ptr [edi+4]
00404256 |. 39D9 |cmp ecx, ebx
00404258 |. 75 4B |jnz short 004042A5
0040425A |. 83C6 08 |add esi, 8
0040425D |. 83C7 08 |add edi, 8
00404260 |. 4A |dec edx
00404261 |.^ 75 E2 \jnz short 00404245
00404263 |. EB 06 jmp short 0040426B
00404265 |> 83C6 04 add esi, 4
00404268 |. 83C7 04 add edi, 4
0040426B |> 5A pop edx
0040426C |. 83E2 03 and edx, 3
0040426F |. 74 22 je short 00404293
00404271 |. 8B0E mov ecx, dword ptr [esi]
00404273 |. 8B1F mov ebx, dword ptr [edi]
00404275 |. 38D9 cmp cl, bl
00404277 |. 75 41 jnz short 004042BA
00404279 |. 4A dec edx
0040427A |. 74 17 je short 00404293
0040427C |. 38FD cmp ch, bh
0040427E |. 75 3A jnz short 004042BA
00404280 |. 4A dec edx
00404281 |. 74 10 je short 00404293
00404283 |. 81E3 0000FF00 and ebx, 0FF0000
00404289 |. 81E1 0000FF00 and ecx, 0FF0000
0040428F |. 39D9 cmp ecx, ebx
00404291 |. 75 27 jnz short 004042BA
00404293 |> 01C0 add eax, eax
00404295 |. EB 23 jmp short 004042BA
00404297 |> 8B57 FC mov edx, dword ptr [edi-4]
0040429A |. 29D0 sub eax, edx
0040429C |. EB 1C jmp short 004042BA
0040429E |> 8B46 FC mov eax, dword ptr [esi-4]
004042A1 |. 29D0 sub eax, edx
004042A3 |. EB 15 jmp short 004042BA
004042A5 |> 5A pop edx
004042A6 |. 38D9 cmp cl, bl
004042A8 |. 75 10 jnz short 004042BA
004042AA |. 38FD cmp ch, bh
004042AC |. 75 0C jnz short 004042BA
004042AE |. C1E9 10 shr ecx, 10
004042B1 |. C1EB 10 shr ebx, 10
004042B4 |. 38D9 cmp cl, bl
004042B6 |. 75 02 jnz short 004042BA
004042B8 |. 38FD cmp ch, bh
004042BA |> 5F pop edi
004042BB |. 5E pop esi
004042BC |. 5B pop ebx
004042BD \. C3 retn
从上面的比较看出ESI=~|~|;在此试着用这个怪符号去注册一下看,结果弹出Good job!省了一些事呵呵!向大侠们学习!学无耻尽,以专为贵.CRACK
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课