rea/scripts
Omisakin Joshua 8823c55b0c
feat(ghidra): decode Swift String literals in function dossiers (#2049)
* feat(ghidra): decode Swift String literals in function dossiers

Swift passes a String as two words. Small literals keep their UTF-8 bytes
inside those words, and immortal large literals keep a count plus a pointer
to their bytes biased by 32. Ghidra creates no data reference for either, so
analyze_function reported no strings for Swift code.

On AArch64 programs that contain Swift metadata, the Ghidra bridge now runs
constant propagation over the function and decodes register pairs where
Swift consumes a String: consecutive argument registers at calls and tail
calls, x0 and x1 at returns, and both registers of one STP. Large literals
must resolve to terminated bytes inside one initialized block that is not
executable. A pair whose registers both come from conditional selects is
skipped, because Ghidra forks each select without correlating the
condition and could otherwise pair words from different cases.

Decoded values are a derivation from the ABI layout rather than observed
references, so they appear in a new optional swift_string_literals field
with their source instruction, registers and raw words, and in a matching
inspect_analysis_view facet. referenced_strings is unchanged.

Refs #2030

* fix(ghidra): bound Swift literal reads and compare decoded strings

Large immortal literals are measured against the remaining heap before
allocation, and a failed fit stays visible as a limitation. The canonical
empty string is kept. Small and large literals now require matching
address nullability, and function comparison treats decoded literals as
string evidence without equating a missing record to an empty one.

* fix(ghidra): budget Swift literal decoding and tighten use sites

Large literals now draw on one heap budget per dossier, measured once
before decoding, instead of a separate check per literal. A literal that
does not fit is listed in a new swift_string_literal_omissions field
with its address, byte length and reason, so consumers read omissions
from structured data rather than from limitation text.

strings_names comparison checks referenced strings and names first and
reports a change there even when Swift literal coverage differs; it
returns unknown only when those facts match and literal coverage is
absent on one side or partial.

A computed jump counts as a tail call only when it has no resolved
target inside the function, so jump tables no longer qualify, and a
return requires a RETURN p-code operation, so traps no longer qualify.

Decoded literals keep control characters, which Swift strings may
contain and JSON escapes. The Swift verifier builds the literal fixture
for arm64 on any Mac host and now also covers the empty string and a
literal containing a tab.

* fix(ghidra): charge escaped JSON and follow copied selects

The Swift literal budget now charges the worst case per UTF-8 byte: UTF-16
text, six escaped JSON characters held in Gson's growing buffer and in the
returned String, and the UTF-8 bytes written to the socket. Literals made
of control characters can no longer exceed the reserved heap.

A jump counts as a tail call only when every resolved target lies outside
the function. The conditional select check follows register copies back
to their definition, so selects copied into argument registers are
recognized like selects written there directly.

strings_names reports a change when both dossiers decoded different
literals at the same use site, even when either side has omissions; it
returns unknown only when no such use site disagrees.

* fix(ghidra): bound literal records and trace selects across branches

Every Swift literal record now pays a fixed cost against the dossier
budget in addition to its text, so many empty or small literals are
bounded as well. The first record that does not fit is kept as an
omission and decoding stops there, which keeps the omission record
itself bounded; omissions now describe small or large literals.

The conditional select check searches every predecessor path for the
reaching definitions, following register copies, so selects made
before a branch into the use block are recognized.

A dossier records Swift literals and their omissions together. Coverage
reads omissions first, and strings_names compares every use site that
neither side omitted: a decoded literal is known where it was recorded,
and an absence is known only in a dossier whose decoding examined every
use site.

* fix(ghidra): stop every flow at the literal budget and route omissions

Ending one flow from the evaluator leaves other queued flows running, so
the budget now records a shared stop that every flow checks before it
examines another instruction. A record that exceeds the budget is routed
by that capacity result rather than by whether text was decoded, so a
small literal over budget becomes an omission instead of a literal.

When coverage is partial, the per site comparison keeps each literal's
representation as well as its value, matching the full strings_names
projection.

* fix(ghidra): keep unresolved Swift tail-call sites unknown

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-13 20:41:10 +08:00
..
ci test(javascript): verify Windows path case and load scope (#2635) 2026-10-13 20:37:48 +08:00
fixtures fix(browser): exclude sensitive binary lengths from historical captures (#2477) 2026-10-13 14:49:47 +08:00
lib fix(ghidra): resolve file offsets in decompile (#2101) 2026-10-13 18:23:17 +08:00
verify refactor(firmware): split verification into staged functions (#2713) 2026-10-13 20:25:58 +08:00
audit-website-links.py chore(website): simplify maintenance and detect documentation drift 2026-10-10 20:27:01 +08:00
build-conformance-fixtures.mjs refactor(schema): remove data-only version markers 2026-09-29 08:45:36 +08:00
build-ghidra-nativeaot.mjs fix(ghidra): isolate optional nativeaot script sources 2026-10-11 09:35:22 +08:00
build-windows-native.mjs fix(windows): retain failed native inspection ownership (#1826) 2026-10-11 21:33:25 +08:00
bundle-runtime.d.mts perf(cli): bundle runtime entries to reduce Windows startup I/O (#1996) 2026-10-12 09:25:27 +08:00
bundle-runtime.mjs fix(cli): preserve failure semantics across full-output formats 2026-10-13 03:33:27 +08:00
check-dependency-install.mjs fix(deps): run freshness check from escaped paths 2026-07-16 19:51:25 +08:00
check-doc-facts.mjs build: add canonical product catalog and docs drift checks 2026-07-15 17:43:52 +08:00
clean-build-output.mjs build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
create-ghidra-windows-fixture.mjs fix(native): preserve compact reference provenance (#1438) 2026-10-10 21:39:28 +08:00
electron-active-hook-boundaries.cjs fix(capture): retain Electron observations and HAR resource failures 2026-10-09 06:49:02 +08:00
electron-active-hook.cjs fix(capture): retain Electron observations and HAR resource failures 2026-10-09 06:49:02 +08:00
generate-completion-ledger.mjs fix(build): make catalogs and packaged skills generated outputs (#1086) 2026-10-08 22:43:51 +08:00
generate-error-schema.mjs chore: migrate formatting to Oxfmt (#615) 2026-10-06 01:59:19 +08:00
generate-mcp-tool-catalog.mjs build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
generate-nativeaot-fixtures.mjs fix(ghidra): resolve file offsets in decompile (#2101) 2026-10-13 18:23:17 +08:00
generate-package-metadata.mjs fix(skills): expose authored skill to repository discovery 2026-10-10 14:20:22 +08:00
generate-product-catalog.mjs fix(build): make catalogs and packaged skills generated outputs (#1086) 2026-10-08 22:43:51 +08:00
generate-skill-metadata.mjs fix(skills): expose authored skill to repository discovery 2026-10-10 14:20:22 +08:00
generate-third-party-inventory.mjs fix: align MCP archive contracts and documentation (#2478) 2026-10-13 12:06:41 +08:00
hopper-demo-x11.py fix(hopper): stop Linux demo children when the REA owner exits (#2499) 2026-10-13 12:59:22 +08:00
prepack.mjs fix(cli): preserve failure semantics across full-output formats 2026-10-13 03:33:27 +08:00
prepare-website.py feat(website): add multilingual editions and translation workflow 2026-10-11 17:24:46 +08:00
prepare.mjs build: streamline local and CI validation 2026-07-22 16:06:28 +00:00
print-mcp-config.mjs fix(npm): use latest entry points without install scripts 2026-07-17 00:16:46 +00:00
rea.mjs fix(cli): normalize empty Windows profile before imports (#2482) 2026-10-13 12:43:52 +08:00
release-notes.mjs fix(release): avoid duplicated contributor thanks 2026-10-11 11:49:49 +08:00
release-npm-tag.mjs fix(release): publish prereleases under the next npm tag 2026-10-09 00:49:30 +08:00
run-development-tests.mjs build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
run-exclusive-command.mjs fix(dev): preserve command arguments in exclusive runners 2026-10-13 04:12:45 +08:00
run-exclusive.mjs build: separate runtime artifacts and supervise command ownership 2026-10-09 20:11:17 +08:00
scan-todos.mjs chore(scripts): merge duplicate node:fs import in scan-todos (#1790) 2026-10-11 18:18:10 +08:00
test-website.py feat(website): add a persistent light and dark theme switch 2026-10-13 09:27:49 +08:00
verify-adb.mjs feat(adb): complete ADB device support for Android reverse engineering (#1552) 2026-10-10 23:01:24 +08:00
verify-agent-experience.mjs feat(skills)!: improve Codex onboarding and task recovery (#1613) 2026-10-11 03:13:56 +08:00
verify-apktool.mjs fix(android): preserve decoded values and duplicate class inventories 2026-10-12 06:29:13 +08:00
verify-binary-layout.mjs fix(native): clarify Mach-O offset origins and reject partial ELF tables 2026-10-12 06:29:19 +08:00
verify-browser-dom-destinations.mjs fix(verify): report final success only after resource cleanup 2026-10-09 04:12:49 +08:00
verify-browser-modules.mjs feat(browser): trace captured website module imports (#879) 2026-10-07 14:59:52 +08:00
verify-browser-network.mjs feat(browser): capture correlated network content and lifecycle evidence (#797) 2026-10-07 04:35:49 +08:00
verify-browser-runtime.mjs feat(browser): attribute native execution and listener sources (#917) 2026-10-07 21:45:07 +08:00
verify-browser-scripts.mjs feat(web): export captured scripts for JavaScript application analysis (#801) 2026-10-07 05:24:32 +08:00
verify-browser-source-maps.mjs fix(browser): compose nested source-map column offsets (#1109) 2026-10-09 02:01:29 +08:00
verify-claude-client.mjs perf(mcp)!: compact repeated session discovery facts (#1988) 2026-10-12 07:40:19 +08:00
verify-commandcode-client.mjs fix(clients): preserve portable MCP schemas in native workflows (#1580) 2026-10-11 00:09:43 +08:00
verify-conformance-fixtures.mjs refactor(schema): remove data-only version markers 2026-09-29 08:45:36 +08:00
verify-copilot-client.mjs fix(tests): separate Copilot model IDs from wire models (#1647) 2026-10-11 06:52:45 +08:00
verify-deepseek-client.mjs feat(setup): register DeepSeek Harness through setup, doctor and uninstall (#1929) 2026-10-12 11:06:26 +08:00
verify-evm-interface.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
verify-flutter.mjs feat(flutter): identify Dart snapshot builds and inspect AOT payloads by pure APK parsing (#1582) 2026-10-12 22:35:55 +08:00
verify-frida.mjs feat: add Frida instrumentation support (#1359) 2026-10-12 22:01:58 +08:00
verify-gemini-client.mjs test(clients): verify native Gemini CLI integration on Windows (#1936) 2026-10-12 10:50:11 +08:00
verify-go-binary.mjs fix(go): accept file-backed unmapped Mach-O debug segments 2026-10-13 03:47:45 +08:00
verify-grok-client.mjs test(clients): verify native Grok Build workflows (#1571) 2026-10-10 22:59:43 +08:00
verify-jeb.mjs feat(jeb): add JEB engine provider over its MCP interface (#1536) 2026-10-10 23:03:27 +08:00
verify-linux-setup-e2e.mjs test(hopper): repair Linux demo setup and native verification (#2638) 2026-10-13 14:39:18 +08:00
verify-mcp-registry-metadata.mjs feat(electron): add autonomous Electron runtime analysis (#464) 2026-08-05 19:07:46 +08:00
verify-module-boundaries.mjs build: verify resolved module boundaries (#862) 2026-10-07 13:02:28 +08:00
verify-native-agent-client.mjs fix(onboarding): isolate client homes and clarify npm release support (#1627) 2026-10-11 04:37:31 +08:00
verify-native-calls.mjs test(native): retain trace diagnostics when observed hits differ 2026-10-10 04:39:17 +08:00
verify-native-ui.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
verify-omp-client.mjs fix(setup): reject invalid OMP profiles before fallback writes (#1562) 2026-10-10 22:11:14 +08:00
verify-opencode-client.mjs test(clients): verify native OpenCode integration (#1546) 2026-10-10 19:51:30 +08:00
verify-package-artifact.mjs feat(native): add investigation features (#486) 2026-09-30 00:41:05 +08:00
verify-package-capabilities.mjs perf(mcp)!: compact repeated session discovery facts (#1988) 2026-10-12 07:40:19 +08:00
verify-package-discovery.d.mts fix(package): separate agent and Hopper setup support (#584) 2026-10-06 00:00:15 +08:00
verify-package-discovery.mjs fix(package): separate agent and Hopper setup support (#584) 2026-10-06 00:00:15 +08:00
verify-package-environment.d.mts fix(test): use direct Node launcher on macOS 2026-07-24 03:31:26 +00:00
verify-package-environment.mjs fix(setup): honor active client configuration and skill roots (#1504) 2026-10-10 17:03:43 +08:00
verify-package-evidence.mjs refactor(adapters): split oversized provider workflows 2026-07-18 05:49:14 +00:00
verify-package-install.mjs feat: add Hermes as a supported MCP client (#1403) 2026-10-10 16:03:25 +08:00
verify-package-managed.mjs test(managed): include shared dossier fixture in artifact inputs 2026-10-10 04:09:45 +08:00
verify-package-mcp.mjs test(mcp): align completion checks with provider readiness 2026-10-12 18:44:02 +08:00
verify-package-pack.mjs fix(skills): expose authored skill to repository discovery 2026-10-10 14:20:22 +08:00
verify-package-platform.d.mts fix: consolidate boundary ownership and cleanup failure paths (#477) 2026-09-08 10:59:13 +08:00
verify-package-platform.mjs refactor: return complete tool results inline 2026-09-29 07:08:46 +08:00
verify-package-prompts.mjs test(mcp): align completion checks with provider readiness 2026-10-12 18:44:02 +08:00
verify-package-setup.mjs fix(setup): preserve initial backups and Codex comments (#1204) 2026-10-09 12:57:00 +08:00
verify-package-unknown-provider.mjs refactor(adapters): split oversized provider workflows 2026-07-18 05:49:14 +00:00
verify-package-update.mjs feat(setup): register OMP during setup (#1301) 2026-10-09 08:51:12 -07:00
verify-package.mjs ci: separate fast feedback from full qualification 2026-10-13 17:09:53 +08:00
verify-packaged-ghidra-windows.mjs perf(mcp)!: compact repeated session discovery facts (#1988) 2026-10-12 07:40:19 +08:00
verify-packaged-wasm-artifact.mjs feat(wasm): inspect local artifacts with WABT (#1533) 2026-10-11 19:49:00 +08:00
verify-packed-bridge.mjs perf(ghidra): compile bundle activator with bridge scripts (#1931) 2026-10-12 02:46:32 +08:00
verify-packet-capture.mjs feat(captures): discover installed protocol and field definitions (#2496) 2026-10-13 15:55:25 +09:00
verify-pcap.mjs feat(pcap): add bounded capture summaries through CLI and MCP 2026-10-13 04:53:03 +00:00
verify-published-package.mjs perf(mcp)!: compact repeated session discovery facts (#1988) 2026-10-12 07:40:19 +08:00
verify-qlog-captures.mjs feat(browser): inspect retained aioquic qlog JSON captures 2026-10-13 03:24:05 +00:00
verify-qwen-client.mjs fix(tests): verify Qwen skills through an isolated native home (#1646) 2026-10-11 06:05:57 +08:00
verify-real-browser.mjs fix(ci): close speculative browser fixture connections 2026-10-11 11:05:08 +08:00
verify-real-electron.mjs fix(electron): attribute unresolved paths to selected inputs 2026-10-13 04:12:40 +08:00
verify-real-ghidra-address-context.mjs fix(ghidra): resolve file offsets in decompile (#2101) 2026-10-13 18:23:17 +08:00
verify-real-ghidra-assertions.mjs refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
verify-real-ghidra-com.mjs refactor: prune obsolete provider and verification code 2026-10-12 08:59:14 +08:00
verify-real-ghidra-dos.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
verify-real-ghidra-function.mjs feat(ghidra): recover signed AArch64 relative jump tables (#1592) 2026-10-11 10:45:35 +08:00
verify-real-ghidra-inventory.mjs feat(native): add investigation features (#486) 2026-09-30 00:41:05 +08:00
verify-real-ghidra-mips-relocatable.mjs fix(scripts): pass MCP callTool timeouts as request options (#2387) 2026-10-13 09:16:41 +09:00
verify-real-ghidra-mips-shared.mjs feat(ghidra): admit verified MIPS16 shared ELF images 2026-10-12 07:50:31 +08:00
verify-real-ghidra-mips.mjs fix(scripts): pass MCP callTool timeouts as request options (#2387) 2026-10-13 09:16:41 +09:00
verify-real-ghidra-nativeaot.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
verify-real-ghidra-noreturn.mjs fix(ghidra): normalize Mach-O imported symbol names 2026-10-11 09:59:27 +08:00
verify-real-ghidra-raw.mjs feat(ghidra): apply validated analyzer overrides before analysis 2026-10-12 03:49:31 +08:00
verify-real-ghidra-riscv.mjs feat(ghidra): admit RISC-V ELF analysis through a pinned generic lane (#2151) 2026-10-13 00:11:35 +08:00
verify-real-ghidra-swift.mjs feat(ghidra): decode Swift String literals in function dossiers (#2049) 2026-10-13 20:41:10 +08:00
verify-real-ghidra-switch-assertions.mjs fix(ghidra): recover evidenced switch cases and default targets (#579) 2026-10-05 22:54:17 +08:00
verify-real-ghidra-switch-controls.mjs chore: migrate formatting to Oxfmt (#615) 2026-10-06 01:59:19 +08:00
verify-real-ghidra-switch.mjs refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
verify-real-ghidra-windows.mjs fix(ghidra): resolve file offsets in decompile (#2101) 2026-10-13 18:23:17 +08:00
verify-real-ghidra.mjs feat(ghidra): recover signed AArch64 relative jump tables (#1592) 2026-10-11 10:45:35 +08:00
verify-real-hopper-deadlines.mjs refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
verify-real-hopper-fat.mjs refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
verify-real-hopper-linux.mjs test(hopper): repair Linux demo setup and native verification (#2638) 2026-10-13 14:39:18 +08:00
verify-real-hopper.mjs fix(hopper): stop Linux demo children when the REA owner exits (#2499) 2026-10-13 12:59:22 +08:00
verify-real-ida.mjs fix(ida): preserve native coverage and verify returned values (#2324) 2026-10-13 08:44:18 +08:00
verify-reconstruction-readiness.mjs perf(domain): avoid duplicate readiness bundle validation 2026-10-11 13:29:11 +08:00
verify-recorded-crash.mjs feat(native): inspect recorded crashes through pwntools and pwndbg (#1054) 2026-10-08 16:50:31 +08:00
verify-release-checkpoint.mjs fix(release): validate frozen checkpoint versions and breaking notes 2026-10-08 10:13:05 +00:00
verify-repository-skill.mjs fix(skills): expose authored skill to repository discovery 2026-10-10 14:20:22 +08:00
verify-signal-recording.mjs feat(signals): discover installed decoders and option help (#2487) 2026-10-13 15:58:19 +09:00
verify-test-discovery.mjs fix(verify): report final success only after resource cleanup 2026-10-09 04:12:49 +08:00
verify-test-temp-hygiene.mjs fix(verify): report final success only after resource cleanup 2026-10-09 04:12:49 +08:00
verify-wasm-artifact.mjs fix(wasm): preserve leading BOM in custom section names (#2102) 2026-10-12 18:39:01 +08:00
verify-web-network-captures.mjs feat(mcp): derive an API surface view from retained web network captures (#1891) 2026-10-12 10:44:17 +08:00
verify-website.py feat(website): add multilingual editions and translation workflow 2026-10-11 17:24:46 +08:00
verify-windows-native-artifact.mjs feat(ghidra): enable Windows x64 read-only analysis (#699) 2026-10-06 16:53:33 +08:00
verify-windows-native-inspection.mjs fix(windows): retain failed native inspection ownership (#1826) 2026-10-11 21:33:25 +08:00
verify-windows-native.mjs fix(windows): preserve caller affinity only within one processor group (#2202) 2026-10-13 14:49:34 +08:00
verify-windows-package.mjs feat(setup): register OMP during setup (#1301) 2026-10-09 08:51:12 -07:00
website.py fix(website): keep omitted language selectors free of whitespace 2026-10-13 18:21:09 +08:00
website_i18n.py fix(website): incorporate multilingual contributor refinements 2026-10-11 17:24:46 +08:00
windows-capabilities.mjs feat(ghidra): define the Windows P0 admission boundary 2026-07-17 03:05:19 +09:00