Hi,all of you.
Today, i post 2 tut in oder to use Olly for cracking 2 crackmes at http://crackmes.de.
("http://crackmes.de.
")
no.1:
target: Crackme#5 for duelist@beer.com
dowload here:
Click ("http://crackmes.de/download.php/due-cm5.zip?Crackme=428&CrackmesSession=CrackmeSession4b1695a087144c338f5fc9001781b58b")
no.2:
target: Crackme#2 for [v0!d]
dowload here:
Click here ("http://crackmes.de/download.php/vcrkme02.zip?Crackme=201&CrackmesSession=CrackmeSession4b1695a087144c338f5fc9001781b58b")
And no.1 as following:
<pre>
======================
Only use OllyDbg v1.08b
=======================
OllyDbg is a 32-bit assembler-level analyzing Degugger with intuitive interface.
OllyDbg is very friendly debugger.
OllyDbg run any WINDOWS (with chip intel x86).
...
OllyDbg can use for crack

------------------------------------------------------------------------------
This my no.1 crack for me in OllyDbg.
Target: Duelist's Crackme #5
Author: duelist@beer.com
Crack it by: luucorp@yahoo.com
Crackme#5 is packed,so we must find Origin Point (OP).
And Crackme#5 have 2 goals:
1.Remove Nag
2.Box "Unregistered" -> box "Registered"
We load due-cm5.exe in OllyDbg (F3 -> Open)
-->warning: Entry Point Alert -->OK.
In window "CPU-main..." we are staying Entry point:
Disassembler as:
00406600 > 53 PUSH EBX
00406601 51 PUSH ECX
00406602 52 PUSH EDX
00406603 56 PUSH ESI
00406604 57 PUSH EDI
00406605 55 PUSH EBP
A program_Packed before unpacking, it usually saves register (EBP,ESI,EDI,..) into Stack by using intruction push, as we see above.
Of course, When unpacking to finish then program_Packed will restore value that saved in Stack by using pop, So we will use OllyDbg:
Ctrl+S
type:
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
click button Find.
OllyDbg leads us to the followings:
0040665D 5D POP EBP <-------restore value in Stack
0040665E 5F POP EDI
0040665F 5E POP ESI
00406660 5A POP EDX
00406661 59 POP ECX
00406662 5B POP EBX
00406663 FFE0 JMP EAX <-----EAX= Original Point (1)
We set breakpoint at 00406663 ( line (1) )
And press F9 for program_Packed to unpack itseft, wait until program Paused at line(1).
Remove breakpoint at line(1) by press F2.
And now, EAX=401000=Original Point(OP) we go to OP by F7.
EIP are staying at 401000, but we don't understand any instruction, why?
because Olly doesn't analyze this para code before, So we tell OllyDbg that please analyze it

Let OllyDbg do: We press Ctrl+A
We have code as the following:
004010C1 > 68 00200000 PUSH 2000 ; /Style = MB_OK|MB_TASKMODAL
004010C6 . 68 5C204000 PUSH DUE-CM5.0040205C ; |Title = "Unregistered"
004010CB . 68 17204000 PUSH DUE-CM5.00402017 ; |Text "Please..."
004010D0 . 6A 00 PUSH 0 ; |hOwner = NULL
004010D2 . E8 94010000 CALL DUE-CM5.0040126B ; \MessageBoxA
004010D7 . 6A 00 PUSH 0 ; /lParam = NULL
004010D9 . 68 B8104000 PUSH DUE-CM5.004010B8 ; |DlgProc = DUE-CM5.004010B8
004010DE . 6A 00 PUSH 0 ; |hOwner = NULL
004010E0 . 6A 01 PUSH 1 ; |pTemplate = 1
004010E2 . FF35 0F214000 PUSH DWORD PTR DS:[40210F] ; |hInst = NULL
004010E8 . E8 12010000 CALL DUE-CM5.004011FF ; \DialogBoxParamA
004010ED .^EB C2 JMP SHORT DUE-CM5.004010B1
For printing nag then the code begins from 004010C1 to 4010D2.
we see ">" at 004010C1:
004010C1 >
so we click left mouse on this instruction, press Ctrl+R , Olly will goto window "Ref...."
We see in this window first line:
0040105C|jmp short ..
click double mouse on this lines, olly return "CPU-MAIN.."
That means jmp to prinf(" Unregistered"

, so we will fix it don't printf.
Do it, we jump to after MessageBoxA -> must jmp to address 004010D7.
On this line:
0040105C . EB 63 JMP SHORT DUE-CM5.004010C1
you press Space,
you type "JMP SHORT 004010D7"
Click Assemble
click Cancel
As NAG removed.
Next, we can goto this code:
00401130 > 68 5C204000 PUSH DUE-CM5.0040205C
; /lParam = 40205C " Unregistered"
00401135 . 6A 00 PUSH 0 ; |wParam = 0
00401137 . 6A 0C PUSH 0C ; |Message = WM_SETTEXT
00401139 . 6A 03 PUSH 3 ; |ControlID = 3
0040113B . FF75 08 PUSH DWORD PTR SS:[EBP+8] ; |hWnd
0040113E . E8 3A010000 CALL DUE-CM5.0040127D ; \SendDlgItemMessageA
How to find para above code

click right mouse+Search for+All ref -> click double mouse on line " Unregistered" order 2)
Now, We must find string as :" Registered"
We press Shift+Tab (twice)
Ctrl+B
in box lable ASCII, we type " Registered" (no colon)
Enter
OllyDbg goto address 40204F, here have string " Registered",0
As What Do you know fix on line 00401130 ??????????
press Tab (twice)
this on line:
00401130 > 68 5C204000 PUSH DUE-CM5.0040205C
; /lParam = 40205C " Unregistered"
press Space
type : "push 40204F"
Click Assemble
Click Cancel
As you replace from " Unregistered" to " Registered"

Finish goals 2.
==================>PRESS F9.
</pre>
If you want patcher for this crackme#5 then tell me.
Greets to: Oleh Yuschuk, TBD and u
thx
luucorp
luucorp@yahoo.com
See you again with tut no.2
<::TBD::edit> added bbcode code for formatting