universal-imgui-hook
Provides engine tools for Unity (Mono or IL2CPP) games: lists classes, finds live objects, and reads or writes fields by name through the overlay.
Provides engine tools for Unreal Engine 4/5 games: lists classes, finds live objects, reads and writes fields by name, calls game functions, and can generate a C++ SDK.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Universal-Dear-ImGui-Hook
Draw your Dear ImGui menu inside any game, whatever its graphics API, and let Claude see and play it.
Quick start · Chat with Claude · AI remote control · API · Building · Compatibility

The graphics API is detected at run time: build once, inject anywhere. The same library also lets an AI assistant such as Claude Code see and play the game through MCP, read and change its memory and code, and browse the objects of Unity and Unreal Engine games. You can even chat with Claude from inside the game.
API | Windows (x86, x64) | Linux (x86-64, ARM64) |
Direct3D 9, 9Ex | ✅ | ✅ Windows DLL under Wine or Proton |
Direct3D 10, 11, 12 | ✅ | ✅ Windows DLL under Wine or Proton |
Vulkan | ✅ | ✅ |
OpenGL 3.0+ | ✅ WGL | ✅ GLX, EGL |
On Linux, the overlay works in X11, XWayland and native Wayland games.
Use it on single-player games and your own software. Anti-cheat systems detect injected DLLs and can ban your account. While the remote control is on, any program running on your machine can control the game, and with the memory tools, read and write its memory.
Contents
Get started | Go further | Project |
Sections marked with ▶ expand on click. What changed in each version is listed in the releases.
Related MCP server: local-game-mcp
Features
The overlay
🎨 One library for every API. The backend is picked from the first API that presents a frame. Inject before or after the game initializes its graphics.
⌨️ Menu input.
INSERT, or L3 + R3 on a controller, opens the menu, andF11removes the overlay and unloads the DLL; both keys are settings. While the menu is open, the game receives no keyboard, mouse or controller input, and an XInput controller navigates the menu. On Linux, the game gets no key or button presses and no motion, on X11 and native Wayland alike.🛡️ The overlay can't crash the game (MSVC builds on Windows, and Linux). An access violation or a C++ exception in the overlay, in a renderer backend or in your menu code, removes the overlay instead of taking the game down. The menu key brings it back.
🖼️ Images and frame capture.
uih::CreateTexture()turns RGBA pixels into an image forImGui::Image(), anduih::CaptureFrame()copies the game's frame, without the overlay, on every backend.🪟 Multiple windows. When the game presents to more than one window or swap chain, the overlay stays on one of them and follows the focus.
🖥️ Readable on any display. The interface follows the game window's DPI, or a fixed scale. Colors are right on sRGB, floating-point and HDR10 back buffers, where the overlay is as bright as the SDR content Windows shows.
The AI assistant
💬 Chat with Claude in the game. A chat window over the game where you tell Claude what to do. It looks at the game, plays it, reads or changes its memory, and answers in the chat.
🤖 AI remote control. Through MCP, an assistant such as Claude Code sees the game, shows messages to the player, presses keys and clicks. Your menu can give it tools of your own, such as teleport or spawn an item, which it calls like the built-in ones.
🔬 Memory and code tools. With the memory and advanced tools, it scans values, follows pointer chains, freezes values and finds the code that writes them. It also disassembles and patches that code, and builds signatures that survive an update.
⏸️ Plays at its own pace. It types text, drags the mouse, waits for the screen to change, and pauses or slows down the game while it thinks. The AI Advanced Features window shows everything it does.
🧩 Unity and Unreal Engine objects. With the engine tools, the assistant lists the classes of a Unity (Mono or IL2CPP) or Unreal Engine 4 or 5 game, finds their live objects, and reads and writes their fields by name instead of by address. On Unreal, the Engine tab of the AI Advanced Features window does the same in the game, calls its functions, and writes a C++ SDK of the game for a mod, a tool or an automated test of your own.
Shipping it
📦 No injector needed. The DLL can be loaded as
dinput8.dll, and the Linux library withLD_PRELOAD.🧱 No dependencies. Dear ImGui, MinHook, Zydis and the Vulkan headers are vendored, and the C and C++ runtimes are linked statically: you ship one file.
✅ Tested in real games. On every commit, the CI loads the library into DDNet and a Godot project on Windows and Linux, with Direct3D 11, Direct3D 12, Vulkan and OpenGL, and plays them through the MCP server on Linux. It also runs the Windows build of Godot under Wine with the DLL as
dinput8.dll, with OpenGL, Direct3D 11 and Vulkan. docs/COMPATIBILITY.md has the full list.
Quick start
1. Get the library
Prebuilt libraries are attached to each release, and every commit's builds are kept as workflow artifacts. Pick the one that matches the game, not your machine:
Game | File |
Windows, 64-bit |
|
Windows, 32-bit |
|
Linux, x86-64 or ARM64 |
|
These are the Universal-ImGui-Hook.dll and .so that the build below produces, renamed after their platform; the rest of this page uses the short name.
Each file also comes in four variants with some settings on, named with a suffix, such as Universal-ImGui-Hook-msvc-x64-ai.dll:
Suffix | Settings on | What it gives |
none | none | The menu alone |
|
| The remote control: an assistant such as Claude sees the game, shows messages and presses keys |
|
| The remote control and the memory tools, with the engine tools of Unity and Unreal games |
|
| The remote control and the advanced tools: typing, mouse, game speed, and the chat with Claude, without access to the memory |
| all three | Every tool of the assistant, with the chat and the advanced memory tools |
Which one to take:
You want to | Take |
Add your own menu or overlay to a game, without any assistant | the file without suffix |
Let Claude see and play the game: screenshots, messages, key presses, tools of your own, for automated playtesting |
|
Let Claude also inspect the game: scan, read and change values, search byte patterns, and, on Unity and Unreal, read the objects by name, search their functions and properties and write the C++ SDK |
|
Chat with Claude in the game, and let it type, use the mouse and slow down the game, without access to its memory |
|
Use the Engine tab in the game and call the game's functions; follow pointer chains, freeze values, find the code that writes a value, disassemble and patch it, and make signatures |
|
On a single-player game, when in doubt, take -ai: it has everything. Take a smaller one to give Claude less access.
Use the variants for single-player games only: any program you run can then control the game, and with-memory or -ai its memory too.
Each release lists the SHA256 of its libraries in SHA256SUMS, and GitHub attests that this repository's CI built them:
gh attestation verify Universal-ImGui-Hook-msvc-x64.dll --repo Sh0ckFR/Universal-Dear-ImGui-Hook2. Or build it
Windows: open Universal-ImGui-Hook.sln in Visual Studio 2022 or newer and build Release|x64, or Release|Win32 for a 32-bit game. The DLL is build/vs/x64/Release/Universal-ImGui-Hook.dll, or in build/vs/x86/Release/ for Win32.
Linux:
sudo apt install cmake ninja-build g++ pkg-config libxcb1-dev
cmake --preset linux && cmake --build --preset linux
LD_PRELOAD=$PWD/build/linux/Universal-ImGui-Hook.so ./gameBuilding covers MinGW-w64, cross-compiling and the CMake options.
3. Make it yours
You only edit the example; the hook itself, in src/, needs no changes:
To change | Edit |
The menu |
|
Hotkeys, controller buttons, graphics API, interface scale |
|
AI remote control and its pipe or socket name |
|
Tools of your own for the assistant |
|
Fonts and style | A |
Usage
Windows
How to load it | What to do | What |
With an injector | Inject | Unloads the DLL; inject it again to bring the overlay back |
As | Rename the DLL to | Removes the overlay, and |
As dinput8.dll, the DLL exports DirectInput8Create and forwards it to the system library, so any game that imports DirectInput 8, or loads dinput8.dll as Godot does, loads it.
Logs (config.debugLog) go to OutputDebugString; read them with DebugView. The example DLL writes them when the game runs with the environment variable UIH_DEBUG=1.
Linux
LD_PRELOAD=/path/to/Universal-ImGui-Hook.so ./gameSteam game: set the launch options to
LD_PRELOAD=/path/to/Universal-ImGui-Hook.so %command%.Logs:
UIH_DEBUG=1prints them on stderr.F11: a preloaded library cannot leave the process, soF11removes the overlay and its hooks, andINSERTbrings them back.
Steam Deck. SteamOS is Linux:
Game | What to do |
Native Linux game | Set its launch options to |
Windows game under Proton | Use the Windows DLL as |
The controller buttons that open the menu (menuButtons) are read through XInput, which only the Windows DLL uses. In a native game, bind the menu key, INSERT by default, to a button of the Deck with Steam Input.
Settings
The example library's settings are compiled into it: edit example/config.cpp, next to dllmain.cpp, and rebuild.
void ApplySettings(uih::Config& config) {
config.menuKey = VK_INSERT; // opens and closes the menu
config.unloadKey = VK_F11; // removes the overlay, unloads the DLL
config.menuButtons = uih::GamepadL3 | uih::GamepadR3; // controller buttons held together, 0 to disable
config.backend = uih::Backend::None; // graphics API to hook, None detects it
config.scale = 0.0f; // interface size, 0 follows the DPI
config.remoteControl = false; // AI remote control
config.remotePipe = "universal-imgui-hook"; // name of its pipe (Windows) or socket (Linux)
config.remoteMemory = false; // memory tools of the remote control
config.aiAdvancedFeatures = false; // advanced tools and the AI Advanced Features window
}Setting | Values |
| Windows: virtual-key codes such as |
|
|
|
|
|
|
|
|
|
|
|
|
Writing your menu
The interface lives in example/menu.cpp. DrawMenu() is called every frame between ImGui::NewFrame() and ImGui::Render(), so any Dear ImGui code works there. The entry points, example/dllmain.cpp on Windows and example/preload.cpp on Linux, apply the settings and start the hook:
uih::Config config;
ApplySettings(config); // example/config.cpp
config.render = DrawMenu; // every frame
config.setup = LoadFonts; // when the ImGui context is created: fonts, style
config.module = module; // Windows: DLL unloaded by unloadKey
uih::Start(config);Images are created once from RGBA pixels and drawn like any ImGui texture:
static ImTextureData* logo = uih::CreateTexture(pixels, 64, 64);
ImGui::Image(logo->GetTexRef(), ImVec2(64, 64));The example menu is a tour of the common widgets: buttons, combo and list boxes, inputs, sliders, colors, tabs, trees, tables, plots, popups and draw lists, with imgui.png shown under the slider. Its Menu bar opens Dear ImGui's own demo window, which covers every function. example/image.cpp embeds the picture in the library and decodes it with stb_image.
Using the hook as a library
The repository is a CMake package. Link uih::uih to get include/uih.h and Dear ImGui's headers:
include(FetchContent)
FetchContent_Declare(uih
GIT_REPOSITORY https://github.com/Sh0ckFR/Universal-Dear-ImGui-Hook.git
GIT_TAG v2.1.0) # a release tag, for reproducible builds
FetchContent_MakeAvailable(uih)
target_link_libraries(my_overlay PRIVATE uih::uih)tests/consumer/ is a complete example, built by the CI. On Linux, linking uih::uih into a shared library applies src/linux/exports.map, which exports only the hooked functions.
Talk to Claude from the game
Chat with Claude in a window drawn over the game: ask it what it sees, or tell it what to do. It looks at the game, plays it, reads or changes its memory, and answers in the chat as it works.
flowchart LR
A["Chat tab of the<br/>AI Advanced Features window"] -- "your messages" --> B["remote/uih_chat.py<br/>(the bridge)"]
B -- "claude -p, one for<br/>the conversation" --> C["Claude Code"]
C -- "game tools" --> D["remote/uih_mcp.py"]
D -- "screenshots, keys,<br/>clicks, memory" --> E["The library in the game"]
B -- "the answers" --> AWhat you need
Claude Code | Installed and signed in: |
Python | 3.8 or newer, from python.org on Windows. Nothing to install with |
This repository | Cloned, to build the library and run the scripts in |
A single-player game | Anti-cheat systems detect injected DLLs. |
Step 1: get the library with the chat on
Download the -ai library of a release that matches the game, such as Universal-ImGui-Hook-msvc-x64-ai.dll (see Quick start): it has the settings below on. The -advanced library has the chat too, without access to the memory.
Or build it. In example/config.cpp, set these settings to true, or configure CMake with -DUIH_EXAMPLE_VARIANT=ai, which turns them all on (remote, memory and advanced build the other variants):
config.remoteControl = true; // the game can be controlled through a local pipe or socket
config.remoteMemory = true; // optional: Claude can read and change the game's memory
config.aiAdvancedFeatures = true; // the AI Advanced Features window and its chatThen build, as in Quick start: build/vs/x64/Release/Universal-ImGui-Hook.dll on Windows (build/vs/x86/Release/ for Win32), build/linux/Universal-ImGui-Hook.so on Linux.
Step 2: load the library into the game
Windows: the DLL must be loaded into the game, by any means. If it already is, with your own injector or as dinput8.dll next to the game, skip to the check below. Otherwise, start the game, wait for its window, then run this in a terminal opened in the repository:
python remote/uih_mcp.py inject game.exe build/vs/x64/Release/Universal-ImGui-Hook.dllgame.exe is the process name shown in the Task Manager (Details tab), or its PID. Give the process that shows the game window, not its launcher. inject only loads the DLL and exits: nothing else needs it.
Linux: start the game with the library preloaded:
LD_PRELOAD=$PWD/build/linux/Universal-ImGui-Hook.so /path/to/gameThe socket opens with the overlay's first frame, in the process that draws it, not in the launch scripts that preload the library too.
Check. The overlay shows up with the menu open: that is how you know the library is loaded. To check that the game also answers on its pipe or socket, however the library got in:
python remote/uih_mcp.py checkThe game answers on universal-imgui-hook. Graphics API: Vulkan, window 1024x768, keyboard focus: True, overlay menu open: True, memory tools: on, advanced tools: on.Add --pipe <name> if config.remotePipe is not the default.
Step 3: start the bridge
In a terminal opened in the repository, which you leave open while you play:
python remote/uih_chat.pyIt prints Connected once it has found the game. Start it before or after the game, in any order: it waits for the game, and for it to come back after a restart.
You never startremote/uih_mcp.py yourself for the chat: the bridge hands it to Claude Code, which starts it once and keeps it for the conversation. Run without arguments, it is an MCP server waiting for a client on its standard input, and does nothing on its own.
Step 4: chat
In the game, press INSERT to open the menu, click AI Advanced Features, and stay on the Chat tab. The top of the tab says Claude is listening in green. Type, then press Enter:
What do you see?
Find my health and keep it at 100.
Walk to the door and open it.
Type "gg" in the game's chat.
Why can't I buy this item?
Claude writes in the chat as it works, and the line Claude is working shows which tool it is using. Stop ends its answer, and New conversation makes it forget what was said.
To play, Claude closes the menu, since the game gets no keys or clicks while it is open. Its answers then show at the top of the screen, and INSERT brings the chat back.
Bridge options
Option | Default | Effect |
|
| The game's |
| Claude Code's default |
|
|
| The Claude Code executable |
It runs Claude Code headless (
claude -p) with the tools ofremote/uih_mcp.pyand no other tool: no shell, no file access.It starts it as soon as it finds the game and keeps it for the whole conversation, writing it each of your messages, so answers start without waiting for Claude Code to load. New conversation starts a new one.
It runs from its own folder in the temporary directory, so none of your
CLAUDE.mdfiles apply. The conversation is kept there: if Claude Code stops, the next message resumes it.
Troubleshooting
You see | Do |
| The library is not in the game: inject it into the process that shows the window, with the same architecture (x64 DLL for a 64-bit game). Some launchers start the game as a second process, such as Godot's |
The bridge stays on | Same as above, or |
|
|
Claude is not connected in the chat | The bridge is not running, or runs with another |
| Install Claude Code, or give its path with |
| Run |
Claude cannot press keys or read the memory | The switches at the top of the window are off, or |
Remote control by an AI assistant
The library can let an AI assistant such as Claude Code see the game, show messages to the player, press keys and click, and optionally read and write the game's memory. It works with every graphics API, and on Linux with X11, XWayland and native Wayland games.
The assistant speaks the Model Context Protocol (MCP) with remote/uih_mcp.py over standard input and output, and the script talks to the library over a local named pipe (Windows) or Unix socket (Linux):
flowchart LR
A["Assistant, such as Claude Code"] -- "MCP on stdin and stdout" --> B["remote/uih_mcp.py"]
B -- "local named pipe or Unix socket" --> C["The library in the game"]Set it up
1. Turn it on and load the library into the game, as in steps 1 and 2 of the chat. Only config.remoteControl is required; the other settings add tools, as the table below shows. config.remotePipe names the pipe, \\.\pipe\universal-imgui-hook by default, or the socket, $XDG_RUNTIME_DIR/universal-imgui-hook. python remote/uih_mcp.py check tells you whether the game answers.
2. Register the MCP server with the assistant, once. You do not start uih_mcp.py yourself: the assistant does when a session starts, and talks to it over its standard input and output. With Claude Code:
claude mcp add game -- python C:/path/to/Universal-Dear-ImGui-Hook/remote/uih_mcp.pyOn Linux, use python3 /path/to/Universal-Dear-ImGui-Hook/remote/uih_mcp.py. With another remotePipe, add --pipe <name> after the script. Other MCP clients, such as Claude Desktop, take the same command in their configuration:
{
"mcpServers": {
"game": { "command": "python", "args": ["C:/path/to/Universal-Dear-ImGui-Hook/remote/uih_mcp.py"] }
}
}3. Ask. Start a new session of the assistant, or run /mcp in Claude Code, and talk about the game:
Ask | Needs |
Look at the game and tell me what you see. |
|
Write "Well done!" in the game for 5 seconds. |
|
Walk right to the edge of the platform, then jump. |
|
Open the overlay menu and describe it. |
|
Click on "New game" in the main menu. |
|
Find my money in memory and set it to 99999. |
|
Type "gg" in the chat, then wait for the next round to start. |
|
Find my health, keep it at 100, and find a pointer to it that survives a restart. |
|
Find the instruction that takes my health away, show me the code around it, and patch it out. |
|
Which tools each setting gives
With | The assistant gets |
| The tools: screenshot, message, keys, clicks, game info, and tools of your own |
| The memory tools and the engine tools |
| The advanced tools: typing, mouse, waiting, game speed, and the AI Advanced Features window with the chat |
All three | The advanced memory tools: pointers, watch list, what writes, disassembler, patches, signatures |
Tools
Tool | Effect |
| The current frame, without the overlay, at most 1280 pixels wide or high by default |
| A message to the player at the top of the screen, drawn by the overlay, for 10 seconds by default |
| Holds keys for a duration, 150 ms by default; |
| Clicks at a point of the last screenshot, with the left, right or middle button |
| Graphics API, window size, keyboard focus, menu state, whether the memory and advanced tools are on, and the speed of the game when it is not real time |
Memory tools
With remoteMemory, the assistant also gets memory tools, like those of a memory editor such as Cheat Engine:
Tool | Effect |
| Value scan of the writable memory ( |
| Hexadecimal dump, with the first bytes decoded as numbers and as a pointer; writes a value or bytes, code included |
| Byte pattern with |
| The game's modules with their base address and size |
Addresses are hexadecimal or module+offset, such as game.exe+1a2b3c. With aiAdvancedFeatures, they can also be pointer chains: [game.exe+1a2b3c]+10 is the address 0x10 bytes after the one stored at game.exe+1a2b3c.
Engine tools
With remoteMemory, the assistant also sees the objects of Unity and Unreal Engine games, by their classes and fields instead of bytes:
Unity: the library finds the runtime of the game's scripts, Mono or IL2CPP, and calls its C API, which it does not link.
Unreal Engine 4.22 to 5.x: it finds the engine's name table and object array in the game's memory, and reads the classes, structs, enums, properties and functions from them. It calls functions through
UObject::ProcessEvent, which it finds in the virtual table of the objects.
Tool | Effect |
| The engine, its scripting runtime and its version, such as Unity 2022.3.10f1 with IL2CPP, or Unreal Engine 5.3 |
| The assemblies of the game's scripts (the packages on Unreal), or their classes whose name contains a filter, such as |
| The methods and fields (functions and properties on Unreal) of every class whose name contains a text, such as |
| A class: its parents, its fields with their type and offset (or static, const), inherited ones included, and its methods with their parameters |
| The live objects of a class, such as every |
| Reads a field of an object or a static field, and writes it when given a value: numbers, booleans, strings, enums, structs such as |
| Calls a method on the game's main thread and returns its result, or the exception it threw; on Unreal, a function of an object or a static one, with structs as JSON objects ( |
| Unreal: writes a C++ SDK of the game, its own packages by default or |
Ask, for example: Find the player object, tell me its health, and set its speed to 10. The assistant lists the classes of Assembly-CSharp, describes the player's class, finds its instance and reads or writes the fields.
Unreal names may have spaces, such as the blueprint function Get Health Ratio: in the commands of the protocol, they go between double quotes.
A C++ SDK of an Unreal Engine game
engine_dump, or the Dump C++ SDK button of the Engine tab, writes the classes, structs, enums and functions of the running game to one header, such as %TEMP%\MyGame-SDK-5.3-20261127-164021.hpp, and gives its full path. The header needs nothing else, neither Unreal's headers nor this library: include it in a DLL of your own, C++17, built with MSVC, MinGW-w64, GCC or Clang, and inject that DLL into the game: a mod, a tool or an automated test.
uesdk::WaitForInit()finds the engine again at each launch: the name table, the object array andProcessEvent, and checks they are those of the game that was dumped, the same build. Until then, and when it fails,uesdk::LastError()says why.Each property is an accessor,
player->Health(), that reads and writes the game's memory; each function a wrapper,player->Heal(50), whose out parameters are references. Offsets are found again by name when the game's are not those of the dump. An accessor reads the object's memory directly, as the game does: use objects found again recently, since the game frees those it destroys.uesdk::Instances<SDK::APlayer>(),uesdk::FindObject()andSDK::APlayer::StaticClass()find the objects.Functions must run on the game thread:
uesdk::GameThread::Run()runs code there and waits for it,Post()does not wait. A call that faults in the game's code returns false with MSVC builds, and the game goes on.Call
uesdk::Shutdown()before the DLL unloads.
#include "MyGame-SDK-5.3-20261127-164021.hpp"
DWORD WINAPI TestThread(void* module) {
if (!uesdk::WaitForInit(30000))
return 1; // uesdk::LastError() says why
while (!(GetAsyncKeyState(VK_END) & 1)) {
for (SDK::APlayerCharacter_C* player : uesdk::Instances<SDK::APlayerCharacter_C>())
player->Health() = player->Health_Max(); // keeps the player alive while testing a level
if (GetAsyncKeyState(VK_F5) & 1) // moves the player up, to reach a spot to test
uesdk::GameThread::Run([] {
if (auto* player = uesdk::FirstInstance<SDK::APlayerCharacter_C>()) {
SDK::FVector at = player->K2_GetActorLocation();
at.Z() += 500;
SDK::FHitResult hit{}; // an out parameter
player->K2_SetActorLocation(at, false, hit, true);
}
});
Sleep(100);
}
uesdk::Shutdown();
FreeLibraryAndExitThread(static_cast<HMODULE>(module), 0);
}
BOOL WINAPI DllMain(HMODULE module, DWORD reason, void*) {
if (reason == DLL_PROCESS_ATTACH)
CloseHandle(CreateThread(nullptr, 0, TestThread, module, 0, nullptr));
return TRUE;
}The names are the game's: a property Health Max becomes Health_Max(), a blueprint class gets the prefix A for actors, U for other objects and F for structs, as in Unreal's C++. Dump the SDK again after each update of the game: the header refuses another build. On Linux, the header works the same, except GameThread, which has nothing to run on: call the functions from a hook of the game's own.
Advanced features and the AI Advanced Features window
With config.aiAdvancedFeatures = true, the assistant also gets these tools:
Tool | Effect |
| Types Unicode text, for chat boxes and text fields; a new line presses Enter |
| Moves the cursor to a point of the last screenshot, or drags from one point to another with a button held |
| Waits until a share of the frame's pixels has changed, 1% by default, or for a timeout: use it after a loading screen or an animation, instead of taking screenshots in a loop |
| Pauses the game while the assistant thinks, slows it down (0.25 for a fast fight) or brings it back to real time; while it is paused, each key, click or wait runs it for its duration, and |
and, with remoteMemory too:
Tool | Effect |
| Follows a pointer chain, |
| Finds the pointers to an address, those stored in a module first: |
| A watch list of values, each with a type and a label; a frozen value is written again every frame |
| The instructions that write a value, or read it, decoded, with their hit counts: hardware breakpoints on every thread, like a debugger's data breakpoint |
| x86 and x64 instructions at an address, and optionally those before it, with module+offset, bytes, exported functions, and the module+offset and symbol of the addresses they branch to or read |
| Changes the game's code, such as |
| A byte pattern unique in its module, with |
The example menu then shows an AI Advanced Features button, which opens a window provided by the library, uih::DrawAIAdvancedFeatures():
Part of the window | What it does |
Chat | Talk to Claude from the game while |
Activity | The assistant's commands and their answers, newest first |
Switches | Pause the assistant's input (keys, clicks, typing, mouse) or its memory tools, without rebuilding; and the speed of the game, to resume a game the assistant paused |
Watch list | The values watched by the assistant or the player, updated live, with a checkbox to freeze each one, a value to write, and a form to add one |
Pointers | A pointer chain followed as you type it, and a pointer scan whose results go to the watch list in one click |
What writes | The instruction watch on an address, with each instruction, decoded, its hit count and the bytes before it |
Patches | The code the assistant patched, with a button that restores each patch, or all of them |
Engine | Unreal Engine games: their classes, structs and enums with a filter, or with Functions and Properties the members of every class whose name holds it, one click opening its class with the function ready to call or the property among the live values of its first object; a class's parents, properties with offsets, enum values and functions with their signatures; its live objects; the values of an object's properties, updated live and written on Enter; a form that calls a function on the game thread; and the Dump C++ SDK button, with the path of the header and a button that copies it |
Tools of your own
Your code can give the assistant tools of its own, next to the built-in ones: it knows the game, where the assistant only sees pixels and bytes.
uih::RegisterTool() takes a name, a description, the JSON Schema of the arguments and a function. The function receives the arguments as JSON and returns the text the assistant reads. It runs in the frame of the overlay, on the thread of the render callback, so it can use the game's objects as your menu does:
uih::RegisterTool("teleport", "Moves the player to x, y, z in world units, and returns where the player ended up.",
R"({"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"z":{"type":"number"}},"required":["x","y","z"]})",
[](const std::string& arguments) {
Vector3 to{std::stof(uih::ToolArgument(arguments, "x")), std::stof(uih::ToolArgument(arguments, "y")),
std::stof(uih::ToolArgument(arguments, "z"))};
game::LocalPlayer()->SetPosition(to); // your game's code
return "The player is at " + game::LocalPlayer()->Position().ToString();
});uih::ToolArgument()reads one argument without a JSON library.An exception thrown by the function reaches the assistant as an error.
The example registers
example_menu, which reads and sets the slider and the checkbox of its menu.The tools need
remoteControlonly. The assistant sees those registered when its session starts: in Claude Code, run/mcpto reconnect after registering more.python remote/uih_mcp.py checklists them.
Good to know
Any program you run can use the pipe or the socket, so the remote control is off by default. Other machines cannot, nor, on Linux, other users. Turn it on for single-player games only: anti-cheat systems detect injected DLLs.
With
remoteMemory, any program you run can also read and write the game's memory through the pipe or the socket; on Linux, that bypasses Yama's ptrace restrictions for programs of your user.One game per pipe or socket name: a second game started with the same name logs that the remote control is unavailable.
unloadKeystops the remote control along with the overlay.
While you type to the assistant, the game does not have the focus. Keys and clicks then reach it as window messages, or X11 events on Linux, which games that read the keyboard or mouse state directly (DirectInput, raw input) do not see, and neither does the overlay menu on Linux. With the focus, a click moves the player's cursor, except at a point another window covers, where it goes as a window message. Click the game window after sending your request, or let the assistant play on a second screen.
While the overlay menu is open, the game receives no keys: the assistant can close it with
insert.The assistant plays turn by turn, a screenshot and a few keys at a time: fine for menus, puzzles and slow games, not for reflexes.
On Linux, keys and clicks go through the X server's XTEST extension; without it, they are sent as events to the window. Native Wayland games get them as Wayland events, handed to the listeners of their pointer and keyboard the next time they read their events: the compositor's pointer does not move, and a game that reads no events, such as one stopped by
game_speed 0, gets them once it runs again (the command answers an error after one second).Typed text reaches games that read text input, as chat boxes do; games that read the keys themselves see only Enter and Tab, so use
press_keyfor them. On Linux, a character missing from the keyboard layout is mapped to a free keycode while it is typed, which the X server's other applications see too.Screenshots of HDR back buffers, with more than 10 bits per channel, fail.
A value scan also finds copies of the value: change it in the game and narrow the scan until one address is left.
memory_what_writessets debug register 3 of every thread of the game on Windows: a debugger attached to the game, or a game that uses that register, sees the change. On Linux, it asks the kernel for a hardware breakpoint on each thread (perf events), which unprivileged processes get whilekernel.perf_event_paranoidis 2 or lower. Ubuntu sets 4, so runsudo sysctl kernel.perf_event_paranoid=2once per boot. Threads started later are watched within half a second.memory_patchchanges code that the game's threads may be running. On Windows, they are suspended while the bytes change, and the patch waits for none of them to be inside those bytes; on Linux, they keep running, and a patch of up to 8 bytes within an aligned 8-byte word is written at once. A thread that returns into the middle of patched bytes, from a call they hold, still runs a cut instruction. Code generated at run time, by a JIT, may be generated again over a patch.memory_disassembleandmemory_signaturedecode x86 and x64 code only: on ARM64 Linux, they answer that the processor is not supported, andmemory_patchdoes not check where the instructions end.
engine_instanceslists the objects of the exact class: ask for each subclass by its name. Destroyed Unity objects are left out. An object is recognized by its header and checked against its fields, so for a class with no reference or boolean field, and not a Unity object, a freed object whose memory was not reused yet can still be listed.On Unreal Engine, the library finds the name table and the object array by their contents and checks every offset it uses against objects all games have. It was tested on layouts built from Epic's engine headers (5.8 and 4.22) and on a shipped Unreal Engine 4.27 game; a game whose engine was modified, or whose object array or names are encrypted, gets an error. It reads properties of every type and writes numbers, enums, bools, names, structs and object references, not strings, arrays or maps.
Unreal functions are called through
UObject::ProcessEvent, found as the virtual function that testsFUNC_Nativein the function's flags, and checked by a call ofKismetMathLibrary::Add_IntIntbefore the first one: when other virtual functions test the same flag, the first that returns the right sum is kept. Finding it decodes the game's x86, x64 or ARM64 code. Arguments are numbers, bools, enums, names, strings, structs and objects; delegates, arrays, maps and sets cannot be passed, and a fault in the game's code fails the call without stopping the game or the overlay, on Linux and with MSVC builds on Windows.engine_callwaits for the game's main thread: on Windows, the thread of its window, which runs the call in its next message; on Linux, the thread reading its X events. A game whose main thread is stuck, such as during a loading screen, answers after 10 seconds with an error. On Unity, structs cannot be passed as arguments.The C++ SDK maps the properties it knows the C++ type of: numbers, bools (bitfields as
BitRef), enums, names, strings, objects, classes, weak pointers, arrays and structs. Delegates, texts, maps, sets and the like are opaque bytes of their size. By default it holds the game's own packages and the engine types they use;allwrites every package, several megabytes, which a compiler takes some seconds to read.Only one copy of the hook runs in a process: a second DLL built from this library, injected beside the first, does not start until the first is unloaded, since both would hook the same functions.
To write your own client instead of remote/uih_mcp.py, see the protocol: one text command per line on the pipe or socket.
API
Everything is in include/uih.h, in the uih namespace.
Function | Description |
| Installs the hooks on a worker thread and returns. Safe to call from |
| Removes the overlay, releases the GPU resources on the rendering thread and removes the hooks. Blocks; do not call it from |
| The API the overlay is drawn with, |
| Menu state, also toggled by |
| Whether the hook runs with |
| Image from RGBA pixels, uploaded by the active backend on the next frame and again after a backend switch. Any thread. Returns null once |
| Releases an image on the next frame. |
| A tool of your own for the assistant, run in the frame of the overlay; false when the name (1 to 64 letters, digits, |
| Copies the game's next frame, without the overlay, as RGBA pixels. Waits for that frame on any thread except the render callback's; returns false on timeout, or with a back buffer of more than 10 bits per channel (HDR). |
| Default | Description |
|
| Called every frame, between |
|
| Called when the ImGui context is created, and again if the game switches devices or windows |
|
| Restricts the hook to one API; |
|
| Virtual-key codes on Windows, X11 keysyms on Linux |
|
| Controller buttons held together to toggle the menu, |
|
| Interface size; |
|
| Windows: module freed by |
|
|
|
|
| Serves the remote control on a named pipe for local processes (Windows), or a Unix socket for the user's processes (Linux) |
|
| Name of that pipe, |
|
| With |
|
| With |
From C and other languages
include/uih_c.h has the same functions for C, and for languages that call C, such as Rust, Zig or Python's ctypes. They are compiled into the same library, so it is still one DLL or .so. Draw your menu from the render callback with Dear ImGui's C bindings, such as cimgui:
#include "uih_c.h"
static void render(void) { /* your menu, with cimgui */ }
void start_overlay(void) {
uih_config config;
uih_config_init(&config); // the defaults of uih::Config
config.render = render;
uih_start(&config);
}uih_capture_frame() hands the pixels to a callback instead of filling a std::vector, and uih_create_texture() returns the ImTextureData* as a void*. No exception leaves these functions.
Tools of your own work the same way. The callback answers through uih_tool_answer(), or through uih_tool_fail() for an error. uih_tool_argument() copies a value into your buffer and returns its length, as snprintf() does. There is nothing to free:
static void teleport(const char* arguments, uih_tool_result* result, void* context) {
char x[32];
uih_tool_argument(arguments, "x", x, sizeof(x));
if (!move_player(atof(x)))
uih_tool_fail(result, "the player cannot move there");
else
uih_tool_answer(result, "moved");
}
uih_register_tool("teleport", "Moves the player to x.",
"{\"type\":\"object\",\"properties\":{\"x\":{\"type\":\"number\"}},\"required\":[\"x\"]}",
teleport, NULL);How it works
flowchart LR
A["The game presents a frame"] --> B["The hooked present function<br/>(Present, vkQueuePresentKHR, *SwapBuffers)"]
B --> C["Your render callback<br/>draws the ImGui menu"]
C --> D["The overlay draws on<br/>the game's back buffer"]
D --> E["The real present"]Start() hooks the present function of each graphics API (Present, vkQueuePresentKHR, *SwapBuffers), found through dummy objects with MinHook on Windows and by symbol interposition on Linux. In each present, the overlay runs your render callback and draws the ImGui data on the game's back buffer. While the menu is open, the game's input functions report nothing, and faults in the overlay are caught so they remove the overlay instead of crashing the game.
The details, from hook points and input blocking to teardown, faults, frame capture and the remote control server, are in docs/ARCHITECTURE.md.
Building
Target | Output | CMake presets |
Windows game, 64-bit |
|
|
Windows game, 32-bit |
|
|
Native Linux game |
|
|
Each preset builds into build/<preset>.
Visual Studio 2022 or newer, with the "Desktop development with C++" workload. Pick one:
Universal-ImGui-Hook.slnbuilds the DLL anduih_hostwithout CMake, intobuild/vs/<x64|x86>/<configuration>/.Open the folder: Visual Studio reads
CMakePresets.json.Command line:
cmake --preset msvc-x64, thencmake --build --preset msvc-x64.
From an MSYS2 UCRT64 shell, or with a winlibs toolchain in PATH:
pacman -S mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja
cmake --preset mingw-x64 && cmake --build --preset mingw-x64With the mingw-x64 and mingw-x86 presets and the toolchain files in cmake/:
System | Packages |
Debian, Ubuntu |
|
Fedora |
|
Arch |
|
macOS (Homebrew) |
|
With the linux preset:
Distribution | Packages |
Debian, Ubuntu |
|
Fedora |
|
Arch |
|
At run time, it only needs libxcb and glibc, but a glibc at least as recent as the build machine's. To share the library or use it in the Steam Linux Runtime, build it on an old distribution or take the prebuilt one. Set CC=clang CXX=clang++ before configuring to use Clang.
Options are passed at configure time, such as -DUIH_BUILD_TESTS=ON:
Option | Default | Effect |
|
| The example DLL or shared object |
|
|
|
|
| Static C and C++ runtimes |
|
| Linux with GCC: AddressSanitizer and UndefinedBehaviorSanitizer in every target, for the tests |
Minimum versions: CMake 3.21, Visual Studio 2022, mingw-w64 11 with GCC 13, GCC 13 or Clang 18 on Linux; Windows 10 at run time. The mingw-w64 headers of Ubuntu 22.04 are too old for D3D12.
Tests
-DUIH_BUILD_TESTS=ON builds uih_host, which renders a solid color with one API and checks the overlay, and registers its scenarios with CTest:
cmake --preset msvc-x64 -DUIH_BUILD_TESTS=ON && cmake --build --preset msvc-x64
ctest --test-dir build/msvc-x64 -C ReleaseSome tests press real keys and move the mouse. They are skipped when the host window does not have the focus, so leave the machine alone while they run.
tests/README.md describes every scenario, how to run the tests without a GPU or under the validation and debug layers, the Linux tests, the real-game tests and what the CI checks.
docs/COMPATIBILITY.md lists the games, graphics APIs and toolchains the CI tests on every commit. It also gives the cost of the overlay, measured with
uih_host --bench: at most 0.07 ms per frame on an RTX 4070 SUPER, whatever the API, with the menu open or closed.
Contributing
Bug reports, fixes and features are welcome:
CONTRIBUTING.md gives the principles and rules of the project.
docs/ARCHITECTURE.md maps where the code is and how it works.
Report security problems privately, as SECURITY.md explains.
Limitations
CaptureFrame()only copies 8-bit and 10-bit back buffers: HDR output's floating-point back buffers are not captured, and the frame of an HDR10 swap chain comes with its PQ values as they are, which look washed out.On an HDR10 swap chain, the overlay draws its colors with the PQ curve when the game set the color space after the hook started, or when the game's window is on a display in HDR mode. A game injected late on an SDR display, whose HDR10 output Windows converts, shows the overlay with wrong colors until it sets the color space again, as when HDR is turned off and on in its settings.
A Vulkan swap chain created before the hook has no overlay until the game recreates it. Its presents report
VK_SUBOPTIMAL_KHR, to which games respond by recreating it.Native ARM64 Windows games are not supported: MinHook only handles x86 and x64.
game_speedslows down the clocks the game reads through Windows. A game that times itself with the processor's counter alone (rdtsc), which is rare, keeps running in real time.MinGW-w64 builds of the DLL survive C++ exceptions in the overlay, but not access violations, since MinGW-w64 has no structured exception handling. The released DLLs are built with MSVC.
Input is read from the X server, or, for native Wayland games (SDL with
SDL_VIDEODRIVER=wayland, GLFW, Godot with--display-driver wayland, Vulkan or EGL on awl_surface), from the listeners of theirwl_pointerandwl_keyboard. The wheel scrolls the menu in games that read the mouse buttons from the X server, and in Wayland games. Input methods are not handled, and a pointer the game has grabbed stays grabbed while the menu is open.On Wayland, a pointer the game locked (
zwp_locked_pointer_v1) stays locked while the menu is open: its relative motion moves the menu's cursor instead, which the compositor does not draw. Keys are read with the game's keymap through libxkbcommon, opened at run time, or with the US layout when it is not installed. Listeners set withwl_proxy_add_dispatcher, and those of a protocol version newer than the library knows, are not read, nor input that a game reads on an event queue of its own from inside its presents. The menu is drawn at a scale of 1 on Wayland.32-bit games, OpenGL ES, and games that link their GL or Vulkan loader statically are not supported.
game_speedneeds the library preloaded, since it stands forclock_gettime(). A paused game that sleeps until a time it computed from its own clock may spin a core until it runs again.
The limits of the assistant's tools are in Good to know.
Credits
This project stands on the work of the open source community, and thanks everyone behind it:
The libraries it is built with: Dear ImGui by Omar Cornut and its contributors, the interface this whole project exists to draw; MinHook by Tsuda Kageyu, which places every hook on Windows; Zydis by zyantific, the disassembler of the memory tools; the Vulkan-Headers of the Khronos Group; stb_image by Sean Barrett, for the example's picture.
What the CI runs on: Mesa's llvmpipe and lavapipe, and mesa-dist-win by pal1000, which let every graphics API render without a GPU; DDNet and Godot, open source games that the CI plays on every commit; and Wine, on which it runs the Windows build as a Linux or Steam Deck player does.
The projects that explored the same problem: kiero by Rebzzel, where this project started, and UniversalHookX, hudhook (in Rust) and HydraHook (for DirectX): have a look at them too, one may fit your project better.
The Model Context Protocol, an open standard that lets any assistant use the remote control.
Contributor | What |
Author and maintainer | |
ImGui and input hooks | |
The kiero library, the original base of the hooks | |
Dear ImGui and kiero updates, input hook improvements | |
Fix of the buffer count type |
Thanks as well to everyone who reported a bug, tested a game or starred the repository.
Support
This project is free and MIT-licensed. It is, as far as we know, the only ImGui hook that covers every major graphics API on both Windows and Linux, tests itself in real games on every commit, and lets an AI assistant play the game from inside it. Rebuilding it would take roughly 125 days of senior C++ work, about €81,000 at French freelance rates: some 18,000 lines, a third of them tests.
If it saved you time, consider sponsoring or starring the repository. ⭐
License
This project is licensed under the MIT License; see the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Let AI see and use your own Windows PC with your permission: screen, apps, mouse and keyboard.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Analytics, A/B tests, remote configs and player sentiment for games and apps, run by your AI agent.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI models to interact with Unity games at runtime by providing tools to list UI actions, inspect GameObjects, capture screenshots, and manage scenes.9MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to play local Windows games through low-level keyboard/mouse input, screen capture, OCR, and per-game profiles for semantic actions.-
- AlicenseBqualityCmaintenanceEnables AI agents to visually design and iterate on Dear ImGui game UIs in real-time with live preview, input simulation, and a wide range of widgets and tools.849MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with running games in real time — introspecting game state, simulating keyboard and mouse input to actually play, capturing screenshots, executing Lua code, hot-reloading files, and receiving push notifications when state changes.8MIT