home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / passme-sol-scoob.txt < prev    next >
Encoding:
Text File  |  2001-09-21  |  6.4 KB  |  145 lines

  1. This Tutorial is written by SCooB
  2.  
  3. Target:     - Crackme "PassMe" from Code_Inside downloaded from 
  4. http://crackmes.cjb.net/
  5.  
  6. Protection: - Serial
  7.  
  8. Used:       - SoftIce v 4.0.5
  9.             - Brain
  10.             - Good cup of coffee (hot and strong)
  11.  
  12. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  13.  
  14.  
  15. * The pre-examination of the crackme
  16.  
  17. Open the crackme and enter a serial. Press "check" and.....Password not 
  18. accepted (hehe, why not:-)
  19. You noticed that you only have to enter a serialcode and no name, so it 
  20. could be very simple or....:-)
  21.  
  22. --------------------------------------------------------------------------------------------
  23.  
  24. * Let's make the crack
  25.  
  26. Run your crackme and enter a serial (I entered 12234556). Now open 
  27. SoftIce and put a breakpoint on getdlgitemtexta. Close the debugger by 
  28. typing "X" and press "Check".
  29. Boom, there's SoftIce popping up. Press "F11" one time to get out of 
  30. the Call and you'll get here:
  31.  
  32. 017F:00401056  FF15701D4000        CALL      [USER32!GetDlgItemTextA]
  33. 017F:0040105C  3C08                CMP       AL,08 <-------   check if 
  34. you entered 8 characters
  35. 017F:0040105E  7590                JNZ       00400FF0                           
  36. 017F:00401060  BFC2114000          MOV       EDI,004011C2 <-- move text 
  37. into EDI
  38. 017F:00401065  33C9                XOR       ECX,ECX                            
  39. 017F:00401067  33D2                XOR       EDX,EDX                            
  40. 017F:00401069  33F6                XOR       ESI,ESI                            
  41. 017F:0040106B  8A0F                MOV       CL,[EDI] <------ move 
  42. first char. in CL
  43. 017F:0040106D  8A5701              MOV       DL,[EDI+01] <--- move 
  44. second char. in DL
  45. 017F:00401070  80FA00              CMP       DL,00 <--------- check if 
  46. end of text reached
  47. 017F:00401073  7409                JZ        0040107E <------ if yes, 
  48. jump
  49. 017F:00401075  01D1                ADD       ECX,EDX                            
  50. 017F:00401077  01CE                ADD       ESI,ECX                            
  51. 017F:00401079  83C702              ADD       EDI,02                             
  52. 017F:0040107C  EBED                JMP       0040106B                           
  53. 017F:0040107E  01CE                ADD       ESI,ECX
  54.  
  55. Now, trace to the code (by typing "F10") to get an idea of what's going 
  56. on. After a while you'll notice that you're inside a "code-circle". Now 
  57. it's time to know what's happening. As you can see at address 00401060 
  58. there's some text moving in register EDI and after that the characters 
  59. are processed one by one. If the end of the text has reached, jump to 
  60. 0040107E.
  61. So, place a breakpoint at address 0040107E and let SoftIce do it's job.
  62. Now you're at the code section listed below.
  63.  
  64. 017F:0040107E  01CE                ADD       ESI,ECX <----- you landed 
  65. here
  66. 017F:00401080  0FAFF0              IMUL      ESI,EAX                            
  67. 017F:00401083  F7FE                IDIV      ESI                                
  68. 017F:00401085  01F6                ADD       ESI,ESI                            
  69. 017F:00401087  01D6                ADD       ESI,EDX                            
  70. 017F:00401089  8BD6                MOV       EDX,ESI                            
  71. 017F:0040108B  C1C210              ROL       EDX,10                             
  72. 017F:0040108E  01D6                ADD       ESI,EDX                            
  73. 017F:00401090  33D2                XOR       EDX,EDX                            
  74. 017F:00401092  BF00134000          MOV       EDI,00401300                       
  75. 017F:00401097  33C0                XOR       EAX,EAX                            
  76. 017F:00401099  8B07                MOV       EAX,[EDI]                          
  77. 017F:0040109B  8B4F04              MOV       ECX,[EDI+04]                       
  78. 017F:0040109E  01C8                ADD       EAX,ECX                            
  79. 017F:004010A0  3BC6                CMP       EAX,ESI                            
  80. 017F:004010A2  7402                JZ        004010A6                           
  81. 017F:004010A4  EB2E                JMP       004010D4                           
  82.  
  83. When you trace through the code by pressing "F10" you will reach the 
  84. address with the one and only jump in the section. It must be the 
  85. "decide-jump". To check it, change the "zero-flag" and let the crackme 
  86. run.............Good job cracker, you did it
  87.  
  88. Ok, now we know we have the right jump and so we know that the serial 
  89. processing has to be between 0040105C and 004010A2. We also know that 
  90. when EAX is equal to ESI we have entered the right serial.
  91. Now we're going to have a look at what's inside the two registers:
  92. Type "? EAX" and you will see "igge" (if you entered the same serial as 
  93. I did:-)
  94. Type "? ESI" and you will see "E[E[" (the correct serial after it is 
  95. processed)
  96.  
  97. When these are the same, you're the man :-)
  98.  
  99. To find out what we have to enter to get E[E[ in the EAX-register, 
  100. we're going to reverse the code.
  101.  
  102. 017F:00401092  BF00134000          MOV       EDI,00401300 <--- move 
  103. 12234556 in EDI
  104. 017F:00401097  33C0                XOR       EAX,EAX
  105. 017F:00401099  8B07                MOV       EAX,[EDI] <------ move 
  106. 3221 in EAX
  107. 017F:0040109B  8B4F04              MOV       ECX,[EDI+04] <--- move 
  108. 6554 in ECX
  109. 017F:0040109E  01C8                ADD       EAX,ECX <-------- ADD ECX 
  110. to EAX
  111. 017F:004010A0  3BC6                CMP       EAX,ESI <-------- CMP igge 
  112. to E[E[
  113. 017F:004010A2  7402                JZ        004010A6                           
  114. 017F:004010A4  EB2E                JMP       004010D4                           
  115.  
  116. As we can see, our code is chopped in half, is reversed and after that 
  117. it is combined to each other. To prove this we have to convert the 
  118. ascii-character to the ascii-value.
  119.  
  120. 3221 is the same as  51  50  50  49
  121. 6554 is the same as  54  53  53  52
  122. ------------------------------------+
  123.                     105 103 103 105 is the same as iggi
  124.  
  125.  
  126. After this it's a piece off cake to find one of the correct serials
  127.  
  128. We're going to do the same trick backwards with E[E[
  129.  
  130. E[E[ is the same as 69 91 69 91
  131.                     35 45 35 45 is the same as # - # -  (you can take 
  132. every combination you want
  133.                     34 46 34 46 is the same as " . " .   as long as the 
  134. sum is correct)
  135.  
  136. Now, let's find out if it works.
  137.  
  138. Open the crackme and type -#-#."." (remember that you had to reverse 
  139. it:-)
  140.  
  141. Good job, Cracker (thank you:-))
  142.  
  143. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  144. SCooB, scoob@secureroot.com
  145.