Skip to content

Simple proof of concept showing how to hijack Windows Magnifier to create a transparent external overlay on any application (even in fullscreen mode) without code injection.

License

Notifications You must be signed in to change notification settings

ataoytun/MagnOverlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MagnOverlay

A PoC that hijacks Windows Magnifier to create a transparent overlay without injecting code into protected processes.

Note: This is a PoC with spaghetti code that demonstrates the technique, it's not meant to be production quality.

1.gif

How It Works

This project hijacks Windows Magnifier to create an overlay that works on top of any application, including games with anticheat protection:

  1. Launches Windows Magnifier
  2. Finds and hijacks its window by modifying properties
  3. Makes the window transparent, layered, and topmost*
  4. Renders content with DirectX 11 and ImGui

Key advantages:

  • No code injection into protected processes
  • No API hooking
  • No game file modifications
  • Works without directly interacting with protected processes

Implementation Details

HWND MagnifierOverlay::FindMagnifierWindow() {
    const char* magnifierClasses[] = {
        "Magnifier",
        "MagUIClass",
        "Screen Magnifier Fullscreen Window"
    };

    return Utils::FindWindowByClasses(magnifierClasses, 3);
}

Window style modifications:

SetWindowLongPtr(m_magnifierWindow, GWL_STYLE, originalStyle | WS_VISIBLE);
SetWindowLongPtr(m_magnifierWindow, GWL_EXSTYLE, (originalExStyle | WS_EX_LAYERED | WS_EX_TRANSPARENT) & ~WS_EX_NOREDIRECTIONBITMAP);
SetLayeredWindowAttributes(m_magnifierWindow, m_transparencyColor, 0, LWA_COLORKEY);

Detection Vectors

This method avoids many common detection vectors, but could still be detected through:

  1. Magnifier window style modifications
  2. Window transparency attributes
  3. Extended window styles (WS_EX_LAYERED, WS_EX_TRANSPARENT)
  4. Magnifier process monitoring
  5. Unusual window z-order placement

About

Simple proof of concept showing how to hijack Windows Magnifier to create a transparent external overlay on any application (even in fullscreen mode) without code injection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages