Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #20  
Old 05-28-2005, 09:55
jonwil jonwil is offline
VIP
 
Join Date: Feb 2004
Posts: 399
Rept. Given: 2
Rept. Rcvd 21 Times in 9 Posts
Thanks Given: 2
Thanks Rcvd at 67 Times in 35 Posts
jonwil Reputation: 21
I have a "fake dinput8.dll" with code like this

typedef HANDLE (WINAPI *cf) (LPCSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile);
cf Create_File;
typedef BOOL (WINAPI *rf) (HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped);
rf Read_File;

HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter)
{
Create_File = (cf)0x11DC317;
Read_File = (rf)0x11EC5CC;
HANDLE hfile = Create_File("main.common.ovl",0x80000000,2,0,3,0,0);
void *x = malloc(100000000);
DWORD b;
Read_File(hfile,x,100000000,&b,0);
FILE *f = fopen("main.out","wb");
fwrite(x,b,1,f);
fclose(f);
HMODULE h = LoadLibrary("c:\\windows\\system\\dinput8.dll");
Create = (di8c)GetProcAddress(h,"DirectInput8Create");
return Create(hinst,dwVersion,riidltf,ppvOut,punkOuter);
}

This is then being placed in the game folder on a machine with a fully unlocked target.
The game is then run and promptly crashes.
With the addition of debugging output statements (snipped for clarity) I have established that the crash happens right when the call to Create_File is made.
When I run IDA on my dump without the "nop call" fixups, I can identify that 11DC317 is the redirected createfile.
And 11EC5CC is the redirected readfile.
Although when I did this code
FILE *cf = fopen("fopen.bin","wb");
fwrite(Create_File,30,1,cf);
fclose(cf);
to see what was at that memory location, the values in fopen.bin didnt match with what IDA says is at 11DC317

So obviously something somewhere means that the functions I need are not at the addresses I think they are.
Running a debugger on this machine is not an option, is there some other way I could obtain the right addresses to call for the redirected Create_File and Read_File?
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Trymedia Activemark do encrypted data files? jonwil General Discussion 3 05-26-2005 19:13
Trymedia's ActiveMark Protection?!?! Seventh General Discussion 7 10-25-2004 14:36


All times are GMT +8. The time now is 15:04.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )