home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / Code Inside / Tut38.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  7.3 KB  |  227 lines

  1. **********************************************************************************************************************
  2.                     Win32Asm CrackMe 2
  3. **********************************************************************************************************************
  4.  
  5. Author:        Acid_Cool_178
  6. Protection:    CD-Check
  7. URL:        http://members.nbci.com/_XMCM/norskehf/crackmes/asm/ac_crackme_02.zip
  8. Tools:        W32Dasm v8.93
  9.         Hex-Editor
  10.  
  11.  
  12. --->    Intro...
  13.  
  14. Welcome to my next Tutorial !!!
  15. The second CrackMe from Acid_Cool_178 :)
  16. It's a simple CD-Check.
  17.  
  18.  
  19. --->    Let's Begin...
  20.  
  21. Ok, as always first open the CrackMe to see what's going on :)
  22. You'll get immediately a Message Box saying:
  23.  
  24. "Sorry, CD-Rom are NOT in Your CD-Rom Drive"
  25. "Nah"
  26.  
  27. Remember the first line for W32Dasm :)
  28. Now click the "Ok" button and the CrackMe quits.
  29. Ok, now disassemble the CrackMe in W32Dasm and click on "Strn Ref" (String Data References).
  30. And double click on the line:
  31.  
  32. "Sorry, CD-Rom are NOT in Your "
  33.  
  34. And you'll see this:
  35.  
  36. ----------------------------------------------------------------------------------------------------------------------
  37.  
  38. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  39. |:0040100F(C)
  40. |
  41. :00401026 6A00                    push 00000000            <--------------
  42.                                         |
  43. * Possible StringData Ref from Data Obj ->"Sorry, CD-Rom are NOT in Your "    |
  44.                                         ->"CD-Rom Drive"            |
  45.                                   |                        |
  46. :00401028 6804304000              push 00403004                    |
  47.                                         |
  48. * Possible StringData Ref from Data Obj ->"Nah"                    | - Bad Message Box
  49.                                   |                        |
  50. :0040102D 6800304000              push 00403000                    |
  51. :00401032 6A00                    push 00000000                    |
  52.                                         |
  53. * Reference To: USER32.MessageBoxA, Ord:01BBh                    |
  54.                                   |                        |
  55. :00401034 E809000000              Call 00401042            <---------------
  56. :00401039 EB00                    jmp 0040103B            <--- Jump to ExitProcess
  57.  
  58. ----------------------------------------------------------------------------------------------------------------------
  59.  
  60. Now notice on top "0040100F(C)", the Message Box has been called by a (C)onditional Jump at
  61. Offset 0040100F :)
  62. So scroll a bit up till that Address "0040100F" and you'll see this:
  63.  
  64. ----------------------------------------------------------------------------------------------------------------------
  65.  
  66. * Possible StringData Ref from Data Obj ->"1"
  67.                                   |
  68.  
  69. //******************** Program Entry Point ********
  70. :00401000 685C304000              push 0040305C
  71.  
  72. * Reference To: KERNEL32.GetDriveTypeA, Ord:00F0h
  73.                                   |
  74. :00401005 E844000000              Call 0040104E            <--- Get Drive Type Information
  75. :0040100A 83F805                  cmp eax, 00000005        <--- Compare EAX with 00000005 (is it a CD-Rom Drive?)
  76. :0040100D 7402                    je 00401011            <--- If equal jump to the Good Message Box
  77. :0040100F 7515                    jne 00401026            <--- Else jump to Bad Message Box
  78.  
  79. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  80. |:0040100D(C)
  81. |
  82. :00401011 6A00                    push 00000000            <---------------
  83. :00401013 6838304000              push 00403038                    |
  84.                                         |
  85. * Possible StringData Ref from Data Obj ->"Well DoneCongratZ, NC Crackme "    |
  86.                                         ->"1 are completed1"            |
  87.                                   |                        | - Good Message Box
  88. :00401018 682F304000              push 0040302F                    |
  89. :0040101D 6A00                    push 00000000                    |
  90.                                         |
  91. * Reference To: USER32.MessageBoxA, Ord:01BBh                    |
  92.                                   |                        |
  93. :0040101F E81E000000              Call 00401042            <---------------
  94. :00401024 EB15                    jmp 0040103B            <--- Jump to ExitProcess
  95.  
  96. ----------------------------------------------------------------------------------------------------------------------
  97.  
  98. You see that little nice Compare over there? ;)
  99. There it checks if it's a CD-Rom, if it is we get the Good Message Box, else the Bad Message Box :)
  100. So we can defeat this CrackMe in several ways:
  101.  
  102. 1.    Change the instruction "cmp eax, 00000005" into "cmp eax, 00000001" (00000001 means "C:\" ;)
  103. 2.    Change the "je 00401011" into "jmp 00401011"
  104. 3.    Change the "jne 00401026" into "nop nop" or "jne 00401011" :)
  105. 4.    Or we can change that it Jumps from the Entry Point to the Good Message Box :)
  106.  
  107. We're gonna do them all ;)
  108.  
  109.  
  110. --->    Method 1
  111.  
  112. Double click on "cmp eax, 00000005" then look at the bottom of W32Dasm you'll see this:
  113.  
  114. "@Offset 0000040Ah"
  115.  
  116. Then open the CrackMe in your Hex-Editor and go to location "0000040A".
  117. There change this:
  118.  
  119. 83F805    (cmp eax, 00000005)
  120.  
  121. into:
  122.  
  123. 83F801    (cmp eax, 00000001)
  124.  
  125. Save the File and run it (don't forget to close W32Dasm otherwise we can't save), it works ;)
  126.  
  127.  
  128. --->    Method 2
  129.  
  130. Ok, disassemble the CrackMe again in W32Dasm (if you closed W32Dasm ;) and double click on the
  131. instruction "je 00401011" then you'll see at the bottom this:
  132.  
  133. "@Offset 0000040Dh"
  134.  
  135. Then open the CrackMe in your Hex-Editor and go to location "0000040D".
  136. There change this:
  137.  
  138. 7402    (je "Jump if Equal")
  139.  
  140. into:
  141.  
  142. EB02    (jmp "Jump")
  143.  
  144. Save the File and run it (don't forget to close W32Dasm otherwise we can't save), it works ;)
  145.  
  146.  
  147. --->    Method 3
  148.  
  149. Ok, disassemble the CrackMe again in W32Dasm (if you closed W32Dasm ;) and double click on the
  150. instruction "jne 00401026" then you'll see at the bottom this:
  151.  
  152. "@Offset 0000040Fh"
  153.  
  154. Then open the CrackMe in your Hex-Editor and go to location "0000040F".
  155. There change this:
  156.  
  157. 7515    (jne "Jump if Not Equal")
  158.  
  159. into:
  160.  
  161. 9090    (NOP, NOP)
  162.  
  163. or into:
  164.  
  165. 7500    (jne "Jump if Not Equal")
  166.  
  167. Save the File and run it (don't forget to close W32Dasm otherwise we can't save), it works ;)
  168.  
  169.  
  170. --->    Method 4
  171.  
  172. Double click on the Entry Point (location "00401000") to see what's the real Address ;) it's:
  173.  
  174. "@Offset 00000400h"
  175.  
  176. Then open the CrackMe in your Hex-Editor and go to location "00000400".
  177. you'll see there:
  178.  
  179. 685C304000E84400000083F80574027515
  180.  
  181. We're going to make it Jump from the beginning till after the "7515" (jne) :)
  182. So change it into this:
  183.  
  184. EB0F304000E84400000083F80574027515
  185.  
  186. Ok, now why this line? ;)
  187. First of all you need to know when your calculating Jumps, is that you need to start counting
  188. after the Jump instruction till you reach the beginning of the Instruction where you want to Jump
  189. to, and offcourse don't forget to count in Hex. ;)
  190. Let me explain:
  191.  
  192.       From here... (After the Jump Instruction)   Till here... (Beginning destination place)
  193.       |                           |
  194. EB 0F 30 40 00 E8 44 00 00 00 83 F8 05 74 02 75 15
  195. |   |
  196. Our Jump
  197.  
  198.  
  199.       0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
  200.       |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  201. EB 0F 30 40 00 E8 44 00 00 00 83 F8 05 74 02 75 15
  202. |   |
  203. Our Jump
  204.  
  205. See it's simple :)
  206. So replace the first 2 Bytes with "EB0F".
  207. Save the File and run it (don't forget to close W32Dasm otherwise we can't save), it works ;)
  208. That's All...
  209.  
  210.  
  211. --->    Greetings...
  212.  
  213. To be honest i'm getting a bit sick of these greetings everytime ;P
  214. So i'll just say:
  215.  
  216. Greetings to everyone i know, and to everyone who knows me, and You... ;P
  217.  
  218.  
  219.             Don't trust the Outside, trust the InSiDe !!!
  220.  
  221.                       Cya...
  222.  
  223.                     CoDe_InSiDe
  224.  
  225.  
  226. Email:    code.inside@home.nl
  227. Homepage: http://codeinside.cjb.net