From 67c3e572d7ffd0a49bf5bf10fa80a30485e1d1b1 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Wed, 30 Jan 2019 15:02:23 -0500 Subject: [PATCH] hook x64 directx (untested) --- vnrhook/engine/match64.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vnrhook/engine/match64.cc b/vnrhook/engine/match64.cc index 15f34f1..bfece13 100644 --- a/vnrhook/engine/match64.cc +++ b/vnrhook/engine/match64.cc @@ -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); } }