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

  1. *****************************************************************************************************************************************************
  2.                     TazManian CrackMe #1
  3. *****************************************************************************************************************************************************
  4.  
  5. Author:        TazManian
  6. Protection:    Name / Serial
  7. URL:        http://snacker.rizzah.com/crackmes/azCrackme1.zip
  8. Tools:        SoftICE V4.05
  9.  
  10.  
  11. --->    Intro...
  12.  
  13. Welcome to my next Tutorial !!!
  14. This is a simple CrackMe with one little kind of bug in the Algo ;)
  15. First i'm going to Sniff the Serial then i'll patch it.
  16.  
  17.  
  18. --->    Let's Begin...
  19.  
  20. Open the CrackMe and you'll be asked to enter a Name and Serial i've used:
  21.  
  22. Name:        CoDe_InSiDe
  23. Serial:        1234567890
  24.  
  25. Now press (CTRL+D) to get into SoftICE and type "bpx hmemcpy" followed by "Enter".
  26. Then press (CTRL+D) again to get out of SoftICE, and then press the button "Registrar"
  27. And SoftICE should popup, now first type "BC *" to clear the breakpoint and then press (F12)
  28. 12 times and you'll see this:
  29.  
  30. -----------------------------------------------------------------------------------------------------------------------------------------------------
  31.  
  32. :00441560 8B45F8                  mov eax, dword ptr [ebp-08]        <--- EAX now points to our Name
  33. :00441563 E8E025FCFF              call 00403B48                <--- In here it gets the length of our Name
  34. :00441568 83F805                  cmp eax, 00000005            <--- Compare 00000005 with our length
  35. :0044156B 0F8C93000000            jl 00441604                <--- If lower we jump and fail, else continue
  36. :00441571 8B45F8                  mov eax, dword ptr [ebp-08]        <--- EAX now points to our Name
  37. :00441574 E8CF25FCFF              call 00403B48                <--- In here it gets the length of our Name
  38. :00441579 8BF0                    mov esi, eax                <--- Move EAX in ESI
  39. :0044157B 85F6                    test esi, esi                <--- Test if ESI is 00
  40. :0044157D 7E2B                    jle 004415AA                <--- If equal or lower we jump and fail, else continue
  41. :0044157F BF01000000              mov edi, 00000001            <--- Move 00000001 in EDI
  42.  
  43. -----------------------------------------------------------------------------------------------------------------------------------------------------
  44.  
  45. Ok, in here it simple checks if our Name was less then 5 Chars, if it is we jump and fail ,else we continue and we're going to
  46. the Algo and you'll see this:
  47.  
  48. -----------------------------------------------------------------------------------------------------------------------------------------------------
  49.  
  50. :00441584 8B45F8                  mov eax, dword ptr [ebp-08]        <--- EAX now points to our Name
  51. :00441587 E8BC25FCFF              call 00403B48                <--- In here it gets the length of our Name
  52. :0044158C 8B55F8                  mov edx, dword ptr [ebp-08]        <--- EDX now points to our Name
  53. :0044158F 0FB6543AFF              movzx edx, byte ptr [edx+edi-01]    <--- Move our 1st Char in EDX
  54. :00441594 8D1452                  lea edx, dword ptr [edx+2*edx]    <--- Move [EDX+2*EDX] in EDX
  55. :00441597 F7EA                    imul edx                <--- Multiply EDX with EAX (length)
  56. :00441599 03C0                    add eax, eax                <--- ADD EAX with EAX
  57. :0044159B 8D0480                  lea eax, dword ptr [eax+4*eax]    <--- Move [EAX+4*EAX] in EAX
  58. :0044159E 69D814860000            imul ebx, eax, 00008614        <--- Multiply 00008614 with EAX and put the result in EBX
  59. :004415A4 03DB                    add ebx, ebx                <--- ADD EBX with EBX
  60. :004415A6 47                      inc edi                <--- EDI +1
  61. :004415A7 4E                      dec esi                <--- ESI -1
  62. :004415A8 75DA                    jne 00441584                <--- If ESI is not 00 we jump and repeat the loop, else continue
  63.  
  64. -----------------------------------------------------------------------------------------------------------------------------------------------------
  65.  
  66. Ok, so here's the Algo let me show you what it does:
  67.  
  68. First it moves the length of our name in EAX (in my case its 0000000B)
  69. Then it moves the first Char in EDX (in my case its C = 43 hex)
  70. Then it moves [43+2*43] in EDX    (result in EDX = 000000C9)
  71. And then it Multiplies EDX (000000C9) with EAX (0000000B) result = 000008A3 in EAX
  72. Then it ADDs 000008A3 with 000008A3 result in EAX = 00001146
  73. Then it moves [00001146+4*00001146] in EAX result = 0000565E
  74. And then it Multiplies 00008614 with 0000565E and put the result in EBX = 2D3BF358
  75. Then it finally ADDs EBX with EBX result in EBX is now = 5A77E6B0
  76. Increase EDI
  77. Decrease ESI
  78. Repeat loop if ESI isn't 00000000
  79.  
  80. Ok, like i mentioned above in this text there's a little bug in this Algo (or he did it on purpose :)
  81. But if you pay close attention to the Algo you'll see that it only calculates the last Char of our Name.
  82. And the final result is stored in EBX.
  83. Let's see what's next:
  84.  
  85. -----------------------------------------------------------------------------------------------------------------------------------------------------
  86.  
  87. :004415AA 8D55F8                  lea edx, dword ptr [ebp-08]        <--- Point EDX to some space for our "Real" Serial
  88. :004415AD 8BC3                    mov eax, ebx                <--- Move EBX in EAX
  89. :004415AF E85464FCFF              call 00407A08                <--- And here it makes our "Real" Serial with wsprintfA
  90. :004415B4 8B45F8                  mov eax, dword ptr [ebp-08]        <--- EAX now points to our "Real" Serial
  91. :004415B7 80382D                  cmp byte ptr [eax], 2D        <--- Compare the first Number with "2D" (-) (is it a negative value?)
  92. :004415BA 7506                    jne 004415C2                <--- If not equal we jump and skip the next three instructions, else continue
  93. :004415BC 8BC3                    mov eax, ebx                <--- Move EBX in EAX
  94. :004415BE F7D8                    neg eax                <--- Kind of like Reverse all the value's in EAX
  95. :004415C0 8BD8                    mov ebx, eax                <--- Move EAX in EBX
  96.  
  97. -----------------------------------------------------------------------------------------------------------------------------------------------------
  98.  
  99. Ok, so in here it makes our "Real" Serial with wsprintfA.
  100. Then it checks if the first number is "2D" (-) to see if it's a negative value.
  101. If so it Reverses the value in EAX and puts it back in EBX.
  102. Let's see what's next:
  103.  
  104. -----------------------------------------------------------------------------------------------------------------------------------------------------
  105.  
  106. :004415C2 8D55F4                  lea edx, dword ptr [ebp-0C]
  107. :004415C5 8B45FC                  mov eax, dword ptr [ebp-04]
  108. :004415C8 8B80DC020000            mov eax, dword ptr [eax+000002DC]
  109. :004415CE E8610CFEFF              call 00422234
  110. :004415D3 8B45F4                  mov eax, dword ptr [ebp-0C]        <--- Point EAX to our "Fake" Serial
  111. :004415D6 50                      push eax                <--- Save EAX
  112. :004415D7 8D55F0                  lea edx, dword ptr [ebp-10]
  113. :004415DA 8BC3                    mov eax, ebx                <--- Move EBX in EAX
  114. :004415DC E82764FCFF              call 00407A08                <--- And here it makes our "Real" Serial again but this time positive
  115. :004415E1 8B55F0                  mov edx, dword ptr [ebp-10]        <--- EDX now points to our "Real" Serial
  116. :004415E4 58                      pop eax                <--- Pop EAX (EAX points to our "Fake" Serial
  117. :004415E5 E86E26FCFF              call 00403C58                <--- And here it compares EAX with EDX
  118. :004415EA 7518                    jne 00441604                <--- If not equal we jump and skip the Message Box and we fail, else continue
  119.  
  120. -----------------------------------------------------------------------------------------------------------------------------------------------------
  121.  
  122. Ok, no need for a big explaination ;)
  123. Here it just simply compares our "Fake" Serial with the "Real" Serial (this time positive if it were negative).
  124. Well, to patch this CrackMe you need to change the "jne 00441604" into nothing (NOP it "9090")
  125. I think you know how to do that...
  126. That's all :)
  127.  
  128.  
  129. --->    Greetings...
  130. Everybody from TrickSoft        (www.TrickSoft.net)
  131. Everybody from Cracking4Newbies        (www.Cracking4Newbies.com)
  132. Everybody from Keygenning4Newbies    (Keygenning4Newbies.cjb.net)
  133. And You...
  134.  
  135.             Don't trust the Outside, trust the InSiDe !!!
  136.  
  137.                       Cya...
  138.  
  139.                     CoDe_InSiDe
  140.  
  141. Email:    code.inside@home.nl