home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / E_bliss / tutor10.txt < prev    next >
Text File  |  2000-05-25  |  11KB  |  241 lines

  1.             Terminal Cilla's
  2.                   Tutorial#10
  3.  
  4. [Target Infos:]
  5. [Name  :] CrackMe 8 
  6. [Author:] FireWorX
  7. [Type  :] Serial; Name/Serial; Keyfile
  8. [Where :] http://crackmes.cjb.net
  9.  
  10. [Needed Tools:]
  11. SoftIce
  12. WinDasm
  13.  
  14. [Our Aim:]
  15. 1. Find the serial.
  16. 2. Find a valid serial for our name.
  17. 3. Built a keyfile.
  18.  
  19. -----------------------------------------------------------------------------
  20.             Hi Reader. 
  21. I'm sorry for all grammatical and orthographic errors.
  22. I assume that you already configured your SoftIce/WinDasm and
  23. that you are basicly down with them - otherwise stop reading
  24. and take a "SoftIce/WinDasm4Newbies - Tutorial".
  25.               Still here?
  26.              Ok, let's go!
  27.  
  28. I won't go much in details in this tut 'cause I think
  29. that this crackme is easy to reverse for everyone.
  30. So only short notes...
  31.  
  32. Part1 - Serial:
  33. ---------------
  34.  
  35. With the help of Softice (using bpx hmemcpy) we'll come here:
  36. -------------------------------------------------------------
  37. :00445D93 E804F8FDFF              call 0042559C
  38. :00445D98 8B45FC                  mov eax, dword ptr [ebp-04]
  39. :00445D9B 803854                  cmp byte ptr [eax], 54
  40. :00445D9E 757D                    jne 00445E1D
  41. :00445DA0 8D55FC                  lea edx, dword ptr [ebp-04]
  42. :00445DA3 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  43. :00445DA9 E8EEF7FDFF              call 0042559C
  44. :00445DAE 8B45FC                  mov eax, dword ptr [ebp-04]
  45. :00445DB1 80780165                cmp byte ptr [eax+01], 65
  46. :00445DB5 7566                    jne 00445E1D
  47. :00445DB7 8D55FC                  lea edx, dword ptr [ebp-04]
  48. :00445DBA 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  49. :00445DC0 E8D7F7FDFF              call 0042559C
  50. :00445DC5 8B45FC                  mov eax, dword ptr [ebp-04]
  51. :00445DC8 80780248                cmp byte ptr [eax+02], 48
  52. :00445DCC 754F                    jne 00445E1D
  53. :00445DCE 8D55FC                  lea edx, dword ptr [ebp-04]
  54. :00445DD1 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  55. :00445DD7 E8C0F7FDFF              call 0042559C
  56. :00445DDC 8B45FC                  mov eax, dword ptr [ebp-04]
  57. :00445DDF 8078036E                cmp byte ptr [eax+03], 6E
  58. :00445DE3 7538                    jne 00445E1D
  59. :00445DE5 8D55FC                  lea edx, dword ptr [ebp-04]
  60. :00445DE8 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  61. :00445DEE E8A9F7FDFF              call 0042559C
  62. :00445DF3 8B45FC                  mov eax, dword ptr [ebp-04]
  63. :00445DF6 80780445                cmp byte ptr [eax+04], 45
  64. :00445DFA 7521                    jne 00445E1D
  65. :00445DFC 8D55FC                  lea edx, dword ptr [ebp-04]
  66. :00445DFF 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  67. :00445E05 E892F7FDFF              call 0042559C
  68. :00445E0A 8B45FC                  mov eax, dword ptr [ebp-04]
  69. :00445E0D 80780564                cmp byte ptr [eax+05], 64
  70. :00445E11 750A                    jne 00445E1D
  71. -------------------------------------------------------------------
  72. As we can see, every letter of our input is compared with a
  73. predefined char. The important instructions are listened below:
  74. -
  75. :00445D9B 803854                  cmp byte ptr [eax], 54    (T)
  76. :00445DB1 80780165                cmp byte ptr [eax+01], 65 (e)
  77. :00445DC8 80780248                cmp byte ptr [eax+02], 48 (H)
  78. :00445DDF 8078036E                cmp byte ptr [eax+03], 6E (n)
  79. :00445DF6 80780445                cmp byte ptr [eax+04], 45 (E)
  80. :00445E0D 80780564                cmp byte ptr [eax+05], 64 (d)
  81. -
  82. So the valid serial is like: 5465486E4564.
  83. These values are in hex, so if we convert them we'll
  84. get the serial.
  85.  
  86. Part2 - Name/Serial:
  87. --------------------
  88.  
  89. Once again SICE will bring us to the important routine:
  90. -------------------------------------------------------------
  91. :00446131 E866F4FDFF              call 0042559C
  92. :00446136 8B45F4                  mov eax, dword ptr [ebp-0C]
  93. :00446139 8D55F8                  lea edx, dword ptr [ebp-08]
  94. :0044613C E8FBFEFFFF              call 0044603C
  95. :00446141 8B55F8                  mov edx, dword ptr [ebp-08]
  96. :00446144 58                      pop eax
  97. :00446145 E80ADAFBFF              call 00403B54
  98. :0044614A 750A                    jne 00446156
  99. -------------------------------------------------------------
  100. As a result of tracing we noticed that the jump at :44614A
  101. decides wether we are good or bad cracker. So the call before
  102. must be the compare-routine. Let's see what parameters
  103. the call gets.
  104. Looking at edx and eax and the search is over.
  105. Edx will contain the valid serial for our name and
  106. eax contains our stupid serial.
  107. In my case it was like:
  108.     8BFD-FF0F-1F12-C878
  109. for the name 
  110.     Terminal Cilla
  111. We don't have more to know.
  112.  
  113. Part3 - Keyfile:
  114. ----------------
  115.  
  116. Using WinDasm we find out that there were 3 'Good Code' calls.
  117. Since now we have found only 2 - one for the serial, one for the
  118. name/serial and so the 3 call must be for the Keyfile.
  119. Let's look at the code:
  120. ---------------------------------------------------------------
  121. :00446418 55                      push ebp
  122. :00446419 8BEC                    mov ebp, esp
  123. :0044641B 6A00                    push 00000000
  124. :0044641D 53                      push ebx
  125. :0044641E 8BD8                    mov ebx, eax
  126. :00446420 33C0                    xor eax, eax
  127. :00446422 55                      push ebp
  128. :00446423 6843654400              push 00446543
  129. :00446428 64FF30                  push dword ptr fs:[eax]
  130. :0044642B 648920                  mov dword ptr fs:[eax], esp
  131. :0044642E 8D55FC                  lea edx, dword ptr [ebp-04]
  132. :00446431 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  133. :00446437 E860F1FDFF              call 0042559C
  134. :0044643C 8B45FC                  mov eax, dword ptr [ebp-04]
  135. :0044643F 803846                  cmp byte ptr [eax], 46
  136. :00446442 0F85E5000000            jne 0044652D
  137. :00446448 8D55FC                  lea edx, dword ptr [ebp-04]
  138. :0044644B 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  139. :00446451 E846F1FDFF              call 0042559C
  140. :00446456 8B45FC                  mov eax, dword ptr [ebp-04]
  141. :00446459 80780169                cmp byte ptr [eax+01], 69
  142. :0044645D 0F85CA000000            jne 0044652D
  143. :00446463 8D55FC                  lea edx, dword ptr [ebp-04]
  144. :00446466 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  145. :0044646C E82BF1FDFF              call 0042559C
  146. :00446471 8B45FC                  mov eax, dword ptr [ebp-04]
  147. :00446474 80780272                cmp byte ptr [eax+02], 72
  148. :00446478 0F85AF000000            jne 0044652D
  149. :0044647E 8D55FC                  lea edx, dword ptr [ebp-04]
  150. :00446481 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  151. :00446487 E810F1FDFF              call 0042559C
  152. :0044648C 8B45FC                  mov eax, dword ptr [ebp-04]
  153. :0044648F 80780365                cmp byte ptr [eax+03], 65
  154. :00446493 0F8594000000            jne 0044652D
  155. :00446499 8D55FC                  lea edx, dword ptr [ebp-04]
  156. :0044649C 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  157. :004464A2 E8F5F0FDFF              call 0042559C
  158. :004464A7 8B45FC                  mov eax, dword ptr [ebp-04]
  159. :004464AA 80780450                cmp byte ptr [eax+04], 50
  160. :004464AE 757D                    jne 0044652D
  161. :004464B0 8D55FC                  lea edx, dword ptr [ebp-04]
  162. :004464B3 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  163. :004464B9 E8DEF0FDFF              call 0042559C
  164. :004464BE 8B45FC                  mov eax, dword ptr [ebp-04]
  165. :004464C1 80780568                cmp byte ptr [eax+05], 68
  166. :004464C5 7566                    jne 0044652D
  167. :004464C7 8D55FC                  lea edx, dword ptr [ebp-04]
  168. :004464CA 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  169. :004464D0 E8C7F0FDFF              call 0042559C
  170. :004464D5 8B45FC                  mov eax, dword ptr [ebp-04]
  171. :004464D8 80780633                cmp byte ptr [eax+06], 33
  172. :004464DC 754F                    jne 0044652D
  173. :004464DE 8D55FC                  lea edx, dword ptr [ebp-04]
  174. :004464E1 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  175. :004464E7 E8B0F0FDFF              call 0042559C
  176. :004464EC 8B45FC                  mov eax, dword ptr [ebp-04]
  177. :004464EF 80780733                cmp byte ptr [eax+07], 33
  178. :004464F3 7538                    jne 0044652D
  179. :004464F5 8D55FC                  lea edx, dword ptr [ebp-04]
  180. :004464F8 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  181. :004464FE E899F0FDFF              call 0042559C
  182. :00446503 8B45FC                  mov eax, dword ptr [ebp-04]
  183. :00446506 80780872                cmp byte ptr [eax+08], 72
  184. :0044650A 7521                    jne 0044652D
  185. :0044650C 8D55FC                  lea edx, dword ptr [ebp-04]
  186. :0044650F 8B83C4020000            mov eax, dword ptr [ebx+000002C4]
  187. :00446515 E882F0FDFF              call 0042559C
  188. :0044651A 8B45FC                  mov eax, dword ptr [ebp-04]
  189. :0044651D 80780C2E                cmp byte ptr [eax+0C], 2E
  190. :00446521 750A                    jne 0044652D
  191. ---------------------------------------------------------------
  192. We see a similar routine to Part1. Let's sum up the
  193. important parts:
  194. -
  195. :0044643F 803846                  cmp byte ptr [eax], 46    (F)
  196. :00446459 80780169                cmp byte ptr [eax+01], 69 (i)
  197. :00446474 80780272                cmp byte ptr [eax+02], 72 (r)
  198. :0044648F 80780365                cmp byte ptr [eax+03], 65 (e)
  199. :004464AA 80780450                cmp byte ptr [eax+04], 50 (P)
  200. :004464C1 80780568                cmp byte ptr [eax+05], 68 (h)
  201. :004464D8 80780633                cmp byte ptr [eax+06], 33 (3)
  202. :004464EF 80780733                cmp byte ptr [eax+07], 33 (3)
  203. :00446506 80780872                cmp byte ptr [eax+08], 72 (r)
  204. :0044651D 80780C2E                cmp byte ptr [eax+0C], 2E (.)
  205. -
  206. The contents of the keyfile gets compared with the same
  207. method as the serial used.
  208. But this time there's a little trick;)
  209. -
  210. :0044651D 80780C2E                cmp byte ptr [eax+0C], 2E (.)
  211. -
  212. The last valid char must be at the 12. position of the string.
  213. So it won't work if we use: FirePh33r.
  214. It should be like:          FirePh33r   .
  215. For the spaces you can take every letter you want.
  216.  
  217.  
  218.     ...our job is done!
  219.  
  220.     Thx4Readin'
  221. -----------------------------------------------------------------------------
  222.  
  223.         -=I'm still a newbie - So I can only get better!=-
  224.  
  225. (c) Terminal Cilla (mai 1999)
  226.     
  227.  
  228. Peace&Respects 2: duelist,The AntiXryst, Torn@do, EB
  229.           Sanhedrin,rubor and all crackme-coders
  230.           and tutorial-writers.
  231.  
  232. Special thx2 'duelist' for beeing a good friend and
  233.          'Eternal Bliss' for hosting my cMz. 
  234.                       ________________________
  235.              |   Be sure to visit:    |
  236.              | http://crackmez.cjb.net|
  237.              |           &              |
  238.                  | http://crackmes.cjb.net|
  239.                      |________________________|
  240.  
  241.