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

  1. *******************************************************************************************************************************************
  2.                     DaNiEl-RJ CrackMe #1
  3. *******************************************************************************************************************************************
  4.  
  5. Author:        DaNiEl-RJ
  6. Protection:    Name / Serial
  7. URL:        http://www.mesa-sys.com/~eternal/a-d/daniel-rj.zip
  8. Tools:        W32Dasm v8.93
  9.         Hex-Editor
  10.  
  11.  
  12. --->    Intro...
  13.  
  14. Welcome to my next Tutorial !!!
  15. This time we're going to crack a Name/Serial Protection "without" 
  16. SoftICE :P
  17.  
  18.  
  19. --->    Let's Begin...        *** Getting a Serial ***
  20.  
  21. Open the CrackMe and you'll see just a window and an MenuItem called 
  22. "File" with 2 Sub Items:
  23.  
  24. Damn! Where's the whole thing???
  25. About
  26.  
  27. But the first one is grayed (disabled) hmm.. well anyway click on 
  28. "About" ;)
  29. And you'll see a Message Box saying "Greetz 2 all brazilian crackers!!! 
  30. :)".
  31. Ok, that's nice :) click "Ok" to return to the Main Window and then 
  32. click on the MenuItem "File"
  33. again, hey the first Sub Item is ungrayed (Enabled) Ah nice... ;P
  34. Click on it, and you'll see that a button and 2 Edit Boxes come up, ah 
  35. finally something to
  36. Register with ;)
  37. Ok, enter anything you want in the Edit Boxes, i've used:
  38.  
  39. Name:        CoDe_InSiDe
  40. Serial:        1234567890
  41.  
  42. Now click on the button "Check it!" and a Message Box pops up saying:
  43.  
  44. "No no no! :( Try again!"
  45.  
  46. Remember this line :)
  47. Now close the CrackMe and disassemble it in W32Dasm.
  48. Ok, click on the button "Strn Ref" (String Data References) and search 
  49. for the line:
  50.  
  51. "No no no! :( Try again!"
  52.  
  53. Double click on it and you should see this:
  54.  
  55. -------------------------------------------------------------------------------------------------------------------------------------------
  56.  
  57. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  58. |:0042D522(C)
  59. |
  60. :0042D556 8D55F8                  lea edx, dword ptr [ebp-08]
  61. :0042D559 8B86E0010000            mov eax, dword ptr [esi+000001E0]
  62. :0042D55F E8FCC8FEFF              call 00419E60
  63. :0042D564 8B45F8                  mov eax, dword ptr [ebp-08]        <--- 
  64. Maybe our Serial or the Good Serial ?
  65. :0042D567 8B55FC                  mov edx, dword ptr [ebp-04]        <--- 
  66. Maybe our Serial or the Good Serial ?
  67. :0042D56A E86163FDFF              call 004038D0                <--- Here it 
  68. Compares those 2
  69. :0042D56F 750C                    jne 0042D57D                <--- If not equal 
  70. jump to the Bad String, else continue
  71.  
  72. * Possible StringData Ref from Code Obj ->"Congratz cracker! hehehe"
  73.                                   |
  74. :0042D571 B8ECD54200              mov eax, 0042D5EC            <--- Here's the 
  75. Good String
  76. :0042D576 E87DFBFFFF              call 0042D0F8
  77. :0042D57B EB0A                    jmp 0042D587
  78.  
  79. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  80. |:0042D56F(C)
  81. |
  82.  
  83. * Possible StringData Ref from Code Obj ->"No no no! :( Try again!"
  84.                                   |
  85. :0042D57D B810D64200              mov eax, 0042D610            <--- Here's the 
  86. Bad String
  87. :0042D582 E871FBFFFF              call 0042D0F8
  88.  
  89. * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  90. |:0042D4F6(U), :0042D57B(U)
  91. |
  92. :0042D587 33C0                    xor eax, eax
  93. :0042D589 5A                      pop edx
  94. :0042D58A 59                      pop ecx
  95. :0042D58B 59                      pop ecx
  96.  
  97. -------------------------------------------------------------------------------------------------------------------------------------------
  98.  
  99. Ok, well remember that "jne 0042D57D" for Patching ;)
  100. Now just scroll a bit up because we need to find the Algo :)
  101. So scroll up till you see something like this:
  102.  
  103. -------------------------------------------------------------------------------------------------------------------------------------------
  104.  
  105. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  106. |:0042D4EA(C)
  107. |
  108. :0042D4FB BB01000000              mov ebx, 00000001            <--- Move 
  109. 00000001 in EBX
  110.  
  111. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  112. |:0042D491(C)
  113. |
  114. :0042D500 8D55F8                  lea edx, dword ptr [ebp-08]
  115.  
  116. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  117. |:0042D4A0(C)
  118. |
  119. :0042D503 8B86DC010000            mov eax, dword ptr [esi+000001DC]
  120. :0042D509 E852C9FEFF              call 00419E60
  121. :0042D50E 8B45F8                  mov eax, dword ptr [ebp-08]        <--- 
  122. Point EAX to your Name (Probably)
  123. :0042D511 E8AA62FDFF              call 004037C0                <--- If you check 
  124. here, it takes the length of your Name (Probably)
  125. :0042D516 8BF8                    mov edi, eax                <--- Move EAX in EDI
  126. :0042D518 8D45FC                  lea eax, dword ptr [ebp-04]
  127. :0042D51B E82460FDFF              call 00403544
  128. :0042D520 3BFB                    cmp edi, ebx                <--- Compare EBX 
  129. (00000001) with EDI (Length of Name (Probably))
  130. :0042D522 7C32                    jl 0042D556                <--- If lower jump and 
  131. fail, else continue
  132.  
  133. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  134. |:0042D554(C)
  135. |
  136. :0042D524 8D55F8                  lea edx, dword ptr [ebp-08]
  137. :0042D527 8B86DC010000            mov eax, dword ptr [esi+000001DC]
  138. :0042D52D E82EC9FEFF              call 00419E60
  139. :0042D532 8B45F8                  mov eax, dword ptr [ebp-08]        <--- 
  140. Move the Offset to our Name in EAX (Probably)
  141. :0042D535 33D2                    xor edx, edx                <--- XOR EDX which is 
  142. now 00
  143. :0042D537 8A5418FF                mov dl, byte ptr [eax+ebx-01]        <--- 
  144. Move first Char in DL
  145. :0042D53B 83C205                  add edx, 00000005            <--- ADD 00000005 
  146. to DL
  147. :0042D53E 8D45F0                  lea eax, dword ptr [ebp-10]
  148. :0042D541 E8A261FDFF              call 004036E8                <--- In here it 
  149. places DL to some place
  150. :0042D546 8B55F0                  mov edx, dword ptr [ebp-10]
  151. :0042D549 8D45FC                  lea eax, dword ptr [ebp-04]
  152. :0042D54C E87762FDFF              call 004037C8
  153. :0042D551 43                      inc ebx                <--- EBX +1
  154. :0042D552 3BFB                    cmp edi, ebx                <--- Compare EBX with 
  155. EDI
  156. :0042D554 7DCE                    jge 0042D524                <--- If equal or 
  157. greater repeat loop, else continue
  158.  
  159. -------------------------------------------------------------------------------------------------------------------------------------------
  160.  
  161. Well first of all you may think "Hey that guy knows exactly what all 
  162. the stuff does???" ;)
  163. About all these instruction, yes that's not so hard, "But what about 
  164. the calls???"...
  165. I know that because i allready cracked a lot of Delphi programs and 
  166. they all work the same :P
  167. If you don't believe me then check it with SoftICE (Believe me i 
  168. haven't looked in it with SoftICE) :)
  169. Well anyway as you can see the Algo is very small :)
  170. It takes a Char of your Name and ADD's 00000005 to it, then places it 
  171. somewhere and then takes the next Char and so on...
  172. So for my Name it does this:
  173.  
  174. Ascii        C  o  D  e  _  I  n  S  i  D  e
  175. Hex        43 6F 44 65 5F 49 6E 53 69 44 65
  176.         --------------------------------    ADD 00000005
  177. Result        48 74 49 6A 64 4E 73 58 6E 49 6A
  178. Ascii        H  t  I  j  d  N  s  X  n  I  j
  179.  
  180. That's it, try it with your Name, my final result:
  181.  
  182. Name:        CoDe_InSiDe
  183. Serial:        HtIjdNsXnIj
  184.  
  185. And if you try it, it works :P
  186. CrackMe cracked, now to the Patching ;)
  187.  
  188.  
  189. --->    Let's Begin...        *** Patching ***
  190.  
  191. Ok, remember the place where i said "Ok, well remember that "jne 
  192. 0042D57D" for Patching ;)".
  193. Go there and click on the line "jne 0042D57D" then write down the 
  194. Offset you see below in W32Dasm, it's "0002C96F".
  195. Now if you look a bit up you'll see the instruction "mov edx, dword ptr 
  196. [ebp-04]" remember those Opcodes (or write it down) it's "8B55FC".
  197. Why ???
  198. Because if you've looked closely to the Algo and surrounding Code (and 
  199. because of the Compare call and jne) you'll see that it probably
  200. leads to the Good Serial, (the instruction in front of it leads 
  201. probably to our "Fake" Serial).
  202. I want to use that instruction to show the Good Serial everytime in the 
  203. Message Box :P
  204. BUT !!!
  205. As you maybe notice for the Good String (Congratz cracker! hehehe) it's 
  206. located in EAX and our code leads to EDX :(
  207. To fix this look at the Opcodes from the instruction "mov eax, dword 
  208. ptr [ebp-08], the Opcodes are "8B45F8".
  209. But we need it from "[ebp-04]", just change the Opcodes to "8B45FC" :)
  210. Ok, now we got the Offsets now we can close W32Dasm and open the file 
  211. in a Hex-Editor, do it.
  212. Go to the Offset "0002C96F" for the "jne 0042D57D".
  213. Just NOP it away :)
  214. Then take a look at the bytes after it change it into this (remember 
  215. those Opcodes from above?):
  216.  
  217. B8ECD54200
  218.  
  219. into
  220.  
  221. 8B45FC9090        (9090 to make it run smooth ;)
  222.  
  223. Save the file and run it.
  224. It work's :P now it shows for any Name the real Serial ! ;)
  225. That's all...
  226.  
  227.  
  228. --->    Greetings...
  229.  
  230. To be honest i'm getting a bit sick of these greetings everytime ;P
  231. So i'll just say:
  232.  
  233. Greetings to everyone i know, and to everyone who knows me, and You... 
  234. ;P
  235.  
  236.  
  237.             Don't trust the Outside, trust the InSiDe !!!
  238.  
  239.                       Cya...
  240.  
  241.                     CoDe_InSiDe
  242.  
  243.  
  244. Email:    code.inside@home.nl
  245.