Web : http://kickme.to/mxbnet
Contact Me : dheeraj_xp@yahoo.com


Main | Index

Fontastic 5.0

Type : Font editor
Protection : Serial
Tech : Serial fishing

Crack : Make a dead listing using W32DASM.
Search for string shown in when serial entered is worng.
Above this we can see real S/N

String ref ** "MRC-981-3925-1863"
0x47E0FB MOV EAX,0x47E200

Registration info :

S/N = MRC-981-3925-1863


if">Main | Index

Flash MX- VBOX

Type : Animation program
Protection : VBOX
Tech : Case Study

Crack : I gave up the idea of cracking Flash MX.This baby is protected by VBOX.Dumping and finding the real OEP was very easy.But fixing the IAT was realy boring.
Dreamweaver MX had only one API CALL encrypted by VBOX [ See my tutorial about it].
But here there are about 200 API CALLS encrypted by VBOX.I traced about 100 APIs but remaining APIs are only activated when we do something with the program ... i.e you work with FlashMX and explore every aspect .... my point is that rest of the APIs are only called occasionaly ... when user works with API.So i gave up the idea of fixing it.

Any way here is a breif tutorial about this :

Dumping can be done by putting a BPX GETVERSION after VBOX shows its BOX.Now click "Try" button.When we break in main program module just look few lines up ....

015F:00828864 55 PUSH EBP --- Real EP
015F:00828865 8BEC MOV EBP,ESP
015F:00828867 6AFF PUSH FF
015F:00828869 68D068B000 PUSH 00B068D0
015F:0082886E 68E4BD8200 PUSH 0082BDE4
015F:00828873 64A100000000 MOV EAX,FS:[00000000]
015F:00828879 50 PUSH EAX
015F:0082887A 64892500000000 MOV FS:[00000000],ESP
015F:00828881 83EC58 SUB ESP,58
015F:00828884 53 PUSH EBX
015F:00828885 56 PUSH ESI
015F:00828886 57 PUSH EDI
015F:00828887 8965E8 MOV [EBP-18],ESP
015F:0082888A FF15187BCE00 CALL [KERNEL32!GetVersion] --- we are here
015F:00828890 33D2 XOR EDX,EDX --- Dump here it will work
015F:00828892 8AD4 MOV DL,AH
015F:00828894 89159095C100 MOV [00C19590],EDX
015F:0082889A 8BC8 MOV ECX,EAX
015F:0082889C 81E1FF000000 AND ECX,000000FF
015F:008288A2 890D8C95C100 MOV [00C1958C],ECX
015F:008288A8 C1E108 SHL ECX,08
015F:008288AB 03CA ADD ECX,EDX

Find out the IAT Range [ CE73A8 TO CE85A4].Use ImpRec ...

OEP = 428864
RVA = 8E73A8
SIZE = 11FD

Click "GetImports" ... we can see a lot of invalid pointers .... these are nothing but VBOX routines which will give actual API address.I think FLASH MX TEAM has used VBOX to its full extend.It was realy easy to fix in the case of DreamweaverMX.Trace routine in Imprec fails...

Here is how these API call are made ...

API Emulation in VBOX
*****************

FLASH!.text ----------------------------------------------------------

015F:0082CE07 FF15E878CE00 CALL [00CE78E8] ---> VBOX Code .. Go Inside
015F:0082CE0D 3BC7 CMP EAX,EDI
015F:0082CE0F 89460C MOV [ESI+0C],EAX
015F:0082CE12 7514 JNZ 0082CE28

VBOX ------------------------------------------------------------------
015F:01EA0000 E8C7E51605 CALL 0700E5CC <--- We reach here.Go Inside
015F:01EA0005 698BA000000000000000IMUL ECX,[EBX+000000A0],00000000

VBOXTA!PREVIEW -------------------------------------------------------

015F:0700E5D2 53 PUSH EBX <--- we reach here
015F:0700E5D3 8945FC MOV [EBP-04],EAX 
015F:0700E5D6 895DF8 MOV [EBP-08],EBX
015F:0700E5D9 894DF4 MOV [EBP-0C],ECX
015F:0700E5DC 8955F0 MOV [EBP-10],EDX
015F:0700E5DF 8D45F0 LEA EAX,[EBP-10]
015F:0700E5E2 50 PUSH EAX
015F:0700E5E3 8D45F4 LEA EAX,[EBP-0C]
015F:0700E5E6 50 PUSH EAX
015F:0700E5E7 8D45F8 LEA EAX,[EBP-08]
015F:0700E5EA 50 PUSH EAX
015F:0700E5EB 8D45FC LEA EAX,[EBP-04]
015F:0700E5EE 50 PUSH EAX
015F:0700E5EF E812000000 CALL 0700E606
015F:0700E5F4 83C410 ADD ESP,10
015F:0700E5F7 8B45FC MOV EAX,[EBP-04]
015F:0700E5FA 8B5DF8 MOV EBX,[EBP-08]
015F:0700E5FD 8B4DF4 MOV ECX,[EBP-0C]
015F:0700E600 8B55F0 MOV EDX,[EBP-10]
015F:0700E603 5B POP EBX
015F:0700E604 C9 LEAVE 
015F:0700E605 C3 RET -->> RET to Win32API Address

Inside CALL 0700E606 -------------------------------------------------

015F:0700E613 56 PUSH ESI 
015F:0700E614 8B750C MOV ESI,[EBP+0C] 
015F:0700E617 FF760C PUSH DWORD PTR [ESI+0C]
015F:0700E61A E88EDAFFFF CALL 0700C0AD
015F:0700E61F 59 POP ECX
015F:0700E620 89460C MOV [ESI+0C],EAX = BFF7FFE7 -- API Address
015F:0700E623 85C0 TEST EAX,EAX
015F:0700E625 5E POP ESI
015F:0700E626 7561 JNZ 0700E689

EAX Holds API Address ...

Inside CALL 0700C0AD -------------------------------------------------

015F:0700C0C9 FF742408 PUSH DWORD PTR [ESP+08]
015F:0700C0CD 50 PUSH EAX
015F:0700C0CE E856000000 CALL 0700C129
015F:0700C0D3 59 POP ECX
015F:0700C0D4 8BF0 MOV ESI,EAX = BFF7FFE7
015F:0700C0D6 59 POP ECX
015F:0700C0D7 EB02 JMP 0700C0DB

Put BPMB CS:700C0D4 X
Trace Back.We can find all API and from where it is called ...But realy boring and some APIs are never called in normal working .... you will have to do all sort of thing with this baby to make that API call so that we can find from where it is called.

Inside Win32 API -----------------------------------------------------

015F:BFF7FFE4 C20400 RET 0004 
KERNEL32!VirtualAlloc 
015F:BFF7FFE7 55 PUSH EBP --- Here !!!
015F:BFF7FFE8 8BEC MOV EBP,ESP
015F:BFF7FFEA 83EC08 SUB ESP,08
015F:BFF7FFED 817D0C0000C07F CMP DWORD PTR [EBP+0C],7FC00000
015F:BFF7FFF4 53 PUSH EBX
015F:BFF7FFF5 56 PUSH ESI
015F:BFF7FFF6 57 PUSH EDI
015F:BFF7FFF7 760C JBE BFF80005

This means : CALL [00CE78E8] ---> CALL KERNEL32!VirtualAlloc

We can use IAT editor in ImpRec to fill this API ...But any way i got full version of FlashMX from warez .... who cares about this silly demo ...


PTR [EBP-70],B5F3
015F:00C400F0 C745FC01000000 MOV DWORD PTR [EBP-04],00000001
015F:00C400F7 B900000000 MOV ECX,00000000
015F:00C400FC 668CC9 MOV CX,CS
015F:00C400FF 32C9 XOR CL,CL
015F:00C40101 E361 JECXZ 00C40164
015F:00C40103 B443 MOV AH,43
015F:00C40105 CD68 INT 68 <----
015F:00C40107 66338558FEFFFF XOR AX,[EBP-01A8]
015F:00C4010E 663B4590 CMP AX,[EBP-70]
015F:00C40112 7550 JNZ 00C40164

EAX=601105B3 ; [EBP-70] = SS:0058B30C=B5F3

UnPacking :

BPMB #0030:00C3D79C W DR3

FCShare.text1

015F:600BD511 50 PUSH EAX
015F:600BD512 8B47F8 MOV EAX,[EDI-08]
015F:600BD515 0345FC ADD EAX,[EBP-04]
015F:600BD518 50 PUSH EAX
015F:600BD519 E8D20B0000 CALL 600BE0F0 <--- Unpack
015F:600BD51E 83C728 ADD EDI,28
015F:600BD521 83C40C ADD ESP,0C
015F:600BD524 8D47EC LEA EAX,[EDI-14]
015F:600BD527 3BC3 CMP EAX,EBX
015F:600BD529 72DE JB 600BD509
015F:600BD52B 8B7DFC MOV EDI,[EBP-04]
015F:600BD52E 3B7DF4 CMP EDI,[EBP-0C]
015F:600BD531 7423 JZ 600BD556 <--- Loop
015F:600BD533 8B86A0000000 MOV EAX,[ESI+000000A0]
015F:600BD539 FFB6A4000000 PUSH DWORD PTR [ESI+000000A4]
015F:600BD53F 03C7 ADD EAX,EDI
015F:600BD541 50 PUSH EAX
015F:600BD542 FF75F4 PUSH DWORD PTR [EBP-0C]
015F:600BD545 57 PUSH EDI
015F:600BD546 E8D8000000 CALL 600BD623
015F:600BD54B 83C410 ADD ESP,10
015F:600BD54E 84C0 TEST AL,AL
015F:600BD550 0F84C9000000 JZ 600BD61F ---> Extraction Error
015F:600BD556 FFB680000000 PUSH DWORD PTR [ESI+00000080]
015F:600BD55C 57 PUSH EDI
015F:600BD55D E852010000 CALL 600BD6B4
015F:600BD562 59 POP ECX
015F:600BD563 84C0 TEST AL,AL
015F:600BD565 59 POP ECX
015F:600BD566 0F84B3000000 JZ 600BD61F ---> Extraction Error
015F:600BD56C 8D86F8000000 LEA EAX,[ESI+000000F8]

Quickly restoring the patch in memory avoids page fault.
So each section act as an decryption key.

Patch :

Write String "Asshole" at end of file FCShare.dll and run it ... we can
see that there is no page fault.So that part is not part of key.

File offset : 46F60
In memory :

015F:6011CF60 41 73 73 68 6F 6C 65 00-00 00 00 00 00 00 00 00 Asshole.........
015F:6011CF70 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................

So we will use this place to write our code.


Winnt.h

#define PAGE_NOACCESS 0x01
#define PAGE_READONLY 0x02
#define PAGE_READWRITE 0x04
#define PAGE_WRITECOPY 0x08
#define PAGE_EXECUTE 0x10
#define PAGE_EXECUTE_READ 0x20
#define PAGE_EXECUTE_READWRITE 0x40
#define PAGE_EXECUTE_WRITECOPY 0x80
#define PAGE_GUARD 0x100
#define PAGE_NOCACHE 0x200
#define PAGE_WRITECOMBINE 0x400


Text1.Section
Flag : 60000020 -- Contains executable code + readable
Offset : 2DF


The section we where looking to patch have only Execute and Readonly permission.So we can't use runtime patching directly [ we will end up in page fault ].But there are loop holes ... If we can use some api with Ring0 prvg we can bypass this protection.

How To Patch This Baby :

What we are going to do is to change OEP to 6011CF40 using hex editor and quickly restore its OEP in memory so that Armadillo will think every thing is OKand do our stuff and then jump to real OEP

015F:6011CF40 60 PUSHAD -- NEW EP
015F:6011CF41 33FF XOR EDI,EDI
015F:6011CF43 E8EE79E65F CALL KERNEL32!GetCurrentProcessId
015F:6011CF48 50 PUSH EAX
015F:6011CF49 57 PUSH EDI
015F:6011CF4A 6A38 PUSH 38
015F:6011CF4C E8FC8CE75F CALL KERNEL32!OpenProcess
015F:6011CF51 8BF0 MOV ESI,EAX ---> Let us restore OEP in memory
015F:6011CF53 B804000000 MOV EAX,00000004 <-- Count
015F:6011CF58 B930CF1160 MOV ECX,6011CF30 <-- Buffer:Data To Write "40ED0300"
015F:6011CF5D BA48010860 MOV EDX,60080148 <-- Addr To Write
015F:6011CF62 6A00 PUSH 00
015F:6011CF64 50 PUSH EAX
015F:6011CF65 51 PUSH ECX
015F:6011CF66 52 PUSH EDX
015F:6011CF67 56 PUSH ESI
015F:6011CF68 E8687AE75F CALL KERNEL32!WriteProcessMemory --- Write orginal OEP
015F:6011CF6D 90 NOP -----> ===== Start Hook Routine =====
015F:6011CF6E A1C0C00C60 MOV EAX,[KERNEL32!VirtualProtect]
015F:6011CF73 A394120D60 MOV [600D1294],EAX
015F:6011CF78 C705C0C00C6090CF1160MOV DWORD PTR [600CC0C0],6011CF90
015F:6011CF82 61 POPAD
015F:6011CF83 E9B81DFAFF JMP 600BED40 -- JMP TO OEP
015F:6011CF88 0000 ADD [EAX],AL
015F:6011CF8A 0000 ADD [EAX],AL
015F:6011CF8C 0000 ADD [EAX],AL
015F:6011CF8E 0000 ADD [EAX],AL == Hook Function ===
015F:6011CF90 66C78090C70000EB28 MOV WORD PTR [EAX+0000C790],28EB -- Patch
015F:6011CF99 A194120D60 MOV EAX,[KERNEL32!VirtualProtect]
015F:6011CF9E A3C0C00C60 MOV [600CC0C0],EAX -- Restore API Address
015F:6011CFA3 B820000000 MOV EAX,00000020
015F:6011CFA8 6890120D60 PUSH 600D1290 <-- Buffer
015F:6011CFAD 6A00 PUSH 00
015F:6011CFAF 6A00 PUSH 00
015F:6011CFB1 6800CE1160 PUSH 6011CE00 <-- THread Func
015F:6011CFB6 6A00 PUSH 00
015F:6011CFB8 6A00 PUSH 00 -- Create a Thread to Patch after Some time
015F:6011CFBA E8AB9FE55F CALL KERNEL32!CreateThread
015F:6011CFBF C3 RET

At line 6011CF90 --- EAX=00C31000
Eax + C790 = 00C3D790

Thread Function :

015F:6011CE00 C60584D20A6045 MOV BYTE PTR [600AD284],45
015F:6011CE07 6A00 PUSH 00
015F:6011CE09 E8D1D0E65F CALL KERNEL32!ExitThread

It is seen that while we reach here data is ready to patch

Note : I get a PAge Fault while closing IE ? But program is working in registered mode..

Special Note to Armadillo programers : You $%#$%^! ,you have no right
to control my PC ... which is my private property.Kick Ass $%^$#%!


http://kickme.to/mxbnet
dheeraj_xp@yahoo.com

 

border:none;mso-border-alt:solid windowtext .5pt;