Hooking DX9 Present & Reset
Hey,
I've started now writing some stuff for MW2 and I now wanted to make a gui/ingame menu.
As I like the ImGui menus (and have some menus already written for it) and wanted to use it here to.
The problem is I just can't seem to get it working.
I'm swapping the pointer to the original present/reset to my own functions (in the gameoverlayrenderer.dll) but they don't seem to get called.
My code to swap them (should work for all dx9 games):
Code:
Hooks::present_addr = FindPattern("gameoverlayrenderer.dll", Signatures::Present) + 2;
Hooks::reset_addr = FindPattern("gameoverlayrenderer.dll", Signatures::Reset) + 2;
Hooks::original_present = **reinterpret_cast<decltype(&Hooks::original_present)*>(Hooks::present_addr);
Hooks::original_reset = **reinterpret_cast<decltype(&Hooks::original_reset)*>(Hooks::reset_addr);
**reinterpret_cast<void***>(Hooks::present_addr) = reinterpret_cast<void*>(&Hooks::user_present);
**reinterpret_cast<void***>(Hooks::reset_addr) = reinterpret_cast<void*>(&Hooks::user_reset);
The original functions addresses are found but it doesn't get called. It's weird as the Steam overlay works fine
Did anyone get it an ImGui menu working? Appreciate any help