Add IAT based hooking to allow hooking 64bit opengl32.dll

* Needs vigorous testing in as many situations as I can think of, not least
  32bit, 64bit, D3D11, D3D9, OpenGL, managed apps, different windows SDKs,
  delay loading dlls (not sure if these will work), statically linked libs,
  LoadLibrary + GetProcAddress
* Credit goes to jslutter for originally bringing it to my attention &
  suggesting it.
* References:
  http://msdn.microsoft.com/en-us/magazine/bb985992.aspx
  http://msdn.microsoft.com/en-us/magazine/cc301808.aspx
  http://www.codeproject.com/Articles/6265/Process-wide-API-spying-an-ultimate-hack
This commit is contained in:
Baldur Karlsson
2014-08-06 15:43:16 +01:00
parent 23543d6a43
commit 12a30a7b97
10 changed files with 428 additions and 11 deletions
+2
View File
@@ -228,11 +228,13 @@ class OpenGLHook : LibraryHook
if(!m_EnabledHooks)
return false;
#if USE_MHOOK
if(GetModuleHandleA(DLL_NAME) == NULL)
{
RDCWARN("Failed to load %s - not inserting OpenGL hooks.", DLL_NAME);
return false;
}
#endif
bool success = SetupHooks(GL);