procmem

procmem

An MCP server for Windows process memory inspection/editing and crash dump analysis, enabling live memory scanning, patching, pointer resolution, disassembly, and offline dump examination via structured tool calls.

Category
访问服务器

README

procmem

An MCP server that gives a model full access to Windows process memory and crash dump analysis. Two tools: procmem for live process inspection and editing, dumpfile for offline crash dump analysis.

This is a Cheat Engine replacement built for LLMs. It was designed so a model can attach to a running process, scan for values, resolve pointer chains, patch bytes, disassemble code, and analyze crash dumps, all through structured tool calls instead of a GUI.

This is a Windows-only, security-sensitive tool. It calls VirtualQueryEx, ReadProcessMemory, WriteProcessMemory, VirtualAllocEx, VirtualProtectEx, and can generate direct syscall stubs to bypass EDR hooks. Only run it on machines you own, attached to processes you have permission to inspect.

Tools

procmem (live process memory)

Attach to a running process and work with its memory directly.

Core:

  • list_processes - list running processes (optional name filter)
  • attach / detach - open/close a process handle by name or PID
  • status - show current attachment, active freezes, snapshots, allocations
  • modules - list loaded modules with base address and size
  • regions - list memory regions with protection flags (VirtualQueryEx)
  • read / write - read or write a typed value at an address
  • read_struct - read multiple values at offsets in one call

Scanning:

  • scan - wildcard AOB (array of bytes) pattern scan across a module or all regions
  • scan_value - Cheat Engine-style value scan with comparison operators (eq, ne, gt, lt, changed, increased, decreased), multi-step narrowing with scan sessions
  • clear_scan - reset a scan session
  • pointer - resolve a pointer chain (base + offsets), raw or struct mode

Memory management:

  • protect - change memory protection (VirtualProtectEx)
  • allocate / free - allocate/free memory in the target process (VirtualAllocEx/VirtualFreeEx)
  • snapshot / diff - save a memory region and compare it later to find changes
  • dump - save a memory region to a file

Threads:

  • threads - list threads with IDs and state
  • suspend / resume - suspend or resume a thread by ID
  • freeze / unfreeze - continuously write a value to an address in the background
  • kill_all_freezes / list_freezes - manage active freeze loops

PE analysis:

  • get_exports - list exported functions (Export Address Table)
  • get_imports - list imported functions (Import Address Table)
  • get_sections - list PE sections with entropy analysis (high entropy = packed/encrypted)

Assembly:

  • disassemble - disassemble bytes at an address (Capstone, x86/x64)
  • assemble - assemble x86/x64 instructions (Keystone), optionally write result to an address
  • signature - generate an AOB signature from an address with smart wildcards on call/jmp offsets
  • aob_inject - atomic scan + patch: find a pattern, flip protection, write replacement bytes or assembled instructions, verify, restore protection
  • watch - poll an address until the value changes or a timeout is reached

File editing (offline binary patching):

  • file_open - open a PE file for offline editing (creates an automatic backup)
  • file_close - close the file, save changes, update PE checksum
  • file_read / file_write - read/write bytes by RVA or file offset, with optional disassembly
  • file_patch - AOB scan + replace in the file
  • file_find_cave - find code caves (sequences of 0x00 or 0xCC) for injection
  • file_strings - extract ASCII/Unicode strings from the file
  • file_scan - AOB pattern scan across the file
  • file_list - list currently open files

Direct syscalls:

  • syscall_resolve - resolve the System Service Number for an NT function via Hell's Gate / Halo's Gate (falls back to a known-SSN table if the function is hooked)
  • syscall_check - detect hooked ntdll functions (EDR detection)
  • syscall_stub - generate raw syscall stub bytes for a function
  • syscall_gadget - find a syscall; ret gadget in ntdll for indirect syscall techniques
  • syscall_mode - enable/disable direct syscall mode for future memory operations

Address format: hex (0x1234) or module+offset (game.exe+0x7A3B20). Value types: int, uint, int8, uint8, int16, uint16, int64, uint64, float, double, bytes, string, wstring, ptr.

dumpfile (crash dump analysis)

Load and analyze crash dumps offline, without the original process running.

  • load - load a dump file (auto-detects Windows minidump vs Linux ELF core)
  • close - unload the current dump
  • status - show what is loaded
  • info - crash details: exception code/name, faulting address, crash module + offset, OS version
  • threads - list threads in the dump
  • modules - list loaded modules with base addresses
  • mappings - list memory regions captured in the dump
  • registers - show register values for a thread (defaults to the crashing thread)
  • stack - show raw stack values from the stack pointer
  • read - read a typed value from the dump's memory (same interface as procmem)
  • scan - AOB pattern scan across dump memory
  • search_string - search for ASCII or Unicode strings in the dump
  • disassemble - disassemble code at an address in the dump

Supports Windows minidumps (.dmp, .mdmp) via the minidump package and Linux core dumps (ELF) via pyelftools.

Install

Requires Python 3.10 or newer and Windows (procmem uses the Windows API directly via ctypes). The dumpfile tool works on any OS for analyzing dumps collected elsewhere.

Install as a package:

pipx install git+https://github.com/cutlerbenjamin1-cmd/procmem

From a local checkout: pip install .

Or skip packaging entirely and run server.py directly:

pip install -r requirements.txt

Optional dependencies

The core tool (attach, read, write, scan, pointer chains) needs only pymem. Everything else is optional and the server still boots without it:

pip install pymem              # required: process memory access
pip install pefile             # PE analysis: exports, imports, sections, file editing
pip install capstone           # disassembly
pip install keystone-engine    # assembly (assemble, aob_inject with asm mode)
pip install minidump           # dumpfile: Windows minidump support
pip install pyelftools         # dumpfile: Linux core dump support

Or install everything at once:

pip install "procmem[all]"

Use it with an MCP client

procmem speaks MCP over stdio. Point your client at the procmem command (if installed as a package) or at server.py directly:

{
  "mcpServers": {
    "procmem": {
      "command": "procmem"
    }
  }
}

Or with a direct path:

{
  "mcpServers": {
    "procmem": {
      "command": "python",
      "args": ["/absolute/path/to/procmem/server.py"]
    }
  }
}

There is a ready-to-edit copy in example_config.json.

Configuration

All optional, set as environment variables:

  • OUTPUT_MAX_CHARS - hard cap on a single tool result before truncation (default: 15000).
  • MCP_DEBUG - set to true for stderr debug logging.

Examples

Attach to a process, scan for a health value, freeze it:

procmem(action="attach", process="game.exe")
procmem(action="scan_value", value=100, value_type="int", all_regions=true)
# change the value in-game, then narrow the scan:
procmem(action="scan_value", value=95, op="eq", scan_id="default")
# found it at 0x12345678 - freeze it at 999:
procmem(action="freeze", address="0x12345678", value=999, value_type="int", name="health")

Find and patch a conditional jump in a binary:

procmem(action="scan", pattern="74 0A 8B 45 ?? 89", module="game.exe")
# patch the JE (74) to JMP (EB):
procmem(action="aob_inject", pattern="74 0A 8B 45 ?? 89", replace="EB", pad="nop", module="game.exe")

Analyze a crash dump:

dumpfile(action="load", path="crash.dmp")
dumpfile(action="info")
# -> ACCESS_VIOLATION at 0x7ff612345678 in engine.dll+0x1A3B20
dumpfile(action="registers")
dumpfile(action="disassemble", address="0x7ff612345678")
dumpfile(action="search_string", search="error")

Check if ntdll is hooked (EDR detection):

procmem(action="syscall_check")
# -> hooked: ["NtReadVirtualMemory", "NtWriteVirtualMemory", ...], likely_edr: true
procmem(action="syscall_mode", value=true)
# future memory operations will use direct syscalls

How it works

procmem is a ~3700-line Python module that wraps the Windows memory API through ctypes. There is no C extension and no DLL injection. It opens a handle to the target process with OpenProcess and uses the documented NT API surface: ReadProcessMemory, WriteProcessMemory, VirtualQueryEx, VirtualProtectEx, VirtualAllocEx, VirtualFreeEx, CreateToolhelp32Snapshot. Thread control uses SuspendThread/ResumeThread. Pattern scanning is parallelized across CPU cores using subprocess workers.

The direct syscall feature resolves System Service Numbers from ntdll.dll's export table using Hell's Gate (read the stub at the export address, extract the SSN from the mov eax, <ssn> instruction) with Halo's Gate as a fallback (walk neighboring stubs when a function is hooked). This lets you detect EDR hooks and optionally bypass them for memory operations, which is useful in game anti-cheat and malware analysis contexts.

The file editing subsystem (file_open through file_list) works offline on PE files using pefile. It creates a backup before any modification, maps between RVA and file offset automatically, and updates the PE checksum on close. Code cave finding scans for long runs of null bytes or INT3 instructions where you can place injected code.

dumpfile parses Windows minidumps (MDMP magic) via the minidump package and Linux ELF core dumps via pyelftools. It presents a read/scan interface that mirrors procmem so the same workflow (read values, scan for patterns, disassemble) works on both live processes and crash dumps.

A word on what this is for

This was built for game modding, reverse engineering, malware analysis, and crash dump triage. It is the kind of tool that security researchers and game hackers use routinely, packaged so an LLM can drive it through structured calls instead of clicking through Cheat Engine or x64dbg.

It is not a rootkit, though it contains the building blocks of one. The direct syscall feature exists because EDR products and game anti-cheats hook ntdll, and if you are doing legitimate security research or game modding you need to be able to see that and work around it. If you are using this for unauthorized access to systems you do not own, that is on you.

License

MIT. See LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选