home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Mendoza / flux5.txt < prev    next >
Text File  |  2000-05-25  |  5KB  |  135 lines

  1. Flu[X]'s cracking tutor #5 - A EXTREMELY easy keygen
  2.  
  3. Tools
  4. -Softice 3.2+
  5. -Uninstall manager v2.5
  6. -Turbo Pascal 7
  7. -Brain
  8.  
  9.  
  10. I HIGHLY RECOMEND YOU VIEW THIS IN NOTEPAD!!!
  11.  
  12. -INTRO-
  13. Ok, in this tut ill teach you how to do a keygen..  THIS
  14. is a VERY easy example. Simple principals.. simple protection.
  15. This is probably the most simple protection IVE EVER seen!
  16.  
  17. Ok, install and start out target. Find under the menus the
  18. register button. Enter a fake code.. i used: 
  19. name: Fluxphrozen
  20. code: 121212
  21.  
  22. ok get into softice (Control-D) set a bpx on 44FD57
  23. hopefully softice should break.. you will see the heart of
  24. the protection scheme..
  25.  
  26. Ok it is inportant to know at the start of this routine
  27. EDI contains ho many letters there are in out name. 
  28. Also note, before the program gets to this point, it converts
  29. your name to total lowercase.. you can see that from tracing.
  30. I will just concentrate on the maths part of it.
  31. Note EBX is used as an accumulator.. the below function
  32. just adds up all the ascii values into one number.
  33.  
  34.  
  35.  
  36. :0044FD57        mov edx, dword ptr [ebp-04]     <-get name into edx
  37. :0044FD5A        mov dl, byte ptr [edx+eax-01]   <-get character 
  38. :0044FD5E        cmp dl, 20                      <-compare character to a "spacebar"
  39. :0044FD61        je 0044FD6E                     <-if equal to "spacebar" skip the adding process
  40. :0044FD63        mov ecx, dword ptr [ebp-04]     <-get name into ecx (usless instruction.. never used)
  41. :0044FD66        and edx, 000000FF               <-basically does nothing to data (another unimportant step)
  42. :0044FD6C        add ebx, edx                    <-add ascii value of character to accumulator
  43. :0044FD6E        inc eax                         <-increase position in name to get next character
  44. :0044FD6F        dec edi                         <-decrease # of letters left to process in your name
  45. :0044FD70        jne 0044FD57                    <-if no more letters left continue
  46.                                                    or else bak to top of this process
  47.  
  48. Ok that piece of code should be simple. i hope i explained it well
  49. enough.. ok now what happens with the number it makes? below is the
  50. code that processes it.
  51.  
  52.  
  53. :0044FD72        xor ebx, 00000089                 <-XOR result by hex $89
  54. :0044FD78        xor ebx, 00000033                 <-Xor Result of above by $33
  55. :0044FD7B        lea edx, dword ptr [ebp-08]       <-|
  56. :0044FD7E        mov eax, dword ptr [esi+0000021C] <-| these functions get your fake
  57. :0044FD84        call 0041F8E0                     <-| serial you put in the box
  58. :0044FD89        mov eax, dword ptr [ebp-08]       <-| to check it
  59. :0044FD8C        call 00407408                     <-|
  60. :0044FD91        cmp ebx, eax                      <-Compare your fake one with real generated
  61.                                                      ebx= real  eax= fake
  62.  
  63.  
  64.  
  65. Now to make a keygenerator. I have included my source below. It
  66. is commented and should be easy to follow.
  67.  
  68.  
  69. ===Begin Source Code===
  70.  
  71.  
  72. program umkeymaker;
  73.  
  74. var
  75.  name:string;           {declare variables to use}
  76.  secondc:integer;
  77.  total:integer;
  78.  pos,z:integer;
  79.  
  80. begin
  81.  writeln('Uninstall Manager v2.5 Keygen');   {write info to screen}
  82.  writeln('Flu[X]/PC98');
  83.  writeln('7/06/98');
  84.  writeln(' ');
  85.  write('Enter Name :');
  86.  readln(name);                        {read keyboard input}
  87.  Write('Registration Key : ');
  88.  
  89.  total:=0;                            {initalize variables}
  90.  secondc:=0;
  91.  pos:=1;
  92.  
  93.  while pos <= length(name) do         {change name to all lowercase}
  94.   begin
  95.   z:= ord(name[pos]);
  96.   secondc:=ord(name[pos]);
  97.    if ord(name[pos]) <= 90 then
  98.     begin
  99.      if ord(name[pos]) >= 65 then
  100.       begin
  101.        name[pos]:= char(ord(name[pos]) + 32);
  102.       end;
  103.     end;
  104.    pos:=pos+1;
  105.  end;
  106.  
  107.  secondc:=0;
  108.  pos:=1;                              {reset counter variable}
  109.  
  110.  while pos <= length(name) do         {add ascii values of lowercasr name together} 
  111.   begin
  112.     if ord(name[pos]) <> $20 then      {test to see if name has a space}
  113.     begin
  114.      secondc := secondc + ord(name[pos]);
  115.     end;
  116.     pos := pos +1;
  117.   end;
  118.  
  119.  total := secondc XOR $89;            {XOR total by 89 hex}
  120.  secondc:= total;                     {copy resul;t from above to secondc}
  121.  total := secondc XOR $33;            {XOR the result by 33 hex}
  122.  
  123.  
  124.  writeln(total);                      {print out total, which is your key}
  125.  
  126. end.
  127.  
  128. ===END Source Code===
  129.  
  130.  
  131. I hope to see you again in Flu[X] tutor #6
  132. As always if you like a program buy it!  Thi essay is for
  133. educational purposes ONLY! Software authors deserve your support!
  134.  
  135. Flu[X]/PC98