hook x64 directx (untested)

This commit is contained in:
Akash Mozumdar 2019-01-30 15:02:23 -05:00
parent 5aa4b982fd
commit 67c3e572d7

View File

@ -5,6 +5,14 @@
namespace Engine
{
void HookDirectX()
{
for (std::wstring DXVersion : { L"d3dx9", L"d3dx10" })
if (HMODULE module = GetModuleHandleW(DXVersion.c_str())) PcHooks::hookD3DXFunctions(module);
else for (int i = 0; i < 50; ++i)
if (HMODULE module = GetModuleHandleW((DXVersion + L"_" + std::to_wstring(i)).c_str())) PcHooks::hookD3DXFunctions(module);
}
void Hijack()
{
static bool hijacked = false;
@ -15,6 +23,7 @@ namespace Engine
PcHooks::hookGDIFunctions();
PcHooks::hookGDIPlusFunctions();
PcHooks::hookOtherPcFunctions();
HookDirectX();
}
__except (EXCEPTION_EXECUTE_HANDLER) { ConsoleOutput(HIJACK_ERROR); }
}