home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / Code Inside / Tut9.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  11.2 KB  |  205 lines

  1. *********************************************************************************************************************************************************************************************************
  2.                     Teleport Pro V1.29.1590
  3. *********************************************************************************************************************************************************************************************************
  4.  
  5. Author:        Tennyson Maxwell
  6. Protection:    Name / Company / Serial - CRC Check
  7. URL:        http://tenmax.com/pro12.exe
  8. Tools:        SoftICE 4.05
  9.         W32Dasm V8.93
  10.         Hex-Editor
  11.  
  12.  
  13. --->    Intro...
  14.  
  15. Hi and welcome to my next Tutorial !!!
  16. This time we're going to crack "Teleport Pro V1.92.1590".
  17. It has an very easy Algo and some CRC Check to prevent modifying the file :)
  18. Ok, i'm only gonna "Sniff the Serial" today, i leave the CRC Check up to you, hehe its a very simple one but i don't want to explain it sorry =/
  19. Ask me if you really want to know the CRC Check ;)
  20.  
  21. --->    Let's Begin...
  22.  
  23. Ok, open up the program and then select "Help / Register...", you will see a window with 3 edit boxes.
  24. One for the Name, one for the Company and one for the Serial :)
  25. Now enter some "Fake" info in it, ive used:
  26.  
  27. Name:        CoDe_InSiDe
  28. Company:    KnOwLeDgE
  29. Serial:        1234567890
  30.  
  31. When your ready we press (CTRL+D) to get into SoftICE to set our breakpoint.
  32. But what breakpoint could we use ???
  33. GetDlgItemTextA...
  34. GetWindowTextA...
  35. etc...
  36.  
  37. hmm, you know what, we're going to use hmemcpy (because it almost always breaks), so in SoftICE
  38. we type "bpx hmemcpy" followed by (ENTER) then leave SoftICE (CTRL+D) and click on "Ok" and SoftICE will popup.
  39. Ok, now we're at the beginning of the hmemcpy code, now type "BC *" to clear the breakpoint
  40. and press (F12) 11 times till you see this:
  41.  
  42. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  43.  
  44. :00426905 8B87DD000000            mov eax, dword ptr [edi+000000DD]    <--- WE LAND HERE AFTER THE BREAK !!!
  45. :0042690B 33DB                    xor ebx, ebx                <--- XOR EBX which is now 00
  46. :0042690D 6A0A                    push 0000000A
  47. :0042690F 53                      push ebx
  48. :00426910 50                      push eax
  49. :00426911 E85E690000              call 0042D274                <--- In this CALL it puts your "Fake" Serial in EAX in Decimal Format
  50. :00426916 8B0DF8204800            mov ecx, dword ptr [004820F8]
  51. :0042691C 83C40C                  add esp, 0000000C
  52. :0042691F 8945E8                  mov dword ptr [ebp-18], eax        <--- Save "Fake" Serial in Memory
  53. :00426922 3899DB040000            cmp byte ptr [ecx+000004DB], bl
  54. :00426928 0F8412020000            je 00426B40
  55. :0042692E 3BC3                    cmp eax, ebx                <--- Compare EBX (00000000) with EAX ("Fake" Serial)
  56.  
  57. * Possible StringData Ref from Data Obj ->"User"
  58.                                   |
  59. :00426930 BE00DA4700              mov esi, 0047DA00
  60. :00426935 0F8406010000            je 00426A41                <--- If EAX is equal to EBX we jump and that means we haven't entered a Serial, or our Serial consists of 00000000, else continue
  61. :0042693B FFB7D5000000            push dword ptr [edi+000000D5]        <--- Push the offset to our Name
  62. :00426941 E896090000              call 004272DC                <--- Here's the Algo !!!
  63. :00426946 3945E8                  cmp dword ptr [ebp-18], eax        <--- Compare EAX ("Real" Serial) with our "Fake" Serial in Memory
  64. :00426949 59                      pop ecx
  65. :0042694A 753A                    jne 00426986                <--- If not equal we jump and get the Bad Guy message ,else we get the Good Guy message :)
  66.  
  67. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  68.  
  69. Ok well, first it puts our "Fake" Serial into the Register EAX (In Decimal Format), so if your out of that CALL and then do a "? EAX" you'll see your "Fake" Serial in SoftICE :)
  70. Then it Compares that value (Your "Fake" Serial) to the value 00000000, to see if we really entered something or to see if we entered only 0's :)
  71. If so we jump and fail, if not we continue to the Algo, let's see what the Algo is so enter the CALL 004272DC and you'll see this:
  72.  
  73. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  74.  
  75. :004272DC 57                      push edi
  76. :004272DD 8B7C2408                mov edi, dword ptr [esp+08]        <--- Move the offset to our Name in EDI
  77. :004272E1 85FF                    test edi, edi                <--- Test if EDI is 00
  78. :004272E3 7409                    je 004272EE                <--- If so we jump and XOR's EAX and we fail, else we continue
  79. :004272E5 57                      push edi
  80. :004272E6 E855560000              call 0042C940                <--- In here it gets the length of our Name
  81. :004272EB 59                      pop ecx
  82. :004272EC EB02                    jmp 004272F0                <--- Jump to the Compare
  83.  
  84. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  85. |:004272E3(C)
  86. |
  87. :004272EE 33C0                    xor eax, eax                <--- XOR EAX which is now 00
  88.  
  89. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  90. |:004272EC(U)
  91. |
  92. :004272F0 83F805                  cmp eax, 00000005            <--- Compare EAX with 05
  93. :004272F3 7304                    jnb 004272F9                <--- If below we continue and then it XOR's EAX and we fail, else jump and continue to the Algo
  94. :004272F5 33C0                    xor eax, eax                <--- XOR EAX which is now 00
  95. :004272F7 5F                      pop edi
  96. :004272F8 C3                      ret
  97.  
  98. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  99.  
  100. In this piece of Code it takes the length of our Name and Compares it with 05, if less then 5 Characters entered as Name we fail, else we continue to the Algo.
  101. So trace a little further till it jumps after the "cmp eax, 00000005" (or do everything again if you entered less then 5 Characters for your Name) and then you'll see this:
  102.  
  103. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  104.  
  105. :004272F9 53                      push ebx
  106. :004272FA 56                      push esi
  107. :004272FB BEA4E4FE5D              mov esi, 5DFEE4A4            <--- Hmm... Move Magic Value in ESI :)
  108. :00427300 33DB                    xor ebx, ebx                <--- XOR EBX which is now 00
  109.  
  110. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  111. |:00427322(U)
  112. |
  113. :00427302 85FF                    test edi, edi                <--- Test if EDI is 00 (EDI holds the offset to our Name)
  114. :00427304 7409                    je 0042730F                <--- If so we jump to the "xor eax, eax", else continue
  115. :00427306 57                      push edi
  116. :00427307 E834560000              call 0042C940                <--- In here it gets the length of our Name
  117. :0042730C 59                      pop ecx
  118. :0042730D EB02                    jmp 00427311                <--- Jump and skip one instruction
  119.  
  120. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  121. |:00427304(C)
  122. |
  123. :0042730F 33C0                    xor eax, eax                <--- XOR EAX which is now 00
  124.  
  125. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  126. |:0042730D(U)
  127. |
  128. :00427311 83C0FC                  add eax, FFFFFFFC            <--- ADD EAX FFFFFFFC (-04), so it subs 04 from the length of your Name
  129. :00427314 3BD8                    cmp ebx, eax                <--- Compare EAX (Length of your Name) with EBX (00000000)
  130. :00427316 730C                    jnb 00427324                <--- If below we continue to make our Serial, else we jump to the end
  131. :00427318 33343B                  xor esi, dword ptr [ebx+edi]        <--- XOR [EBX+EDI] (is 1st four Chars) with ESI (5DFEE4A4)
  132. :0042731B F6C340                  test bl, 40                <--- Test if BL is less then 40
  133. :0042731E 7401                    je 00427321                <--- If so we jump and skip one instruction, else continue
  134. :00427320 43                      inc ebx                <--- EBX +1
  135.  
  136. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  137. |:0042731E(C)
  138. |
  139. :00427321 43                      inc ebx                <--- EBX +1
  140. :00427322 EBDE                    jmp 00427302                <--- Repeat loop
  141.  
  142. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  143. |:00427316(C)
  144. |
  145. :00427324 8BC6                    mov eax, esi                <--- Move our "Real" Serial in EAX
  146. :00427326 5E                      pop esi
  147. :00427327 5B                      pop ebx
  148. :00427328 5F                      pop edi
  149. :00427329 C3                      ret
  150.  
  151. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  152.  
  153. Very small Algo :)
  154. Ok, so it takes the length of your Name and subtracts 04 from it why?... Because as you see it XOR's a Dword (4 bytes) with ESI (Our Magic Value), if it didn't subtract 04 from the length then you
  155. would get a XOR with 00 and they didn't want that :)
  156. So it goes like this:
  157.  
  158. CoDe_InSiDe"
  159. Lenght of my Name "0B" (11 Decimal)
  160. Length - 04 = "07" (7 Decimal)
  161. Then it Compares EBX (00 at the beginning) with our "New" Length (07)
  162. If below we continue to make the "Real" Serial, else we jump to the end and move ESI (Our "Real" Serial) in EAX
  163. Then it XOR's the first 4 bytes of our Name with the Magic Value in ESI (65446F43 XOR 5DFEE4A4)
  164. Then it Test's if BL is less then 40
  165. If so we jump and increase EBX by 1, else we increase EBX by 2
  166. Repeat loop
  167. ...
  168. Compare EBX (01 now) with our "New" Length (07)
  169. If below we continue to make the "Real" Serial, else we jump to the end and move ESI (Our "Real" Serial) in EAX
  170. Then it XOR's with ESI with 4 bytes of our Name (now it begins at the next Char of our Name because of "inc EBX")
  171. Then it Test's if BL is less then 40
  172. If so we jump and increase EBX by 1, else we increase EBX by 2
  173. And so on...
  174.  
  175. Till the "Compare ebx, eax" is the same and then we jump and move the final result from ESI in EAX
  176. Then we get back to the main Code and then it does "cmp dword ptr [ebp-18], eax", Compare EAX ("Real" Serial) with our "Fake" Serial in Memory.
  177. If equal we continue and get the Good Guy message, else we get the Bad Guy message :)
  178. Do a "? EAX" to see your Serial in Decimal Format.
  179. Ok, that's it...
  180. As you can see it hasn't calculated our "Company" like so much other Program's won't :)
  181. So finally i got this Serial for my Name:
  182.  
  183. Name:        CoDe_InSiDe
  184. Company:    KnOwLeDgE    <--- Not necessary can be left blank
  185. Serial:        1050509777
  186.  
  187. I hope you learned something from this tutorial, as it wasn't very hard to understand i hope :)
  188. If you have any questions or just something to say send it to:
  189.  
  190. Email:    code.inside@home.nl
  191.  
  192.  
  193. --->    Greetings...
  194.  
  195. Everyone from TrickSoft            (www.TrickSoft.net)
  196. Everyone from Cracking4Newbies        (www.Cracking4Newbies.com)
  197. Everyone from Keygenning4Newbies    (Keygenning4Newbies.cjb.net)
  198. And You...
  199.  
  200.             Don't trust the Outside, trust the InSiDe !!!
  201.  
  202.                       Cya...
  203.  
  204.                     CoDe_InSiDe
  205.