home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / eb-drj1.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  8.6 KB  |  246 lines

  1.             Tutorial Number 35
  2.  
  3. Written by Eternal Bliss
  4. Email: Eternal_Bliss@hotmail.com
  5. Website: http://vipatcher.cjb.net
  6. Date written: 30th April 2000
  7.  
  8. Program Details:
  9. Name: CrackMe 1 by DaNiEl-RJ
  10.  
  11. Tools Used:
  12. Resource Editor (ExeScope in this case)
  13. SoftIce
  14. W32Dasm
  15.  
  16. Cracking Method:
  17. Patching to Enable MenuItem
  18. Serial Sniffing
  19.  
  20. Viewing Method:
  21. Use Notepad with Word Wrap switched on
  22. Screen Area set to 800 X 600 pixels (Optional)
  23.  
  24. __________________________________________________________________________
  25.  
  26.  
  27.                         About this protection system
  28.  
  29. The MenuItem to show the register window is disabled until you click on
  30. the About Box. I am not sure what is required of this CrackMe so the
  31. aims below are what I want to do. 8P
  32. Aims:
  33. 1) Enable the MenuItem "Damn! Where's the whole thing go???" at runtime.
  34. 2) Find a serial for my name.
  35. 3) Show the correct serial in a message box instead of the error message.
  36.  
  37. _________________________________________________________________________
  38.  
  39.  
  40.                         About this tutorial
  41.  
  42. I will try to be as detailed as possible again. I know that some of my
  43. tutorials are not very detailed. But that is because if you have been 
  44. following them, you would be able to understand them.
  45.  
  46. This is the first time I am using a resource editor for a CrackMe. It is
  47. very useful. Do download one and play with it. Sometimes, it is possible
  48. to crack a program just by using it especially if the program is based
  49. on a nag.
  50.  
  51. _________________________________________________________________________
  52.  
  53.  
  54.             Enable MenuItem
  55.  
  56. Run the program a few times and look at the characteristics of the
  57. program eg. "Damn! Where's the whole thing go???" in the MenuItem.
  58.  
  59. Disassemble the CrackMe with W32Dasm. In the String Data Reference (SDR),
  60. you will see "Delphi%.8X". I am not sure what "%.8X" means but I do
  61. know what Delphi is. 8)
  62.  
  63. I read somewhere that enabling a Delphi Menu can be difficult when
  64. using Sice or just a Disassembler. So, I tried a Resource Editor and
  65. it works.
  66.  
  67. Load the crackme in ExeScope. You will see
  68. 1) Header
  69. 2) Import
  70. 3) Resource
  71.  
  72. Let's concern ourselves with just the Resource section...
  73. When you click on the + sign next to it, you will see
  74. 1) String
  75. 2) RCData
  76. 3) Cursor
  77. 4) Icon
  78.  
  79. In a Delphi program, the forms (ie the windows you see) are in
  80. the RCData section of Resource. Click on the + sign next to
  81. RCData. You will see TFORM1. 8)
  82.  
  83. This is the window you see when you run the program. Click on it.
  84. OMG... Tons of stuff. 8P
  85.  
  86. Let's search for "Damn! Where's the whole thing go???" 8)
  87. You will find it at the bottem of TFORM1 in the form of
  88.   object MainMenu1: TMainMenu
  89.     object File1: TMenuItem
  90.       Caption = '&File'
  91.       object Damn: TMenuItem
  92.         Caption = '&Damn! Where'#39's the whole thing???'
  93.         Enabled = False
  94.         OnClick = DamnClick
  95.       end
  96.       object About1: TMenuItem
  97.         Caption = '&About'
  98.         OnClick = About1Click
  99.       end
  100.     end
  101.   end
  102.  
  103. There... Did you see "Enabled = False" ??
  104. Click on the False and change it to True
  105. ie. Enabled = True
  106.  
  107. Then save it. You will be prompted if you want to change 
  108. the size of the program. 
  109. Make sure that "Permit to change file size is not checked".
  110.  
  111. Now, run the CrackMe. That MenuItem is enabled... 8)
  112.  
  113. _________________________________________________________________________
  114.  
  115.  
  116.             Serial Sniffing
  117.  
  118. If you look at the SDR, you will see "No no no! :( Try again!" which is
  119. what you get when you enter the wrong serial. Double click on the line in
  120. SDR to bring you to the part of the code.
  121. A habit of mine is to double click again to make sure that there is no
  122. other instance where the string is used. There isn't in this case. 
  123. You will be brought to 0042D57D. Below is a small snippet of the code
  124. with my comments pre-fixed with "<<".
  125.  
  126. ------------------------Code Start------------------------
  127. :0042D556 8D55F8                  lea edx, dword ptr [ebp-08]
  128. :0042D559 8B86E0010000            mov eax, dword ptr [esi+000001E0]
  129. :0042D55F E8FCC8FEFF              call 00419E60
  130. :0042D564 8B45F8                  mov eax, dword ptr [ebp-08]
  131. :0042D567 8B55FC                  mov edx, dword ptr [ebp-04]
  132. :0042D56A E86163FDFF              call 004038D0        << Call before jump... hmm
  133. :0042D56F 750C                    jne 0042D57D        << Jump to error message
  134.  
  135. * Possible StringData Ref from Code Obj ->"Congratz cracker! hehehe"
  136.                                   |
  137. :0042D571 B8ECD54200              mov eax, 0042D5EC    << Go here if
  138. :0042D576 E87DFBFFFF              call 0042D0F8        << you enter the
  139. :0042D57B EB0A                    jmp 0042D587        << correct code
  140.  
  141. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  142. |:0042D56F(C)
  143. |
  144. * Possible StringData Ref from Code Obj ->"No no no! :( Try again!"
  145.                                   |
  146. :0042D57D B810D64200              mov eax, 0042D610    << Going to show the
  147. :0042D582 E871FBFFFF              call 0042D0F8        << error message
  148. -------------------------Code End-------------------------
  149.  
  150. If you are into patching, you can patch 0042D56F so that it will
  151. never jump to 0042D57D. Just NOP the jne 0042D57D by replacing 750C
  152. with 9090. I won't teach you how to replace them. Go and read my first
  153. few tutorials.
  154.  
  155. If you want a serial, carry on. 8)
  156.  
  157. Notice at 0042D56A there is a CALL before the conditonal jump. And
  158. above it, there is the mov eax and mov edx. Experience tells me that this
  159. "moves" the correct code and the code you enter into eax and edx.
  160. The CALL will check to see if they are the same. If they are the same, you
  161. won't take that jump that follows.
  162.  
  163. **Note: Cracking needs a certain amount of guessing or intuition.
  164.  
  165. Let's use Sice to check.
  166. I used hmemcpy by typing "bpx hmemcpy". Before that, I filled in my name
  167. Eternal Bliss and serial of 12345678.
  168. When you click on the "Check It!" button, you will break. Trace till you
  169. get to the part of the code I showed you.
  170.  
  171. Indeed... eax after 0042D564 is my serial of 1234567 and
  172. edx after 0042D567 is the correct serial...
  173.  
  174. CrackMe Cracked!
  175.  
  176. __________________________________________________________________________
  177.  
  178.  
  179.                              Additional Points
  180.  
  181. Now, lets try something more challenging... Show the correct serial
  182. in the message box instead of "No no no! :( Try again!"
  183.  
  184. I am showing you the code again with different comments below.
  185.  
  186. ------------------------Code Start------------------------
  187. :0042D564 8B45F8                  mov eax, dword ptr [ebp-08]
  188. :0042D567 8B55FC                  mov edx, dword ptr [ebp-04]    << address of [ebp-04]
  189. :0042D56A E86163FDFF              call 004038D0            << contains the real serial
  190. :0042D56F 750C                    jne 0042D57D
  191.  
  192. * Possible StringData Ref from Code Obj ->"Congratz cracker! hehehe"
  193.                                   |
  194. :0042D571 B8ECD54200              mov eax, 0042D5EC
  195. :0042D576 E87DFBFFFF              call 0042D0F8
  196. :0042D57B EB0A                    jmp 0042D587
  197.  
  198. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  199. |:0042D56F(C)
  200. |
  201. * Possible StringData Ref from Code Obj ->"No no no! :( Try again!"
  202.                                   |
  203. :0042D57D B810D64200              mov eax, 0042D610    << 0042D610 contains
  204. :0042D582 E871FBFFFF              call 0042D0F8        << the error message
  205. -------------------------Code End-------------------------
  206.  
  207. [ebp-04] contains the address that stores the correct serial similar
  208. to 0042D610 which contains the error message and
  209. 0042D5EC which contains the congrats message.
  210.  
  211. To find what is [ebp-04], type "d (ebp-04)" and in the data window
  212. you will see D0 1D B9 00 ....
  213. The address is actually in dword format. So to change the data window to 
  214. show dword format, you do a "dd (ebp-04)"
  215. You will see 00B91DD0. I know this address is weird. To check, type
  216. "db 00B91DD0" and you will see the correct serial in byte format. 8)
  217.  
  218. Now, at 0042D57D, you see that the error message is moved into eax to
  219. be shown to us. What we need to do is to replace it with the address
  220. that stores the correct serial ie 00B91DD0.
  221.  
  222. Trace in Sice until you come to 
  223. :0042D57D B810D64200              mov eax, 0042D610
  224. When the highlighted line is that, type
  225. a eip            << this allows you to alter the code on this line
  226. mov eax, 00B91DD0    << this change the code
  227.  
  228. Then press Enter to update the code. Copy the bytes of this line.
  229. We will need it to patch the program.
  230. F5 to let the program run.
  231. Voila... You see the correct serial.
  232.  
  233. The bytes to replace B810D64200 (mov eax, 0042D610) with is
  234. B8D01DB900 (mov eax, 00B91DD0)
  235.  
  236. _________________________________________________________________________
  237.  
  238.  
  239.                              Final Notes
  240.  
  241. This tutorial is dedicated to all the newbies like me.
  242.  
  243. My thanks and gratitude goes to:-
  244.  
  245. All the writers of Cracks tutorials and CrackMes
  246. and also to all the crackers that have been supporting my site and project forum.