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

  1. Items needed for this tutorial:
  2.   W32 Dasm
  3.   SoftICE
  4.   Animato v1.0 (ftp://ftp.lakeclear.com/ANIMAT10.EXE)
  5.   Basic asm knowlodge...
  6.  
  7. Ok, after you have all of these items your ready
  8.  
  9. Im going to introduce you to a little known method of turning
  10. a program into its OWN keygen! Im not talking about that dialog
  11. box trick either..
  12.  Ok, enough Bullcrap, lets get down to it. Start our target and
  13. goto the register screen. Look, the author is already giving us
  14. some useful information, All serials start with ANM- . We have
  15. an idea of what to look for now... Ok, enter in any name and serial,
  16. switch to softice and set your breakpoints (you should know these),
  17. after a while of tracing we will come to some code that looks like
  18. this (NOTE: addresses may be different):
  19.  
  20.  
  21.  
  22. :00493AF4 8B45FC                  mov eax, dword ptr [ebp-04]
  23. :00493AF7 8B80EC010000            mov eax, dword ptr [eax+000001EC]
  24. :00493AFD E816B6F8FF              call 0041F118
  25. :00493B02 8B45E4                  mov eax, dword ptr [ebp-1C]
  26. :00493B05 8D55F4                  lea edx, dword ptr [ebp-0C]
  27. :00493B08 E87B38F7FF              call 00407388
  28. :00493B0D 8D55E0                  lea edx, dword ptr [ebp-20]
  29. :00493B10 8B45F4                  mov eax, dword ptr [ebp-0C]
  30. :00493B13 E8A839F7FF              call 004074C0
  31. :00493B18 8B55E0                  mov edx, dword ptr [ebp-20]
  32. :00493B1B 8D45F4                  lea eax, dword ptr [ebp-0C]
  33. :00493B1E E85DFFF6FF              call 00403A80
  34. :00493B23 8B45F8                  mov eax, dword ptr [ebp-08] <-- good serial
  35. :00493B26 8B55F4                  mov edx, dword ptr [ebp-0C] <-- our faake #
  36. :00493B29 E84602F7FF              call 00403D74       <-- call to test if we put in good serial
  37. :00493B2E 0F85A3000000            jne 00493BD7         <--if not same goto bad cracker
  38.  
  39.  
  40.  
  41.  
  42. Ok we can see where the Real and our Fake Serial #'s are as i marked.
  43. Now most of us are thiinking right now, hmm, lets just write down the
  44. serial# and use it. Tsk Tsk, we can do better than that. How about
  45. turning this sucker into its own keygen?
  46.  
  47. Obviously at the code marked above it is getting edx / eax ready to
  48. be compared. Well if we look closely we notice
  49. that the line mov edx, [ebp-c] holds our fake serial
  50. and mov eax, [ebp-8] holds our REAL one. How about if we changed
  51. mov edx, [ebp-c]   TO   mov edx, [ebp-8]
  52.  
  53. so it would go from:
  54.  
  55. :00493B23 8B45F8                  mov eax, dword ptr [ebp-08]
  56. :00493B26 8B55F4                  mov edx, dword ptr [ebp-0C]
  57.  
  58.                  TO
  59.  
  60. :00493B23 8B45F8                  mov eax, dword ptr [ebp-08]
  61. :00493B26 8B55F8                  mov edx, dword ptr [ebp-08]
  62.  
  63.  
  64. now BOTH eax and edx would hold the correct serial# before the compare
  65. is made! Ok. patch it and try it. Hew it works... kinda..
  66. You should get a box that says you have successfully registered.
  67. But the program is still unregistered. What could have happened.
  68.  
  69. Ok lets trace again... get back to that point of the code where the
  70. serial#'s are getting set up to be compared.  lets trace throught
  71. from here...
  72.  
  73. :00493B23 8B45F8                  mov eax, dword ptr [ebp-08] <-- Good serial#
  74. :00493B26 8B55F8                  mov edx, dword ptr [ebp-08] <-- changed from above
  75. :00493B29 E84602F7FF              call 00403D74
  76. :00493B2E 0F85A3000000            jne 00493BD7                <-- since we changed above we skip this jmp
  77. :00493B34 A108884A00              mov eax, dword ptr [004A8808]
  78. :00493B39 8B00                    mov eax, dword ptr [eax]
  79. :00493B3B 8B9084040000            mov edx, dword ptr [eax+00000484]
  80. :00493B41 8D45E0                  lea eax, dword ptr [ebp-20]
  81.  
  82. * Possible StringData Ref from Code Obj ->"\Registration"
  83.                                   |
  84. :00493B44 B97C3C4900              mov ecx, 00493C7C
  85. :00493B49 E86201F7FF              call 00403CB0
  86. :00493B4E 8B55E0                  mov edx, dword ptr [ebp-20]
  87. :00493B51 A108884A00              mov eax, dword ptr [004A8808]
  88. :00493B56 8B00                    mov eax, dword ptr [eax]
  89. :00493B58 8B8080040000            mov eax, dword ptr [eax+00000480]
  90. :00493B5E B101                    mov cl, 01
  91. :00493B60 E83F33FBFF              call 00446EA4
  92. :00493B65 8D55E4                  lea edx, dword ptr [ebp-1C]
  93. :00493B68 8B45FC                  mov eax, dword ptr [ebp-04]
  94. :00493B6B 8B80E4010000            mov eax, dword ptr [eax+000001E4]
  95. :00493B71 E8A2B5F8FF              call 0041F118
  96. :00493B76 8B4DE4                  mov ecx, dword ptr [ebp-1C]
  97. :00493B79 A108884A00              mov eax, dword ptr [004A8808]
  98. :00493B7E 8B00                    mov eax, dword ptr [eax]
  99. :00493B80 8B8080040000            mov eax, dword ptr [eax+00000480]
  100.  
  101. * Possible StringData Ref from Code Obj ->"User"
  102.                                   |
  103. :00493B86 BA943C4900              mov edx, 00493C94
  104. :00493B8B E8BC36FBFF              call 0044724C
  105. :00493B90 A108884A00              mov eax, dword ptr [004A8808]
  106. :00493B95 8B00                    mov eax, dword ptr [eax]
  107. :00493B97 8B8080040000            mov eax, dword ptr [eax+00000480]
  108. :00493B9D 8B4DF4                  mov ecx, dword ptr [ebp-0C]      <-- hey look here notice the 
  109.                                                                      [ebp-c] lets change it!
  110.  
  111. * Possible StringData Ref from Code Obj ->"Key"
  112.                                   |
  113. :00493BA0 BAA43C4900              mov edx, 00493CA4
  114. :00493BA5 E8A236FBFF              call 0044724C
  115.  
  116. * Possible StringData Ref from Code Obj ->"Thank you for Purchasing Animato! "
  117.                                         ->" All limitations have now been "
  118.                                         ->"removed."
  119.  
  120.  
  121.  
  122. OK, lets see why it didnt keep our registration, scrolling down past the
  123. jump we come to the registration section. near the end we notice
  124. how it moves [ebp-c] into ecx.. wait a miniute.. if i remember correctly
  125. [ebp-c] was our fake serial # from above! and it looks like it saves the
  126. information from ecx into the registry maybe if we change it to [ebp-8]
  127.  it will keep our correct information!
  128.  
  129. Lets try it ... hey it works.. now when you enter any serial starting
  130. with ANM-  the correct one is stored!.
  131.  
  132. Now most of us are asying, wow  thats cool, but why not just write
  133. down the serial # and be done with it? Well, heres a  good use
  134. of tis method... Some shareware authors are starting to use random
  135. ID#'s that are generated and the serial#'s are generated from them
  136. so people cant just pass arround serial#'s to their programs. Well
  137. this type of patch would apply there. You could simply move in the
  138. correct information to be stored as the program saves the serial#.
  139.  
  140. Anyways, i dont have to say this as it should be understood, if you
  141. like thes program and continue to use it you should purchase a copy.
  142.  
  143.  
  144. Flu[X] - Phrozen Crew 98