Skip to content

Commit 22cf964

Browse files
committed
docs(skill): route native runtime questions through explicit workflows
1 parent 4fb936f commit 22cf964

3 files changed

Lines changed: 64 additions & 8 deletions

File tree

‎.agents/skills/reverse-engineer-anything/SKILL.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
name: reverse-engineer-anything
33
description: Reverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.
44
metadata:
5-
version: "45"
5+
version: "46"
66
---
77

88
# REA
99

1010
Use REA when a claim depends on a shipped binary or package, decompilation,
11-
passive application runtime evidence, or comparison with
11+
requested runtime evidence, or comparison with
1212
behavior not established by available source. For ordinary analysis of a
1313
complete source repository, use normal repository tools and do not run REA
1414
readiness or provider commands.
@@ -124,6 +124,12 @@ explicit path or endpoint and do not need it.
124124
- .NET NativeAOT PE/ELF: native Ghidra analysis. Native code can yield pseudocode;
125125
consult the NativeAOT workflow in `references/native-and-artifacts.md` for
126126
optional metadata recovery and its supported host/layout boundary.
127+
- Native program behavior, live calls, instrumentation, or command-run effects:
128+
choose the matching [native runtime workflow](references/runtime-observation.md#native-runtime-questions).
129+
`open_binary` and `trace_native_values` establish static facts; they do not
130+
observe execution. Runtime tools have distinct launch, attach, mutation and
131+
cleanup effects, and do not require a preliminary static session unless their
132+
own contract says so.
127133
- User-owned browser page already open: `list_browser_targets`.
128134
- Browser action the agent must perform (click, type, navigate):
129135
`capture_browser_scenario` with declared actions. See
@@ -438,8 +444,8 @@ as complete while required questions remain open.
438444
[references/javascript-applications.md](references/javascript-applications.md)
439445
- Android APK declarations, classes, methods, and static references:
440446
[references/android-applications.md](references/android-applications.md)
441-
- Browser/Electron observation (passive and scenario) and static/runtime
442-
reconciliation:
447+
- Native instrumentation, debugger and process capture; browser/Electron
448+
observation; static/runtime comparison:
443449
[references/runtime-observation.md](references/runtime-observation.md)
444450
- Evidence paging, comparisons, residual unknowns, and verification:
445451
[references/evidence-workflows.md](references/evidence-workflows.md)

‎.agents/skills/reverse-engineer-anything/references/android-applications.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ instead of guessing.
1515

1616
The provider requires a separately supplied headless JADX MCP JAR 0.7.1 and
1717
Java 17 or newer. `REA_JADX_MCP_JAR` selects the absolute JAR path; `JAVA_HOME`
18-
can select Java. REA setup does not install or configure that JAR. Use
19-
`rea doctor --provider jadx --json` to check configuration and obtain prerequisite
20-
remediation. Readiness does not establish successful analysis of a particular APK.
18+
can select Java. Use `rea doctor --provider jadx --json` to check the JADX
19+
configuration and obtain remediation for missing prerequisites. Java and the
20+
headless JADX MCP JAR remain caller-supplied; REA setup does not install or
21+
configure them. Configuration readiness does not establish successful analysis
22+
of a particular APK.
2123

2224
Linux and macOS use the POSIX owned-process boundary. Windows x64 requires the
2325
matching bundled native controls and uses an owned Job Object with bidirectional

‎.agents/skills/reverse-engineer-anything/references/runtime-observation.md‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,52 @@
1-
# Browser and Electron runtime observation
1+
# Runtime observation
2+
3+
## Native runtime questions
4+
5+
Start from the requested observation. State the selected target, input, expected
6+
result, failure signal and stopping condition before a run. Reuse static Evidence
7+
to choose a function or hypothesis; `trace_native_values` follows recovered
8+
static value dependencies and does not measure runtime values. Prefer static
9+
inspection or existing capture comparison when it already answers the question.
10+
11+
| Question | Existing workflow | Host and effects |
12+
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13+
| Which selected native entry is reached, with which integer argument registers? | `observe_native_calls` on the active Mach-O, with exact function/Objective-C breakpoints and a duration/event bound | macOS with LLDB and required debugger access. Launches a new owned process, stops at entries, records and continues; target execution may write files, show UI or use the network. It never attaches to an existing process. Inspect termination and partial coverage after the run. |
14+
| What does caller-authored instrumentation observe? | `list_frida_devices` / `list_frida_processes` when discovery is needed; `start_frida_session`, `load_frida_script`, then status/unload/close | Requires compatible installed Frida bindings and selected device access; the real REA verifier covers Linux. Attach selects an existing PID; spawn selects a program and starts it paused until `resume_frida_session`. Scripts execute in the target and can change memory, files, network activity and behavior. This is not passive inspection. |
15+
| Which debugger state or controlled execution explains the behavior? | `start_gdb_session` and `gdb_console`, or `start_rizin_debug_session` and `rizin_debug_command` | Persistent debugger workflows are Linux-only. GDB starts a debugger; console commands choose/load/attach/run targets. Rizin debug start launches the selected target and requires a durable `inferior_tty`. Both consoles are unrestricted and can change target memory/registers, run shell commands, write files and use the network. |
16+
| How do terminal output, process lifetime and selected files differ between runs? | `capture_process_scenario`, then `compare_process_captures` with compatible recorded inputs | New captures require Linux or macOS and a working native PTY backend; macOS also needs `xcrun`/Swift for ownership inspection. Capture launches an owned command with ordinary user permissions. Observation paths select snapshots, not a filesystem sandbox. Comparing retained captures does not execute targets and is also available on Windows. |
17+
| What does an existing desktop window show, or what changes after a declared UI action? | `observe_native_ui`; use `capture_native_ui_scenario` only for requested actions | macOS 14+ with required Screen Recording/Accessibility access. Select an existing PID/window. Observation does not launch or own the app; scenario actions can change its data or trigger network activity, and leave its state as-is. |
18+
19+
Close each persistent session with its matching tool. `close_frida_session`
20+
unloads scripts and detaches; it does not kill the target. A still-paused spawn
21+
is resumed only after instrumentation cleanup is confirmed. GDB and Rizin close
22+
can detach a live inferior and let it continue only after verifying its durable
23+
output terminal. When disposition or cleanup is unresolved, preserve the owned
24+
session and reported recovery; do not assume that closing the debugger terminated
25+
the target. Process capture and LLDB call observation instead own their launched
26+
processes and report their termination/cleanup outcome. Cancellation is not proof
27+
that cleanup completed.
28+
29+
Unrestricted GDB/Rizin commands and relevant start/close operations retire an
30+
active binary-analysis session in the same MCP server. Close an active Ghidra
31+
session explicitly first; after target effects settle, reopen the artifact before
32+
new static analysis. A Cutter bridge command is likewise unrestricted and may
33+
affect its GUI/target; it is not a passive native observation substitute.
34+
35+
To test a static hypothesis across two builds, retain compatible static
36+
comparison Evidence and `compare_process_captures` Evidence. Supply explicit
37+
finding/dimension mappings to `correlate_static_and_runtime`. It does not ingest
38+
arbitrary Frida, LLDB or debugger traces, auto-match names, or prove causality
39+
from cochange. Preserve those traces as their own Evidence and leave unobserved
40+
behavior unknown. Record truncation, unmatched breakpoints, changed target
41+
identity and cleanup uncertainty as limitations, rather than treating no retained
42+
event as proof that the behavior never occurs.
43+
44+
Detailed contracts and prerequisites: [Frida](https://github.com/morluto/rea/blob/main/docs/frida-instrumentation.md),
45+
[GDB/Rizin/Cutter](https://github.com/morluto/rea/blob/main/docs/reverse-engineering-tools.md),
46+
[process capture](https://github.com/morluto/rea/blob/main/docs/process-capture.md),
47+
and [native calls/UI](https://github.com/morluto/rea/blob/main/docs/native-investigation.md#native-desktop-observation).
48+
49+
## Browser and Electron
250

351
Supply the existing browser or Electron instance's literal-port loopback CDP
452
endpoint in the request. No separate permission configuration or per-call

0 commit comments

Comments
 (0)