home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / riscs_mm1_tut.txt < prev    next >
Encoding:
Text File  |  1999-06-11  |  9.8 KB  |  254 lines

  1. MatrixxxMadness 1  -- a tutorial on ripping a valid matrix for your name...
  2.  
  3. Tutorial by : R!SC -- risc@notme.com -- http://csir.cjb.net 
  4. Date : 11th june 1999 (heh, the day the film gets released(well, in england anyway))
  5.  
  6. Cracking a Matrix (using soft-ice and good luck)
  7.  
  8. Right, we have an 8*8 Matrix of check boxes and a place to enter our name..
  9.  
  10. Theory, every three seconds, the crackme takes our name and our matrix entry, it
  11. then uses our name to work out the correct matrix, and compares this to our fake
  12. matrix entry. All we have to do is find the compare, and decode the matrix
  13. information so we can use it. 8*8 matrix = 64 check boxes, how to represent this in
  14. memory? too many ways, lets just crack this mother :)
  15.  
  16. i have two ways to crack this program, the first is real easy to follow..
  17.  
  18. Method #1:
  19.  
  20. Load MatrixxxMadness, and also load it into WDasm...While its running in the
  21. background, study the code in WDasm, after about 15-20 minutes, go back to
  22. matrixxxmadness, and its registered, showing you the congratulations screen..
  23. simple enough?? (for this method, WDasm is not required, but it helps to pass the
  24. time)
  25.  
  26. Method #2:
  27.  
  28. More complicated... run matrixxxmadness, enter your nick, i choose 'R!SC & notme'.
  29. Randomly check some boxes(i made a big 'X' with the ticks) ... Enter softice, and
  30. put a breakpoint on hmemcpy 'bpx hmemcpy', exit softice, and wait...
  31.  
  32. when softice breaks, you have to hit F11 to return to caller, then F12 several
  33. times to exit out of USER code back into mm1!code (i had to hit F12 6 times..)
  34.  
  35. you should end up here...
  36.  
  37. 015F:00431D81  E8368C0000          CALL    0043A9BC
  38. 015F:00431D86  5E                  POP     ESI          <-- YOU ARE HERE!!!
  39. 015F:00431D87  5B                  POP     EBX
  40. 015F:00431D88  C3                  RET
  41.  
  42. trace with F8 or F10(can still use F12 if you like) until you get to some proper
  43. code.. after 6 ret's, you end up after the call that called the call that called
  44. the call(etc..) that copied your name into memory
  45.  
  46. 015F:00457B22  E8A9F4FDFF          CALL    00436FD0
  47. 015F:00457B27  8D558C              LEA     EDX,[EBP-74] <-- YOU ARE HERE!!!
  48.  
  49. okay, this code looks normal enough, lets trace through this, and see whats
  50. happening :)
  51.  
  52. 015F:00457B27  8D558C              LEA     EDX,[EBP-74]
  53. 015F:00457B2A  8B45F8              MOV     EAX,[EBP-08] <-- address of name (BC21C4)
  54. 015F:00457B2D  E816FBFAFF          CALL    00407648     <-- copies it to BC21E0
  55. 015F:00457B32  837D8C00            CMP     DWORD PTR [EBP-74],00
  56. 015F:00457B36  0F84D9000000        JZ      00457C15
  57.  
  58.  
  59. 015F:00457B3C  8D45A0              LEA     EAX,[EBP-60]
  60. 015F:00457B3F  E80CE9FFFF          CALL    00456450
  61. 015F:00457B44  8B45F8              MOV     EAX,[EBP-08] <-- address of name (again)
  62. 015F:00457B47  E88CBFFAFF          CALL    00403AD8     <-- get length
  63. 015F:00457B4C  83F840              CMP     EAX,40       <-- is it 0x40 (64 decimal)
  64. 015F:00457B4F  7D18                JGE     00457B69
  65.  
  66.  
  67. 015F:00457B51  8D45F8              LEA     EAX,[EBP-08] - this bit gets name, and 
  68. 015F:00457B54  8B55F8              MOV     EDX,[EBP-08] - copies it onto the end of
  69. 015F:00457B57  E884BFFAFF          CALL    00403AE0     - itself, into a buffer at
  70. 015F:00457B5C  8B45F8              MOV     EAX,[EBP-08] - BC21FC, so keeps doubling
  71. 015F:00457B5F  E874BFFAFF          CALL    00403AD8     - the size, until it is
  72. 015F:00457B64  83F840              CMP     EAX,40       - greater than 0x40..
  73. 015F:00457B67  7EE8                JLE     00457B51
  74.  
  75.  
  76. 015F:00457B69  8B45F8              MOV     EAX,[EBP-08]
  77. 015F:00457B6C  E867BFFAFF          CALL    00403AD8
  78. 015F:00457B71  83F840              CMP     EAX,40
  79. 015F:00457B74  7E24                JLE     00457B9A
  80.  
  81. 015F:00457B76  8B45F8              MOV     EAX,[EBP-08] <-- new >0x40 char name :)
  82. 015F:00457B79  E85ABFFAFF          CALL    00403AD8     <-- get length
  83. 015F:00457B7E  8BD0                MOV     EDX,EAX      <-- save it
  84. 015F:00457B80  8D45F8              LEA     EAX,[EBP-08] <-- guess..
  85. 015F:00457B83  B901000000          MOV     ECX,00000001 <-- hmmm
  86. 015F:00457B88  E88FC1FAFF          CALL    00403D1C     <-- trim 1 char off the end
  87. 015F:00457B8D  8B45F8              MOV     EAX,[EBP-08] <-- buffer to big name
  88. 015F:00457B90  E843BFFAFF          CALL    00403AD8     <-- get length
  89. 015F:00457B95  83F840              CMP     EAX,40       <-- if its not 0x40
  90. 015F:00457B98  75DC                JNZ     00457B76       - carry on chopping
  91.  
  92.  
  93. 015F:00457B9A  33D2                XOR     EDX,EDX
  94. 015F:00457B9C  8D45B0              LEA     EAX,[EBP-50] <-- a new Buffer (69FBFC)
  95. 015F:00457B9F  8B4DF8              MOV     ECX,[EBP-08] <-- truncted big name
  96. 015F:00457BA2  8A4C11FF            MOV     CL,[EDX+ECX-01]
  97. 015F:00457BA6  8808                MOV     [EAX],CL     <-- copy it byte by byte
  98. 015F:00457BA8  42                  INC     EDX            - into the new buffer,
  99. 015F:00457BA9  40                  INC     EAX            - missing the last char
  100. 015F:00457BAA  83FA40              CMP     EDX,40
  101. 015F:00457BAD  75F0                JNZ     00457B9F     <-- loop until its finished
  102.  
  103.  
  104. 015F:00457BAF  8D55A0              LEA     EDX,[EBP-60] - gets complicated here
  105. 015F:00457BB2  8D45B0              LEA     EAX,[EBP-50]
  106. 015F:00457BB5  E8FEE8FFFF          CALL    004564B8
  107. 015F:00457BBA  8D75A0              LEA     ESI,[EBP-60]
  108. 015F:00457BBD  8D7D90              LEA     EDI,[EBP-70]
  109. 015F:00457BC0  B904000000          MOV     ECX,00000004
  110. 015F:00457BC5  F3A5                REPZ MOVSD
  111. 015F:00457BC7  8D5590              LEA     EDX,[EBP-70]
  112. 015F:00457BCA  8D45B0              LEA     EAX,[EBP-50]
  113. 015F:00457BCD  E8E6E8FFFF          CALL    004564B8
  114. 015F:00457BD2  8B45A0              MOV     EAX,[EBP-60] - but this bit was
  115. 015F:00457BD5  2B45A4              SUB     EAX,[EBP-5C] - very interesting
  116. 015F:00457BD8  2B45A8              SUB     EAX,[EBP-58] - sub this off that
  117. 015F:00457BDB  0345AC              ADD     EAX,[EBP-54] - add this to that
  118. 015F:00457BDE  8945A0              MOV     [EBP-60],EAX - move it here...
  119. 015F:00457BE1  8B4590              MOV     EAX,[EBP-70]
  120. 015F:00457BE4  2B4594              SUB     EAX,[EBP-6C]
  121. 015F:00457BE7  2B4598              SUB     EAX,[EBP-68]
  122. 015F:00457BEA  03459C              ADD     EAX,[EBP-64] - using some strange numbers
  123. 015F:00457BED  894590              MOV     [EBP-70],EAX - aswell....
  124. 015F:00457BF0  8D55F0              LEA     EDX,[EBP-10]
  125. 015F:00457BF3  8D45F4              LEA     EAX,[EBP-0C] - all the sub's and mov's
  126. 015F:00457BF6  E8B1F8FFFF          CALL    004574AC     - caught my eye :)
  127.  
  128.  
  129. 015F:00457BFB  8B45F0              MOV     EAX,[EBP-10] <-- VERY NICE
  130. 015F:00457BFE  50                  PUSH    EAX
  131. 015F:00457BFF  8B4DF4              MOV     ECX,[EBP-0C] <-- JUST AS NICE
  132. 015F:00457C02  8B5590              MOV     EDX,[EBP-70] <-- MAGIC
  133. 015F:00457C05  8B45A0              MOV     EAX,[EBP-60] <-- EXCELLENT!!
  134. 015F:00457C08  E8AFFEFFFF          CALL    00457ABC     <-- hmm, dont care no more..
  135. 015F:00457C0D  8945FC              MOV     [EBP-04],EAX
  136. 015F:00457C10  8B45FC              MOV     EAX,[EBP-04]
  137. 015F:00457C13  FFD0                CALL    EAX
  138.  
  139.  
  140.  
  141. after all this? do you know what i know? look at the last section of code.. 
  142.  
  143. MOV     EAX,[EBP-10] <-- this put '18244281' into EAX
  144. MOV     ECX,[EBP-0C] <-- this put '81422418' into ECX
  145.  
  146. which i thought could be my matrix entry (in binary..) look, convert it byte by byte
  147. into binary..
  148.  
  149. EAX...
  150. 18= 00011000
  151. 24= 00100100
  152. 42= 01000010
  153. 81= 10000001
  154.  
  155. hmm? the bottom  half of an 'X' eh? so i killed the 'bpx hmemcpy', and set a
  156. breakpoint on 00457BFB . exited softice, and checked a few more boxes, sure enough,
  157. EAX & ECX seemed to change as the boxes did...
  158.  
  159. going on a hunch, as you do when you havent reversed the code, and have no source to
  160. go with, i decided that these lines revealed the correct matrix code..
  161.  
  162. MOV     EDX,[EBP-70] <-- EDX = '15BB7346'
  163. MOV     EAX,[EBP-60] <-- EAX = '6866D0DC'
  164.  
  165. okay, using logic
  166.  
  167. MOV     EAX,[EBP-10] <-- bottom half?
  168. MOV     ECX,[EBP-0C] <-- top half?
  169.  
  170. er, do you see the logic? bottom half of fake is epb-10, so maybe epb-70 is bottom
  171. half of real matrix ? if they were sorted into descending order? 
  172.  
  173. 70..60  bottom..top
  174. 10..0C  bottom..top
  175.  
  176. name 'R!SC & notme'
  177.  
  178. eax..6866D0DC  (00457C05  8B45A0              MOV     EAX,[EBP-60])
  179. 01101000
  180. 01100110
  181. 11010000
  182. 11011100
  183.  
  184. edx..15BB7346  (00457C02  8B5590              MOV     EDX,[EBP-70])
  185. 00010101
  186. 10111011
  187. 01110011
  188. 01000110
  189.  
  190. make it look pretty...
  191.  
  192.      1 2 3 4 5 6 7 8
  193.   
  194.   a: 0 1 1 0 1 0 0 0 :a
  195.   b: 0 1 1 0 0 1 1 0 :b
  196.   c: 1 1 0 1 0 0 0 0 :c   my name 'R!SC & notme'
  197.   d: 1 1 0 1 1 1 0 0 :d
  198.   e: 0 0 0 1 0 1 0 1 :e
  199.   f: 1 0 1 1 1 0 1 1 :f
  200.   g: 0 1 1 1 0 0 1 1 :g
  201.   h: 0 1 0 0 0 1 1 0 :h
  202.  
  203.      1 2 3 4 5 6 7 8
  204.      
  205.  
  206.      
  207. name 'NiCKY BLaCKMaRKeT'
  208.  
  209. eax...
  210. B37B90C0
  211. edx...
  212. 5F33EC07
  213.  
  214. 10110011 : B3
  215. 01111011 : 7B
  216. 10010000 : 90
  217. 11000000 : C0
  218.  
  219.  
  220. 01011111 : 5F
  221. 00110011 : 33
  222. 11101100 : EC
  223. 00000111 : 07
  224.  
  225. make it look pretty...
  226.  
  227.      1 2 3 4 5 6 7 8
  228.   
  229.   a: 1 0 1 1 0 0 1 1 :a
  230.   b: 0 1 1 1 1 0 1 1 :b
  231.   c: 1 0 0 1 0 0 0 0 :c   my name 'NiCKY BLaCKMaRKeT'
  232.   d: 1 1 0 0 0 0 0 0 :d
  233.   e: 0 1 0 1 1 1 1 1 :e
  234.   f: 0 0 1 1 0 0 1 1 :f
  235.   g: 1 1 1 0 1 1 0 0 :g
  236.   h: 0 0 0 0 0 1 1 1 :h
  237.  
  238.      1 2 3 4 5 6 7 8
  239.      
  240.  
  241.  
  242. Time taken to crack, about 30 minutes, good job luck was on my side... time taken to
  243. compose tutorial, and recrack several times, about 2.5 hrs..
  244.  
  245. Personal difficulty rating, er, a fair 4/10.. it could have been a lot harder, damn,
  246. it could have been impossible, like duelists crackme #3 :)
  247.  
  248. Greets to all crackers / reversers (except yoshi), thanks to The AntiXrysT for some
  249. entertainment (please dont make another Matrix crackme.....)
  250.  
  251.  
  252. oh, and thanks for reading.. did you learn anything??
  253.  
  254. R!SC -- risc@notme.com  11th june '99