Native DLL mods 0.3
Real mod menus for Windows games you dont have the source to. The DLL loads into the game, hooks the call that shows each frame and draws goome on top of everything the game drew, so it should work in exclusive fullscreen too (the test games are windowed, I havent tried exclusive fullscreen). Same idea as ReShade or a Dear ImGui mod menu. They live in the examples repo, mods/native. Read the anti-cheat line first.
| Folder | Hooks | For |
|---|---|---|
dx11 |
IDXGISwapChain::Present |
Direct3D 11 games |
dx12 |
Present + ExecuteCommandLists |
Direct3D 12 games |
opengl |
wglSwapBuffers and SwapBuffers |
OpenGL games |
vulkan |
vkQueuePresentKHR |
Vulkan games |
Build one
git clone https://github.com/goome-ui/examples
cd examples/mods/native
bash build.sh dx11Swap dx11 for dx12, opengl or vulkan. It needs x86_64-w64-mingw32-gcc (or set CC) and drops build/dx11/version.dll. The script fetches MinHook, and the Vulkan headers for the vulkan one, nothing is checked in. With MSVC the same sources should build if you put those two on your include path, CI only builds them with mingw.
Put version.dll next to the game's exe and start the game. Insert hides and shows the menu.
How it loads
Windows loads the mod as version.dll and the mod forwards every real call to the system one, the game never notices. Plenty of games load version.dll and it only has sixteen functions to pass on. A dxgi.dll or winmm.dll proxy should work the same, common/proxy.c just lists other names (only the version.dll one is built and tested).
Once its in it starts a thread, makes a throwaway device to read the swapchain vtable and hooks present with MinHook. From then on goome draws offscreen every frame and the matching renderer backend puts it over the game's frame as one quad. dx12 also catches the game's command queue through ExecuteCommandLists, records its own command list and submits it there. vulkan hooks the create calls to find its device and swapchain, then records a pass over the image being shown.
Input goes through common/mod.h, which subclasses the game window with the Win32 platform backend, so eaten input never reaches the game.
Your own menu
The menu is goome_mod_menu_draw in common/goome_menu.h, a normal UI kit frame:
if (goome_ui_begin(u, 0)) {
if (goome_ui_window(u, "my mod", &m->x, &m->y, &m->w, &m->h, GOOME_WIN_MOVE | GOOME_WIN_CLOSE, &m->open)) {
goome_ui_toggle(u, "Noclip", &m->noclip);
goome_ui_slider(u, "Move speed", &m->speed, 0.25, 8, "%.2fx");
}
goome_ui_window_end(u);
goome_ui_end(u);
}Change the fields in goome_mod_menu and the widgets, the hooks dont care whats in it.
Testing it
testgame/ has a tiny game per api that spins a triangle and counts every mouse and key message it handles. The test loads the mod next to it, checks the menu shows up in a screenshot, drags a slider across the menu and checks not one message got to the game, then clicks empty space and checks that one does.
cd testgame
bash build.sh
RUNNER=native bash run.shOn Linux it runs under wine with Xvfb and mesa, RUNNER=wine SKIP=vulkan bash run.sh. CI skips vulkan everywhere, so the vulkan mod only gets compiled there. On the real Windows runner the log shows OpenGL and D3D11, under wine OpenGL, D3D11 and D3D12 all pass, and there is no D3D12 line in the Windows runner log. The runners have no GPU, so D3D runs on WARP, and none of it has run in a real game or against anti-cheat. Vulkan only runs where theres a working swapchain.