miscusi-peek/cheatengine-mcp-bridge
GitHub: miscusi-peek/cheatengine-mcp-bridge
一个通过 MCP 将 AI 代理与 Cheat Engine 连接,实现自然语言驱动的内存分析与逆向工程自动化的桥接项目。
Stars: 538 | Forks: 91
[演示](https://github.com/user-attachments/assets/a184a006-f569-4b55-858a-ed80a7139035)
# Cheat Engine MCP 桥接
**让数十亿美元的 AI 数据中心为您分析程序内存。**
创建修改项、训练器、安全审计、游戏机器人,加速逆向工程(RE),或用极少的时间对任何程序和游戏进行操作。
[](#) [](https://python.org)
## 问题
您正盯着数吉字节的内存。数百万个地址。数千个函数。找到*那个指针*、*那个结构*可能需要数天或数周的 manual 工作。
**如果可以问它呢?**
**这正是它的作用。**
- 停止点击十六进制转储,开始与内存对话。
## 您得到什么:
| 手动(Before) | AI 代理 + MCP(After) |
|----------------|------------------------|
| 第一天:查找数据包地址 | 第一分钟:“查找 RX 数据包解密钩子” |
| 第二天:追踪写入它的内容 | 第三分钟:“生成唯一 AOB 签名以使其持久更新” |
| 第三天:查找 RX 钩子 | 第六分钟:“查找移动操作码” |
| 第四天:记录结构 | 第十分钟:“创建十六进制到纯文本的 Python 解释器” |
| 第五天:游戏更新,重新开始 | **完成。** |
**您的 AI 现在可以:**
- 即时读取任何内存(整数、浮点数、字符串、指针)
- 跟随指针链:`[[base+0x10]+0x20]+0x8` → 毫秒级解析
- 自动分析结构并标注字段类型和值
- 通过 RTTI 识别 C++ 对象:*“这是一个 CPlayer 对象”*
- 反汇编并分析函数
- 使用硬件断点和 Ring -1 虚拟机进行隐形调试
- 等等更多功能!
## 工作原理
```
flowchart TD
AI[AI Agent: Claude/Cursor/Copilot]
AI -->|MCP Protocol - JSON-RPC over stdio| MCP
MCP[mcp_cheatengine.py - Python MCP Server]
MCP <-->|Named Pipe - Async| PIPE
PIPE["\\.\\pipe\\CE_MCP_Bridge_v99"]
PIPE <--> CE
subgraph CE[Cheat Engine - DBVM Mode]
subgraph LUA[ce_mcp_bridge.lua]
WORKER[Worker Thread - Blocking I/O]
MAIN[Main Thread - GUI + CE API]
WORKER <-->|Sync| MAIN
end
end
MAIN -->|Memory Access| TARGET[Target .exe]
```
## 安装
```
pip install -r MCP_Server/requirements.txt
```
或手动安装:
```
pip install mcp pywin32
```
## 快速开始
### 1. 在 Cheat Engine 中加载桥接
```
1. Enable DBVM in CheatEngine.
2. File → Execute Script → Open ce_mcp_bridge.lua → Execute
```
查找:`[MCP v11.4.0] Server started on \\.\pipe\CE_MCP_Bridge_v99`
### 2. 配置 MCP 客户端
添加到您的 MCP 配置(例如 `mcp_config.json`):
```
{
"servers": {
"cheatengine": {
"command": "python",
"args": ["C:/path/to/MCP_Server/mcp_cheatengine.py"]
}
}
}
```
重启 IDE 以加载 MCP 服务器配置。
### 3. 验证连接
使用 `ping` 工具验证连接:
```
{"success": true, "version": "11.4.0", "message": "CE MCP Bridge Active"}
```
### 4. 开始提问
```
"What process is attached?"
"Read 16 bytes at the base address"
"Disassemble the entry point"
```
## 43 种 MCP 工具可用
### 内存
| 工具 | 描述 |
|------|---------|
| `read_memory`, `read_integer`, `read_string` | 读取任意数据类型 |
| `read_pointer_chain` | 跟随 `[[base+0x10]+0x20]` 路径 |
| `scan_all`, `aob_scan` | 查找数值与字节模式 |
### 分析
| 工具 | 描述 |
|------|---------|
| `disassemble`, `analyze_function` | 代码分析 |
| `dissect_structure` | 自动检测字段和类型 |
| `get_rtti_classname` | 识别 C++ 对象类型 |
| `find_references`, `find_call_references` | 交叉引用 |
### 调试
| 工具 | 描述 |
|------|---------|
| `set_breakpoint`, `set_data_breakpoint` | 硬件断点 |
| `start_dbvm_watch` | Ring -1 隐形追踪 |
更多内容请参考 `AI_Context/MCP_Bridge_Command_Reference.md`
## 关键配置
### 防止蓝屏(BSOD)
## 示例工作流
**查找一个值:**
```
You: "Scan for gold: 15000" → AI finds 47 results
You: "Gold changed to 15100" → AI filters to 3 addresses
You: "What writes to the first one?" → AI sets hardware BP
You: "Disassemble that function" → Full AddGold logic revealed
```
**理解一个结构:**
```
You: "What's at [[game.exe+0x1234]+0x10]?"
AI: "RTTI: CPlayerInventory"
AI: "0x00=vtable, 0x08=itemCount(int), 0x10=itemArray(ptr)..."
```
## 项目结构
```
MCP_Server/
├── mcp_cheatengine.py # Python MCP Server (FastMCP)
├── ce_mcp_bridge.lua # Cheat Engine Lua Bridge
└── test_mcp.py # Test Suite
AI_Context/
├── MCP_Bridge_Command_Reference.md # MCP Commands reference
├── CE_LUA_Documentation.md # Full CheatEngine 7.6 official documentation
└── AI_Guide_MCP_Server_Implementation.md # Full technical documentation for AI agent
```
## 测试
运行测试:
```
python MCP_Server/test_mcp.py
```
预期输出:
```
✅ Memory Reading: 6/6 tests passed
✅ Process Info: 4/4 tests passed
✅ Code Analysis: 8/8 tests passed
✅ Breakpoints: 4/4 tests passed
✅ DBVM Functions: 3/3 tests passed
✅ Utility Commands: 11/11 tests passed
⏭️ Skipped: 1 test (generate_signature)
────────────────────────────────────
Total: 36/37 PASSED (100% success)
```
## 结论
您不再需要成为专家。只需提出正确的问题。
⚠️ 教育免责声明
本代码仅用于教育和研究目的。它旨在展示模型上下文协议(MCP)以及基于 LLM 的调试能力。我不提倡将这些工具用于恶意破解、多人游戏作弊或违反服务条款。这是一种软件工程自动化的演示。
标签:AI 代理, AI 数据中心, AI 编程, AI 辅助调试, AI 驱动, Cheat Engine, Claude, Copilot, Cursor, CVE检测, JARM, JSON-RPC, MCP, Python MCP Server, rizin, 云资产清单, 内存分析, 内存读取, 命名管道, 威胁情报, 开发者工具, 异步通信, 性能加速, 指针扫描, 模组开发, 游戏修改, 游戏机器人, 硬件断点, 自动化逆向, 逆向工具, 逆向工程, 逆向工程加速, 逆向工程工具