rea/bridge/ghidra
Matt Van Horn 2a78763e20
feat(native): search analyzed memory for masked byte patterns (#2341)
* feat(native): search analyzed memory for masked byte patterns

The diff adds search_bytes to the CLI, the shared MCP contract, Ghidra
inventory, and the headless bridge, and advertises the same operation on
Hopper as unavailable until that provider is verified. Patterns are
hexadecimal byte pairs with optional ?? wildcards and an optional
equal-length bit mask; the TypeScript boundary and the bridge both
require a nonempty pattern, equal lengths, and at least one constrained
bit. Ghidra walks initialized blocks in address order within inclusive
bounds, keeps overlapping matches inside a single block, and returns
each hit with its segment, unique source file offset, and containing
procedure, continuing through a cursor bound to the target, profile,
pattern, mask, and bounds. Each page reports the inclusive ranges
examined and the skipped uninitialized blocks; cancellation returns a
typed error and discards the active Ghidra database.
address_to_file_offset now uses the same unique-offset helper, which
rejects a mapping that is missing, ambiguous, or larger than a safe
integer.

* fix(native): limit unbounded byte search to loaded memory

Without start or end, search_bytes walked every Ghidra block, including
non-loaded file parts such as .symtab and overlay blocks, which the docs
call out of scope. Unbounded searches now skip those blocks and list them
in searched.skipped_not_loaded; explicit bounds in their address space
still search them. Document that a match must end at or before end.

* fix(native): preserve implicit address spaces in range consumers

* fix(native): reject present malformed byte search state

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-10-13 23:41:45 +08:00
..
ReaGhidraAnalysisOptions.java feat(ghidra): apply validated analyzer overrides before analysis 2026-10-12 03:49:31 +08:00
ReaGhidraApplySeeds.java feat(ghidra): configurable import language and analysis seeds (#1667) 2026-10-11 09:57:38 +08:00
ReaGhidraBridge.java feat(native): search analyzed memory for masked byte patterns (#2341) 2026-10-13 23:41:45 +08:00
ReaGhidraBundleActivator.java perf(ghidra): compile bundle activator with bridge scripts (#1931) 2026-10-12 02:46:32 +08:00
ReaGhidraExtensions.java feat(ghidra): integrate optional NativeAOT metadata recovery (#748) 2026-10-07 00:57:08 +08:00
ReaGhidraMipsSoftFloat.java feat(ghidra): admit soft-float MIPS32r2 ELF with integer-register float storage (#1949) 2026-10-12 04:54:38 +08:00
ReaGhidraNoReturnFix.java fix(ghidra): normalize Mach-O imported symbol names 2026-10-11 09:59:27 +08:00
ReaGhidraPrepareCom.java feat(ghidra): admit explicit DOS COM analysis (#702) 2026-10-06 16:26:40 +08:00
ReaGhidraPrepareRaw.java feat(ghidra): support raw NMOS 6502 analysis (#2079) 2026-10-13 21:13:01 +08:00