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

  1. ********************************************************************************************************************************************
  2.                     CrackMe #4
  3. ********************************************************************************************************************************************
  4.  
  5. Author:        n0p3x
  6. Protection:    CD Check
  7. URL:        http://www.phrozencrew.co.uk/crackme4.zip
  8. Tools:        SoftICE V4.05
  9.         W32Dasm V8.93
  10.         Hex-Editor
  11.  
  12.  
  13. --->    Intro...
  14.  
  15. Welcome to my next Tutorial !!!
  16. This is a very easy example of a CD Check :)
  17. The API that most of the time is used for CD Checks is "GetDriveTypeA".
  18.  
  19.  
  20. --->    Let's Begin...
  21.  
  22. Open the CrackMe, and a Message Box pops up saying:
  23.  
  24. "This program isn't being run from a CD, Please insert the CD"
  25.  
  26. Hehe offcourse it's not runned from a CD ;)
  27. But we're going to fool the program so it thinks we're running it from a CD :)
  28. Now click "Ok" and you'll see a window with 3 buttons (Exit, Re-Test CD, About), and an
  29. "Edit Box" which says:
  30.  
  31. "Invalid CD In Drive"
  32.  
  33. Now get into SoftICE (CTRL+D) and type "bpx GetDriveTypeA" followed by "enter".
  34. Then out of SoftICE (CTRL+D) and press the button "Re-Test CD" and SoftICE should popup.
  35. Now type "BC *" to clear the breakpoint and press (F12) 1 time and you'll see this:
  36.  
  37. --------------------------------------------------------------------------------------------------------------------------------------------
  38.  
  39. :0040108A 83F805                  cmp eax, 00000005            <--- Interesting Compare :)
  40. :0040108D 7526                    jne 004010B5                <--- If not equal we jump and get the bad Message Box, else continue
  41. :0040108F 6800100000              push 00001000
  42.  
  43. * Possible StringData Ref from Data Obj ->"Well Done"
  44.                                   |
  45. :00401094 6898204000              push 00402098
  46.  
  47. * Possible StringData Ref from Data Obj ->"This program is being run from "
  48.                                         ->"a CD"
  49.                                   |
  50. :00401099 6874204000              push 00402074
  51. :0040109E 6A00                    push 00000000
  52.  
  53. * Reference To: USER32.MessageBoxA, Ord:0000h
  54.                                   |
  55. :004010A0 E86D040000              Call 00401512
  56.  
  57. * Possible StringData Ref from Data Obj ->"Correct CD In Drive"
  58.                                   |
  59. :004010A5 68A2204000              push 004020A2
  60.  
  61. * Possible Reference to Dialog: DialogID_0001, CONTROL_ID:0065, ""
  62.                                   |
  63. :004010AA 6A65                    push 00000065
  64. :004010AC 53                      push ebx
  65.  
  66. * Reference To: USER32.SetDlgItemTextA, Ord:0000h
  67.                                   |
  68. :004010AD E85A040000              Call 0040150C
  69. :004010B2 5B                      pop ebx
  70. :004010B3 5D                      pop ebp
  71. :004010B4 C3                      ret
  72.  
  73. --------------------------------------------------------------------------------------------------------------------------------------------
  74.  
  75. Ok, here it Compares EAX with 00000005 (Which means CDROM Drive) and then followed by a "jne 004010B5".
  76. So to defeat this we can change the "jne 004010B5" into NOP (90) or we can change the "cmp eax, 00000005" into
  77. "cmp eax, 00000003" (which means Fixed Drive), we're gonna do the second patch.
  78. Now write down the address of the "cmp eax, 00000005" or keep in mind and disassemble the CrackMe with W32Dasm.
  79. Then press (SHIFT+F12) and fill in the address "0040108A" and press "Ok".
  80. Now look at the bottom of W32Dasm you'll see a line like this:
  81.  
  82. Line:148 Pg 3 and 4 of 21 Code Data @:0040108A @Offset 0000068Ah in File:crackme4.exe
  83.  
  84. The only thing important now is "@Offset 0000068Ah" write it down.
  85. Then close W32Dasm and open the CrackMe in your Hex-Editor.
  86. Now go to that address "0000068A" and change it into this:
  87.  
  88. 83F805
  89.  
  90. into
  91.  
  92. 83F803
  93.  
  94. Save the file and run it, a Message Box pops up saying that the CrackMe was runned from a CD :)
  95. That's all.
  96.  
  97.  
  98. --->    Greetings...
  99.  
  100. Everyone from TrickSoft            (www.TrickSoft.net)
  101. Everyone from Cracking4Newbies        (www.Cracking4Newbies.com)
  102. Everyone from Keygenning4Newbies    (Keygenning4Newbies.cjb.net)
  103. And You...
  104.  
  105.             Don't trust the Outside, trust the InSiDe !!!
  106.  
  107.                       Cya...
  108.  
  109.                     CoDe_InSiDe
  110.  
  111. Email:    code.inside@home.nl