A clean, lightweight C++ library for controlling mouse input via DMA (Direct Memory Access) on a remote PC. Designed for game development, automation, and cheat development.
- Simple API - Just 3 main functions:
Initialize(),MoveMouse(),Shutdown() - No Configuration Files - Automatic process and signature discovery
- Low Latency - Direct memory writes bypass Windows input stack
- DMA-Based - Uses MemProcFS and FPGA hardware for external memory access
- Clean Code - Well-documented, easy to integrate into existing projects
- DMA Card - PCIe FPGA device (e.g., Squirrel, DMA35, etc.)
- Two PCs - Main PC (target) and Radar PC (controller with DMA card)
- Windows 10/11
- Visual Studio 2022 (or compatible C++ compiler)
- MemProcFS drivers installed
DMA-Mouse-Handler/
βββ src/
β βββ DMAMouse.h # Library header
β βββ DMAMouse.cpp # Library implementation
β βββ MouseHandler.cpp # Target PC program
β βββ Controller.cpp # Full controller example
β βββ Example.cpp # Simple usage example
βββ bin/ # Compiled executables and DLLs
βββ external/
β βββ memprocfs/ # MemProcFS library files
βββ build.bat # Build script
git clone https://github.com/J4sp3rTM/DMA-Mouse-Input-Injection.git
cd DMA-Mouse-Input-Injection
build.batbin\MouseHandler.exeNote the displayed offset (usually 0x44000).
bin\Example.exe#include "DMAMouse.h"
int main() {
DMAMouse mouse;
// Connect to target process
if (mouse.Initialize("game.exe")) {
// Move mouse right 100 pixels
mouse.MoveMouse(100, 0);
// Move mouse diagonally
mouse.MoveMouse(50, -50);
}
mouse.Shutdown();
return 0;
}#include "DMAMouse.h"
class MyCheat {
private:
DMAMouse mouse;
public:
bool Initialize() {
if (!mouse.Initialize("target.exe")) {
printf("DMA Init failed: %s\n", mouse.GetLastError());
return false;
}
return true;
}
void AimAt(int targetX, int targetY, int currentX, int currentY) {
int deltaX = targetX - currentX;
int deltaY = targetY - currentY;
// Smooth movement
while (abs(deltaX) > 1 || abs(deltaY) > 1) {
int stepX = deltaX / 10;
int stepY = deltaY / 10;
mouse.MoveMouse(stepX, stepY);
deltaX -= stepX;
deltaY -= stepY;
Sleep(1);
}
}
};Establishes DMA connection to target process.
- Parameters: Process name (e.g., "game.exe", "MouseHandler.exe")
- Returns:
trueon success,falseon failure - Example:
if (!mouse.Initialize("target.exe")) { printf("Error: %s\n", mouse.GetLastError()); }
Moves mouse by relative delta.
- Parameters:
deltaX: Horizontal pixels (positive = right, negative = left)deltaY: Vertical pixels (positive = down, negative = up)
- Returns:
trueon success,falseon failure - Example:
mouse.MoveMouse(10, -5); // Right 10, up 5
Checks if DMA connection is active.
- Returns:
trueif initialized and ready
Gets human-readable error message.
- Returns: Error description string
Closes DMA connection and cleans up resources.
Radar PC (DMA Card) Target PC
βββββββββββββββββββ ββββββββββββββββββββ
β Your Cheat β β MouseHandler.exe β
β βββββββββββββ β β βββββββββββββββ β
β β DMAMouse β β DMA Read β β g_MouseCtrl β β
β β Library ββββΌβββββββββββΌβ>β Structure β β
β βββββββββββββ β DMA Writeβ βββββββββββββββ β
β β <βββββββββΌββββββββββ β
βββββββββββββββββββ β Polls & Moves β
β Mouse Cursor β
ββββββββββββββββββββ
struct MouseControl {
int deltaX; // +0x00: X movement
int deltaY; // +0x04: Y movement
int active; // +0x08: Command flag
int signature; // +0x0C: 0xDEADBEEF
};- Offset Method (Fast) - Tries known offset
0x44000first - Pattern Scan (Fallback) - Scans memory for
0xDEADBEEFsignature - Verification - Validates structure before use
MouseHandler (Target PC):
cl /O2 /EHsc MouseHandler.cpp user32.lib /Fe:MouseHandler.exeExample (Radar PC):
cl /O2 /EHsc Example.cpp DMAMouse.cpp /I. external\memprocfs\vmm.lib user32.lib /Fe:Example.exe/O2- Optimize for speed/EHsc- Enable C++ exception handling/I.- Include current directory
- Check DMA card is properly connected
- Verify MemProcFS drivers are installed
- Run as Administrator
- Ensure MouseHandler.exe is running on target PC
- Check process name matches exactly
- Try truncated name if longer than 14 characters
- Verify MouseHandler.exe is the correct version
- Check if antivirus is interfering
- Try rebuilding both programs
This project is released under MIT License. Free to use, modify, and distribute.
This tool is for educational purposes and legitimate use cases (automation, accessibility, development). Users are responsible for complying with applicable laws and game/software terms of service. The authors are not responsible for misuse.
Pull requests welcome! Please:
- Fork the repository
- Create a feature branch
- Test your changes
- Submit a PR with clear description
- GitHub: J4sp3rTM
- Repository: DMA-Mouse-Input-Injection
Star β this repo if you find it useful!