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

  1.  
  2.                   dead listening/Patching Tutorial 
  3.                               ================================
  4.  
  5. ----------------------------------------------------|
  6. Writer:         Bengaly                             |
  7. date:           23/6/01                             |
  8. Author:         cW_                                 |
  9. Protection:    serial/name                         |
  10. URL: http://www.mesa-sys.com/~eternal/a-d/cycle.zip |
  11. Tools:                                            |
  12.         Hex-Editor (Hview)                  |
  13.         W32DASM                             |
  14. ----------------------------------------------------|
  15.  
  16. Hello!
  17. Welcome to my 24th tutorial, today we will talk about Patching.
  18.  
  19.  
  20. the author says:
  21. ----------------
  22. -> no brute force, since there are a lot of keys for your name
  23. -> no patching
  24. * but who listen to them ;D...naaa sometimes rulz are rulz, but hey nothing is perfect!
  25.  
  26. Let's get started:
  27. -----------------
  28.  
  29. Run the crackme, it informs u to enter serial/name...
  30. So enter any name and serial..and click the "Check" button.
  31. u will see nothing happens...hmm that's wired.
  32. so open up w32dasm and diassemble the crackme...
  33. u will notice that the "strn-ref" button is enable ;P
  34. heh so we have some text in the crackme, so click the "strn-ref"
  35. so will see that text used in the crackme...:
  36.  
  37. "hmm no!"
  38. "congratulations"
  39. "please enter valid serial"...
  40.  
  41. ok we will explore this, i see that when we enter a name/serial
  42. and click the "check" button and nothing happens, but im the 
  43. above text we must somehow get "please enter valid serial"...
  44. so open the crackme again, enter any name, and enter exactly 16 chars
  45. or above for a serial.
  46.  
  47. *how did i know i need 16 chars??...
  48. well i enter chars for the serial check box untill i got this message! =)
  49.  
  50. so now we get the nice message box eh? ;D
  51. ok that's what i wanted to get from the crack.
  52.  
  53. now, i am goona patch the crackme, but in the way we all know: jne<->je  nope!
  54. i will change the "please enter valid serial" message box to the "congratulations" 
  55. message box, it will be the same result as the jne<->je approch, but sometimes 
  56. i wan't to try diff approaches ;P
  57.  
  58. ===================================[ Patching ]===============================================
  59.  
  60. click "strn-ref" button and double click on "please enter valid serial"
  61.  
  62. we will be here:
  63. =============================================================================
  64. * Referenced by a CALL at Address:                                          |
  65. |:0040111A  <- caller                                                       |
  66. |                                                                           |
  67. :00401166 6A00                    push 00000000                             |
  68. * Possible StringData Ref from Data Obj ->"Ahm. No!"                        |
  69.                                   |                                         |
  70. :00401168 68DE204000              push 004020DE                             |
  71. * Possible StringData Ref from Data Obj ->"Please enter a valid serial for "|
  72.                                         ->"your name!"                      |
  73.                                   |                                         |
  74. :0040116D 68E7204000              push 004020E7                             |
  75. :00401172 FF7508                  push [ebp+08]                             |
  76. * Reference To: USER32.MessageBoxA, Ord:0000h                               |
  77.                                   |                                         |
  78. :00401175 E843010000              Call 004012BD                             |
  79. :0040117A C3                      ret                                       |
  80. =============================================================================
  81.  
  82. Good, so we see that the call to that place was at 0040111A.
  83. so what's in 004011A...just do search->find text (in 32dasm) and enter: 0040111A 
  84. *do search in the up direction , and press FIND TEXT 2 time (the first 0040111A caller)
  85.  
  86. u will see this:
  87.  
  88. ===========================================
  89. :0040111A E847000000      call 00401166   |
  90. ===========================================
  91.  
  92. so we see that 40111A call to some location ;P....what is that location??
  93. let's check, again do a search for 401166...yes it's taking us to the same place
  94. as i have pasted above!! ;D
  95. that's good for me, so i know now which place i can patch.
  96. so our target patching is: 0040111A E847000000  -> [call 00401166] <-
  97.  
  98. now, click on "strn-ref" button again, and choos: "Congratulations!"
  99.  
  100. we will be here:
  101.  
  102. ================================================================
  103. * Referenced by a CALL at Address:                             |                           
  104. |:0040114B                                                     |
  105. |                                                              |
  106. :0040117B 6A00                    push 00000000                |
  107.                                                                |
  108. * Possible StringData Ref from Data Obj ->"Wow!"               |
  109.                                   |                            |
  110. :0040117D 6812214000              push 00402112                |
  111.                                                                |
  112. * Possible StringData Ref from Data Obj ->"Congratulations!"   |
  113.                                   |                            |
  114. :00401182 6817214000              push 00402117                |
  115. :00401187 FF7508                  push [ebp+08]                |
  116.                                                                |
  117. * Reference To: USER32.MessageBoxA, Ord:0000h                  |
  118.                                   |                            |
  119. :0040118A E82E010000              Call 004012BD                |
  120. :0040118F C3                      ret                          |
  121. ================================================================
  122.  
  123. so u see this is the place where the good jump is going to if u enter the good serial!
  124. so this is a MessageBoxA type!
  125. the caller of the MessageBoxA is 0040117B 6A00  push 00000000.
  126. write 40117b down. (we will patch to this location)
  127.  
  128. so the only thing we have to do now is to patch 0040111A E847000000  -> [call 00401166]
  129. to the above messageboxa..
  130. how we do it??
  131.  
  132. ok, so back to :0040111A location, and look at the @Offset..it's 71A(h)
  133. write it down.
  134. Open Hview, and load the crackme...press F4 and choose "decode" and press F5
  135. fill in 71A and we will be at the right asm instruction!
  136. :0040111A E847000000 call 00401166   <= That instruction..
  137. but we already know that we need to change that call to the good messagebox.
  138. so, call 00401166 will be 0040117B.
  139. So Press F3 (edit), u will notice the the location adress (at left side) is changed to hex
  140. values ;P....so adress :0040117B will be 00000077B ;D (F9 to return to normal mode)
  141. now back to location :0040111A, just move on this location and press F3 (convert to hex mode now), and Press F2 (asm edit line)....u will see this:
  142.  
  143. ====Aseembler============
  144. | Call        000000776 |
  145. =========================
  146.  
  147. now, we need to chage the call to: :0040117B (good messagebox), but u need to type the
  148. hex value, so we know the Hex value is: 0000077B ;D
  149.  
  150. so just edit and change it to :
  151.  
  152. ====Aseembler============
  153. | Call        00000077B |
  154. =========================
  155.  
  156. press <enter>...and then Esc
  157. then F9 to save the file...and F10 to exit the Hex Editor!
  158.  
  159. now, load the crackme again, enter any name (no metter langht) and a 16+ chars (any)
  160. for the serial...u will get the "Wow! Congratulations!...."
  161. CrackMe Patched.
  162.  
  163.  
  164. Have fun ;D
  165.  
  166.                          My thanks and gratitude goes to:
  167.                          --------------------------------
  168.  
  169.                      ----CODE_INSIDE----- ;for helping in cracking
  170.                      -----BLAcKgH0sT------;for being good friend :)
  171.                      -------FusS------    ;asm / keygenning helper
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.