home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / Eternal bliss / EB_TUT13.TXT < prev    next >
Encoding:
Text File  |  1999-08-27  |  10.8 KB  |  326 lines

  1.             Tutorial Number 13
  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: 13th Mar 1999
  8.  
  9. Program Details:
  10. Name: VB Crackme v1.0
  11. Author: EinZtein
  12.  
  13. Tools Used:
  14. SmartCheck
  15. SoftIce
  16.  
  17. Cracking Method:
  18. Calculation analysis
  19. Code sniffing
  20.  
  21. Viewing Method:
  22. Use Notepad with Word Wrap switched on
  23. Screen Area set to 800 X 600 pixels (Optional)
  24.  
  25. __________________________________________________________________________
  26.  
  27.  
  28.                         About this protection system
  29.  
  30. No disabled function. 
  31. Protection is based on a Name, Registration Number and Unlock Code.
  32. A routine is used to calculate a final number which must be equal to
  33. 123456789
  34.  
  35. __________________________________________________________________________
  36.  
  37.  
  38.                                  The Essay
  39.  
  40. In this essay, when I write type "d edx" or similar commands in Softice,
  41. I mean it without the quotes. At the same time, I'll not go into the 
  42. settings and how to configure SmartCheck anymore. If this is the first time 
  43. you are reading my tutorials, I suggest you download the first few that 
  44. use SmartCheck.
  45.  
  46. __________________________________________________________________________
  47.  
  48.  
  49.                 SmartCheck
  50.  
  51. Start SmartCheck and run the CrackMe.
  52.  
  53. Enter the following :-
  54. Name: EternalBliss (no space in between) 
  55. Registration Number: 12
  56. Unlock Code: 144
  57.  
  58. Click on Register. You will see "Too bad, give it another try" in 
  59. the Status box.
  60.  
  61. Stop the CrackMe and lets look at what SmartCheck has to show...
  62.  
  63. You will see Command1_Click
  64. **You must be in "Show Errors and Specific Events" mode
  65.  
  66. Expand the thread by clicking on the + sign
  67. Click on Serial1.Text and choose "Show All Events"
  68.  
  69. You will see
  70. Len(String:"EternalB...") returns LONG:12
  71. **this is to get the length of your name
  72.  
  73. A few lines below, you will see
  74. Serial2.Text
  75. Len(String:"12") returns LONG:2
  76. **this is to get the length of the Registration Number
  77.  
  78. A few more lines down, you will see
  79. __VbaVarDiv(VARIANT:String:"144", VARIANT:Long:12)...
  80. __VbaVarMul(VARIANT:Double:12,VARIANT:Integer:2)...
  81. __VbaVarSub(VARIANT:Double:24,VARIANT:Integer:12)...
  82.  
  83.  
  84. This few steps are explained as:
  85. 1) Unlock Code(144) divided by length of Name(12) = 12
  86. 2) result(12) multipled by length of Reg number(2) = 24
  87. 3) result(24) minus 12 = 12
  88.  
  89.  
  90. After the second Serial2.Text, you will see
  91. __vbaVarMul(VARIANT:Double:12,VARIANT:String:"12")...
  92. __vbaVarDiv(VARIANT:Double:144, VARIANT:Integer:2)...
  93. __vbaVarTstEq(VARIANT:Double:72, VARIANT:Const String:"")...
  94.  
  95. This few steps are explained as:
  96. 4) result(12) multiplied by Reg Number(12) = 144
  97. 5) result(144) divided by 2 = 72
  98. 6) result(72) is compared with something.
  99.  
  100. Too bad that something is not shown...
  101. Well, we need Softice now.
  102.  
  103. _________________________________________________________________________
  104.  
  105.  
  106.                 SoftIce
  107.  
  108. Notice __vbaVarTstEq in SmartCheck? Well, it is one of the common breakpoints
  109. to be used. So, lets use it.
  110.  
  111. Set the breakpoint by typing "bpx __vbaVarTstEq" (same as __vbavartsteq)
  112.  
  113. You will break in Softice after you click on Register.
  114. Before you go on, I would like to say that it is quite a long way to trace 
  115. and I've shorten the listing to show only the important parts as a guide.
  116. To trace without going into calls, use F10
  117. To trace and go into calls, use F8
  118. I've commented on certain things in the code.
  119.  
  120. Break due to BPX MSVBVM50!__vbaVarTstEq
  121. MSVBVM50!__vbaVarTstEq
  122. :7B3FB9A2  FF742408            PUSH    DWORD PTR [ESP+08]
  123. :7B3FB9A6  6A00                PUSH    00
  124. :7B3FB9A8  E8E74AFFFF          CALL    7B3F0494
  125. **Go into this call using F8
  126.  
  127. ==========================================================================
  128. :7B3F0494  55                  PUSH    EBP
  129. :7B3F0495  8BEC                MOV     EBP,ESP
  130. :7B3F0497  83EC44              SUB     ESP,44
  131. :7B3F049A  833D64F03F7B00      CMP     DWORD PTR [7B3FF064],00
  132. :7B3F04A1  53                  PUSH    EBX
  133. :7B3F04A2  56                  PUSH    ESI
  134. :7B3F04A3  57                  PUSH    EDI
  135. :            __________Snip___________
  136. :
  137. :7B3F6EF5  6A05                PUSH    05
  138. :7B3F6EF7  FF7508              PUSH    DWORD PTR [EBP+08]
  139. :7B3F6EFA  FF750C              PUSH    DWORD PTR [EBP+0C]
  140. :7B3F6EFD  53                  PUSH    EBX
  141. :7B3F6EFE  E8F1480000          CALL    7B3FB7F4
  142. **Go into this call using F8
  143.  
  144. ==========================================================================
  145. :7B3FB7F4  55                  PUSH    EBP
  146. :7B3FB7F5  8BEC                MOV     EBP,ESP
  147. :7B3FB7F7  83EC30              SUB     ESP,30
  148. :            __________Snip___________
  149. :
  150. :7B3FB82A  56                  PUSH    ESI
  151. :7B3FB82B  E803CDFCFF          CALL    MSVBVM50!__vbaStrVarCopy
  152. **Go into this call using F8
  153.  
  154. ==========================================================================
  155. MSVBVM50!__vbaStrVarCopy
  156. :7B3C8534  8B4C2408            MOV     ECX,[ESP+08]
  157. :7B3C8538  8BEC                MOV     EBP,ESP
  158. :7B3C853A  83EC30              SUB     ESP,30
  159. :            __________Snip___________
  160. :
  161. :7B3C857C  50                  PUSH    EAX
  162. :7B3C857D  50                  PUSH    EAX
  163. :7B3C857E  6A08                PUSH    08
  164. :7B3C8580  51                  PUSH    ECX
  165. :7B3C8581  52                  PUSH    EDX
  166. :7B3C8582  E80C2CF4FF          CALL    7B30B193
  167. **Go into this call using F8
  168.  
  169. ==========================================================================
  170. :7B30B193  55                  PUSH    EBP
  171. :7B30B194  33C0                XOR     EAX,EAX
  172. :            __________Snip___________
  173. :
  174. :7B30B1E8  50                  PUSH    EAX
  175. :7B30B1E9  6800040000          PUSH    00000400
  176. :7B30B1EE  56                  PUSH    ESI
  177. :7B30B1EF  FF7508              PUSH    DWORD PTR [EBP+08]
  178. :7B30B1F2  FF153C1A2F7B        CALL    [OLEAUT32!VariantChangeTypeEx]
  179.  
  180. **F10 over this call and after it, EDX = 7.2. (type "d edx")
  181.   72 is the converted number we get from the Name, Reg Num  and Unlock Code
  182.   Since this is a VB program, 72 is shown in w.i.d.e. .c.h.a.r.a.c.t.e.r
  183.  
  184. :7B30B1F8  8BD8                MOV     EBX,EAX
  185. :7B30B1FA  66837DE800          CMP     WORD PTR [EBP-18],00
  186. :            __________Snip___________
  187. :
  188. :7B30B214  5D                  POP     EBP
  189. :7B30B215  C21000              RET     0010
  190.  
  191. ==========================================================================
  192. **resume tracing after the call at :7B3C8582
  193. :7B3C8587  50                  PUSH    EAX
  194. :            __________Snip___________
  195. :
  196. :7B3C8550  5D                  POP     EBP
  197. :7B3C8551  C20400              RET     0004
  198.  
  199. ==========================================================================
  200. **resume tracing after the call at :7B3FB82B (CALL MSVBVM50!__vbaStrVarCopy)
  201. :7B3FB830  50                  PUSH    EAX
  202. :7B3FB831  8BF0                MOV     ESI,EAX
  203. :            __________Snip___________
  204. :
  205. :7B2F460D  FF74240C            PUSH    DWORD PTR [ESP+0C]
  206. :7B2F4611  FF74240C            PUSH    DWORD PTR [ESP+0C]
  207. :7B2F4615  50                  PUSH    EAX
  208. :7B2F4616  E848EFFFFF          CALL    MSVBVM50!__vbaStrComp
  209. **Go into this call using F8
  210.  
  211. ==========================================================================
  212. MSVBVM50!__vbaStrComp
  213. :7B2F3564  8BEC                MOV     EBP,ESP
  214. :7B2F3566  53                  PUSH    EBX
  215. :7B2F3567  56                  PUSH    ESI
  216. :            __________Snip___________
  217. :
  218. :7B2F359F  50                  PUSH    EAX
  219. :7B2F35A0  FF750C              PUSH    DWORD PTR [EBP+0C]
  220. :7B2F35A3  FF7510              PUSH    DWORD PTR [EBP+10]
  221. :7B2F35A6  E83FA40000          CALL    7B2FD9EA
  222. **Go into this call using F8
  223.  
  224. ==========================================================================
  225. :7B2FD9EA  56                  PUSH    ESI
  226. :7B2FD9EB  57                  PUSH    EDI
  227. :7B2FD9EC  8B7C2410            MOV     EDI,[ESP+10]    <-edi = real code
  228. :7B2FD9F0  8B74240C            MOV     ESI,[ESP+0C]    <-esi = 72
  229. :7B2FD9F4  8B4C2414            MOV     ECX,[ESP+14]
  230. :            __________Snip___________
  231. :
  232. :7B2FDA04  5F                  POP     EDI
  233. :7B2FDA05  5E                  POP     ESI
  234. :7B2FDA06  C20C00              RET     000C
  235.  
  236. ==========================================================================
  237. ==========================================================================
  238.  
  239. After tracing through all that, you will see that the real code is
  240. 123456789
  241.  
  242. So, lets have a summary before continuing...
  243.  
  244. Name: EternalBliss (no space in between) 
  245. Registration Number: 12
  246. Unlock Code: 144
  247.  
  248.  
  249. Conversion:
  250. 1) Unlock Code(144) divided by length of Name(12) = 12
  251. 2) result(12) multipled by length of Reg number(2) = 24
  252. 3) result(24) minus 12 = 12
  253. 4) result(12) multiplied by Reg Number(12) = 144
  254. 5) result(144) divided by 2 = 72
  255. 6) result(72) is compared with something.
  256.  
  257. Now, we know that something = 123456789
  258.  
  259.  
  260. _________________________________________________________________________
  261.  
  262.  
  263.                 Calculation
  264.  
  265.  
  266. We can derive the formula below from these 6 steps:
  267. (((((x / 12) * 2) - 12) * 12) / 2) = 123456789
  268. x = the real Unlock Code to be entered
  269.  
  270. So, lets reverse step by step...
  271. **when you reverse the math, multiple becomes divide and vis versa
  272.   subtraction becomes addition and vis versa
  273.  
  274. 123456789 *  2     = 246913578
  275. 246913578 / 12     =  20576131
  276.  20576131 + 12     =  20576143
  277.  20576143 /  2     =  10288071
  278.  10288071 * 12     = 123456861
  279.  
  280. The Real Unlock Code is 123456861
  281.  
  282. Name: EternalBliss (no space in between) 
  283. Registration Number: 12
  284. Unlock Code: 123456861
  285.  
  286. CrackMe Cracked!!
  287.  
  288. __________________________________________________________________________
  289.  
  290.  
  291.                 Afterthought
  292.  
  293. You might think that I am very lucky to have used 12 as the Reg Num and 
  294. 144 as the Unlock Code. Well, that's not true... 
  295.  
  296. After many trials and errors, I discovered that the Reg Num must not be 
  297. longer than 5 char and having seen the divisions, I decided to use 12 and 
  298. 144. Notice also that my name is EternalBliss and not Eternal Bliss. 
  299.  
  300. That is to have 12 as the length instead of 13 which will make the 
  301. calculation more difficult...
  302.  
  303. Tracing through SoftIce wasn't easy either... I actually traced through
  304. every call. That is because I know that I am quite near the end of the
  305. whole routine. I only show you which are the calls you should take. If you
  306. want to investigate more, trace into all the calls.
  307.  
  308. But once we found out that the converted number is compared to 123456789,
  309. we can change anything we want.
  310.  
  311. __________________________________________________________________________
  312.  
  313.  
  314.                              Final Notes
  315.  
  316. This tutorial is dedicated to all the newbies like me.
  317.  
  318. And because I'm a newbie myself, I may have explained certain things wrongly
  319. So, if that is the case, please forgive me. Email me if there is anything 
  320. you are not clear about.
  321.  
  322.  
  323. My thanks and gratitude goes to:-
  324.  
  325. The Sandman
  326. All the writers of Cracks tutorials and CrackMes