# PyMemoryEditor A pure-Python library (built on [ctypes](https://docs.python.org/3/library/ctypes.html)) that lets you **inspect, modify and search the memory of any running process in a few lines of Python** — Cheat Engine workflows on Windows, Linux and macOS! ---
Read, write and scan the memory of any process — straight from Python.
One unified API. Three operating systems. No C compiler. No native build step.
Runs on Windows · Linux · macOS — 32-bit and 64-bit.
Tweak a value in a running game · inspect a live program's state · harvest data straight from RAM.
--- ## Install ```bash pip install PyMemoryEditor ``` To also install the bundled GUI app (a Cheat Engine-style scanner), use the `app` extra: ```bash pip install "PyMemoryEditor[app]" pymemoryeditor ``` For faster scans on large processes, add the `speed` extra. It pulls in NumPy and automatically vectorizes the numeric scan comparison loop — ~10–30× faster on selective scans: ```bash pip install "PyMemoryEditor[speed]" ``` To let an AI assistant drive the library over the Model Context Protocol, use the `mcp` extra (see [below](#let-an-ai-assistant-do-it-mcp)): ```bash pip install "PyMemoryEditor[mcp]" ``` 📖 Full guide at **[Read the Docs](https://pymemoryeditor.readthedocs.io)**. --- ## See it in action ```python from PyMemoryEditor import OpenProcess with OpenProcess(name="game.exe") as process: # Scan the whole process for every address holding the value 100. for address in process.search_by_value(int, value=100): print(f"Found at 0x{address:X}") # Read the current value, then write a new one back. current = process.read_int(address) process.write_int(address, current + 500) ``` That's it — read, write or scan another process in three lines, the same way on every platform. --- ## Let an AI assistant do it (MCP) PyMemoryEditor ships a **Model Context Protocol server**, so an AI assistant can run the whole loop itself: > *"Find the health value in my game. It's 100 right now."* > > It scans, asks you to take damage, refines the matches, and hands you the address. ```bash pip install "PyMemoryEditor[mcp]" claude mcp add pymemoryeditor -- pymemoryeditor-mcp ``` Or in any client that reads `mcpServers` JSON (Claude Desktop, editors, …): ```json { "mcpServers": { "pymemoryeditor": { "command": "pymemoryeditor-mcp", "args": [] } } } ``` Fourteen tools cover the full workflow, with scan results kept server-side behind a handle, so a 40 000-hit first scan costs a few tokens instead of your whole context. Read the [MCP guide](https://pymemoryeditor.readthedocs.io/en/latest/mcp.html) to learn more. --- ## 📖 Documentation Full documentation lives at **[pymemoryeditor.readthedocs.io](https://pymemoryeditor.readthedocs.io)** — installation, the Cheat Engine workflow, every method and parameter, the GUI app guide, platform notes and troubleshooting. A quick map of where to go:| Quick Start | Open a process, read, write and run your first scan. |
| Searching memory | Value scans, ranges, refining results, the Cheat Engine loop. |
| Pattern scan | Find code/data with byte signatures (AOB) and regex. |
| Pointers | Multi-level pointer chains and the live RemotePointer. |
| Pointer scan | Find static pointers that survive ASLR. |
| The GUI app | The bundled Cheat Engine-style scanner. |
| The MCP server | Let an AI assistant drive the scan/refine loop. |
| API reference | Every public class, method and parameter. |
| Platform notes | Permissions and quirks on Windows, Linux and macOS. |
| Troubleshooting | Common errors and how to fix them. |