跳到主要内容

REA 逆向分析工作流

收藏0

在授权前提下对原生二进制、JavaScript/Electron、APK、固件等做取证、反编译、版本比对与证据化分析的工作流手册;是 REA MCP 服务器的配套指令(需另装工具本体),仅限合法安全研究。

让 AI 安装

github最新版本 0.1.1更新于 2026-10-19下载 0 次2 个版本

references/connection-and-recovery.md

8.6 KB查看排版效果
1# Connection and task recovery
2
3Read this guide only for an observed connection, command, approval or provider
4blocker. Keep the user's target and question in view. Explain what prevented the
5operation and the next useful step; after repair, continue the investigation.
6
7Commands below use an installed `rea`. If none is available, use the package
8invocation in `SKILL.md` when acquiring REA is authorized. Follow the connected
9server's schemas and the installed CLI's help rather than assuming repository
10main and an older release expose the same arguments.
11
12## Choose the remedy from the observed failure
13
14| Observation | Meaning and next step |
15| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16| No REA tools in the active session | Inspect registration with `rea doctor --client codex --json`. A skill installation alone does not register MCP. |
17| Missing, malformed or stale registration | Prepare a scoped setup plan; apply only authorized changes with backups. |
18| Aligned registration, but no connected tools | Restart/reconnect the client. Doctor checks registration; it cannot establish the current agent's connection. Inspect the client's launch error if reconnection fails. |
19| `MCP tool call requires approval, but approval policy is never` | Codex rejected the call before REA executed it. Do not install an engine or repeat setup to solve this client-policy decision. See the approval section below. |
20| REA returns `provider_unavailable` or an unavailable tool entry | Read that operation's provider diagnostics or `binary_session.result.tool_availability`. Expand each group's tool names and inherit the shared client requirements unless overridden. Use the operation's availability, reason, and remediation; a complete tool catalog does not imply every operation is available. |
21| `rea` is missing in a child shell, or Node is incompatible | Inspect the actual shell PATH and launcher/runtime. A prefix installation may be absent from a login shell's PATH; this does not establish a broken MCP registration. |
22
23If the client cannot launch its shell/sandbox helper or read the installed skill,
24inspect its launch diagnostic. For example, Codex can refuse helper aliases when
25CODEX_HOME is under `/tmp`; use an authorized profile outside the OS temporary
26directory. REA setup cannot repair the client's executor. Preserve the sandbox
27instead of silently disabling it to make an analysis command work.
28
29Static JavaScript and ordinary ZIP inventory need neither Hopper nor Ghidra.
30HAR inspection is offline and does not require a live browser. Native
31decompilation, Android analysis and firmware extraction have their own
32bring-your-own prerequisites. Use supported inventory/static evidence when it
33answers part of the question, and name the unavailable evidence separately.
34Do not substitute another target. Label observations from ordinary shell tools
35as such; only actual REA output supplies REA Evidence.
36
37## Repair registration when needed
38
39For Codex:
40
41```bash
42rea doctor --client codex --json
43rea setup --client codex --dry-run --json
44```
45
46Use the current supported client's ID: `claude_code`, `claude_desktop`, `codex`,
47`cursor`, `gemini_cli`, `windsurf`, `devin`, `opencode`, `antigravity`,
48`copilot_cli`, `commandcode`, `qwen_code`, `vscode`, `trae`, `grok_build`, `omp`, `pi`,
49`hermes`, `qoder`, `droid`, `zcode`, `dsh`, or `grok_bot`. If unknown, inspect `doctor --json` before choosing a
50scope. `grok_bot` uses a chat registration step rather than local `mcp.json`.
51For unsupported clients, use version-pinned manual stdio registration or CLI.
52
53Show the plan's exact paths, backups, changes and bundled-skill replacement.
54Obtain approval for writes when that concrete scope is not already authorized,
55then apply the same scope with `rea setup --client codex --yes`. Add
56`--install-hopper` only when separately needed and explicitly approved. Do not
57install or upgrade unrelated prerequisites. Restart/reconnect, verify tools
58actually appear, and resume the original task. If they remain absent, inspect
59the launch failure rather than looping through setup.
60
61## Codex tool approval is separate from REA readiness
62
63REA tools have no permission-grant handshake. Codex can still require approval
64because an operation creates owned resources, launches a helper or has cleanup
65effects. An advertised tool or successful doctor result does not override that
66client policy. `workspace-write` alone does not resolve an MCP approval
67rejection, and `approval_policy = "never"` does not mean every MCP tool is
68preapproved.
69
70When interactive approval is available, use the client's approval flow for the
71requested operation. In an unattended run, continue through an authorized CLI
72workflow if the execution environment permits it, or report the blocked
73operation and the approval needed to proceed. Do not retry the same rejected
74call, silently broaden approvals, or rewrite MCP effects as read-only.
75
76For an operator who explicitly wants to preapprove named operations in a
77disposable Codex profile, current Codex supports per-tool configuration. For
78example, opening and closing an analysis session can be scoped independently:
79
80```toml
81[mcp_servers.rea.tools.open_binary]
82approval_mode = "approve"
83
84[mcp_servers.rea.tools.close_binary]
85approval_mode = "approve"
86```
87
88Use the actual server ID and only the operations whose effects were approved;
89this example does not approve inspection, extraction or runtime execution.
90Show the proposed config edit and preserve unrelated entries and backups before
91writing. Managed policy can constrain client settings. Consult the
92[Codex configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference)
93for the installed client's supported settings. This is an optional recovery
94choice, not a prerequisite for every REA task.
95
96## Continue through an installed CLI
97
98Check the command environment only if the launcher fails:
99
100```bash
101command -v rea
102command -v node
103node --version
104rea --version
105```
106
107Use the public launcher at its known installation path with a supported existing
108Node on PATH when the child shell loses a prefix installation. Avoid internal
109`dist/cli.js` entrypoints or global toolchain changes. MCP may have its own valid
110launcher even when a shell cannot resolve `rea`.
111
112For a user-supplied JavaScript tree or ASAR, select output files in the authorized
113workspace and save complete Evidence before reading a view:
114
115```bash
116rea analyze-javascript-application /absolute/path/to/app --json > app-evidence.json
117jq -c '{source: {kind: "inline", evidence: .}, view: {kind: "summary"}}' app-evidence.json > app-view.json
118rea inspect-analysis-view app-view.json
119```
120
121These commands do not register MCP or install an analysis engine. CLI JavaScript
122JSON is complete and can be very large; redirect it rather than loading it into
123context. Use an existing JSON processor if `jq` is absent, without installing
124one just for this recipe. Inspect a module page or item using the same inline
125source and the [JavaScript recipes](javascript-applications.md). Preserve graph
126coverage, limitations and unknowns. Native CLI analysis still requires its
127selected engine, and all CLI operations retain the host's execution permissions.

文件内容是平台检查时读出的文本,只供查看。平台不会运行包里的任何脚本或程序。