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

  1. *********************************************************************************************************************************************
  2.                 Official CFF CrackMe #3
  3. *********************************************************************************************************************************************
  4.  
  5. Author:        Acid Bytes
  6. Protection:    Name / Serial
  7. URL:        http://www.mesa-sys.com/~eternal/a-d/cffo-3.zip
  8. Tools:        SoftICE v4.05
  9.         ProcDump v1.6.2
  10.         Hex-Editor
  11.         W32Dasm v8.93
  12.  
  13.  
  14. --->    Intro...
  15.  
  16. Welcome to my next Tutorial !!!
  17. Ok, first i'm going to find the Name/Serial with SoftICE :)
  18. Then i'm going to Manually Unpack it (it's UPX, you can use the program 
  19. UPX itself to Unpack but
  20. why should I ;P).
  21. And then i'll patch it in some ways.
  22.  
  23.  
  24. --->    Let's Begin...        *** SoftICE ***
  25.  
  26. Ok, open the CrackMe and it asks us for a Name and Serial, enter 
  27. anything you want i've used:
  28.  
  29. Name:        CoDe_InSiDe
  30. Serial:        1234567890
  31.  
  32. Then get into SoftICE (CTRL+D) and type "bpx hmemcpy", then press 
  33. (CTRL+D) to get out of SoftICE
  34. and now press the button "Register now !" and SoftICE should popup.
  35. Ok, now type "BC *" to clear the breakpoint and press (F12) 12 times 
  36. and you'll see this:
  37.  
  38. ---------------------------------------------------------------------------------------------------------------------------------------------
  39.  
  40. :00440ED4 837DFC00                cmp dword ptr [ebp-04], 00000000    <--- 
  41. Check if we entered a Name
  42. :00440ED8 7518                    jne 00440EF2                <--- Jump if we 
  43. entered a Name, else show a Message Box
  44. :00440EDA 6A00                    push 00000000
  45.  
  46. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  47. |:00440E6B(C)
  48. |
  49. :00440EDC B9C80F4400              mov ecx, 00440FC8            <--- String: No 
  50. Name entered
  51. :00440EE1 BAD80F4400              mov edx, 00440FD8            <--- String: 
  52. Enter a Name!
  53. :00440EE6 A1442C4400              mov eax, dword ptr [00442C44]
  54. :00440EEB 8B00                    mov eax, dword ptr [eax]
  55. :00440EED E876C1FFFF              call 0043D068                <--- Call Message 
  56. Box
  57.  
  58. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  59. |:00440ED8(C)
  60. |
  61. :00440EF2 8D55FC                  lea edx, dword ptr [ebp-04]
  62. :00440EF5 8B83C8020000            mov eax, dword ptr [ebx+000002C8]
  63. :00440EFB E820FFFDFF              call 00420E20                <--- Not important
  64.  
  65. ---------------------------------------------------------------------------------------------------------------------------------------------
  66.  
  67. In here it simply checks if we entered a Name, if so it jumps over the 
  68. Message Box, let's see what's next:
  69.  
  70. ---------------------------------------------------------------------------------------------------------------------------------------------
  71.  
  72. :00440F00 837DFC00                cmp dword ptr [ebp-04], 00000000    <--- 
  73. Check if we entered a Serial
  74. :00440F04 7518                    jne 00440F1E                <--- Jump if we 
  75. entered a Serial, else show a Message Box
  76. :00440F06 6A00                    push 00000000
  77.  
  78. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  79. |:00440E99(C)
  80. |
  81. :00440F08 B9E80F4400              mov ecx, 00440FE8            <--- String: No 
  82. Serial entered
  83. :00440F0D BAFC0F4400              mov edx, 00440FFC            <--- String: 
  84. Enter a Serial!
  85. :00440F12 A1442C4400              mov eax, dword ptr [00442C44]
  86. :00440F17 8B00                    mov eax, dword ptr [eax]
  87. :00440F19 E84AC1FFFF              call 0043D068                <--- Call Message 
  88. Box
  89.  
  90. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  91. |:00440F04(C)
  92. |
  93. :00440F1E 8D55FC                  lea edx, dword ptr [ebp-04]
  94. :00440F21 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  95. :00440F27 E8F4FEFDFF              call 00420E20                <--- Not important
  96.  
  97. ---------------------------------------------------------------------------------------------------------------------------------------------
  98.  
  99. And here it simply checks if we entered a Serial :), if so it jumps 
  100. over the Message Box, let's see what's next:
  101.  
  102. ---------------------------------------------------------------------------------------------------------------------------------------------
  103.  
  104. :00440F2C 8B45FC                  mov eax, dword ptr [ebp-04]        <--- EAX 
  105. now points to our Name
  106. :00440F2F BA14104400              mov edx, 00441014            <--- Hmmm.... the 
  107. String: Registered User
  108. :00440F34 E8F32BFCFF              call 00403B2C                <--- Compare those 2
  109. :00440F39 7551                    jne 00440F8C                <--- If not equal 
  110. jump to Bad Message Box, else continue
  111. :00440F3B 8D55FC                  lea edx, dword ptr [ebp-04]
  112. :00440F3E 8B83C8020000            mov eax, dword ptr [ebx+000002C8]
  113. :00440F44 E8D7FEFDFF              call 00420E20                <--- Not important
  114.  
  115. ---------------------------------------------------------------------------------------------------------------------------------------------
  116.  
  117. Hmm... you see that :) it Compares the String: Registered User with our 
  118. Name, if not equal it jumps to the Bad Message Box.
  119. So instead of entering our Name in the first Edit Box we need to place 
  120. there: Registered User :)
  121. Ok change your Name into: Registered User and get back to this place or 
  122. when your on the "jne 00440F8C" type "r fl z" so
  123. we can continue to see what's next, so let's check what's next:
  124.  
  125. ---------------------------------------------------------------------------------------------------------------------------------------------
  126.  
  127. :00440F49 8B45FC                  mov eax, dword ptr [ebp-04]        <--- EAX 
  128. now points to our "Fake" Serial
  129. :00440F4C BA2C104400              mov edx, 0044102C            <--- Hmmm.... the 
  130. String: GFX-754-IER-954
  131. :00440F51 E8D62BFCFF              call 00403B2C                <--- Compare those 2
  132. :00440F56 751A                    jne 00440F72                <--- If not equal 
  133. jump to Bad Message Box, else continue
  134. :00440F58 6A00                    push 00000000                                        <--+
  135. :00440F5A B93C104400              mov ecx, 0044103C            <--- String: 
  136. CrackMe cracked successfully       |
  137. :00440F5F BA5C104400              mov edx, 0044105C            <--- String: 
  138. Congrats! You cracked this CrackMe!   |
  139. :00440F64 A1442C4400              mov eax, dword ptr [00442C44]                                   
  140. | Good Message Box
  141. :00440F69 8B00                    mov eax, dword ptr [eax]                                   |
  142. :00440F6B E8F8C0FFFF              call 0043D068                                           |
  143. :00440F70 EB32                    jmp 00440FA4                                        <--+
  144.  
  145. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  146. |:00440F56(C)
  147. |
  148. :00440F72 6A00                    push 00000000                                        <--+
  149. :00440F74 B980104400              mov ecx, 00441080            <--- String: 
  150. Beggar off!               |
  151. :00440F79 BA8C104400              mov edx, 0044108C            <--- String: 
  152. Wrong Serial,try again!           |
  153. :00440F7E A1442C4400              mov eax, dword ptr [00442C44]                                   
  154. | Bad Message Box
  155. :00440F83 8B00                    mov eax, dword ptr [eax]                                   |
  156. :00440F85 E8DEC0FFFF              call 0043D068                                           |
  157. :00440F8A EB18                    jmp 00440FA4                                        <--+
  158.  
  159. ---------------------------------------------------------------------------------------------------------------------------------------------
  160.  
  161. Hey you see that Serial ;P instead of entering some Serial we need to 
  162. enter the String: GFX-754-IER-954 :) to make us Registered.
  163. Ok, now you can get out of SoftICE and enter those 2 Strings and your 
  164. Registered :) but remember these Offsets for Patching purposes:
  165.  
  166. 00440ED8    Check if we entered a Name
  167. 00440F04    Check if we entered a Serial
  168. 00440F39    Compare 1 (Name:    Registered User)
  169. 00440F56    Compare 2 (Serial:    GFX-754-IER-954)
  170. 00440F5A    We're gonna replace this String with "Registered User"
  171. 00440F5F    We're gonna replace this String with "GFX-754-IER-954"
  172.  
  173. Also remember these two Offsets to Strings:
  174.  
  175. 00441014    the String: Registered User
  176. 0044102C    the String: GFX-754-IER-954
  177.  
  178. But now let's first Unpack this CrackMe :)
  179.  
  180.  
  181. --->    Let's Begin...        *** Manually Unpack ***
  182.  
  183. Ok, like i said above in the file you can Unpack UPX easily with it's 
  184. own Program :) but i don't like that so i'm doing it Manually...
  185. Open ProcDump and click on the button "PE Editor" then select the 
  186. CrackMe and click "Open".
  187. Now you'll see:
  188.  
  189. Entry Point:    00055BB0
  190.  
  191. This is the "Virtual Offset" and we need to find the "Raw Offset" so 
  192. click on "Sections" and look at the "Virtual Offsets".
  193. As you can see this Entry Point belongs to the Middle Section called 
  194. "UPX1" (Btw it's actually always the middle Section in UPX ;).
  195. So how are we going to figure out the "Raw Offset" ?
  196.  
  197. Entry Point = 00055BB0 - (00037000 - 00000400)
  198. Entry Point = 0001EFB0
  199.  
  200. So, open the CrackMe in your Hex-Editor and go to Offset "0001EFB0" now 
  201. press one time "Page-Down" and you should see somewhere where the
  202. Code ends something like this:
  203.  
  204. 61E964B5FEFF
  205.  
  206. Replace "E9" with "CC" and save the File.
  207. Then get into SoftICE (CTRL+D) and type "bpint 3" get out of SoftICE 
  208. (CTRL+D) and run the CrackMe, now SoftICE should break.
  209. And we're landing on a "jmp" to the OEP :)
  210. So press one time (F10) and we're at the OEP, write down the "Virtual 
  211. Offset" it's "00441270" and now put the "EBFE" trick at the OEP.
  212. Then out of SoftICE and open ProcDump.
  213. Right click on the CrackMe and choose "DUMP (full)" then save it to 
  214. anywhere you want.
  215. Now open the saved file in "PE Editor" (In ProcDump and change the 
  216. Entry Point to "00041270" press "Ok" and we're done :)
  217. Now you can run and disassemble the file =)
  218. Now to the Patching part.
  219.  
  220.  
  221. --->    Let's Begin...        *** Patching ***
  222.  
  223. Ok, remembered the Patching points ? let me refresh your mind ;P (or 
  224. just scroll up...):
  225.  
  226. 00440ED8    Check if we entered a Name
  227. 00440F04    Check if we entered a Serial
  228. 00440F39    Compare 1 (Name:    Registered User)
  229. 00440F56    Compare 2 (Serial:    GFX-754-IER-954)
  230. 00440F5A    We're gonna replace this String with "Registered User"
  231. 00440F5F    We're gonna replace this String with "GFX-754-IER-954"
  232.  
  233. Also remember these two Offsets to Strings:
  234.  
  235. 00441014    the String: Registered User
  236. 0044102C    the String: GFX-754-IER-954
  237.  
  238. Ok, open W32Dasm and Disassemble the saved File.
  239. Then get to the Offset "00440ED8" and write down the offset you see on 
  240. the bottom of W32Dasm it's "000404D8".
  241. Then get to the Offset "00440F04" and write down the offset you see on 
  242. the bottom of W32Dasm it's "00040504".
  243. Then get to the Offset "00440F39" and write down the offset you see on 
  244. the bottom of W32Dasm it's "00040539".
  245. Then get to the Offset "00440F56" and write down the offset you see on 
  246. the bottom of W32Dasm it's "00040556".
  247. Then get to the Offset "00440F5A" and write down the offset you see on 
  248. the bottom of W32Dasm it's "0004055A".
  249. Then get to the Offset "00440F5F" and write down the offset you see on 
  250. the bottom of W32Dasm it's "0004055F".
  251.  
  252. Ok, now close W32Dasm and open the Saved file in your Hex-Editor.
  253. Change the first 2 Offsets in "jmp" (EB) (I assume you know how to do 
  254. that :).
  255. And you can NOP out the next 2 Offsets (90).
  256. or "inc eax, dec eax" something to that effect ;)
  257. As long as they don't jump.
  258. now go the Offset "0004055A" and change it into this:
  259.  
  260. :0004055A    B93C104400
  261.  
  262. into
  263.  
  264. :0004055A    B914104400        (String to Registered User)
  265.  
  266. And at Offset "0004055F" change it into this:
  267.  
  268. :0004055F    BA5C104400
  269.  
  270. into
  271.  
  272. :0004055F    BA2C104400        (String to GFX-754-IER-954)
  273.  
  274. Save the file and run it, now every Serial works and you'll get a 
  275. Message Box popping up with the Correct Name and Serial ;P
  276. That's all...
  277.  
  278.  
  279. --->    Greetings...
  280.  
  281. To be honest i'm getting a bit sick of these greetings everytime ;P
  282. So i'll just say:
  283.  
  284. Greetings to everyone i know, and to everyone who knows me, and You... 
  285. ;P
  286.  
  287.  
  288.             Don't trust the Outside, trust the InSiDe !!!
  289.  
  290.                       Cya...
  291.  
  292.                     CoDe_InSiDe
  293.  
  294.  
  295. Email:    code.inside@home.nl
  296.  
  297.