| MAKING INTERNAL KEYGENS | |||
| Intro | |||
|
In this tutorial we will crack Rith's crackme, and make an internal keygenerator
for it. TARGET : rith crackme 1.exe TOOLS USED :Wdasm & HexWorkshop - You don't have to reverse the algo completely |
|||
| Reversing the code | |||
|
004015BC E8E3020000 Call 004018A4
004015C1 8B7E60 mov edi, dword ptr [esi+60] ;Name
004015C4 8B5FF8 mov ebx, dword ptr [edi-08] ;Name length
004015C7 83FB05 cmp ebx, 00000005 ;Name length < 5 ?
004015CA 7C7E jl 0040164A ;Jump to badguy
004015CC 8B4664 mov eax, dword ptr [esi+64] ;Serial
004015CF 89442414 mov dword ptr [esp+14], eax
004015D3 3958F8 cmp dword ptr [eax-08], ebx ;NameLength=Serial length?
(*):004015D6 7572 jne 0040164A ;if not, jump to badguy
004015D8 83FB14 cmp ebx, 00000014 ;Name length>14 ?
004015DB 7F6D jg 0040164A ;if so, jump to badguy
004015DD 33C9 xor ecx, ecx
004015DF 85DB test ebx, ebx
004015E1 7E54 jle 00401637
004015E3 8B742410 mov esi, dword ptr [esp+10] ;Pi (20 digits)
* Referenced by a (U)nconditional or (C)onditional Jump at Address:00401631(C)
004015E7 8A040F mov al, byte ptr [edi+ecx] ;(ecx)th byte of Name
004015EA 0FBE2C31 movsx ebp, byte ptr [ecx+esi] ;(ecx)th digit of Pi
004015EE 0FBEC0 movsx eax, al
004015F1 99 cdq
004015F2 F7FD idiv ebp ;Divide name-byte by Pi-byte
004015F4 8BC2 mov eax, edx ;Move remainder to eax
004015F6 D1E0 shl eax, 1 ;remainder * 2
004015F8 83F87B cmp eax, 0000007B 0040162E 41 inc ecx ;point to next byte/digit
|
|||
| Patching the code | |||
(**) Saves each byte of the calculated serial to address in EDX+Counter Have you noticed that we only had to change 14 bytes to change the proggy to an internal keygen? As I said, this is great for lazy programmers :) To complete this keygen, let's change the program so that we don't have
to enter any serial. Name : Detten
Detten www.biw-reversing.cjb.net |
|||
|
|