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
LoadLibraryA?
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.
http://madshi.net/madCollection.exe (2.1.3.0)
Does that work? It also hooks Direct3DCreate8.