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

  1. *******************************************************************************************************************************************************
  2.                     Win32Asm CrackMe 1
  3. *******************************************************************************************************************************************************
  4.  
  5. Author:        Acid_Cool_178's
  6. Protection:    NAG
  7. URL:        http://www.mesa-sys.com/~eternal/a-d/ac178-cm1.zip
  8. Tools:        W32Dasm v8.93
  9.         Hex-Editor
  10.         ProcDump v1.6.2
  11.  
  12.  
  13. --->    Intro...
  14.  
  15. Welcome to my next Tutorial !!!
  16. A very simple CrackMe, just remove 1 NAG ;)
  17.  
  18.  
  19. --->    Let's Begin...
  20.  
  21. Ok, well first we're going to just open the CrackMe to see what's going 
  22. on :)
  23. So open it, and you'll see a Message Box saying:
  24.  
  25.  
  26. "Acid_Cool_178's"
  27. "Win32Asm CrackMe 1"
  28.  
  29.  
  30. Press "Ok" and we see another Message Box saying:
  31.  
  32.  
  33. "Greetings goes too all my friends.."
  34. "Hellforge, tCA, FHCF, DQF, and the rest..."
  35.  
  36.  
  37. Press "Ok" again and we'll get another Message Box saying:
  38.  
  39.  
  40. "Remove Me!"
  41. "NAG NAG"
  42.  
  43.  
  44. Ah, that looks nice ;)
  45. So now we know that we need the 3rd Message Box.
  46. Click "Ok" 1 more time and the CrackMe exits.
  47. Now open the CrackMe in W32Dasm and click on "Strn Ref" (String Data 
  48. References).
  49. Well not so much text here, but you'll notice the "Remove Me!" ;)
  50. Double click on it and you'll see this:
  51.  
  52. -------------------------------------------------------------------------------------------------------------------------------------------------------
  53.  
  54. :0040101F 6A00                    push 00000000
  55.  
  56. * Reference To: USER32.MessageBoxA, Ord:01BBh
  57.                                   |
  58. :00401021 E81A000000              Call 00401040
  59. :00401026 6A00                    push 00000000
  60.  
  61. * Possible StringData Ref from Data Obj ->"Remove Me!"        <--- Here's the 
  62. text :)
  63.                                   |
  64. :00401028 6871304000              push 00403071
  65.  
  66. * Possible StringData Ref from Data Obj ->"NAG NAG"
  67.                                   |
  68. :0040102D 687C304000              push 0040307C
  69. :00401032 6A00                    push 00000000
  70.  
  71. * Reference To: USER32.MessageBoxA, Ord:01BBh
  72.                                   |
  73. :00401034 E807000000              Call 00401040
  74. :00401039 6A00                    push 00000000
  75.  
  76. * Reference To: KERNEL32.ExitProcess, Ord:0075h
  77.                                   |
  78. :0040103B E806000000              Call 00401046
  79.  
  80. -------------------------------------------------------------------------------------------------------------------------------------------------------
  81.  
  82. Ok, how can we solve this? :)
  83. There are several ways:
  84.  
  85. 1.    Notice the "push 00000000" at offset "00401026" we can let it jump 
  86. to "ExitProcess" and
  87.     then the CrackMe quits :)
  88.  
  89. 2.    We can NOP the call at offset "00401034".
  90.  
  91. 3.    We can make the call at offset "00401034" jump to the "ExitProcess" 
  92. instead of the
  93.     "MessageBoxA".
  94.  
  95. 4.    We can Inline Patch this "either with patch 1, 2 or 3" in the 
  96. beginning of the CrackMe.
  97.  
  98.  
  99. You know what?, i'm gonna try them all ;)
  100. So first we're gonna do Method 1.
  101.  
  102.  
  103.                        *** Method 1 ***
  104.  
  105. ok, we need the "push 00000000" at offset "00401026", double click on 
  106. that instruction to see the
  107. "Raw Address" it's "00000426".
  108. Now open your Hex-Editor and close W32Dasm (Otherwise we can't save the 
  109. File ;) and go to
  110. location "00000426".
  111. There you'll see this:
  112.  
  113. -------------------------------------------------------------------------------------------------------------------------------------------------------
  114.                       Call MessageBoxA     Call ExitProcess
  115.                       |               |
  116. 6A 00 68 71 30 40 00 68 7C 30 40 00 6A 00 E8 07 00 00 00 6A 00 E8 06 00 
  117. 00 00
  118.  
  119. -------------------------------------------------------------------------------------------------------------------------------------------------------
  120.  
  121. We're going to replace the first "6A 00" with a Jump "EB 00" but now we 
  122. need to count how much
  123. bytes we need to Jump :)
  124. So how are we going to do this?
  125. To count from some place to another place, always start counting behind 
  126. the Instruction till you
  127. reach the beginning of the other Instruction where you want it to Jump 
  128. to :)
  129. And don't forget to count in "Hexadecimal" format, that is:
  130.  
  131. 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 ...
  132.  
  133. Let me show you (I hope you'll understand ;) :
  134.  
  135. -------------------------------------------------------------------------------------------------------------------------------------------------------
  136.       Count from here                                    To here (This 
  137. is the beginning of ExitProcess)
  138.       |                             |
  139. 6A 00 68 71 30 40 00 68 7C 30 40 00 6A 00 E8 07 00 00 00 6A 00 E8 06 00 
  140. 00 00
  141.  
  142.       0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F  10 11
  143.       |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  144. EB 00 68 71 30 40 00 68 7C 30 40 00 6A 00 E8 07 00 00 00 6A 00 E8 06 00 
  145. 00 00
  146. |                             |
  147. Our Replaced Jump                     Till we reach this place so "11" is our value
  148.  
  149. -------------------------------------------------------------------------------------------------------------------------------------------------------
  150.  
  151. Well, it looks harder then it is :)
  152. So our final line to make it Jump from the beginning of the last 
  153. Message Box to the ExitProcess looks like this:
  154.  
  155. -------------------------------------------------------------------------------------------------------------------------------------------------------
  156.  
  157. EB 11 68 71 30 40 00 68 7C 30 40 00 6A 00 E8 07 00 00 00 6A 00 E8 06 00 
  158. 00 00
  159.  
  160. -------------------------------------------------------------------------------------------------------------------------------------------------------
  161.  
  162. Ok, so replace the "6A00" with "EB11" at offset "00401026" and save the 
  163. File and run it.
  164. It works ;)
  165. Now method 2.
  166.  
  167.  
  168.                         *** Method 2 ***
  169.  
  170. We're going to replace the "call 00401040" with "NOP" :)
  171. In W32Dasm double click on the call 00401040" at offset "00401034" to 
  172. get the "Raw Address" it's "00000434".
  173. So close W32Dasm and open the CrackMe in your HexEditor, then go to 
  174. that Adress "00000434" and you'll see this:
  175.  
  176. -------------------------------------------------------------------------------------------------------------------------------------------------------
  177.  
  178. E8 07 00 00 00        <--- This is the Call to the Message Box.
  179.  
  180. -------------------------------------------------------------------------------------------------------------------------------------------------------
  181.  
  182. So just replace the E807000000" with "9090909090" and that's it :)
  183. Save the File and run it, it works ;)
  184. On to Method 3.
  185.  
  186.  
  187.                     *** Method 3 ***
  188.  
  189. Ok, look just above on how to get to the correct place for the Call and 
  190. now i'll show you a bigger line ;) :
  191.  
  192. -------------------------------------------------------------------------------------------------------------------------------------------------------
  193. MessageBoxA          ExitProcess    MessageBoxA       ExitProcess
  194. |             |              |                 |
  195. E8 07 00 00 00 6A 00 E8 06 00 00 00 FF 25 08 20 40 00 FF 25 00 20 40 00
  196.  
  197. -------------------------------------------------------------------------------------------------------------------------------------------------------
  198.  
  199. We need to make the "E807000000" Jump to the ExitProcess (You can make 
  200. it jump either to the first ExitProcess or the second, we'll take the 
  201. second ;).
  202. So we're going to do this the same as with Method 1 :)
  203.  
  204. -------------------------------------------------------------------------------------------------------------------------------------------------------
  205.            From here                  To here (ExitProcess)
  206.                |                      |
  207. E8 07 00 00 00 6A 00 E8 06 00 00 00 FF 25 08 20 40 00 FF 25 00 20 40 00
  208.  
  209.                0  1  2  3  4  5  6  7  8  9  A  B  C  D
  210.                |  |  |  |  |  |  |  |  |  |  |  |  |  |
  211. E8 07 00 00 00 6A 00 E8 06 00 00 00 FF 25 08 20 40 00 FF 25 00 20 40 00
  212. |                              |
  213. The Call                          Till this place so we need value "0D"
  214.  
  215. -------------------------------------------------------------------------------------------------------------------------------------------------------
  216.  
  217. Ok, so replace the "E807000000" with "E80D000000" at offset "00000434" 
  218. and save the File.
  219. Run it, it works ;P
  220. On to Method 4.
  221.  
  222.  
  223.                     *** Method 4 ***
  224.  
  225. Ok, now we're going to Inline Patch :)
  226. So we're going to make the Entry Point Jump to our Code and then Patch 
  227. the program (we use Method 1) and then Jump back to the Real Entry 
  228. Point :)
  229. Fire up ProcDump and check out the Entry Point (I assume you know how 
  230. to do this).
  231. The Entry Point is "00001000".
  232. Now open the CrackMe in your HexEditor and look in the Code Section, 
  233. because we need some empty space ;)
  234. Well there's plenty of it at offset "00000500" so we need to replace 
  235. the Entry Point with "00000500" :)
  236. Ok, your still in ProcDump? good ;)
  237. Because now replace the Entry Point "00001000" with "00001100".
  238. Why "00001100" ???
  239. Because if you look in the Section you'll see that the "00001000" is 
  240. the "Virtual Address" for "00000400" (The Raw Address).
  241. And we wanted our Code at "00000500" and so we need the "Virtual 
  242. Address" "00001100" :)
  243. Ok, change it and close ProcDump and now we need to Code our own stuff 
  244. ;) (do it in the way you want).
  245. We need to replace "6A00" with EB11" at offset "00401026" :)
  246. So i coded this at offset "00401100":
  247.  
  248. -------------------------------------------------------------------------------------------------------------------------------------------------------
  249.  
  250. mov word ptr [00401026], EB11
  251. push 00401000
  252. ret
  253.  
  254. -------------------------------------------------------------------------------------------------------------------------------------------------------
  255.  
  256. Ok, now the Code is there save the File and run it.... aarghhh !!! 
  257. error ;)
  258. Hehe, i think i allready now what this is ;) the Size of the Section 
  259. isn't large enough =)
  260. So open the CrackMe again in ProcDump and now look at the first 
  261. Section, the "Raw Size" is "0000004C".
  262. That's too short change it to "00000200" and just in case change the 
  263. Characteristics to "E0000040".
  264. That's it close ProcDump and run the File, now it works ;P
  265. That's All...
  266.  
  267.  
  268. --->    Greetings...
  269.  
  270. To be honest i'm getting a bit sick of these greetings everytime ;P
  271. So i'll just say:
  272.  
  273. Greetings to everyone i know, and to everyone who knows me, and You... 
  274. ;P
  275.  
  276.  
  277.             Don't trust the Outside, trust the InSiDe !!!
  278.  
  279.                       Cya...
  280.  
  281.                     CoDe_InSiDe
  282.  
  283.  
  284. Email:    code.inside@home.nl
  285. Homepage: http://codeinside.cjb.net
  286.