|
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 |
2 | 50 |
|
3 | 51 | Supply the existing browser or Electron instance's literal-port loopback CDP |
4 | 52 | endpoint in the request. No separate permission configuration or per-call |
|
0 commit comments