LoadLibraryA?

c++ / delphi package - dll injection and api hooking
Post Reply
CSixx
Posts: 1
Joined: Mon Aug 23, 2004 11:17 pm

LoadLibraryA?

Post by CSixx »

I am trying to hook Direct3DCreate8 but the target application uses LoadLibraryA and GetProcAddress to call the function.

Using a systemwide hook doesnt seem to work in this scenario.

------ Code -------

IDirect3D8* (WINAPI *Direct3DCreate8Next)(
UINT SDKVersion
);

IDirect3D8* WINAPI myCallback( UINT SDKVersion )
{
MessageBox(NULL, "This never gets called", "none", MB_OK);
return 0;
}

BOOL WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
{
HookAPI("d3d8.dll", "Direct3DCreate8", myCallback, (PVOID *) &Direct3DCreate8Next);

return true;
}

------ Code -------

Am I doing something wrong?

-C6
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Please try the latest "HookDirect3D" demo found in the latest madCodeHook version:

http://madshi.net/madCollection.exe (2.1.3.0)

Does that work? It also hooks Direct3DCreate8.
Post Reply