rea/src/hopper
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
..
BridgeLauncher.ts fix(hopper): stop Linux demo children when the REA owner exits (#2499) 2026-10-13 12:59:22 +08:00
HopperAnalysisProfile.test.ts fix(ida): thin the selected FAT slice into the private headless input (#2201) 2026-10-12 22:07:49 +08:00
HopperAnalysisProfile.ts feat(ghidra): support raw NMOS 6502 analysis (#2079) 2026-10-13 21:13:01 +08:00
HopperCleanup.test.ts refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
HopperCleanup.ts fix(hopper): preserve observed process failures across requests (#1927) 2026-10-12 02:13:53 +08:00
HopperClient.ts fix(mcp): keep prompt completion within ready provider sessions 2026-10-12 16:27:51 +08:00
HopperDiagnostics.ts refactor(domain): split error taxonomy into thematic modules (#636) 2026-10-06 05:57:38 +08:00
HopperFileOffset.ts refactor: remove forwarding exports and redundant aliases 2026-10-09 22:46:09 +08:00
HopperMachOImage.test.ts feat(native): admit bounded MIPS ELF analysis through Ghidra (#1362) 2026-10-10 23:04:27 +08:00
HopperMachOImage.ts feat(ghidra): support raw NMOS 6502 analysis (#2079) 2026-10-13 21:13:01 +08:00
HopperOperationStage.ts fix(hopper): diagnose MCP provider failures with stage, state, and request context (#1044) 2026-10-09 00:33:56 +08:00
HopperProcessDiagnostic.test.ts fix(hopper): preserve startup failures and recover denied launches 2026-10-11 22:35:01 +08:00
HopperProcessDiagnostic.ts fix(hopper): preserve startup failures and recover denied launches 2026-10-11 22:35:01 +08:00
HopperProvider.test.ts feat(native): admit raw binaries with caller-supplied architecture and entry (#1868) 2026-10-12 00:06:29 +08:00
HopperProvider.ts feat(ghidra): admit RISC-V ELF analysis through a pinned generic lane (#2151) 2026-10-13 00:11:35 +08:00
HopperProviderCapabilities.ts feat(native): search analyzed memory for masked byte patterns (#2341) 2026-10-13 23:41:45 +08:00
HopperProviderDiscovery.test.ts fix(hopper): treat a directory launcher path as missing (#1426) 2026-10-10 21:31:26 +08:00
HopperRegexSearch.ts refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
HopperRegexWorker.ts fix(hopper)!: isolate regex matching from the native API thread 2026-10-09 05:12:36 +08:00
HopperRequestQueue.test.ts fix(hopper): enforce caller-supplied request deadlines (#1119) 2026-10-09 06:52:07 +08:00
HopperRequestQueue.ts fix(hopper): preserve observed process failures across requests (#1927) 2026-10-12 02:13:53 +08:00
HopperResponseStream.ts perf(providers): assemble fragmented responses once per line (#911) 2026-10-07 17:07:00 +08:00
HopperSessionValues.ts fix(hopper): preserve startup failures and recover denied launches 2026-10-11 22:35:01 +08:00
HopperSocketConnection.ts refactor(domain): split error taxonomy into thematic modules (#636) 2026-10-06 05:57:38 +08:00
HopperTargetLease.test.ts fix(io): consolidate managed snapshots and retain cleanup ownership 2026-10-12 14:46:37 +08:00
HopperTargetLease.ts fix(io): consolidate managed snapshots and retain cleanup ownership 2026-10-12 14:46:37 +08:00
LinuxPrivateDisplayDiagnostic.ts refactor(runtime): centralize safe JSON parsing and preserve error causes (#629) 2026-10-06 05:00:54 +08:00
LinuxPrivateDisplayProbe.ts refactor!: enforce canonical evidence and provider boundaries 2026-10-09 20:18:52 +08:00
protocol.ts refactor(domain): split error taxonomy into thematic modules (#636) 2026-10-06 05:57:38 +08:00