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
@@ -292,6 +292,7 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const wchar_t *logfile, const
}
#endif
#if USE_MHOOK
// misc
InjectDLL(hProcess, L"kernel32.dll");
@@ -303,6 +304,7 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const wchar_t *logfile, const
// OpenGL
InjectDLL(hProcess, L"opengl32.dll");
InjectDLL(hProcess, L"gdi32.dll");
#endif
InjectDLL(hProcess, renderdocPath);