- Status
- Offline
- Joined
- Mar 3, 2026
- Messages
- 805
- Reaction score
- 457
Why bother writing a custom overlay from scratch when Valve already did the heavy lifting? If you're messing with Modern Warfare 2 (especially on IW4X), Steam's gameoverlayrenderer.dll is almost always loaded in the process space, even if you launched the game with Steam closed.
This is a clean way to render your internal menu and ESP without them showing up on OBS Game Capture. Essentially, we are hijacking Steam's drawing line to inject our own frames. While this snippet is tailored for MW2's D3D9 environment, the logic carries over to almost any titles that support the Steam overlay.
The Technical Meat
We're looking for the Present function inside the overlay module. By scanning for the specific pattern in the renderer, we can redirect the swapchain to our own rendering function before the frame is finished.
Stealth and Capture Results
This method is verified to be streamproof against OBS Game Capture and Discord's standard screen sharing. Since OBS hooks the game's swapchain directly, it misses the Steam overlay's extra drawing layer where our menu lives.
Quick Implementation Notes:
While others are struggling with flickering external overlays, using the native Steam renderer keeps your internal project looking professional and hidden from voyeurs.
anyone else using this method for other DX9 classics?
This is a clean way to render your internal menu and ESP without them showing up on OBS Game Capture. Essentially, we are hijacking Steam's drawing line to inject our own frames. While this snippet is tailored for MW2's D3D9 environment, the logic carries over to almost any titles that support the Steam overlay.
The Technical Meat
We're looking for the Present function inside the overlay module. By scanning for the specific pattern in the renderer, we can redirect the swapchain to our own rendering function before the frame is finished.
Code:
long __stdcall Present(IDirect3DSwapChain9* swapchain, const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion, DWORD flags) {
static IDirect3DDevice9* device = nullptr;
IDirect3DDevice9* current = nullptr;
swapchain->GetDevice(¤t);
// Handle device restoration for IW4X reloads
if (current && current != device) {
if (device)
device->Release();
device = current;
} else if (current) {
current->Release();
}
if (device)
RenderMenu(device);
return presentHook.stdcall<long>(swapchain, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, flags);
}
void hooks::Setup() {
// Pattern scan for the swapchain present offset in gameoverlayrenderer.dll
uintptr_t swapchainPresent = *reinterpret_cast<uintptr_t*>(memory::PatternScan(modules::gameoverlayrenderer_dll, "83 E6 ?? A1") + 4);
uintptr_t reset = swapchainPresent - 0x24; // "A1 ?? ?? ?? ?? 57 53 C7 45 ?? 00 00 00 00" + 1
resetHook = INLINE(*reinterpret_cast<void**>(reset), Reset);
presentHook = INLINE(*reinterpret_cast<void**>(swapchainPresent), Present);
}
Stealth and Capture Results
This method is verified to be streamproof against OBS Game Capture and Discord's standard screen sharing. Since OBS hooks the game's swapchain directly, it misses the Steam overlay's extra drawing layer where our menu lives.
Quick Implementation Notes:
- Make sure the overlay is actually enabled in your settings, or the DLL might not initialize the hooks properly.
- If you see flickering, check your device release logic — IW4X can be picky when the device reloads.
- This isn't a bypass for kernel-level AC screenshotting, but for standard streaming/recording, it's solid.
While others are struggling with flickering external overlays, using the native Steam renderer keeps your internal project looking professional and hidden from voyeurs.
anyone else using this method for other DX9 classics?