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

  1.  
  2.  
  3.                 SiFLyiNG's
  4.                         Tutorial #2
  5.  
  6.  
  7. ___________________________________________________________
  8.  
  9. Target_______: -=Runnin' Butt-On=- [Lite version]
  10. _____________     Crackme By The AntiXryst and Terminal Cilla
  11. _____________  d/l it on Eternal Bliss Site : http://crackmes.cjb.net
  12. Level________: Intermediate (it's said in the cm_about.txt)
  13. Tools needed_: .SoftIce 3.xx
  14.                .WinDasm (not really necessary...)
  15.                .A calculator with XOR, AND, hexa/dec conversion
  16.                .Some basis of cracking
  17.                .A brain
  18.                .Punk music (Millencolin/Screeching Weasel for the moment :)
  19.                .Liters of beer
  20. ___________________________________________________________
  21.  
  22. Before beginning...
  23.  
  24.         This is my second tutor, but my first in English... so please excuse
  25. the numerous mistakes i'll make.
  26.         It's said in the cm_about.txt that the aim of this crackme
  27. is to make a keygen. I'll only tell you how to find a valid serial in this
  28. tut, so that ur job will be to make the keygen.
  29.  
  30.         So, you run the crackme but what do u see ??? a window called Running
  31. butt-on like contains two textbox ( user name and serial) and a CommandButton
  32. called Register. So put the name u want -i'll make the tut with 'SiFLyiNG' as
  33. name- and the serial u want... press register :) ok you can't push the
  34. register button. I'm not very good at english but i believe that's why the
  35. crackme is called 'Running butt-on like'. Notice that even if u manage to
  36. press this crazy button, nothing will happen.
  37.  
  38.         Ok let's understand what happens...
  39. ___________________________________________________________
  40.  
  41. The essay...
  42.  
  43.         First of all you have to fill in the two textbox. So you write
  44. - User name : SiFLyiNG
  45. - Serial    : 123456789
  46.         I think the first reflex is to make a breakpoint on GetWindowTextA
  47. or on GetDlgItemTextA... nothing happens... so you try Hmemcpy. But you
  48. can't press the Register button cause it is running so you suppose that the
  49. serial is compared each time you modify it.
  50.          So add a character (0 for example)to your serial and *Boom* you're
  51. back in softice. Ok i won't retail exactly what you see... i suppose you know
  52. it. So F11, return from the call or trace with F10 until you see that in
  53. green : CM_LITE!CODE+0005540A (note that you might have another adresse after
  54. CM_LITE!CODE)
  55.  
  56. There you see this piece of code :
  57.  
  58. :0045640F mov eax, dword ptr [ebp-18]       ; eax = name
  59. :00456412 call 00403AD0                     ; get len of name in eax
  60. :00456417 add eax, 00000011                 ; eax = len(name) + 11h
  61. :0045641A cmp eax, 00000014                 ; cmp eax to 11h
  62. :0045641D jl 0045650C                       ; if lower, then jump to bad guy
  63.  
  64. ...so u know now that your name must be upper or equal to (14h -11h) = 3...
  65. let's trace on :
  66.  
  67. :00456423 lea edx, dword ptr [ebp-18]
  68. :00456426 mov eax, dword ptr [edi+000002DC]
  69. :0045642C call 00423854
  70. :00456431 mov eax, dword ptr [ebp-18]       ; eax = serial
  71. :00456434 call 00403AD0
  72. :00456439 test eax, eax
  73. :0045643B je 0045650C                       ; jump if no serial entered
  74. :00456441 lea edx, dword ptr [ebp-18]
  75. :00456444 mov eax, dword ptr [edi+000002D8]
  76. :0045644A call 00423854
  77. :0045644F mov eax, dword ptr [ebp-18]       ; eax = name
  78. :00456452 call 00403AD0
  79. :00456457 test eax, eax
  80. :00456459 jbe 004564A9
  81. :0045645B mov dword ptr [ebp-14], eax
  82. :0045645E mov [ebp-0C], 00000001
  83.  
  84. Ok, this is not very interesting for the moment... but if u trace a bit, you
  85. arrive in a loop...wich begins the calculation of your serial in function of
  86. the name you entered :
  87.  
  88. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  89. |:004564A7(C)
  90. |
  91. :00456465 lea edx, dword ptr [ebp-18]
  92. :00456468 mov eax, dword ptr [edi+000002D8]
  93. :0045646E call 00423854
  94. :00456473 mov eax, dword ptr [ebp-18]      ; 'd eax' and you see the name
  95. :00456476 mov edx, dword ptr [ebp-0C]      ; edx = 1 at the beginning
  96. :00456479 movzx eax, byte ptr [eax+edx-01] ; move ascii code from the edx'th
  97.                                              char from name to eax
  98. :0045647E imul [ebp-0C]                    ; eax = eax * [ebp-0C]
  99. :00456481 add ebx, eax                     ; ebx = ebx + eax
  100. :00456483 add esi, esi                  ; esi = esi * 2 (0 at the beginning)
  101. :00456485 add esi, ebx                     ; esi = ebx + esi
  102. :00456487 mov eax, dword ptr [ebp-04]     ; eax = [ebp-04] (0 at the begin.)
  103. :0045648A add eax, esi                    ; eax = eax + esi
  104. :0045648C add eax, ebx                    ; eax= eax + ebx
  105. :0045648E add eax, dword ptr [ebp-0C]     ; eax = eax + [ebp-0C]
  106. :00456491 mov dword ptr [ebp-04], eax     ; saves eax in [ebp-04]
  107. :00456494 mov eax, dword ptr [ebp-04]
  108. :00456497 sub eax, esi                    ; eax = eax - esi
  109. :00456499 add eax, dword ptr [ebp-08]     ; eax = eax + [ebp-08]
  110. :0045649C add eax, ebx                    ; eax = eax + ebx
  111. :0045649E mov dword ptr [ebp-08], eax     ; save eax in [ebp-08]
  112. :004564A1 inc [ebp-0C]                    ; [ebp-0C] = [ebp-0C] + 1
  113. :004564A4 dec [ebp-14]                    ; decrease [ebp-14]
  114. :004564A7 jne 00456465                    ; jump if there are char left in
  115.                                             the name
  116.  
  117. Note that [ebp-14] is equal to the len of your name at the beginning of the
  118. loop. So the loop decreases each time [ebp-14] which is at the start equal
  119. to the len of the name. It means that it'll loop til there are characters
  120. in your name.
  121.  
  122. So these part of code has begin the calculate of the valid serial in fonction
  123. of the name. But what do we see now... :
  124.  
  125. :004564A9 mov eax, dword ptr [ebp-04]     ; For 'SiFLyiNG', eax = 02A16Ch
  126. :004564AC imul [ebp-08]                   ; eax = eax * [ebp-08]
  127.                                            with [ebp-08] = 02A1C0 for my name
  128. :004564AF add esi, eax                    ; esi = esi + eax
  129. :004564B1 xor esi, ebx                    ; esi = esi XOR ebx (ebx = C54h)
  130. :004564B3 and esi, 7FFFFFFF               ; esi =esi AND 7FFF FFFFh
  131. :004564B9 lea edx, dword ptr [ebp-18]        ; eax = serial
  132. :004564BC mov eax, dword ptr [edi+000002DC]
  133. :004564C2 call 00423854                   ; Converts serial(string) to a
  134.                                             number and stores it in eax
  135. :004564C7 mov eax, dword ptr [ebp-18]
  136. :004564CA lea edx, dword ptr [ebp-10]
  137. :004564CD call 004048EC
  138. :004564D2 cmp dword ptr [ebp-10], 00000000
  139. :004564D6 jne 0045650C
  140. :004564D8 lea eax, dword ptr [ebx+eax]    ; eax = eax + ebx
  141.                                       eax = 499602D2h+C54h
  142.                                       Note : 499602D2h=1234567890 (our serial)
  143. :004564DB xor eax, ebx                    ; eax = eax XOR ebx
  144. :004564DD and eax, 7FFFFFFF               ; eax = eax AND 7FFF FFFFh
  145. :004564E2 cmp esi, eax                    ; compare eax to esi
  146. :004564E4 jne 0045650C                    ; -> bad cracker if not equal
  147.  
  148. Ok, now you know that if eax and esi are equal then you will have won. But in
  149. our case, we're going to the bad cracker code.
  150.         but if you type ? esi at 4564E2 you get : 1817657840 in decimal
  151.                     and ? eax                   : 1234568050 ''  ''
  152. so you understand that this cmp compares esi (got from the name) and eax
  153. (got from the serial). So eax must be 1817657840 in this case to be able
  154. to register. Bingo !!!
  155. We know that we must have eax =1817657680 to register... it's easy now.
  156. We can deduce the serial we must have entered to be a good cracker.
  157. Remember :
  158.  
  159. :004564C2 call 00423854                   ; Converts serial
  160. :004564C7 mov eax, dword ptr [ebp-18]
  161. :004564CA lea edx, dword ptr [ebp-10]
  162. :004564CD call 004048EC
  163. :004564D2 cmp dword ptr [ebp-10], 00000000
  164. :004564D6 jne 0045650C
  165. :004564D8 lea eax, dword ptr [ebx+eax]    ; eax = eax + ebx
  166. :004564DB xor eax, ebx                    ; eax = eax XOR ebx
  167. :004564DD and eax, 7FFFFFFF               ; eax = eax AND 7FFF FFFFh
  168.  
  169. we make the reverse way :
  170.  
  171. eax = esi = 1817657840 = 6C5741F0h
  172. eax = eax AND 7FFF FFFFh = 6C5741F0h AND 7FFF FFFFh = 6C5741F0h
  173. eax = eax xor ebx = 6C574150h XOR C54h = 6C574DA4h
  174. eax = eax - ebx = 6C574DA4h - C54h = 6C574150h
  175.  
  176. So, if we convert eax in decimal, it must be the valid serial for 'SiFLyiNG'
  177. Let's try : eax = 6C574150h = 1817657680
  178. So enter 'SiFLyiNG' as name, '1817657680' as serial
  179. Hummm... the register button is calm now ... Press it : wowwwwwwwwww!!!
  180.         "Congratulations, sweety!
  181.                 you have successfully managed..."
  182. Asd we say in french: Apres l'effort, le reconfort. Now i think it's the
  183. valid serial !!!!!!! Thanks to The AntiXryst and Terminal Cilla :)
  184.  
  185. ___________________________________________________________
  186.  
  187. The end...
  188.  
  189.         Ok, my job is done. I hope you enjoyed with this tut. If not, then
  190. it's not necessary to insult me, but don't hesitate to make your critisms.
  191. Now, you must understand the calculation of the valid serial and you're
  192. able to provide a keygen. Good luck, it's not difficult :)
  193.         I hope i didn't make too much mistakes... if it's the case, mail me.
  194. ... if someone know the phone number of the superb creature who
  195. congratulates u at the end, please send it to me :)
  196.  
  197.         SiFLyiNG/PsyKedelic
  198.                         siflying@ifrance.com
  199.  
  200. Greetz : Gluconzip my friend, Lucifer48 (http://www.multimania.com/lucifer48/)
  201.          Skymarshall, LittleBob, Earwax, Eternal Bliss
  202.          (http://crackmes.cjb.net)... and all the french crackers that
  203.          i forgot:).
  204.  
  205. PS : my first tutor in french for pusillus crackme is available on Lucifer48's
  206.     site but i think i'll translate it in english soon...
  207.     ...et pour ce tutorial, si y'en a que ca interesse, je peux aussi en faire
  208.     une traduc en francais...
  209.  
  210. Voila, c'est fini... @+
  211.  
  212.  
  213.  
  214.  
  215.