这是我的第一次编写注册机,在分析代码和写的过程中碰到了一些小问题,本来想把问题解决了再发上来,可惜能力有限,始终有些问题搞不懂,最近没办法,只能把一个半成品发上来了。。
00401248 |. 6A 28 push 28 ; /Count = 28 (40.)
0040124A |. 68 8C314000 push 0040318C ; |Buffer = d2k2_cra.0040318C
0040124F |. 6A 02 push 2 ; |ControlID = 2
00401251 |. FF75 08 push dword ptr [ebp+8] ; |hWnd
00401254 |. E8 8F010000 call <jmp.&USER32.GetDlgItemTextA> ; 获取\GetDlgItemTextA
00401259 |. 84C0 test al, al ; ZF=0 //0x6&0x6=0x6
0040125B |. 0F84 06010000 je 00401367 ; 不跳 //ZF=0;只有相等时,才跳
00401261 |. 3C 20 cmp al, 20 ; AL是否为空
00401263 |. 0F8F 13010000 jg 0040137C ; 不跳 //ZF=1;当比较结果是大于时,才跳
00401269 |. 3C 05 cmp al, 5 ; ZF=0 //AL=0x6
0040126B |. 0F8C 20010000 jl 00401391 ; 不跳 //ZF=0,当比较结果是小于时,才跳
00401271 |. 8D1D 8C314000 lea ebx, dword ptr [40318C]
00401277 |. 33C9 xor ecx, ecx ; ECX=0,CF=0 //自身xor运算结果为0,CF=0
00401279 |. B0 05 mov al, 5 ; AL=0x5
0040127B |. 33D2 xor edx, edx ; EDX=0,CF=0 //自身xor运算结果为0,CF=0
0040127D |> 8A0C1A mov cl, byte ptr [edx+ebx]
00401280 |. 80F1 29 xor cl, 29 ; CL=0x42 //CL=0x6B^0x29
00401283 |. 02C8 add cl, al ; CL=0x47 //CL=0x42+0x5
00401285 |. 80F9 41 cmp cl, 41 ; CL与'A'比较 //CL=0x48;ZF=0
00401288 |. 7C 1C jl short 004012A6 ; 不跳 //ZF=0,当比较结果是小于时,才跳
0040128A |. 80F9 5A cmp cl, 5A ; CL与'Z'比较 //CL=0x48;ZF=0
0040128D |. 7F 17 jg short 004012A6 ; 不跳 //ZF=1;当比较结果是大于时,才跳
0040128F |> 888A 3C314000 mov byte ptr [edx+40313C], cl
00401295 |. C682 3D314000>mov byte ptr [edx+40313D], 0
0040129C |. FEC2 inc dl ; DL=(0x4)++
0040129E |. FEC8 dec al ; AL=(0x1)-- //减1
004012A0 |. 3C 00 cmp al, 0 ; ZF=1 //AL=0x0
004012A2 |. 74 08 je short 004012AC ; 跳到004012AC //ZF=1,结果相等
004012A4 |.^ EB D7 jmp short 0040127D ; 跳转到0040127D
004012A6 |> B1 52 mov cl, 52 ; CL=0x52
004012A8 |. 02C8 add cl, al ; CL=0x57 //CL=0x52+0x5
004012AA |.^ EB E3 jmp short 0040128F ; 跳转到0040128F
004012AC |> 33D2 xor edx, edx ; EDX=0,CF=0 //自身xor运算结果为0,CF=0
004012AE |. B8 05000000 mov eax, 5 ; EAX=0x5
004012B3 |> 8A0C1A mov cl, byte ptr [edx+ebx]
004012B6 |. 80F1 27 xor cl, 27 ; CL=0x49 //CL=0x6E^0x27
004012B9 |. 02C8 add cl, al ; CL=0x44 //CL=0x42+0x2
004012BB |. 80C1 01 add cl, 1 ; CL=0x45 //CL=0x44+0x1
004012BE |. 80F9 41 cmp cl, 41 ; CL与'A'比较 //CL=0x45;ZF=0
004012C1 |. 7C 1C jl short 004012DF ; 不跳 //ZF=0,当比较结果是小于时,才跳
004012C3 |. 80F9 5A cmp cl, 5A ; CL与'Z'比较 //CL=0x45;ZF=0
004012C6 |. 7F 17 jg short 004012DF ; 不跳 //ZF=1;当比较结果是大于时,才跳
004012C8 |> 888A 41314000 mov byte ptr [edx+403141], cl
004012CE |. C682 42314000>mov byte ptr [edx+403142], 0
004012D5 |. FEC2 inc dl ; DL=(0x4)++
004012D7 |. FEC8 dec al ; AL=(0x1)-- //减1
004012D9 |. 3C 00 cmp al, 0 ; ZF=1 //AL=0x0
004012DB |. 74 08 je short 004012E5 ; 不跳 //ZF=0;只有相等时,才跳
004012DD |.^ EB D4 jmp short 004012B3 ; 跳转到004012B3
004012DF |> B1 4D mov cl, 4D ; CL=0x4D
004012E1 |. 02C8 add cl, al ; CL=0x52 //CL=0x4D+0x5
004012E3 |.^ EB E3 jmp short 004012C8 ; 跳转到004012C8
004012E5 |> 33C0 xor eax, eax
004012E7 |. 6A 28 push 28 ; /Count = 28 (40.)
004012E9 |. 68 B4314000 push 004031B4 ; |Buffer = d2k2_cra.004031B4
004012EE |. 6A 04 push 4 ; |ControlID = 4
004012F0 |. FF75 08 push dword ptr [ebp+8] ; |hWnd
004012F3 |. E8 F0000000 call <jmp.&USER32.GetDlgItemTextA> ; \GetDlgItemTextA
004012F8 |. 66:85C0 test ax, ax ; ZF=0 //0x9&0x9=0x9
004012FB |. 74 55 je short 00401352 ; 不跳 //ZF=0;只有相等时,才跳
004012FD |. 66:83F8 0A cmp ax, 0A ; ZF=0 //AX=0x9
00401301 |. 7F 4F jg short 00401352 ; 不跳 //ZF=1;当比较结果是大于时,才跳
00401303 |. 7C 4D jl short 00401352 ; 跳到00401352 //ZF=0,SF!=OF
00401305 |. 33C0 xor eax, eax
00401307 |. 33DB xor ebx, ebx
00401309 |. 33C9 xor ecx, ecx
0040130B |. 33D2 xor edx, edx
0040130D |. 8D05 B4314000 lea eax, dword ptr [4031B4]
00401313 |> 8A1C01 mov bl, byte ptr [ecx+eax]
00401316 |. 8A91 3C314000 mov dl, byte ptr [ecx+40313C]
0040131C |. 80FB 00 cmp bl, 0
0040131F |. 0F84 81000000 je 004013A6
00401325 |. 80C2 05 add dl, 5
00401328 |. 80FA 5A cmp dl, 5A
0040132B |. 7F 14 jg short 00401341
0040132D |> 80F2 0C xor dl, 0C
00401330 |. 80FA 41 cmp dl, 41
00401333 |. 7C 11 jl short 00401346
00401335 |. 80FA 5A cmp dl, 5A
00401338 |. 7F 12 jg short 0040134C
0040133A |> 41 inc ecx
0040133B |. 38DA cmp dl, bl
0040133D |.^ 74 D4 je short 00401313
0040133F |. EB 11 jmp short 00401352
00401341 |> 80EA 0D sub dl, 0D
00401344 |.^ EB E7 jmp short 0040132D
00401346 |> B2 4B mov dl, 4B
00401348 |. 02D1 add dl, cl
0040134A |.^ EB EE jmp short 0040133A
0040134C |> B2 4B mov dl, 4B
0040134E |. 2AD1 sub dl, cl
00401350 |.^ EB E8 jmp short 0040133A
00401352 |> 6A 00 push 0 ; /0x0进栈
00401354 |. 68 49304000 push 00403049 ; |ASCII "Dont give up..."
00401359 |. 68 59304000 push 00403059 ; |ASCII "Wrong Code!Try Again!"
0040135E |. 6A 00 push 0 ; |hOwner = NULL
00401360 |. E8 A1000000 call <jmp.&USER32.MessageBoxA> ; \MessageBoxA
00401365 |. EB 52 jmp short 004013B9
00401367 |> 6A 00 push 0 ; /Style = MB_OK|MB_APPLMODAL
00401369 |. 68 6F304000 push 0040306F ; |Title = "Sorry..."
0040136E |. 68 97304000 push 00403097 ; |Text = "Enter Name!"
00401373 |. 6A 00 push 0 ; |hOwner = NULL
00401375 |. E8 8C000000 call <jmp.&USER32.MessageBoxA> ; \MessageBoxA
0040137A |. EB 3D jmp short 004013B9
0040137C |> 6A 00 push 0 ; /Style = MB_OK|MB_APPLMODAL
0040137E |. 68 6F304000 push 0040306F ; |Title = "Sorry..."
00401383 |. 68 A3304000 push 004030A3 ; |Text = "Name can be max 32 Chars long!"
00401388 |. 6A 00 push 0 ; |hOwner = NULL
0040138A |. E8 77000000 call <jmp.&USER32.MessageBoxA> ; \MessageBoxA
0040138F |. EB 28 jmp short 004013B9
00401391 |> 6A 00 push 0 ; /Style = MB_OK|MB_APPLMODAL
00401393 |. 68 6F304000 push 0040306F ; |Title = "Sorry..."
00401398 |. 68 78304000 push 00403078 ; |Text = "Name must be min 5 Chars long!"
0040139D |. 6A 00 push 0 ; |hOwner = NULL
0040139F |. E8 62000000 call <jmp.&USER32.MessageBoxA> ; \MessageBoxA
004013A4 |. EB 13 jmp short 004013B9
004013A6 |> 6A 00 push 0 ; /Style = MB_OK|MB_APPLMODAL
004013A8 |. 68 C2304000 push 004030C2 ; |Title = "Good Cracker"
004013AD |. 68 CF304000 push 004030CF ; |Text = "Serial is correct! Now write a keygen + tut and send it to: diablo2oo2@gmx.net !"
004013B2 |. 6A 00 push 0 ; |hOwner = NULL
004013B4 |. E8 4D000000 call <jmp.&USER32.MessageBoxA> ; \MessageBoxA
004013B9 |> EB 15 jmp short 004013D0
004013BB |> FF75 14 push dword ptr [ebp+14] ; /lParam
004013BE |. FF75 10 push dword ptr [ebp+10] ; |wParam
004013C1 |. FF75 0C push dword ptr [ebp+C] ; |Message
004013C4 |. FF75 08 push dword ptr [ebp+8] ; |hWnd
004013C7 |. E8 10000000 call <jmp.&USER32.DefWindowProcA> ; \DefWindowProcA
004013CC |. C9 leave
004013CD |. C2 1000 retn 10
查看得知假码必须要10位,所以
用户名:keheng
假码:1234567890
ebx="keheng"
ecx=5
al=5
edx=0
cl=6B(K)
cl=cl xor 29=42(B)
cl=cl+5=47(G)
if cl<41 or cl>5a then
cl=52
cl=cl+al=57
end if
user1=cl=47(G) 50(P) 44(D) 4E(N) 48(H) '取用户名的前五位计算,循环5次后分别得到的结果
dl=dl+1=1
al=al-1=4
if al=0 then exit for
edx=0
eax=5
cl=21(!)
cl=21 xor 27=06
cl=06 + 05 = 11
cl=cl+1=12(C)
if cl<41 then
cl=4d
cl=cl+05
end if
a11=52(R) 47(G) 53(S) 45(E) 4B(K) '取用户名的前五位计算,循环5次后分别得到的结果
dl=dl+1
al=al-1
if al=0 then exit for
eax=0
cl=4b(K)
cl=cl xor 27=6C(l)
cl=cl+al=6C+5=70(p)
cl=cl+1=71(q)
if cl<41 or cl>5A then
cl=4d
cl=cl+05
end if
a12=51(Q)
dl=dl+1
al=al-1
if al=0 then exit for
test ax,ax ax=0A
SF=1 则跳
if ax<>0A then
msgbox "wrong code!try again!",vbokonly+64,"dont give up..."
end if
eax=0
ebx=0
ecx=0
edx=0
eax="1234567890"
bl=31(1)
dl=47(G)
if bl<>0 then
dl=dl+5=4C(L)
if dl>5A then
dl=dl-0D
else
dl=dl xor 0C=40(@)
if dl<41 then
dl=4B
dl=dl+cl
end if
if dl>5A then
dl=4B
dl=dl-cl
else
ecx=ecx+1
if dl=bl then
else
msgbox "wrong code!try again!",vbokonly+64,"dont give up..."
end if
end if
end if
else
msgbox "serial is correct!",vbokonly+64,"good cracker"
end if
上面是注册机编写的一些代码,但是不知道咋连接起来并算出注册码,也不知道上面的注册分析是否正确,请侠指点一下。。。。。。。。。。。。。
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
上传的附件: