wowdump 0.3.4 → 0.3.7
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 +11 -6
- package/dist/analysis/runtime-dump.js +2 -2
- package/dist/cli.js +133 -175
- package/dist/core/build-adapters.js +0 -8
- package/dist/debug/cdb.js +412 -0
- package/dist/reader/broker.js +88 -7
- package/dist/reader/launcher.js +5 -5
- package/dist/reader/main.js +18 -35
- package/dist/reader/windows.js +2 -2
- package/dist/toolchain.js +3 -3
- package/package.json +4 -5
- package/skills/wowdump/SKILL.md +18 -12
- package/skills/wowdump/references/commands.md +27 -38
- package/skills/wowdump/references/disassemble.md +3 -3
- package/skills/wowdump/references/evidence-workflow.md +6 -6
- package/skills/wowdump/references/profiles.md +2 -2
- package/skills/wowdump/references/request-schema.md +2 -2
- package/skills/wowdump/references/windbg.md +55 -0
- package/skills/wowdump/references/workflow.md +17 -32
- package/dist/analysis/frida-runtime.js +0 -715
- package/dist/analysis/runtime-script.js +0 -156
- package/dist/frida-worker.js +0 -153
- package/skills/wowdump/references/dynamic.md +0 -54
- package/skills/wowdump/scripts/dynamic-session.js +0 -133
package/dist/reader/windows.js
CHANGED
|
@@ -154,7 +154,7 @@ export class WindowsNativeReader {
|
|
|
154
154
|
const buffer = Buffer.alloc(48);
|
|
155
155
|
const result = Number(VirtualQueryEx(native.raw, address, buffer, buffer.length));
|
|
156
156
|
if (result === 0)
|
|
157
|
-
throw win32Error(`VirtualQueryEx(${native.id})`);
|
|
157
|
+
throw win32Error(`VirtualQueryEx(${native.id}, 0x${address.toString(16)})`);
|
|
158
158
|
return {
|
|
159
159
|
baseAddress: `0x${buffer.readBigUInt64LE(0).toString(16)}`,
|
|
160
160
|
allocationBase: `0x${buffer.readBigUInt64LE(8).toString(16)}`,
|
|
@@ -185,7 +185,7 @@ export class WindowsNativeReader {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
/** Enumerate processes without spawning a shell or depending on
|
|
188
|
+
/** Enumerate processes without spawning a shell or depending on an injector. */
|
|
189
189
|
export function enumerateWindowsProcesses() {
|
|
190
190
|
if (process.platform !== "win32")
|
|
191
191
|
return [];
|
package/dist/toolchain.js
CHANGED
|
@@ -6,19 +6,19 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
6
6
|
import { resolveWowdumpHome } from "./core/build-store.js";
|
|
7
7
|
export const DEFAULT_WOWDUMP_SKILL = `---
|
|
8
8
|
name: wowdump
|
|
9
|
-
description: 用
|
|
9
|
+
description: 用 WinDbg CDB 运行时证据和 IDA Pro MCP 或 iced-x86 定位 WoW 字段,生成并验证 Reader profile。
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
# wowdump
|
|
13
13
|
|
|
14
|
-
先运行 \`wowdump targets\`,再复用 \`~/.wowdump/<buildKey>/database
|
|
14
|
+
先运行 \`wowdump targets\`,再复用 \`~/.wowdump/<buildKey>/database/\`。runtime dump 保存当前 session 的二进制证据,debug 命令保存 CDB 证据,Reader 只读取 build profile。详情见 references/workflow.md、references/commands.md、references/windbg.md、references/disassemble.md 和 references/profiles.md。
|
|
15
15
|
`;
|
|
16
16
|
export const DEFAULT_WOWDUMP_COMMANDS = `# wowdump 命令参考
|
|
17
17
|
|
|
18
18
|
1. \`wowdump targets\`
|
|
19
19
|
2. \`wowdump database status --build <buildKey>\`
|
|
20
20
|
3. \`wowdump analyze runtime --pid <pid> --build <buildKey> --kind dump --confirm\`
|
|
21
|
-
4. \`wowdump analyze
|
|
21
|
+
4. \`wowdump analyze debug --pid <pid> --build <buildKey> --rva <rva> --kind breakpoint --confirm\`
|
|
22
22
|
5. \`wowdump analyze runtime --pid <pid> --build <buildKey> --kind verify --profile <profile.json> --confirm\`
|
|
23
23
|
6. \`wowdump memory read --pid <pid> --build <buildKey> --profile <profile.json> --field <name>\`
|
|
24
24
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wowdump",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "WoW native memory analysis CLI with
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "WoW native memory analysis CLI with WinDbg CDB evidence, IDA/iced-x86 disassembly, and an elevated reader broker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"commander": "^13.1.0",
|
|
37
|
-
"frida": "^17.2.0",
|
|
38
37
|
"iced-x86": "^1.21.0",
|
|
39
38
|
"koffi": "^2.16.3",
|
|
40
39
|
"zod": "^3.24.2"
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"typescript": "^5.7.3"
|
|
45
44
|
},
|
|
46
45
|
"allowScripts": {
|
|
47
|
-
"
|
|
48
|
-
"
|
|
46
|
+
"koffi@2.16.3": true,
|
|
47
|
+
"wowdump@0.3.7": true
|
|
49
48
|
}
|
|
50
49
|
}
|
package/skills/wowdump/SKILL.md
CHANGED
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wowdump
|
|
3
|
-
description:
|
|
3
|
+
description: 使用 WinDbg CDB、Reader broker 和 IDA/iced-x86 证据定位并验证 WoW 原生内存字段。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# wowdump
|
|
7
7
|
|
|
8
|
-
用于读取角色属性、Buff/Debuff
|
|
8
|
+
用于读取角色属性、Buff/Debuff、技能冷却、附近单位等原生字段。先确认目标和 build,再按缺口收集 CDB 证据,最后只让 Reader 读取已验证 profile。
|
|
9
9
|
|
|
10
10
|
## 默认策略
|
|
11
11
|
|
|
12
|
-
1.
|
|
13
|
-
2.
|
|
14
|
-
3. 有 `reader_ready` profile
|
|
15
|
-
4.
|
|
16
|
-
5.
|
|
17
|
-
6.
|
|
18
|
-
7.
|
|
19
|
-
8.
|
|
12
|
+
1. 运行 `wowdump targets`。如果有多个 `Wow.exe`,让用户选择 PID;不要猜 buildKey。该命令会创建或复用 `~/.wowdump/<buildKey>/database/`。
|
|
13
|
+
2. 用 `wowdump database status --build <buildKey>` 查看数据库状态。
|
|
14
|
+
3. 有 `reader_ready` profile 时直接使用 `wowdump memory read --pid <pid> --build <buildKey> --profile <profile> --field <name>`。
|
|
15
|
+
4. 需要 PE 段时运行 `wowdump analyze runtime --kind dump --confirm`。它由 broker 启动 CDB,把段写入当前 runtime session,不创建新数据库。
|
|
16
|
+
5. 需要确认一个函数调用时运行 `wowdump analyze debug --kind breakpoint --rva <rva> --confirm`;只提供静态确认过的单个 RVA。
|
|
17
|
+
6. 需要 CDB 的其他诊断能力时使用 `wowdump analyze debug --kind command --cdb-commands <JSON数组> --confirm`。参数和命令都是数组,不经过 shell。
|
|
18
|
+
7. 由 IDA Pro MCP 优先分析原始 Wow.exe;没有 IDA MCP 时用 iced-x86 做局部反汇编。输出 RVA、调用关系、结构偏移和字段类型。
|
|
19
|
+
8. 将证据整理为 candidate profile,再运行 `wowdump analyze runtime --kind verify --profile <profile> --confirm`。
|
|
20
|
+
9. Reader 实读成功且用户确认后,才把 profile 放到 `~/.wowdump/<buildKey>/profile/`。
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
## 组件边界
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
- WinDbg/CDB:一次性的 dump、断点和调试命令证据;不改写目标函数入口。
|
|
25
|
+
- Reader broker:一次 UAC 后复用 20 分钟,负责 `ReadProcessMemory`、`VirtualQueryEx`、模块枚举和 CDB 子进程。
|
|
26
|
+
- IDA/iced-x86:静态分析,不读取运行时堆状态。
|
|
27
|
+
- Reader:根据 profile 的 RVA、指针链、类型和边界做有界读取;不猜地址。
|
|
28
|
+
|
|
29
|
+
详细命令、调试器参数、证据门槛和 profile 格式见 references 目录。
|
|
24
30
|
|
|
25
31
|
IDA MCP 使用长 TTL 会话(默认 `idle_ttl_sec: 3600`)。每次查询前先做 health probe;出现 `worker not reachable` 时按 `references/disassemble.md` 重新打开并只重试一次。IDA worker 与 Windows broker 独立,broker 的 UAC 复用不会保持 IDA worker 存活。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# wowdump 命令参考
|
|
2
2
|
|
|
3
|
-
Windows
|
|
3
|
+
Windows 下内存和 CDB 请求都连接同一个管理员 broker。首次连接请求 UAC,后续请求复用该进程,空闲 20 分钟退出。
|
|
4
4
|
|
|
5
5
|
## 发现目标
|
|
6
6
|
|
|
@@ -9,24 +9,9 @@ wowdump targets
|
|
|
9
9
|
wowdump targets --pid 33976
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
使用输出中的 `pid`、`path`、`buildKey` 和哈希。多个目标时先让用户选择。
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
```powershell
|
|
17
|
-
wowdump analyze dynamic `
|
|
18
|
-
--pid 33976 `
|
|
19
|
-
--build "retail@12.1.0.69587" `
|
|
20
|
-
--script "C:\work\discover-state.js" `
|
|
21
|
-
--export collect `
|
|
22
|
-
--args '{"fields":["playerAuras","nearbyEnemies","cooldowns"]}' `
|
|
23
|
-
--duration-ms 5000 `
|
|
24
|
-
--confirm
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
CLI 会把结果保存到 `~/.wowdump/<buildKey>/runtime/<session-id>/dynamic.json`,并在 stdout 返回 session 目录。
|
|
28
|
-
|
|
29
|
-
导出供静态分析的运行时模块段。默认只导出 `.text/.rdata/.pdata`;需要运行时全局状态时显式加入 `.data`:
|
|
14
|
+
## CDB 段导出
|
|
30
15
|
|
|
31
16
|
```powershell
|
|
32
17
|
wowdump analyze runtime `
|
|
@@ -37,45 +22,49 @@ wowdump analyze runtime `
|
|
|
37
22
|
--confirm
|
|
38
23
|
```
|
|
39
24
|
|
|
40
|
-
输出写入 `~/.wowdump/<buildKey>/runtime/<session
|
|
25
|
+
输出写入 `~/.wowdump/<buildKey>/runtime/<session>/dump/`,包括 `manifest.json`、`.text.bin` 等二进制和 `cdb.log`。stdout 只返回路径、段摘要、字节数和 SHA-256;不会嵌入大段字节。
|
|
41
26
|
|
|
42
|
-
|
|
27
|
+
## CDB 断点和命令
|
|
43
28
|
|
|
44
29
|
```powershell
|
|
45
|
-
wowdump
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
wowdump analyze debug `
|
|
31
|
+
--pid 33976 `
|
|
32
|
+
--build "retail@12.1.0.69587" `
|
|
33
|
+
--rva 0x18acbf0 `
|
|
34
|
+
--kind breakpoint `
|
|
35
|
+
--max-hits 3 `
|
|
36
|
+
--duration-ms 3000 `
|
|
37
|
+
--confirm
|
|
49
38
|
|
|
50
|
-
|
|
51
|
-
wowdump analyze runtime `
|
|
39
|
+
wowdump analyze debug `
|
|
52
40
|
--pid 33976 `
|
|
53
41
|
--build "retail@12.1.0.69587" `
|
|
54
|
-
--kind
|
|
55
|
-
--
|
|
42
|
+
--kind command `
|
|
43
|
+
--cdb-commands '["lm","r","~"]' `
|
|
44
|
+
--cdb-args '["-lines"]' `
|
|
56
45
|
--confirm
|
|
57
46
|
```
|
|
58
47
|
|
|
59
|
-
`
|
|
60
|
-
|
|
61
|
-
## 静态定位
|
|
48
|
+
`breakpoint` 只接受一个静态确认的 RVA,输出寄存器、返回地址、线程 ID 和页面证据。`command` 允许 Agent 提供有界 CDB 命令数组;所有参数通过 `spawn` 数组传递,禁止 shell 拼接。
|
|
62
49
|
|
|
63
|
-
|
|
50
|
+
## 数据库和验证
|
|
64
51
|
|
|
65
52
|
```powershell
|
|
66
|
-
|
|
53
|
+
wowdump database status --build "retail@12.1.0.69587"
|
|
54
|
+
wowdump analyze runtime --pid 33976 --build "retail@12.1.0.69587" --kind verify --profile <profile.json> --confirm
|
|
67
55
|
```
|
|
68
56
|
|
|
69
|
-
|
|
57
|
+
`verify` 只读取 profile 定义的 RVA、指针链和类型,不读取 IDA 数据库或 dump 文件。验证成功并得到用户确认后,才保存到 `~/.wowdump/<buildKey>/profile/`。
|
|
58
|
+
|
|
59
|
+
## Reader
|
|
70
60
|
|
|
71
61
|
```powershell
|
|
72
62
|
wowdump memory read `
|
|
73
63
|
--pid 33976 `
|
|
74
64
|
--build "retail@12.1.0.69587" `
|
|
75
65
|
--profile "$HOME\.wowdump\retail@12.1.0.69587\profile\player-state.json" `
|
|
76
|
-
--field
|
|
66
|
+
--field playerStats
|
|
67
|
+
wowdump memory regions --pid 33976 --start 0x15000000000 --end 0x15400000000 --max-regions 20000
|
|
77
68
|
```
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
静态分析完成后回到 `analyze dynamic` Hook 验证候选,再生成 profile。短时 Hook/事件采集可以复制 [scripts/dynamic-session.js](../scripts/dynamic-session.js) 后按请求修改;它不会被 CLI 自动执行。详细脚本规则见 [dynamic.md](dynamic.md) 和 [disassemble.md](disassemble.md)。字段请求格式见 [request-schema.md](request-schema.md),profile 生命周期见 [profiles.md](profiles.md)。
|
|
70
|
+
Reader 使用 `ReadProcessMemory` 和 `VirtualQueryEx` 做有界读取,返回实际地址、读取长度、解析值和证据。
|
|
@@ -18,7 +18,7 @@ codex plugin add ida-pro-mcp@mrexodia
|
|
|
18
18
|
|
|
19
19
|
IDA Pro MCP 需要 **IDA Pro 8.3+**(不支持 IDA Free)、Python 3.11+,headless `idalib` 路径还需要 `uv`。安装后重启 IDA 和 Codex,使 MCP 工具生效。若插件市场不可用,按官方仓库 README 的 GUI 或 `idalib-mcp` 安装说明操作;不要在项目中复制或维护 MCP 的内部 Python/IDA 代码。
|
|
20
20
|
|
|
21
|
-
- 能调用时,让 MCP 只分析当前字段相关样本附近的函数、字符串、调用关系和结构,把结果保存为 JSON。随后回到
|
|
21
|
+
- 能调用时,让 MCP 只分析当前字段相关样本附近的函数、字符串、调用关系和结构,把结果保存为 JSON。随后回到 broker Reader 或 CDB 断点做有界验证,不要直接把静态候选当成可读字段。
|
|
22
22
|
|
|
23
23
|
## IDA MCP 会话保活与重连
|
|
24
24
|
|
|
@@ -47,6 +47,6 @@ IDA 的 headless worker 不是常驻进程。`idb_list` 中仍有 session 记录
|
|
|
47
47
|
4. 第二次仍失联时停止扩大分析范围,保存已取得的 JSON 证据并转用 iced-x86 或请求用户稍后重试。
|
|
48
48
|
|
|
49
49
|
不要把 `session_id`、IDA 临时 worker PID 或 `0x140000000` 这类 IDA image base 写入持久化 profile。profile 只保存相对模块的 RVA、字段类型和可复核证据。IDA MCP 会话和 wowdump 的 Windows broker 是两条独立链路:前者负责反汇编,后者负责管理员内存读取;broker 复用不会延长 IDA worker 生命周期。
|
|
50
|
-
- IDA 不可用时,Agent 使用 npm 内置的 `iced-x86` 对 manifest 指向的局部 RVA 反汇编,输出模块 RVA、指令文本、访问偏移和证据。Agent 负责把这些线索与运行时字段对应起来,再用
|
|
50
|
+
- IDA 不可用时,Agent 使用 npm 内置的 `iced-x86` 对 manifest 指向的局部 RVA 反汇编,输出模块 RVA、指令文本、访问偏移和证据。Agent 负责把这些线索与运行时字段对应起来,再用 CDB 断点或 Reader 验证 `root`、`pointerChain`、`layout/type`、计数上限和停止条件。不要把一次运行的绝对地址写进持久化 profile。
|
|
51
51
|
|
|
52
|
-
输出中的 `readerStatus: "reader_ready"` 只适用于每个字段都有可验证 RVA/地址、类型和边界,并且 reader 实际读成功的情况;否则保持 `candidate`,回到
|
|
52
|
+
输出中的 `readerStatus: "reader_ready"` 只适用于每个字段都有可验证 RVA/地址、类型和边界,并且 reader 实际读成功的情况;否则保持 `candidate`,回到 CDB 或继续局部静态分析。只做一次性查询时可以不生成持久化 profile。
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
## 选择路径
|
|
4
4
|
|
|
5
|
-
先判断用户要的是“一次当前值”还是“可复用 Reader 字段”。一次当前值优先走
|
|
5
|
+
先判断用户要的是“一次当前值”还是“可复用 Reader 字段”。一次当前值优先走 Reader 或有限 CDB 命令;可复用字段才补 IDA/iced 和 Reader 验证。两者可以来回切换。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## CDB 证据
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
段导出使用 `analyze runtime --kind dump`,函数调用证据使用 `analyze debug --kind breakpoint`,其他诊断使用 `analyze debug --kind command`。输出至少包含:
|
|
10
10
|
|
|
11
11
|
- `buildKey`、进程 PID、模块名、`moduleBase`
|
|
12
12
|
- 候选地址或 `rva`、字节样本、来源和采样时间
|
|
13
13
|
- 每个请求字段对应的线索
|
|
14
14
|
|
|
15
|
-
不要导出整段进程内存。把 `durationMs
|
|
15
|
+
不要导出整段进程内存。把 `durationMs`、命中次数、命令数量和读取范围限制在请求所需范围内。
|
|
16
16
|
|
|
17
17
|
## Disassemble(按需使用)
|
|
18
18
|
|
|
19
|
-
`analyze runtime --kind dump` 的 `manifest.json`
|
|
19
|
+
`analyze runtime --kind dump` 的 `manifest.json` 和段文件是静态分析输入。只有 CDB 证据不足以确认函数、布局或类型时才调用 IDA Pro MCP;没有时再用 iced-x86 解码。分析后回到 `analyze debug` 或 `analyze runtime --kind verify --profile <file>` 验证。输出 profile 时,每个字段至少给出:
|
|
20
20
|
|
|
21
21
|
```json
|
|
22
22
|
{
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
## Reader
|
|
36
36
|
|
|
37
|
-
Reader 根据模块名、RVA、指针链和类型执行原子读取;它不负责猜测结构,也不执行
|
|
37
|
+
Reader 根据模块名、RVA、指针链和类型执行原子读取;它不负责猜测结构,也不执行 CDB/IDA。一次读取结果应保留实际地址、请求大小、已读字节、解析值和错误状态。
|
|
38
38
|
|
|
39
39
|
需要连续数据时使用 `memory watch` 或重复 `memory read`。运行时模块基址可能变化,profile 保存 RVA,不保存本次运行的绝对地址。
|
|
40
40
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
│ └── combat-state.json
|
|
16
16
|
└── runtime/<session-id>/ # 当前任务证据
|
|
17
17
|
├── target.json
|
|
18
|
-
├──
|
|
18
|
+
├── debug.json
|
|
19
19
|
├── dump/manifest.json
|
|
20
20
|
├── ida-evidence.json
|
|
21
21
|
├── candidate.profile.json
|
|
@@ -36,7 +36,7 @@ buildKey 只能作为单层目录名使用。保留 `@`、点和连字符;拒
|
|
|
36
36
|
|
|
37
37
|
## 保存流程
|
|
38
38
|
|
|
39
|
-
1. 汇总
|
|
39
|
+
1. 汇总 CDB 与必要的 IDA/iced 证据,检查 buildKey、模块、哈希、RVA 和字段证据一致;不要求固定先后顺序。
|
|
40
40
|
2. 向用户展示候选 profile 的路径、字段和验证结果,询问是否保存为该 build 的持久化 profile。
|
|
41
41
|
3. 用户确认后,将候选复制到 `~/.wowdump/<buildKey>/profile/<profile-id>.json`,保留 `buildKey`、来源和验证证据。
|
|
42
42
|
4. 目标文件已存在时先询问覆盖,或使用新的 profile-id;不要静默覆盖。
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
{ "name": "cooldowns", "kind": "cooldown", "scope": "player" }
|
|
13
13
|
],
|
|
14
14
|
"limits": { "maxUnits": 64, "maxAuras": 64, "maxEvents": 100, "durationMs": 5000 },
|
|
15
|
-
"
|
|
15
|
+
"debug": { "kind": "breakpoint", "rva": "0x...", "maxHits": 3, "durationMs": 3000 }
|
|
16
16
|
}
|
|
17
17
|
```
|
|
18
18
|
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
- 技能冷却:`kind: "cooldown", scope: "player"`
|
|
26
26
|
- 周围敌人:`kind: "unit-list", scope: "around-player"`
|
|
27
27
|
|
|
28
|
-
这些是查询意图。没有 reader-ready profile 定义前,不要把
|
|
28
|
+
这些是查询意图。没有 reader-ready profile 定义前,不要把 CDB 一次性证据中的绝对地址交给长期 reader。
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# WinDbg CDB 参考
|
|
2
|
+
|
|
3
|
+
## 探测
|
|
4
|
+
|
|
5
|
+
CLI 按以下顺序寻找 `cdb.exe`:`WOWDUMP_CDB`、Windows SDK x64、WinDbg 安装目录、最后的 `where.exe cdb.exe`。只读探测,不自动下载,也不修改环境变量。找不到时返回 `CDB_NOT_FOUND`。
|
|
6
|
+
|
|
7
|
+
## 段导出
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
wowdump analyze runtime `
|
|
11
|
+
--pid <pid> `
|
|
12
|
+
--build <buildKey> `
|
|
13
|
+
--kind dump `
|
|
14
|
+
--sections .text .rdata .pdata `
|
|
15
|
+
--confirm
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Node 从原始 PE 读取 section RVA 和 virtual size,broker 内部执行等价的:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
.writemem "<absolute output path>" <runtimeStart> <runtimeEnd>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
输出在 `~/.wowdump/<buildKey>/runtime/<session>/dump/`,包含 `manifest.json`、段二进制和 `cdb.log`。JSON 只保存路径、大小、哈希和引擎信息,不内嵌大段字节。
|
|
25
|
+
|
|
26
|
+
## 断点
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
wowdump analyze debug `
|
|
30
|
+
--pid <pid> `
|
|
31
|
+
--build <buildKey> `
|
|
32
|
+
--rva <rva> `
|
|
33
|
+
--kind breakpoint `
|
|
34
|
+
--max-hits 3 `
|
|
35
|
+
--duration-ms 3000 `
|
|
36
|
+
--confirm
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
默认脚本使用硬件执行断点,只记录 RIP、RCX、RDX、R8、R9、RSP、返回地址和线程 ID。命中达到上限或超时后立即清除断点并退出 CDB。broker 用 `VirtualQueryEx` 检查入口页和返回地址页,结果写入 session 的 `debug.json`。
|
|
40
|
+
|
|
41
|
+
## 其他调试命令
|
|
42
|
+
|
|
43
|
+
Agent 可以显式提交 CDB 命令数组,适合寄存器、线程、模块和符号诊断:
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
wowdump analyze debug `
|
|
47
|
+
--pid <pid> `
|
|
48
|
+
--build <buildKey> `
|
|
49
|
+
--kind command `
|
|
50
|
+
--cdb-commands '["lm","r","~"]' `
|
|
51
|
+
--cdb-args '["-lines"]' `
|
|
52
|
+
--confirm
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
命令和参数通过 `spawn(file, args, {shell:false})` 传递;不要把它们拼成 shell 字符串。调试命令必须有时限,输出会截断到证据上限。
|
|
@@ -1,45 +1,30 @@
|
|
|
1
1
|
# 混合分析决策
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 先确认目标
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
1. `wowdump targets` 获取 PID、路径、buildKey、哈希和模块信息。
|
|
6
|
+
2. `wowdump database status --build <buildKey>` 确认静态数据库是否可复用。
|
|
7
|
+
3. 运行时证据都放在当前 build 的 runtime session;profile 只保存稳定的 RVA、相对偏移、类型和边界。
|
|
7
8
|
|
|
8
9
|
## 每轮只解决一个证据缺口
|
|
9
10
|
|
|
10
|
-
|
|
|
11
|
+
| 缺口 | 下一步 | 成功标准 |
|
|
11
12
|
| --- | --- | --- |
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
| 字段定义已完成 | `wowdump memory read` | broker reader 实际读取成功,值与动态结果一致 |
|
|
19
|
-
|
|
20
|
-
## 选择顺序
|
|
21
|
-
|
|
22
|
-
1. 先检查是否已有同 build 的 `reader_ready` profile;有则直接 Reader,失败再回到 Dynamic。
|
|
23
|
-
2. 没有 profile 时优先执行 Agent 编写的 GumJS。脚本可以直接 Hook 已知 RVA,也可以在限定范围内扫描候选。
|
|
24
|
-
3. Dynamic 只拿到线索时,先用 `analyze runtime --kind dump` 导出当前 session 的相关 PE 段,再让 IDA Pro MCP 复用 build database 分析对应函数、字符串和交叉引用。不要把 dump 当成 profile。
|
|
25
|
-
4. 没有 IDA MCP 时直接使用 iced-x86 对 manifest 指向的局部范围解码,得到候选后仍回到 Dynamic 验证。
|
|
26
|
-
5. 每轮最多扩大一个维度:函数数量、扫描范围、读取字节数或采样时长。连续两轮没有新增证据时,停止扩大并请求用户触发相关游戏动作或确认字段范围。
|
|
13
|
+
| 不知道进程和模块 | `targets`、broker `modules` | PID、路径、模块基址明确 |
|
|
14
|
+
| 需要 PE 样本 | `analyze runtime --kind dump` | manifest 和段二进制已落盘 |
|
|
15
|
+
| 需要确认函数入口 | IDA/iced 局部分析 | 得到单个函数 RVA 和调用关系 |
|
|
16
|
+
| 需要观察调用参数 | `analyze debug --kind breakpoint` | 获得有限次数寄存器、返回地址和页证据 |
|
|
17
|
+
| 需要其他诊断 | `analyze debug --kind command` | CDB 命令输出带时限且有证据文件 |
|
|
18
|
+
| 需要稳定字段 | `analyze runtime --kind verify` | broker 实读成功,类型和边界一致 |
|
|
27
19
|
|
|
28
20
|
## 证据门槛
|
|
29
21
|
|
|
30
|
-
`reader_ready` 必须同时满足:
|
|
31
|
-
|
|
32
|
-
- buildKey、模块身份和模块布局匹配;
|
|
33
|
-
- RVA 来自同版本静态或运行时证据,且入口字节一致;
|
|
34
|
-
- `root`/对象获取路径、字段偏移、类型和边界有指令或运行时记录支持;
|
|
35
|
-
- broker-backed Reader 实际读取成功;
|
|
36
|
-
- 读取结果与 Dynamic 快照或 Hook 返回值一致,或差异有明确解释。
|
|
37
|
-
|
|
38
|
-
任何一项缺失都保留 `candidate`,继续在 Dynamic 与 IDA/iced 之间切换,不填充猜测地址。
|
|
22
|
+
`reader_ready` 必须同时满足:build/hash 匹配;RVA 有静态或运行时证据;root、指针链、字段类型和上限可解释;broker Reader 实读成功;结果与目标字段一致。否则保留 `candidate`,不填猜测地址。
|
|
39
23
|
|
|
40
24
|
## 运行约束
|
|
41
25
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
26
|
+
- CDB 只由 broker 启动,使用 `spawn` 参数数组和命令文件,绝不经过 shell。
|
|
27
|
+
- 断点只接受单个已确认入口,不修改入口字节,不调用未知函数,不做大范围读取。
|
|
28
|
+
- 每次 debug 都设置命中上限和时限;超时清理 CDB、断点和临时命令文件。
|
|
29
|
+
- `memory regions` 先用 `VirtualQueryEx` 确认页面,再进行有界 `memory read`。
|
|
30
|
+
- 只有用户确认后的 profile 才复制到 `~/.wowdump/<buildKey>/profile/`。
|