home *** CD-ROM | disk | FTP | other *** search
- Tutorial Number 35
-
- Written by Eternal Bliss
- Email: Eternal_Bliss@hotmail.com
- Website: http://vipatcher.cjb.net
- Date written: 30th April 2000
-
- Program Details:
- Name: CrackMe 1 by DaNiEl-RJ
-
- Tools Used:
- Resource Editor (ExeScope in this case)
- SoftIce
- W32Dasm
-
- Cracking Method:
- Patching to Enable MenuItem
- Serial Sniffing
-
- Viewing Method:
- Use Notepad with Word Wrap switched on
- Screen Area set to 800 X 600 pixels (Optional)
-
- __________________________________________________________________________
-
-
- About this protection system
-
- The MenuItem to show the register window is disabled until you click on
- the About Box. I am not sure what is required of this CrackMe so the
- aims below are what I want to do. 8P
- Aims:
- 1) Enable the MenuItem "Damn! Where's the whole thing go???" at runtime.
- 2) Find a serial for my name.
- 3) Show the correct serial in a message box instead of the error message.
-
- _________________________________________________________________________
-
-
- About this tutorial
-
- I will try to be as detailed as possible again. I know that some of my
- tutorials are not very detailed. But that is because if you have been
- following them, you would be able to understand them.
-
- This is the first time I am using a resource editor for a CrackMe. It is
- very useful. Do download one and play with it. Sometimes, it is possible
- to crack a program just by using it especially if the program is based
- on a nag.
-
- _________________________________________________________________________
-
-
- Enable MenuItem
-
- Run the program a few times and look at the characteristics of the
- program eg. "Damn! Where's the whole thing go???" in the MenuItem.
-
- Disassemble the CrackMe with W32Dasm. In the String Data Reference (SDR),
- you will see "Delphi%.8X". I am not sure what "%.8X" means but I do
- know what Delphi is. 8)
-
- I read somewhere that enabling a Delphi Menu can be difficult when
- using Sice or just a Disassembler. So, I tried a Resource Editor and
- it works.
-
- Load the crackme in ExeScope. You will see
- 1) Header
- 2) Import
- 3) Resource
-
- Let's concern ourselves with just the Resource section...
- When you click on the + sign next to it, you will see
- 1) String
- 2) RCData
- 3) Cursor
- 4) Icon
-
- In a Delphi program, the forms (ie the windows you see) are in
- the RCData section of Resource. Click on the + sign next to
- RCData. You will see TFORM1. 8)
-
- This is the window you see when you run the program. Click on it.
- OMG... Tons of stuff. 8P
-
- Let's search for "Damn! Where's the whole thing go???" 8)
- You will find it at the bottem of TFORM1 in the form of
- object MainMenu1: TMainMenu
- object File1: TMenuItem
- Caption = '&File'
- object Damn: TMenuItem
- Caption = '&Damn! Where'#39's the whole thing???'
- Enabled = False
- OnClick = DamnClick
- end
- object About1: TMenuItem
- Caption = '&About'
- OnClick = About1Click
- end
- end
- end
-
- There... Did you see "Enabled = False" ??
- Click on the False and change it to True
- ie. Enabled = True
-
- Then save it. You will be prompted if you want to change
- the size of the program.
- Make sure that "Permit to change file size is not checked".
-
- Now, run the CrackMe. That MenuItem is enabled... 8)
-
- _________________________________________________________________________
-
-
- Serial Sniffing
-
- If you look at the SDR, you will see "No no no! :( Try again!" which is
- what you get when you enter the wrong serial. Double click on the line in
- SDR to bring you to the part of the code.
- A habit of mine is to double click again to make sure that there is no
- other instance where the string is used. There isn't in this case.
- You will be brought to 0042D57D. Below is a small snippet of the code
- with my comments pre-fixed with "<<".
-
- ------------------------Code Start------------------------
- :0042D556 8D55F8 lea edx, dword ptr [ebp-08]
- :0042D559 8B86E0010000 mov eax, dword ptr [esi+000001E0]
- :0042D55F E8FCC8FEFF call 00419E60
- :0042D564 8B45F8 mov eax, dword ptr [ebp-08]
- :0042D567 8B55FC mov edx, dword ptr [ebp-04]
- :0042D56A E86163FDFF call 004038D0 << Call before jump... hmm
- :0042D56F 750C jne 0042D57D << Jump to error message
-
- * Possible StringData Ref from Code Obj ->"Congratz cracker! hehehe"
- |
- :0042D571 B8ECD54200 mov eax, 0042D5EC << Go here if
- :0042D576 E87DFBFFFF call 0042D0F8 << you enter the
- :0042D57B EB0A jmp 0042D587 << correct code
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042D56F(C)
- |
- * Possible StringData Ref from Code Obj ->"No no no! :( Try again!"
- |
- :0042D57D B810D64200 mov eax, 0042D610 << Going to show the
- :0042D582 E871FBFFFF call 0042D0F8 << error message
- -------------------------Code End-------------------------
-
- If you are into patching, you can patch 0042D56F so that it will
- never jump to 0042D57D. Just NOP the jne 0042D57D by replacing 750C
- with 9090. I won't teach you how to replace them. Go and read my first
- few tutorials.
-
- If you want a serial, carry on. 8)
-
- Notice at 0042D56A there is a CALL before the conditonal jump. And
- above it, there is the mov eax and mov edx. Experience tells me that this
- "moves" the correct code and the code you enter into eax and edx.
- The CALL will check to see if they are the same. If they are the same, you
- won't take that jump that follows.
-
- **Note: Cracking needs a certain amount of guessing or intuition.
-
- Let's use Sice to check.
- I used hmemcpy by typing "bpx hmemcpy". Before that, I filled in my name
- Eternal Bliss and serial of 12345678.
- When you click on the "Check It!" button, you will break. Trace till you
- get to the part of the code I showed you.
-
- Indeed... eax after 0042D564 is my serial of 1234567 and
- edx after 0042D567 is the correct serial...
-
- CrackMe Cracked!
-
- __________________________________________________________________________
-
-
- Additional Points
-
- Now, lets try something more challenging... Show the correct serial
- in the message box instead of "No no no! :( Try again!"
-
- I am showing you the code again with different comments below.
-
- ------------------------Code Start------------------------
- :0042D564 8B45F8 mov eax, dword ptr [ebp-08]
- :0042D567 8B55FC mov edx, dword ptr [ebp-04] << address of [ebp-04]
- :0042D56A E86163FDFF call 004038D0 << contains the real serial
- :0042D56F 750C jne 0042D57D
-
- * Possible StringData Ref from Code Obj ->"Congratz cracker! hehehe"
- |
- :0042D571 B8ECD54200 mov eax, 0042D5EC
- :0042D576 E87DFBFFFF call 0042D0F8
- :0042D57B EB0A jmp 0042D587
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Address:
- |:0042D56F(C)
- |
- * Possible StringData Ref from Code Obj ->"No no no! :( Try again!"
- |
- :0042D57D B810D64200 mov eax, 0042D610 << 0042D610 contains
- :0042D582 E871FBFFFF call 0042D0F8 << the error message
- -------------------------Code End-------------------------
-
- [ebp-04] contains the address that stores the correct serial similar
- to 0042D610 which contains the error message and
- 0042D5EC which contains the congrats message.
-
- To find what is [ebp-04], type "d (ebp-04)" and in the data window
- you will see D0 1D B9 00 ....
- The address is actually in dword format. So to change the data window to
- show dword format, you do a "dd (ebp-04)"
- You will see 00B91DD0. I know this address is weird. To check, type
- "db 00B91DD0" and you will see the correct serial in byte format. 8)
-
- Now, at 0042D57D, you see that the error message is moved into eax to
- be shown to us. What we need to do is to replace it with the address
- that stores the correct serial ie 00B91DD0.
-
- Trace in Sice until you come to
- :0042D57D B810D64200 mov eax, 0042D610
- When the highlighted line is that, type
- a eip << this allows you to alter the code on this line
- mov eax, 00B91DD0 << this change the code
-
- Then press Enter to update the code. Copy the bytes of this line.
- We will need it to patch the program.
- F5 to let the program run.
- Voila... You see the correct serial.
-
- The bytes to replace B810D64200 (mov eax, 0042D610) with is
- B8D01DB900 (mov eax, 00B91DD0)
-
- _________________________________________________________________________
-
-
- Final Notes
-
- This tutorial is dedicated to all the newbies like me.
-
- My thanks and gratitude goes to:-
-
- All the writers of Cracks tutorials and CrackMes
- and also to all the crackers that have been supporting my site and project forum.