home *** CD-ROM | disk | FTP | other *** search
- fusS' 5th crackme keygenning tutorial by nh
-
- E-Mail: nh666@mail.ru
-
- Need tools: IDA v3.xx-4.xx, TASM v5.0
-
- Run crackme to IDA & see this fragment of code:
-
- .text:0040117D push offset dword_0_403143
- .text:00401182 push 0
- .text:00401184 push 20019h
- .text:00401189 push 0
- .text:0040118B push 0
- .text:0040118D push 0
- .text:0040118F push offset aSoftwareTricks
- .text:00401194 push 80000002h
- .text:00401199 call j_RegCreateKeyExA
-
- find in Windows registry 'Software\TrickSoft\fusS\Crackme05' key
-
-
- .text:0040119E push offset asc_0_403127
- .text:004011A3 push offset Name
- .text:004011A8 push offset unk_0_4031AB
- .text:004011AD push 0
- .text:004011AF push offset aUsername
- .text:004011B4 push dword_0_403143
- .text:004011BA call j_RegQueryValueExA
-
- read UserName value to Name
-
- .text:004011BF push offset asc_0_40312B
- .text:004011C4 push offset Code
- .text:004011C9 push offset unk_0_4031AB
- .text:004011CE push 0
- .text:004011D0 push offset aMagicvalue
- .text:004011D5 push dword_0_403143
-
-
- read MagicValue value to Code
-
- .text:004011DB call j_RegQueryValueExA
- .text:004011E0 push 0
- .text:004011E2 call j_RegCloseKey
-
- [...skipped...]
-
- .text:00401222 sub_0_401222 proc near ; CODE XREF: start+1E7p
- .text:00401222 push ebp
- .text:00401223 mov ebp, esp
- .text:00401225 push offset Name
- .text:0040122A call j_lstrlenA
- .text:0040122F cmp eax, 1
- .text:00401232 jle loc_0_4012FC
- .text:00401238 push offset Code
- .text:0040123D call j_lstrlenA
- .text:00401242 cmp eax, 0
- .text:00401245 jz loc_0_4012FC
- .text:0040124B lea eax, ds:40314Bh
- .text:00401251 xor ecx, ecx
- .text:00401253 xor ebx, ebx
- .text:00401255
- .text:00401255 loc_0_401255: ; CODE XREF: sub_0_401222+45j
- .text:00401255 mov bl, [eax]
- .text:00401257 cmp bl, 0
- .text:0040125A jz short loc_0_401269
- .text:0040125C mov bh, [eax+1]
- .text:0040125F imul ebx, ebx
- .text:00401262 add ecx, ebx
- .text:00401264 xor ebx, ebx
- .text:00401266 inc eax
- .text:00401267 jmp short loc_0_401255
-
- so, it's very simple algo. %))
-
-
- .text:00401269 loc_0_401269: ; CODE XREF: sub_0_401222+38j
- .text:00401269 add ecx, 0BAB1E5h
- .text:0040126F xor ebx, ebx
- .text:00401271
- .text:00401271 loc_0_401271: ; CODE XREF: sub_0_401222+56j
- .text:00401271 add ecx, 2
- .text:00401274 inc ebx
- .text:00401275 cmp ebx, 63h
- .text:00401278 jnz short loc_0_401271
-
- =) add 63h*2
-
- .text:0040127A imul ecx, 0DEADBEEFh
- .text:00401280 sub ecx, 0DEADBEEFh
- .text:00401286 lea ebx, ds:403048h
- .text:0040128C push ecx
- .text:0040128D push offset aD
- .text:00401292 push offset unk_0_40318B
- .text:00401297 call j_wsprintfA
-
- convert ecx to string
-
- .text:0040129C add esp, 0Ch
- .text:0040129F push offset unk_0_40318B
- .text:004012A4 call j_lstrlenA
- .text:004012A9 lea ebx, ds:40318Bh
- .text:004012AF add ebx, eax
- .text:004012B1 mov byte ptr [ebx], 2Dh
- .text:004012B4 inc ebx
- .text:004012B5 push offset aTs
- .text:004012BA push ebx
- .text:004012BB call j_lstrcpyA
-
- add to this string '-[TS]' string
-
- .text:004012C0 push offset unk_0_40318B
- .text:004012C5 push offset Code
- .text:004012CA call j_lstrcmpA
-
- and compare with MagicValue
-
- .text:004012CF cmp eax, 0
- .text:004012D2 jnz short loc_0_4012E8
- .text:004012D4 push offset aCongratulation
- .text:004012D9 push dword_0_40313F
- .text:004012DF call j_SetWindowTextA
- .text:004012E4 leave
- .text:004012E5 retn 4
-
- so, keygen source in nh-fcm05.asm & nh-fcm05.rc
-
- that's all.
-
- /nh