| Crackme by Basse | |||
| Intro | |||
|
I'm going to explain how this crackme works, but you won't find a valid
solution in here, if you want to find one, you'll have to brute it... TOOLS USED : WDASM |
|||
| Where to start? | |||
|
If we try to enter a combination 3 times, the program crashes...ans possibly
your computer too! How is that possible?
|
|||
| The code | |||
; Beginning of DlgProc 0040102C 55 push ebp * Possible Reference to Dialog: MYDIALOG, CONTROL_ID:0BB8, "" 0040106A 68B80B0000 push 00000BB8 0040106F FF7508 push [ebp+08] * Reference To: USER32.SetDlgItemTextA, Ord:0228h 00401072 E827020000 Call 0040129E ; Empty the edit box 00401077 58 pop eax ; pop hash 00401078 3DF700FB02 cmp eax, 02FB00F7 ; check hash 0040107D 7529 jne 004010A8 ; If not equal, inc counter 0040107F 6A40 push 00000040 ; Else good-guy message :) * Possible StringData Ref from Data Obj ->"Rev"
00401081 68AA304000 push 004030AA
* Possible StringData Ref from Data Obj ->"Good job! You made it!"
00401086 6879304000 push 00403079
0040108B FF7508 push [ebp+08]
* Reference To: USER32.MessageBoxA, Ord:01BBh
0040108E E8FF010000 Call 00401292 ; Display good-guy message
* Possible StringData Ref from Data Obj ->"Success!"
00401093 6870304000 push 00403070
00401098 FF350D314000 push dword ptr [0040310D]
* Reference To: USER32.SetWindowTextA, Ord:0259h
0040109E E807020000 Call 004012AA ; Put "success" in captionbar
Ok, what do we have here? If we press the
'test' button, a hash value get's checked with 02FB00F7h, if we would
like to patch, the jnz is the place :) This is what the API reference says about SetWindowsHookExA : The SetWindowsHookEx function installs an application-defined hook procedure into a hook chain. An application installs a hook procedure to monitor the system for certain types of events. A hook procedure can monitor events associated either with a specific thread or with all threads in the system. This function supersedes the SetWindowsHook function. HHOOK SetWindowsHookEx( int idHook, // type of hook to install We find it here : :00401143 817D0C10010000 cmp dword ptr [ebp+0C], 00000110 ; WM_INITDIALOG * Reference To: USER32.SetWindowsHookExA, Ord:025Dh
00401162 E849010000 Call 004012B0
00401167 0BC0 or eax, eax ; if Hook succeeds
00401169 7405 je 00401170
0040116B A303314000 mov dword ptr [00403103], eax ; Save hook handle
Next, the focus is set on the editbox, we are ready for input :) What happens in the above code? Well, when the DialogBox is created the
WM_INITDIALOG message is sent, so this code gets executed once at the
beginning. Next, the hook is set up. It' s a hook for WH_GETMESSAGE and the hook
routine starts at address 4011C0h. 004011C0 55 push ebp * Reference To: USER32.CallNextHookEx, Ord:0014h
004011D8 E89D000000 Call 0040127A
004011DD C9 leave
004011DE C20C00 ret 000C
004011E1 EB73 jmp 00401256 * Referenced by a (U)nconditional or (C)onditional Jump at Address:004011C7(C)
004011E3 837D0800 cmp dword ptr [ebp+08], 00000000 ; Check again
004011E7 756D jne 00401256
004011E9 8B5510 mov edx, dword ptr [ebp+10]
004011EC 817A0402010000 cmp dword ptr [edx+04], 00000102 ;WM_CHAR ?
004011F3 7561 jne 00401256
004011F5 8B4208 mov eax, dword ptr [edx+08] ; Move CHAR to eax
004011F8 8B4A08 mov ecx, dword ptr [edx+08] ; Move CHAR to ecx
004011FB 2A0508314000 sub al, byte ptr [00403108]
00401201 880D08314000 mov byte ptr [00403108], cl
00401207 D315FF304000 rcl dword ptr [004030FF], cl ; Start calculation
0040120D A008314000 mov al, byte ptr [00403108]
00401212 33C8 xor ecx, eax
00401214 C1E007 shl eax, 07
00401217 33C8 xor ecx, eax
00401219 C1E007 shl eax, 07
0040121C 33C8 xor ecx, eax
0040121E C1E007 shl eax, 07
00401221 33C8 xor ecx, eax
00401223 C1E003 shl eax, 03
00401226 33C8 xor ecx, eax
00401228 310DFF304000 xor dword ptr [004030FF], ecx
0040122E FF35FF304000 push dword ptr [004030FF] ; Store hash
... The next part, displays the hash in the captionbar (I think) Although I didn't see it (in XP) :( Ok, in the hook procedure all the CHARS are intercepted and the hash
is further calculated every time you press a key. The second byte var, is not needed for the algo, so we can cut it out
to speed up the bruting. mov al, byte ptr [serial+edi]
i=1
=> Note from the author if you want to start bruting <= It's only numbers, 0 - 9, and the length is 10. Basse Now you should be able to brute it in little time... |
|||
| Final notes | |||
|
If you have questions, or remarks abou this tutorial, feel free to mail me.
Detten |
|||
|
|