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

  1.             Tutorial Number 16
  2.  
  3. Written by Etenal Bliss
  4. Email: Eternal_Bliss@hotmail.com
  5. Website: http://crackmes.cjb.net
  6.          http://surf.to/crackmes
  7. Date written: 28th Mar 1999
  8.  
  9. Program Details:
  10. Name: CrackMe 1
  11. Author: Nitrus
  12.  
  13. Tools Used:
  14. SoftIce
  15.  
  16. Cracking Method:
  17. Code sniffing
  18.  
  19. Viewing Method:
  20. Use Notepad with Word Wrap switched on
  21. Screen Area set to 800 X 600 pixels (Optional)
  22.  
  23. __________________________________________________________________________
  24.  
  25.  
  26.                         About this protection system
  27.  
  28. No disabled function. A 10 char serial protection
  29.  
  30. __________________________________________________________________________
  31.  
  32.  
  33.                                  The Essay
  34.  
  35. In this essay, when I write type "d edx" or similar commands in Softice,
  36. I mean it without the quotes.
  37.  
  38. __________________________________________________________________________
  39.  
  40.                 SoftIce
  41.  
  42. Since this is a VB crackme, we might as well try using the few common 
  43. breakpoints:
  44. 1) bpx msvbvm60!__vbavartsteq
  45. 2) bpx msvbvm60!__vbastrcomp
  46.  
  47. **I add in msvbvm60! because it is written in VB6.
  48.  
  49. Run the crackme, type in "12345678" and then set your breakpoints.
  50.  
  51. When you hit Enter, you will break in MSVBVM60!__vbaVarTstEq
  52.  
  53. Break due to BPX MSVBVM60!__vbaVarTstEq  (ET=792.07 milliseconds)
  54. MSVBVM60!__vbaVarTstEq
  55. :004021F4  8D4D9C              LEA     ECX,[EBP-64]
  56.  
  57. Press F12 to get out of this function. This is because I didn't find 
  58. anything useful in it. You can trace it if you want. 8)
  59.  
  60. You will land below:
  61.  
  62. :004021F7  668BF8              MOV     DI,AX
  63. :004021FA  FF150C104000        CALL    [MSVBVM60!__vbaFreeVar]
  64. :00402200  663BFE              CMP     DI,SI
  65. :00402203  0F8472050000        JZ      0040277B                  (NO JUMP)
  66. :00402209  8B4B34              MOV     ECX,[EBX+34]
  67. :0040220C  51                  PUSH    ECX
  68. :0040220D  FF1510104000        CALL    [MSVBVM60!__vbaLenBstr]
  69. :00402213  83F80A              CMP     EAX,0A
  70.  
  71. The function at :0040220D (MSVBVM60!__vbaLenBstr) is to get the length
  72. of the serial we entered. Note the compare after it.
  73.  
  74. EAX is the length of the serial we entered. It is compared to 0A.
  75.  
  76. 0A is the hex value for 10
  77.  
  78. So, our serial must be 10 characters.
  79.  
  80. F5 to return to the crackme.
  81.  
  82. Now, type in "1234567890" for our serial.
  83.  
  84. opps. forgot to tell you to disable your breakpoints first. 8)
  85. Disable your breakpoints or you will keep breaking every time you type
  86. something.
  87.  
  88. Now, reset your 2 breakpoints.
  89.  
  90. When you break at MSVBVM60!__vbaVarTstEq, press F5 to return to the crackme.
  91. But since it is of the correct length, you will break into MSVBVM60!__vbaStrComp.
  92.  
  93. Break due to BPX MSVBVM60!__vbaStrComp  (ET=2.78 seconds)
  94. MSVBVM60!__vbaStrComp
  95. :66060A85  0F8499F00200        JZ      6608FB24                  (NO JUMP)
  96. :66060A8B  6801000300          PUSH    00030001
  97. :66060A90  FF742408            PUSH    DWORD PTR [ESP+08]
  98. :66060A94  FF742410            PUSH    DWORD PTR [ESP+10]
  99. :66060A98  FF742418            PUSH    DWORD PTR [ESP+18]
  100. :66060A9C  FF1510001166        CALL    [OLEAUT32!VarBstrCmp]
  101. **Go into this call using F8
  102.  
  103. ==========================================================================
  104. OLEAUT32!VarBstrCmp
  105. :653C0227  8BEC                MOV     EBP,ESP
  106. :653C0229  51                  PUSH    ECX
  107. :653C022A  53                  PUSH    EBX
  108. :653C022B  56                  PUSH    ESI
  109. :653C022C  8B7508              MOV     ESI,[EBP+08]
  110. :            __________Snip___________
  111. :
  112. :653C025C  8B7D0C              MOV     EDI,[EBP+0C]
  113. :653C025F  8B7508              MOV     ESI,[EBP+08]
  114. :653C0262  8B4D10              MOV     ECX,[EBP+10]    <--set bp here
  115.  
  116. When you go into :653C0227 (OLEAUT32!VarBstrCmp), just keep pressing F10
  117. to trace along the code. Whenever any register changes, type "d register"
  118. to see what is the new value.
  119. **register in "d register" is eax, ebx, ecx, edx, edi, esi
  120.   so don't email me saying that you get an error from Softice when you type
  121.   "d register"
  122.  
  123. I am only showing the interesting codes.
  124.  
  125. After :653C025C, you will see edi having a new value. type "d edi"
  126. You should see
  127. :00510FE4 2D 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  -...............
  128.  
  129. After :653C025F, you will see esi having a new value. type "d esi"
  130. You should see
  131. :00510F9C 34 00 00 00 33 00 34 00-35 00 36 00 37 00 38 00  4...3.4.5.6.7.8.
  132.  
  133. Now, where would "-" or "4" come from? Let's presume that 4 is part of the
  134. serial we typed (1234567890). So, "-" would be the correct serial in that 
  135. location!
  136.  
  137. So, part of the correct serial would be 123-567890
  138.  
  139. After tracing again and again, I find that I always come to this part of 
  140. the code. So, you can just type "bpx xxxx::653C0262" and disable the rest of
  141. your bp. xxxx will depend on your computer when you are inside 
  142. OLEAUT32!VarBstrCmp
  143.  
  144. **bpx here will let edi and esi get the new values. So, when you break, you
  145.   just need to type "d edi" and "d esi" to see the values.
  146.  
  147.  
  148. So, press F5. You will break again
  149.  
  150. Break due to BPX #0177:653C0262  (ET=78.66 microseconds)
  151. 0177:653C0262  8B4D10              MOV     ECX,[EBP+10]
  152. 017F:00510FE4 2D 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  -...............
  153.  
  154. 017F:00510F9C 39 00 00 00 33 00 34 00-35 00 36 00 37 00 38 00  9...3.4.5.6.7.8.
  155.  
  156. Part of the correct serial would be 123-5678-0
  157.  
  158. **If you don't know why, look at the explanation above.
  159.  
  160.  
  161. Press F5 again. You will break
  162.  
  163. Break due to BPX #0177:653C0262  (ET=168.52 microseconds)
  164. 0177:653C0262  8B4D10              MOV     ECX,[EBP+10]
  165. 017F:00510F88 30 00 35 00 33 00 00 00-80 0F 51 00 24 00 00 A0  0.5.3.....Q.$...
  166.  
  167. 017F:00510F9C 31 00 32 00 33 00 00 00-35 00 36 00 37 00 38 00  1.2.3...5.6.7.8.
  168.  
  169. Part of the correct serial would be 053-5678-0
  170.  
  171.  
  172. Press F5 again. You will break
  173.  
  174. Break due to BPX #0177:653C0262  (ET=208.70 microseconds)
  175. 0177:653C0262  8B4D10              MOV     ECX,[EBP+10]
  176. 017F:004100C8 33 00 33 00 38 00 37 00-00 00 DB DB 15 02 00 A0  3.3.8.7.........
  177.  
  178. 017F:00510FE4 35 00 36 00 00 00 00 00-00 00 00 00 00 00 00 00  5.6.............
  179.  
  180. Part of the correct serial would be 053-33xx-0
  181. **xx can be of any values.
  182.  
  183. Press F5 again. You will break
  184.  
  185. Break due to BPX #0177:653C0262  (ET=199.57 microseconds)
  186. 0177:653C0262  8B4D10              MOV     ECX,[EBP+10]
  187. 017F:004100A0 37 00 00 00 00 00 00 00-42 01 00 00 3D 02 00 A0  7.......B...=...
  188.  
  189. 017F:00510FE4 30 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  0...............
  190.  
  191. Note, our last digit is "0" and is compared to "7"
  192.  
  193. So, the final correct code is 053-33xx-7
  194.  
  195. You can place any values in xx and you will get the title of the crackme
  196. to change from "crackme..." to "cracked"
  197.  
  198. CrackMe Cracked!
  199.  
  200. __________________________________________________________________________
  201.  
  202.  
  203.                              Final Notes
  204.  
  205. This tutorial is dedicated to all the newbies like me.
  206.  
  207. And because I'm a newbie myself, I may have explained certain things wrongly
  208. So, if that is the case, please forgive me. Email me if there is anything 
  209. you are not clear about.
  210.  
  211.  
  212. My thanks and gratitude goes to:-
  213.  
  214. The Sandman
  215. All the writers of Cracks tutorials and CrackMes