LunaHook-mirror/LunaHook/engine64/pchooks.cpp

16 lines
530 B
C++
Raw Permalink Normal View History

2024-10-03 14:53:59 +08:00
#include "pchooks.h"
bool pchooks::attach_function()
{
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);
2024-02-07 20:59:24 +08:00
PcHooks::hookGDIFunctions();
PcHooks::hookGDIPlusFunctions();
return true;
2024-10-03 14:53:59 +08:00
}