home *** CD-ROM | disk | FTP | other *** search
- Olivers Crackme keygenning tutor by nh.
-
- E-Mail: nh666@mail.ru
-
- Need tools: SoftIce v4.xx, IDA v3.xx-4.xx, Tasm v5.0
-
- this crackme is rather easy & i describe only algo of keys generating.
- crackme was written in Delphi, so we set breakpoint to hmemcpy, after some F12
- key pressing, (or u can find it in IDA by string references)
- we see such piece of code: (commented in IDA)
-
-
- CODE:00430CC0 mov eax, [ebp-4]
- CODE:00430CC3
- CODE:00430CC3 ShortName: ; CODE XREF: CODE:00430C50j
- CODE:00430CC3 call sub_0_403938
- CODE:00430CC8 cmp eax, 6
- CODE:00430CCB jge short NameIsGood
- CODE:00430CCD mov eax, offset aNameMustBeAtLe
- CODE:00430CD2 call sub_0_42EB3C
- CODE:00430CD7 jmp Bad
- CODE:00430CDC ; ───────────────────────────────────────────────────────────────────────────
- CODE:00430CDC
- CODE:00430CDC NameIsGood: ; CODE XREF: CODE:00430CCBj
- CODE:00430CDC cmp dword ptr [ebp-8], 0
- CODE:00430CE0 jnz short loc_0_430D16
- CODE:00430CE2 mov eax, offset aEnterASerial
- CODE:00430CE7 call sub_0_42EB3C
- CODE:00430CEC jmp Bad
- CODE:00430CF1 ; ───────────────────────────────────────────────────────────────────────────
- CODE:00430CF1
- CODE:00430CF1 FirstCycle: ; CODE XREF: CODE:00430D20j
- CODE:00430CF1 mov eax, [ebp-4]
- CODE:00430CF4 call sub_0_403938
- [...skipped...]
- CODE:00430D16 mov eax, [ebp-4]
- CODE:00430D19 call sub_0_403938
- CODE:00430D1E cmp ebx, eax
- CODE:00430D20 jl short FirstCycle
- CODE:00430D22 mov ebx, 1
- CODE:00430D27 jmp short loc_0_430D5F
- CODE:00430D29 ; ───────────────────────────────────────────────────────────────────────────
- CODE:00430D29
- CODE:00430D29 SecondCycle: ; CODE XREF: CODE:00430D69j
- CODE:00430D29 push dword ptr [ebp-14h]
- [...skipped...]
- CODE:00430D67 cmp ebx, eax
- CODE:00430D69 jl short SecondCycle
- CODE:00430D6B mov ebx, 1
- CODE:00430D70 lea eax, [ebp-0Ch]
- CODE:00430D73 call sub_0_4036BC
- CODE:00430D78 jmp short loc_0_430DC7
- CODE:00430D7A ; ───────────────────────────────────────────────────────────────────────────
- CODE:00430D7A
- CODE:00430D7A ThirdCycle: ; CODE XREF: CODE:00430DD2j
- CODE:00430D7A lea eax, [ebp-24h]
- CODE:00430D7D mov edx, [ebp-14h]
- [...skipped...]
- CODE:00430DCF dec eax
- CODE:00430DD0 cmp ebx, eax
- CODE:00430DD2 jl short ThirdCycle
- CODE:00430DD4 mov ebx, 1
- CODE:00430DD9 lea eax, [ebp-14h]
- CODE:00430DDC call sub_0_4036BC
- CODE:00430DE1 jmp short loc_0_430DFF
- CODE:00430DE3 ; ───────────────────────────────────────────────────────────────────────────
- CODE:00430DE3
- CODE:00430DE3 FourthCycle: ; CODE XREF: CODE:00430E09j
- CODE:00430DE3 lea edx, [ebp-1Ch]
- [...skipped...]
- CODE:00430E02 call sub_0_403938
- CODE:00430E07 cmp ebx, eax
- CODE:00430E09 jl short FourthCycle
-
- after these 4 cycles, we can see generating string.
- algo is easy. Let's name is 'abcdefg'
-
- so, first, we'll have 110033b110022c... etc. where 103,102,... char codes of
- 'g', 'f', etc...
-
- then we convert each char to dec:
-
- 4949484851519849...etc
-
- CODE:00430E0B mov ebx, 3
- CODE:00430E10 lea eax, [ebp-0Ch]
- CODE:00430E13 call sub_0_4036BC
- CODE:00430E18 cmp ebx, 30h
- CODE:00430E1B jge short ExitFifthCycle
- CODE:00430E1D
- CODE:00430E1D FifthCycle: ; CODE XREF: CODE:00430E3Dj
- CODE:00430E1D lea eax, [ebp-1Ch]
- CODE:00430E20 mov edx, [ebp-14h]
- CODE:00430E23 mov dl, [edx+ebx-1]
- CODE:00430E27 call sub_0_403860
- CODE:00430E2C mov edx, [ebp-1Ch]
- CODE:00430E2F lea eax, [ebp-0Ch]
- CODE:00430E32 call sub_0_403940
- CODE:00430E37 add ebx, 3
- CODE:00430E3A cmp ebx, 30h
- CODE:00430E3D jl short FifthCycle
- CODE:00430E3F
- CODE:00430E3F ExitFifthCycle: ; CODE XREF: CODE:00430E1Bj
- CODE:00430E3F mov ebx, 1
- CODE:00430E44 jmp short loc_0_430EA1
- CODE:00430E46 ; ───────────────────────────────────────────────────────────────────────────
-
- in 5th cycle executing, we take each 3rd char:
-
- 4ex: we have: s1=4949484851515555..
- we get : s2=4851...
-
-
- CODE:00430E46
- CODE:00430E46 LastCycle: ; CODE XREF: CODE:00430EABj
- CODE:00430E46 mov eax, [ebp-4]
- [...skipped...]
- CODE:00430EA4 call sub_0_403938
- CODE:00430EA9 cmp ebx, eax
- CODE:00430EAB jle short LastCycle
-
- in last cycle:
- let's:
- name='abcdefg',so length of name is 7
- s1='4949484851519849...'
- |
- s2='4851...'
- we do next:
- subtract from first char of s2 (length_of_name-2) char of s1:
-
- s3='0017...' - this is our key
-
- compare...
-
- CODE:00430EAD mov eax, [ebp-0Ch]
- CODE:00430EB0 mov edx, [ebp-8]
- CODE:00430EB3 call Comparing
- CODE:00430EB8 jnz short Bad
- CODE:00430EBA mov eax, offset aYouGotIt
- CODE:00430EBF call sub_0_42EB3C
- CODE:00430EC4
- CODE:00430EC4 Bad: ; CODE XREF: CODE:00430CD7j
-
- i'm sorry for bad english & very ugly tutor & keygen sources...=)))
- but it works....%))
-
- c'ya
-