Newbies guide to cracking |   By ThrawN 
---------------------------

Tut 5 
--------------------------------
Keygenning made simple and easy with delphi 4/5

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Target: Beginner Software's Delphi Tools 1.x
Website: http://solair.eunet.yu/~beginner/
Time required: Aprox 5 mins
Tools required: Tut 4
                Borland Delphi 4/5
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

To do this tutorial its asumed you have some basic delphi knowledge.
From the last tutorial we saw how to get our serial number. We also saw the algo.
In this tut you will learn how to understand this algo and code a keygen for it.
Here is the programs algo explained:

movzx ecx, byte ptr [ecx+eax-01] <- Get first character of name
imul ecx, eax                    <- Multiple it by Eax which is the number of the character                                  its current working on
mov ebx, eax                     <- Move the number of character its working on into ebx
add ebx, ebx                     <- EBX + EBX
imul ecx, ebx                    <- Multiply ECX by EBX
add esi, ecx                     <- Add our result to ESI
inc eax                          <- EAX + 1 ( add one to counter)
dec edx                          <- Is there another character?
jne 00484BC4                     <- Jump if so and repeat.

I hope you understand this. If not then look below and i give the example using my name.
**********      ThrawN    ********
T =54                      Get next character
54 * 1(eax) = ecx          Multiply it by the number of the character your working on. In this case its the first so '1' is correct
move eax into ebx         so now EBX equals '1'
EBX = EBX + EBX           Fairly easy to understand this :)
ECX = 1(EBX) * 54         Whatever is in ECX is multiplied by the number of character.
add esi, ecx              Whatever the result in ecx was its added to ESI
eax = eax + 1             The counter so next time its character '2' we work on

This will keep looping untill every character has been calculated.
Im not very good at explaining these things and i think iv done a terrible job trying to explain this heh. Anyway load delphi and create two edit boxes and a button.
On the buttonclick event add this in the line before the Begin:
 var s,s2: string;
    n, code, eax, ebx, hex, total : integer;

That simply declares some shit we will be using in the keygen
Now after Begin add this:
    s := edit1.text;
    n := 1 ; code := 0 ;
    total := 0 ;
    while n <= Length(s) do
    begin
     s2 := IntToStr(ord(s[n]));   // Covert the character to ASCI
     eax := n  ;                  // Nunber of charcter working on. I.E 1st 2nd... 
     hex :=  StrToInt(s2) * eax ; // ASCI value * eax
     ebx:= n  ;                   // Nunber of charcter working on. I.E 1st 2nd... 
     ebx := ebx * 2  ;            // Multiplied by 2, same as ebx + ebx
     total := hex * ebx  ;        // Understandable now :)
     code := code + total  ;      { The result pushed into code and code loops till all chars are done now}

   inc(n) ;                       // Add 1 so next time its working on the next character

   end ;
    edit2.text:= IntToStr(code) ; // Our total serial displayed in edit2

I have included the keygen source for you if you were unable to understand this.

Contact ThrawN - thrawnc@hotmail.com

