cheatengine 5.8.27 → 5.8.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/README_CN.md +10 -8
- package/ce_mcp_bridge.lua +5 -43
- package/package.json +1 -1
- package/src/tool-registry.js +2 -22
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ AI <--MCP/JSON-RPC--> ce_mcp_server.js <--Named Pipe--> ce_mcp_bridge.lua (CE)
|
|
|
25
25
|
dofile([[D:\path\to\ce_mcp_bridge.lua]])
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
3. **Configure MCP**
|
|
28
|
+
3. **Configure MCP** :
|
|
29
29
|
```json
|
|
30
30
|
{
|
|
31
31
|
"mcpServers": {
|
|
@@ -157,17 +157,19 @@ Write a value to memory.
|
|
|
157
157
|
|
|
158
158
|
### Scanning & Search
|
|
159
159
|
|
|
160
|
-
#### `ce_aob_scan(aob_string, module?, protection?, max_results?)`
|
|
160
|
+
#### `ce_aob_scan(aob_string, module?, protection?, start?, stop?, max_results?)`
|
|
161
161
|
Scan memory for Array of Bytes pattern. Supports `??` wildcards.
|
|
162
162
|
|
|
163
163
|
**Parameters:**
|
|
164
164
|
- `aob_string` (string, required): Pattern like `"48 89 5C 24 ?? 48 83 EC 20"`
|
|
165
165
|
- `module` (string, optional): Limit scan to module (e.g. `"game.exe"`)
|
|
166
166
|
- `protection` (string, optional): Memory protection flags (default: `"-C+X"`)
|
|
167
|
+
- `start` (string, optional): Start address if module not specified
|
|
168
|
+
- `stop` (string, optional): Stop address if module not specified
|
|
167
169
|
- `max_results` (integer, optional): Maximum results (default: 100)
|
|
168
170
|
|
|
169
171
|
#### `ce_value_scan(value, type, module?, protection?)`
|
|
170
|
-
Scan for a specific value. Useful for pointer tracing. **One-shot scan - for iterative scanning use Scan Sessions.**
|
|
172
|
+
Scan for a specific value. Useful for pointer tracing. Auto-aligns scan based on type for performance. **One-shot scan - for iterative scanning use Scan Sessions.**
|
|
171
173
|
|
|
172
174
|
**Parameters:**
|
|
173
175
|
- `value` (string, required): Value to search (e.g. `"0x255D5E758"` or `"12345"`)
|
|
@@ -182,7 +184,7 @@ Scan for a specific value. Useful for pointer tracing. **One-shot scan - for ite
|
|
|
182
184
|
Implements CE's core "First Scan → Next Scan" workflow with session management. Sessions auto-expire after 5 minutes of inactivity.
|
|
183
185
|
|
|
184
186
|
#### `ce_scan_new(value, type, module?, protection?)`
|
|
185
|
-
Start a new scan session.
|
|
187
|
+
Start a new scan session. Auto-aligns scan based on type for performance (4-byte for dword/float, 8-byte for qword/double).
|
|
186
188
|
|
|
187
189
|
#### `ce_scan_next(session_id, value, scan_type?, value2?)`
|
|
188
190
|
Continue scanning (filter) an existing session.
|
package/README_CN.md
CHANGED
|
@@ -7,7 +7,7 @@ MCP 桥接器,让 AI 助手直接控制 Cheat Engine 进行游戏修改和逆
|
|
|
7
7
|
## 架构
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
AI <--MCP/JSON-RPC--> ce_mcp_server.
|
|
10
|
+
AI <--MCP/JSON-RPC--> ce_mcp_server.js <--命名管道--> ce_mcp_bridge.lua (CE)
|
|
11
11
|
↑
|
|
12
12
|
后台自动重连
|
|
13
13
|
```
|
|
@@ -16,7 +16,7 @@ AI <--MCP/JSON-RPC--> ce_mcp_server.py <--命名管道--> ce_mcp_bridge.lua (CE)
|
|
|
16
16
|
|
|
17
17
|
### 快速开始 (NPX) - 推荐
|
|
18
18
|
|
|
19
|
-
1.
|
|
19
|
+
1. **前提条件**: Node.js 14+ (无需其他依赖项)
|
|
20
20
|
|
|
21
21
|
2. **在 CE 中加载** (二选一):
|
|
22
22
|
- **自动加载**: 将 `ce_mcp_bridge.lua` 复制到 CE 的 `autorun` 文件夹 (如 `D:\Cheat Engine\autorun\`)
|
|
@@ -25,7 +25,7 @@ AI <--MCP/JSON-RPC--> ce_mcp_server.py <--命名管道--> ce_mcp_bridge.lua (CE)
|
|
|
25
25
|
dofile([[D:\path\to\ce_mcp_bridge.lua]])
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
3. **配置 MCP**
|
|
28
|
+
3. **配置 MCP** :
|
|
29
29
|
```json
|
|
30
30
|
{
|
|
31
31
|
"mcpServers": {
|
|
@@ -45,8 +45,8 @@ AI <--MCP/JSON-RPC--> ce_mcp_server.py <--命名管道--> ce_mcp_bridge.lua (CE)
|
|
|
45
45
|
{
|
|
46
46
|
"mcpServers": {
|
|
47
47
|
"cheat-engine": {
|
|
48
|
-
"command": "
|
|
49
|
-
"args": ["D:/path/to/ce_mcp/ce_mcp_server.
|
|
48
|
+
"command": "node",
|
|
49
|
+
"args": ["D:/path/to/ce_mcp/ce_mcp_server.js"]
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -157,17 +157,19 @@ Hook 名称现在会验证以防止 AA 脚本注入:
|
|
|
157
157
|
|
|
158
158
|
### 扫描与搜索
|
|
159
159
|
|
|
160
|
-
#### `ce_aob_scan(aob_string, module?, protection?, max_results?)`
|
|
160
|
+
#### `ce_aob_scan(aob_string, module?, protection?, start?, stop?, max_results?)`
|
|
161
161
|
扫描内存中的字节数组模式。支持 `??` 通配符。
|
|
162
162
|
|
|
163
163
|
**参数:**
|
|
164
164
|
- `aob_string` (string, 必需): 模式如 `"48 89 5C 24 ?? 48 83 EC 20"`
|
|
165
165
|
- `module` (string, 可选): 限制扫描到模块 (如 `"game.exe"`)
|
|
166
166
|
- `protection` (string, 可选): 内存保护标志 (默认: `"-C+X"`)
|
|
167
|
+
- `start` (string, 可选): 起始地址(未指定 module 时使用)
|
|
168
|
+
- `stop` (string, 可选): 结束地址(未指定 module 时使用)
|
|
167
169
|
- `max_results` (integer, 可选): 最大结果数 (默认: 100)
|
|
168
170
|
|
|
169
171
|
#### `ce_value_scan(value, type, module?, protection?)`
|
|
170
|
-
|
|
172
|
+
扫描特定值。用于指针追踪。根据类型自动对齐扫描以优化性能。**一次性扫描 - 迭代扫描请使用扫描会话。**
|
|
171
173
|
|
|
172
174
|
**参数:**
|
|
173
175
|
- `value` (string, 必需): 要搜索的值 (如 `"0x255D5E758"` 或 `"12345"`)
|
|
@@ -182,7 +184,7 @@ Hook 名称现在会验证以防止 AA 脚本注入:
|
|
|
182
184
|
实现 CE 核心的 "首次扫描 → 再次扫描" 工作流,带会话管理。会话在 5 分钟不活动后自动过期。
|
|
183
185
|
|
|
184
186
|
#### `ce_scan_new(value, type, module?, protection?)`
|
|
185
|
-
|
|
187
|
+
开始新的扫描会话。根据类型自动对齐扫描以优化性能(dword/float 用 4 字节对齐,qword/double 用 8 字节对齐)。
|
|
186
188
|
|
|
187
189
|
#### `ce_scan_next(session_id, value, scan_type?, value2?)`
|
|
188
190
|
继续扫描(过滤)现有会话。
|
package/ce_mcp_bridge.lua
CHANGED
|
@@ -1500,46 +1500,9 @@ Handlers.execute_lua = function(p)
|
|
|
1500
1500
|
local ok, result = pcall(fn)
|
|
1501
1501
|
if not ok then error("Runtime error: " .. tostring(result)) end
|
|
1502
1502
|
return { result = result }
|
|
1503
|
-
end
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
local mv = getMemoryViewForm()
|
|
1507
|
-
if mv then
|
|
1508
|
-
local dv = mv.DisassemblerView
|
|
1509
|
-
if dv and dv.SelectedAddress then
|
|
1510
|
-
return { address = Utils.formatHex(dv.SelectedAddress) }
|
|
1511
|
-
end
|
|
1512
|
-
end
|
|
1513
|
-
error("No address selected in Memory View")
|
|
1514
|
-
end
|
|
1515
|
-
|
|
1516
|
-
-- Handler: get_logs - Retrieve log entries with filtering
|
|
1517
|
-
Handlers.get_logs = function(p)
|
|
1518
|
-
local count = p.count or 100
|
|
1519
|
-
local minLevel = p.min_level or p.minLevel or LogLevel.DEBUG
|
|
1520
|
-
|
|
1521
|
-
-- Convert string level to number if needed
|
|
1522
|
-
if type(minLevel) == "string" then
|
|
1523
|
-
local levelMap = {
|
|
1524
|
-
debug = LogLevel.DEBUG,
|
|
1525
|
-
info = LogLevel.INFO,
|
|
1526
|
-
warn = LogLevel.WARN,
|
|
1527
|
-
error = LogLevel.ERROR
|
|
1528
|
-
}
|
|
1529
|
-
minLevel = levelMap[minLevel:lower()] or LogLevel.DEBUG
|
|
1530
|
-
end
|
|
1531
|
-
|
|
1532
|
-
local entries = Logger.getEntries(count, minLevel)
|
|
1533
|
-
local stats = Logger.getStats()
|
|
1534
|
-
|
|
1535
|
-
return {
|
|
1536
|
-
entries = entries,
|
|
1537
|
-
count = #entries,
|
|
1538
|
-
stats = stats
|
|
1539
|
-
}
|
|
1540
|
-
end
|
|
1541
|
-
|
|
1542
|
-
-- Handler: stats - Return comprehensive execution statistics
|
|
1503
|
+
end
|
|
1504
|
+
|
|
1505
|
+
-- Handler: stats - Return comprehensive execution statistics
|
|
1543
1506
|
Handlers.stats = function(p)
|
|
1544
1507
|
local metrics = Metrics.getSummary()
|
|
1545
1508
|
local logStats = Logger.getStats()
|
|
@@ -7473,9 +7436,8 @@ local SYNC_COMMANDS = {
|
|
|
7473
7436
|
register_symbol = true,
|
|
7474
7437
|
unregister_symbol = true,
|
|
7475
7438
|
allocate_memory = true,
|
|
7476
|
-
execute_lua = true,
|
|
7477
|
-
|
|
7478
|
-
-- Hook commands
|
|
7439
|
+
execute_lua = true,
|
|
7440
|
+
-- Hook commands
|
|
7479
7441
|
hook_function = true,
|
|
7480
7442
|
unhook_function = true,
|
|
7481
7443
|
-- Emulation commands
|
package/package.json
CHANGED
package/src/tool-registry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool Registry for MCP Tools
|
|
3
|
-
* Defines all
|
|
3
|
+
* Defines all 55 tools available in the Cheat Engine MCP Bridge
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const ToolCategory = {
|
|
@@ -108,32 +108,12 @@ class ToolRegistry {
|
|
|
108
108
|
|
|
109
109
|
this._register(new Tool(
|
|
110
110
|
'ce_execute_lua',
|
|
111
|
-
'Execute
|
|
111
|
+
'Execute Lua code with full access to CE APIs. Returns {result}.',
|
|
112
112
|
'execute_lua',
|
|
113
113
|
ToolCategory.SYSTEM,
|
|
114
114
|
[new ToolParam('code', 'string', 'Lua code to execute', true)]
|
|
115
115
|
));
|
|
116
116
|
|
|
117
|
-
this._register(new Tool(
|
|
118
|
-
'ce_get_selected_address',
|
|
119
|
-
'Get the currently selected address in CE Memory View/Disassembler',
|
|
120
|
-
'get_selected_address',
|
|
121
|
-
ToolCategory.SYSTEM
|
|
122
|
-
));
|
|
123
|
-
|
|
124
|
-
this._register(new Tool(
|
|
125
|
-
'ce_get_logs',
|
|
126
|
-
'Get log entries from the Cheat Engine MCP Bridge Lua side. ' +
|
|
127
|
-
'Returns: {entries: [{timestamp, level, category, message, data}], count}. ' +
|
|
128
|
-
'Useful for debugging and monitoring bridge operations.',
|
|
129
|
-
'get_logs',
|
|
130
|
-
ToolCategory.SYSTEM,
|
|
131
|
-
[
|
|
132
|
-
new ToolParam('count', 'integer', 'Maximum number of log entries to return (default: 100)', false, 100),
|
|
133
|
-
new ToolParam('min_level', 'integer', 'Minimum log level to include: 1=DEBUG, 2=INFO, 3=WARN, 4=ERROR (default: 1)', false, 1),
|
|
134
|
-
]
|
|
135
|
-
));
|
|
136
|
-
|
|
137
117
|
this._register(new Tool(
|
|
138
118
|
'ce_list_processes',
|
|
139
119
|
'List running processes. Use before ce_attach_process to find available targets. ' +
|