Commit Graph
264 Commits
Author SHA1 Message Date
morluto 522452da70 perf(ida): bootstrap Hex-Rays bridge once, push down string_at and list_funcs filter, and cache imports (#13469)
* perf(ida): bootstrap Hex-Rays bridge once, push down string_at and list_funcs filter, and cache imports (#13276, #13353)

* fix(ida): reload the Python bridge only when its entry point is missing
2026-11-22 16:49:26 +00:00
morluto 747656b995 perf(hopper): materialize pre-casefolded search inventory in hopper_bridge.py (#13458) 2026-11-22 16:25:40 +00:00
morluto 1df51e3247 perf(ghidra): stream inventory and search replies directly via JsonWriter (#13453)
* perf(ghidra): stream inventory and search replies directly via JsonWriter

* fix(ghidra): set serializeNulls explicitly on JsonWriter and enforce default-false null omission in probe stub

* fix(ghidra): check monitor cancellation before streaming cached listNames
2026-11-22 16:13:43 +00:00
morluto beff3a2842 perf(ghidra): skip redundant leaf matching in ReaGhidraBridge literal searches (#13439)
* perf(ghidra): skip redundant leaf matching in ReaGhidraBridge literal searches

* test(ghidra): exercise production matcher factories in leaf-skip probe
2026-11-22 15:12:56 +00:00
ashritandmorluto 3db9120c5e fix(ghidra): point to the LC_MAIN entry when a stripped Mach-O has no main symbol (#12966)
* fix(ghidra): derive the LC_MAIN entry address from bounded snapshot reads

* fix(ghidra): point to the LC_MAIN entry when a stripped Mach-O has no main symbol

* fix(ghidra): keep snapshot cleanup failures from the LC_MAIN hint read

* fix(ghidra): admit the LC_MAIN segment's file range before hinting

* fix(ghidra): give no LC_MAIN hint for an entry in a file-only segment

admitMachoSegmentCommand admits a segment with no VM size and no protection but marks it unmapped; it owns no analysis address, so the hint must not name one.

* fix(ghidra): confirm Mach-O entry retries against the function inventory

* fix(hopper): offer inventory recovery for unresolved selectors

* fix(ida): offer inventory recovery for missing procedures

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-22 14:14:21 +00:00
morluto 18f5b7b4db perf(pcap/pwntools): eliminate redundant parsing, linear scans, and quadratic allocations (#13359)
* perf(pcap/pwntools): eliminate redundant parsing, linear scans, and quadratic allocations

* fix(pcap/pwntools): address review threads on DNS reconciliation, request target cache bound, and dead helpers
2026-11-22 08:04:19 -05:00
morluto 4d7a9710fe perf(artifacts/android): reuse ASAR snapshot descriptors and index JADX bridge lookups (#13361)
* perf(artifacts/android): reuse ASAR snapshot descriptors and index JADX bridge lookups

* fix(android): cap retained external caller index and fall back to scan
2026-11-22 08:03:33 -05:00
4f43d7422f feat(browser): accept mitmproxy 12.3.1 for native capture decode (#8088)
* feat(browser): accept mitmproxy 12.3.1 for native capture decode

Bump the offline adapter profile, provider identity, Linux verification archive, and docs so callers can use mitmproxy 12.3.1 instead of the 12.2.3 pin that blocks patched Brotli/cryptography. Keep SaveHar null postData admission for both producer versions.

Fixes #8078

* test(web): regenerate published HAR example identities

The HAR limitation now names both admitted mitmproxy profiles, which
changes the decoded capture's Evidence ID and both views' parent and
view digests. Update the published API surface and environment manifest
examples to the identities reproduced from their fixture bytes.

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>

---------

Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-22 09:26:35 +00:00
morluto 6cc7de3005 perf(native): eliminate quadratic lookups, comparator Zod/stringify churn, and redundant clones across native workflows (#13306)
* perf(native): eliminate quadratic lookups, comparator Zod/stringify churn, and redundant clones across native workflows

* test(native): assert exact compositeKey ordering sequence in objcSwiftMetadata
2026-11-22 08:54:10 +00:00
morluto 297630cbf3 perf(ghidra): eliminate non-ASCII search flood, compact bridge inventories, and stream JSON responses (#13305)
* perf(ghidra): eliminate non-ASCII search flood, compact bridge inventories, and stream JSON responses

* fix(ghidra): resolve :: in procedure leaf and add checked-in bridge helper tests

* fix(ghidra): handle CRLF line endings in bridge helper tests
2026-11-22 03:15:15 -05:00
Xiangfang Chen 85154de8ab fix(android): advertise the external-reference inputs the bridge accepts
The bridge-owned catalog omitted method_name and reference_target from
get_class_summary and reference_target from get_xrefs_to_method, even
though the bridge reads both on its external-prototype path and REA
sends both for reference queries. Neither side validates against the
schema today, but the verified catalog contradicted the traffic it
describes, and any schema-validating client would reject REA's own
reference queries.

The REA call sites also stopped sending limit, resolve_line and
smali_fallback, which the bridge never reads.

Validation: check:fast, and the Android MCP boundary plus JadxAnalysis
tests (92 tests). The bridge source itself was not compiled here; the
local engine JAR is absent, so verify:android against the real 0.8.0
JAR remains the authoritative catalog check.
2026-11-22 16:01:00 +08:00
Xiangfang Chen 2b6ede2d0c fix(android): let the bridge advertise its own tool schemas
Listing the bridge tools closed the connection. The bridge copied each
property from the pinned engine's schema, and that schema has no
`overload_index` for `get_xrefs_to_method`, so the advertised map carried
a null that kotlinx serialization cannot write. Only `tools/list` was
affected: REA calls tools by name, which is why the real lanes never saw
it, and the same defect reproduces against the 0.7.1 engine.

The bridge now declares the properties and required fields it accepts, so
an engine bump can neither advertise a null nor drop the overload
selector REA relies on. The real Android lane lists the live catalog to
keep the shape under test. One tool list serves both the consumed set and
the reimplementation loop, unknown names fail fast instead of inheriting
a method-shaped schema, and the identity moves to 12 because main's JNI
split-qualification change already owns 11.

Validation: build:cached, check:fast, docs:check, test:focused over the
Android boundary files, and verify:android against the real 0.8.0 JAR and
ApiDemos 6.0.18. The new catalog step passes; the lane still stops at the
pre-existing `missing java` recovery expectation, which this change does
not touch.
2026-11-22 16:01:00 +08:00
Xiangfang Chen 3ca89d8272 feat(android): pin jadx-headless-mcp 0.8.0
Move the audited engine release and its submodule gitlink from v0.7.1 to
v0.8.0 (commit 2b2a560e, sha256 4b9a01c2...). Upstream only changed
source-window paging and metadata-only field reads, so the six tools REA
consumes and the bridge identity stay unchanged.

Hand-copied version numbers now derive from JADX_RELEASE: the fixture
download name, the metadata-bridge workflow path and the fake MCP
server's reported engine version. The composition fallback availability
text no longer names a release, because the Android boundary owns the
versioned remediation.

Validation: build:cached, check:fast, docs:check, test:focused over the
16 Android test files (296 tests), and verify:android against the real
0.8.0 JAR and ApiDemos 6.0.18.
2026-11-22 16:01:00 +08:00
morluto ed234b2016 perf(hopper): eliminate full name-inventory rebuilds in analyze_function, list_names, and caller reconciliation (#13307)
Refs #13277
2026-11-22 03:47:15 +00:00
morluto dff9b479ed perf(ida): push literal patterns down to find_regex on all protocols and drop catch-all non-ASCII wildcard (#13291) 2026-11-22 02:38:16 +00:00
6357f775a0 fix(pwntools): release each PLT emulator so CET binaries keep their PLT map (#13213)
* fix(pwntools): release each PLT emulator so CET binaries keep their PLT map

pwntools 4.15.0 emulates each PLT section in a new Unicorn instance with
a 1 GiB virtual map, and hook closures keep each instance alive until
cyclic GC. Under the default 3 GiB address-space limit the third section
of a CET x86-64 image failed upstream's 1 GiB probe, so linkage.plt was
truncated with only a stderr warning (/usr/bin/ls: 4 of 108 entries).

Wrap upstream's emulate_plt_instructions for the PLT pass so each
section's emulator is collected before the next, restoring it in
finally. Peak PLT address space drops from about 3.2 GiB to 1.1 GiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(pwntools): make the CET verifier deterministic and supervised

---------

Co-authored-by: aadheel <250292080+aadheel@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-22 02:35:42 +00:00
Adolanium 947fa8f14d fix(browser): separate the decoder CPU budget from an inherited ceiling
A SIGXCPU at the requested budget is the decoder's own ceiling. Raising RLIMIT_CPU does not extend it. A lower recorded ceiling remains an inherited limit. A failed close of the CPU record stays on the decoder scope and does not skip that classification.
2026-11-21 20:08:53 +01:00
Adolanium 39ade5694b fix(browser): name the CPU ceiling when mitmproxy dies with SIGXCPU
A tighter inherited RLIMIT_CPU is kept, and that death had no reply. The decoder records the installed ceiling, and SIGXCPU becomes a CPU resource constraint that names it.
2026-11-21 20:08:53 +01:00
Adolanium 92f3f28d29 fix(browser): name the inherited address-space limit on a decoder memory refusal 2026-11-21 20:08:53 +01:00
Adolanium 465ae4d1d5 fix(browser): bound mitmproxy replies by the inherited file limit
A tighter RLIMIT_FSIZE was installed, but the reply check still used the
requested budget. A reply under that budget could exceed the inherited
limit and truncate. The effective cap now bounds the write, and a reply
that does not fit returns a fixed file-size limit. Tests also keep a
higher hard limit distinct from the new soft limit.
2026-11-21 20:08:53 +01:00
Adolanium 919fbfb983 fix(browser): clamp mitmproxy limits and always shut the decoder down
setrlimit ran before the shutdown guard and asked for hard limits the
process may not raise. A tighter inherited hard limit then left mitmdump
running until the capture timeout.
2026-11-21 20:08:53 +01:00
Adolanium 72f8f521a6 fix(desktop): claim agentenv capture exclusively and survive FIFO write errors (#12838)
* fix(desktop): claim agentenv capture exclusively and survive FIFO write errors

stop() used makedirs(exist_ok) before the control FIFO existed, so a
start already in that window kept running after stop reported the
capture absent. A broken or full FIFO also aborted stop and mark
instead of reporting that the capture was not reading.

* fix(desktop): retry agentenv stop until the reader accepts it

stop() treated the first failed FIFO write as final and then started a
second full timeout. A start() that has created the FIFO but not opened
it kept running, and an interrupted startup could take twice the
caller's timeout.

* fix(desktop): remember an absent agentenv stop for a retry

stop() claimed a missing directory and returned absent. A retry found
that directory and waited for a FIFO that start() will not create, so
the build-computer release could not clear the folder. The claim is a
file in the directory, and a later stop returns absent.

* test(lifecycle): name the renamed JEB and BEAM coverage tests

The full source suite still expects titles removed by the JEB catalog consolidation and the BEAM CLI consolidation. Point those entries at the tests that replaced them.
2026-11-21 20:05:35 +01:00
6822ebe1f3 feat(ida): support the official Hex-Rays IDA MCP headlessly (#4813)
* feat(ida): support the official Hex-Rays IDA MCP headlessly

Hex-Rays IDA MCP serves database reads only through execute_python, so
REA rejected it as an upstream. A `hexrays` headless stdio registration
now leases a private idalib worker through open_database, answers the
existing database-supervisor reads with a fixed, packaged, read-only
query module, and releases the lease with close_database, verified by
list_databases.

Observations record execute_python, the query and the module digest.
Tool errors are typed so a completed rejection is distinguished from an
unknown outcome; an unconfirmed release is retried and a late lease on
the private input is adopted.

Validated IDA source and bridge tests, static checks, docs, and npm run
verify:ida on Linux x64 against x86-64 and AArch64 ELF fixtures.

* feat(ida): name the Hex-Rays registration for its catalog

A registration without `protocol` that reaches the official Hex-Rays
server failed with only the missing database-supervisor tools. Startup
profile failures now report the advertised catalog, and when it is the
Hex-Rays one the message and recovery name the `hexrays` registration.

Refs #1416

* docs(ida): state Hex-Rays prerequisites and upstream session traces

Upstream needs IDA 9.4 or later with idalib, Python 3.11 or later, uv
and Git. The profile does not analyze databases open in the IDA GUI, and
the server keeps its own session traces outside REA's workspace.

Refs #1416

* fix(ida): skip inline data when scanning Hex-Rays calls

The call scan decoded every head that FuncItems yields. Inline data such
as a jump table can decode as a call and refer to a function or import,
which reported false callees and call-graph edges. Skip non-code heads
before decoding, as disassembly already does.

Refs #1416

* fix(ida): retain Hex-Rays health reads in evidence

The identity and readiness reads around each operation kept only their
parsed result, dropping the bridge digest and any engine output. Keep
them whole as health_observations beside the parsed metadata, in both
successful and partial-failure Evidence.

Refs #1416

* test(ida): list the Hex-Rays bridge in package fixtures

The packed-bridge verifier has required bridge/ida/hexrays_queries.py
since the Hex-Rays profile landed, but three package tests still built
their member lists without it. The verifier stopped at that file, so 21
cases failed or asserted on the wrong omission.

Refs #1416

* feat(ida): open existing IDA databases through the Hex-Rays profile

A headless open re-ran auto-analysis from the input binary, discarding
the names, types and comments of an existing database and taking far
longer on large targets. Target admission now identifies IDA databases
by their IDA1/IDA2 signature, and the hexrays profile opens a private
copy of one; Hopper and the other IDA profiles reject them.

The copy is required, not incidental: idalib repacks a database when
its last lease is released, even without a save. A database reports
the input it was created from, so the session is bound to the opened
copy's idb_path, and health now reports the input SHA-256 it records.

Validated with resolver, provider and session tests, check:fast,
docs:check and test:changed, plus a real Hex-Rays MCP run against a
1.4 GB SC2 .i64 whose original file was left byte-identical.

Refs #1416

* fix(ida): verify the private workspace of a database target by idb_path

* test(ida): fix Hex-Rays health stand-ins and Windows path and runtime teardown

* refactor(ida): resolve the registration once for target support

* docs(ida): record the real Hex-Rays run on an existing .i64

* docs(ida): make the Hex-Rays registration example install-neutral

* chore: keep merge-hook formatting outside the IDA change

* fix(ida): retain live Hex-Rays databases this server does not lease

A list_databases row with instance_id null is a live owner, not a stopped
database. Mapping it to the supervisor's released-worker shape made cleanup
delete files another client still held. Unleased rows stay active, so the
private path must leave inventory before the workspace is removed.

Accept idat inventory rows, hash the query bridge with sha256Hex, and
complete databaseEngine on Hopper fixtures added on main.

* fix(ida): report uncapped Hex-Rays call graphs

* docs(ida): link to the Hex-Rays bridge on GitHub

* fix(ida): verify Hex-Rays worker identity and cleanup

* feat(ida): support Hex-Rays idat headless workers

Refs #12921

* fix(ida): retain workspace after ambiguous Hex-Rays startup

* fix(ida): preserve typed Hex-Rays call edges and deadlines

* test(ida): verify Hex-Rays cleanup with a peer lease

* test(ci): use project deadlines for the Cutter verifier

* test(ida): keep verifier cleanup fixtures scoped to mocked modules

* fix(ida): retain the worker backend in partial evidence

---------

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-20 17:58:27 -05:00
morluto f61c38c820 test(mitmproxy): consolidate transport evidence checks (#12935) 2026-11-20 22:37:46 +00:00
morluto c0d3f2ea93 test(process): consolidate native Darwin token refusal coverage (#12901) 2026-11-20 18:14:22 +00:00
morluto 41fc470072 fix(ci): verify packaged Agent Environment bridges (#12874)
* test(agentenv): observe timeout before polling a pending run

* test(agentenv): verify bridge files at package boundary
2026-11-20 16:06:14 +00:00
morluto c18a8f9e7f test(agentenv): stabilize timeout and stderr signal fixtures (#12864)
* test(agentenv): stabilize timeout escalation during fixture startup

* test(agentenv): wait for same-session interrupt acknowledgement
2026-11-20 15:33:24 +00:00
morluto 166166e197 test(agentenv): witness supervised exit before drain cancellation (#12858)
test(agentenv): witness leader exit before stderr cancellation
2026-11-20 15:18:18 +00:00
morluto d137ffa762 test(agentenv): consolidate verification, capture and cleanup checks (#12855)
* test(agentenv): consolidate solve verification and cleanup checks

* test(agentenv): verify capture argument delivery and retention together

* test: update lifecycle registry after campaign test renames
2026-11-20 15:05:34 +00:00
morluto e48241439d test(agentenv): consolidate computer bridge teardown checks (#12811)
test(agentenv): consolidate computer teardown cases
2026-11-20 12:59:37 +00:00
morluto 7f5a39c0c1 test(lldb): consolidate bridge journal and FIFO checks (#12808) 2026-11-20 12:56:32 +00:00
Akshad Jogiandmorluto ae25050dff feat(native): surface inferred prototype instruction conflicts (#8161)
* feat(native): surface inferred prototype instruction conflicts

- Add evidence-backed x86-32 stack-read and stdcall cleanup diagnostics in ReaGhidraBridge.java without rewriting signatures or function bodies.

- Carry prototype conflicts through native API schemas, analysis summaries and retained dossier views so CLI and MCP share the observations.

- Update Ghidra analysis profile digests, documentation and MCP boundary tests for the new diagnostic contract.

* fix(native): follow framed paths and retain zero cleanup conflicts

- Traverse decoded entry-frame paths in ReaGhidraBridge.java instead of stopping at an address-ordered early return, so later reachable reads remain visible.

- Detect explicit, implicit and partial EBP writes and use decoded operands with p-code loads, preventing stale-frame warnings and recognizing real Ghidra stack reads.

- Compare immediate return cleanup with inferred stdcall stack bytes even when either side is zero, and allow zero in the native API contract.

- Add real Ghidra instruction probes and MCP/CI regressions for the reported cases and document the bounded checks.

* fix(native): attribute frame reads before register writes

- Check a decoded stack read before invalidating EBP in ReaGhidraBridge.java so instructions that read and replace the frame still report the conflict.

- Match each candidate operand's address p-code to its LOAD pointer so a POP from ESP into an EBP destination cannot masquerade as an argument read.

- Cover both decoded instruction cases in ReaPrototypeConflictProbe.java and await verifier-owned scratch cleanup on success and failure.

* fix(ghidra): recompute raw profile digests after rebase

- Recompute the 6502 and disabled-analyzer raw-binary profile digests in GhidraRawProfileDigest.test.ts so the pinned values commit to the merged shared policy on current main.

* fix(native): locate the entry frame by address and own verifier cleanup

- Find PUSH EBP; MOV EBP, ESP from the function entry address in ReaGhidraBridge.java so an owned block below the entry cannot hide a reachable argument read.

- Run analyzeHeadless in its own process group and stop that group before removing scratch in verify-ghidra-prototype-conflicts.mjs, so the JVM and decompiler children are addressed as one owned family.

- Cover the lower-owned-block case in ReaPrototypeConflictProbe.java with an entry frame preceded by a decoded lower block.

* fix(native): size prototype fixture and own Ghidra cleanup

- Allocate the instruction fixture through the lower-block offset in verify-ghidra-prototype-conflicts.mjs so the entry frame and decoded block exist for the probe.

- Check the detached process group instead of the leader exit code before cleaning up, so lingering decompiler children receive SIGTERM and SIGKILL before scratch removal.

* fix(native): own Ghidra probe cleanup with shared process owner

- Use REA's ProviderProcessSupervisor and token-verified cleanup in verify-ghidra-prototype-conflicts.mjs so the JVM and descendants are stopped before scratch removal, including failed launches.

- Preserve the source-owned x86 fixture with an entry frame and lower block while asserting verified cleanup.

- Build the pinned verifier dependency graph in the Ghidra bridge CI job and extend its timeout before running the real probe.

* fix(native): end verifier waits on interrupt before cleanup

- Install SIGINT and SIGTERM handlers before spawning Ghidra and abort the wait, so Ctrl-C no longer leaves the detached process group running.

- Keep cleanup handlers installed until the shared process owner reports verified cleanup, then remove scratch only after the process family is stopped.

* fix(native): preserve verifier cleanup interruption errors

- Keep interrupt handlers installed through process cleanup and workspace deletion, then check cancellation before reporting success.

- Preserve and report the failing cleanup step instead of replacing it with an interruption or deleting a tree that may still be unsafe.

* fix(native): retain probe failures across verifier cleanup

- Record the probe error before cleanup so a late SIGINT or SIGTERM cannot replace its stack and captured Ghidra diagnostics.

- Prefer the earlier probe failure when cleanup also fails, while preserving cleanup diagnostics and temporary state for diagnosis.

* test(kuna): raise caller matrix verifier budget for parallel CI

- The multi-target verifier spawn used a 10s timeout while sibling verifier cases use 25s.

- Under 8-way sharded CI load this intermittently exceeded 10s and produced ETIMEDOUT, failing shard 1/8 and portable tests.

- Raise to 30s to match the existing verifier budget and avoid load flakes.

* ci: retrigger checks after transient Ghidra SDK download 403

- The ghidra_bridge lane failed in upstream's untouched SDK acquisition step: curl returned 403 with 0 bytes downloaded in 0.046s from the GitHub release CDN.

- Push an empty commit to start a fresh run because rerunning on the upstream repository requires admin rights.

* fix(native): keep the cleanup lease on combined verifier failures

- Run the prototype-conflict probe through withVerifierFixture so a probe failure and a failed release surface as one AggregateError that keeps the probe error as its cause and attaches the retained fixture as cleanupLeases, instead of throwing the probe error alone and dropping the cleanup owner.

- Report the failed cleanup step and retained project only when the fixture was not released, and keep interrupt handlers installed until release finishes.

* test(native): use shared MCP prototype test deadlines

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-19 01:55:13 +00:00
Aurelio Bernalandmorluto 9b1ffa1f7d fix(ghidra): protect only unapplied relocation destinations, not their whole block (#11996)
Since #10483, an unapplied loader relocation in a non-writable block made
that whole block volatile. TLS slots are such relocations and sit in .got
beside the entries Ghidra did apply, so in any shared object or PIE with
initial-exec or dynamic TLS every GOT-indirect call decompiled as pointer
arithmetic instead of a named call.

Mark each unapplied destination volatile through its data item's Mutability
setting, creating an undefined item of the relocation's length where nothing
is defined. Fall back to the whole block only when an instruction or a data
item starting before the destination occupies it. Eligibility, limitations,
the read-only path, permissions and source FileBytes are unchanged.

The loader-relocation fixture now reads an initial-exec TLS variable whose
R_X86_64_TPOFF64 slot shares .got with the applied entries. The probe
requires that block and its applied entries to stay non-volatile and both
unapplied destinations to have volatile data items; on the previous bridge
it fails at applied_got_relocations_not_volatile.

Rename loader_relocation_semantics to
volatile-unapplied-relocation-destinations to state the new behavior.

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 20:30:01 -05:00
00a3f4d2b9 fix(process): preserve Darwin snapshot and cleanup failures (#12100)
* fix(process): preserve Darwin opening snapshot failures

* fix(process): retain the exact Darwin helper cleanup owner

Transfer the failed helper-root capability across repeated prepare failures. Reuse that same owner for retirement and reader close so stale cleanup cannot remove a replacement helper.

Co-authored-by: Anandumv <anandumv@gmail.com>
Co-authored-by: nextjohnp7 <nextjohnp7@gmail.com>

* test(process): isolate retained cleanup and compiler acknowledgements

---------

Co-authored-by: Anandumv <anandumv@gmail.com>
Co-authored-by: nextjohnp7 <nextjohnp7@gmail.com>
2026-11-18 17:34:25 -05:00
86cf8942de feat(ghidra)!: import recognized DOS COM files with ComLoader (#12086)
* feat(ghidra)!: import recognized DOS COM files with ComLoader

Select Ghidra 12.2 ComLoader for an admitted .com image and do not pass a
base address, so the file stays at 0000:0100. Images ComLoader rejects use
the explicit BinaryLoader import at 1000:0100 and record the typed reason.

BREAKING CHANGE: A DOS COM file that ComLoader accepts now loads at linear
0x100 instead of 0x10100. Read load_address. The BinaryLoader fallback
remains at 1000:0100.

* fix(ghidra): score COM dollar-strings in one pass

ComLoader's printable-run walk restarts at every offset, so a 64 KiB image
of printable bytes blocked profile resolution. The same capped count now
skips a run once an earlier start has seen every later dollar sign.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): align COM import facts with the image Ghidra receives

Mismatch load-image coordinates follow the measured loader and address.
A dotfile named .com keeps that suffix on the snapshot, and selection
uses that snapshot name. The COM fallback verifier owns its MCP
connection before connect.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* style(ghidra): format COM snapshot and verifier files

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): keep measured COM facts and required MZ coordinates

DOS MZ and a verified COM image keep load_segment and entry required.
A COM mismatch emits a known loader or load address on its own, and
omits the segment and entry only when that pair is not a known layout.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): require the verified COM layout and document both entries

A verified COM image is either ComLoader at 0000:0100 or BinaryLoader at
1000:0100 with a fallback reason. The DOS guide queries 0x100 only for
the ComLoader entry and 0x10100 for the fallback.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): attest COM imports against the committed loader

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-18 16:40:18 -05:00
5c59bdc8a6 feat(ghidra)!: verify the bridge on Ghidra 12.2 (#12081)
* feat(ghidra)!: verify the bridge on Ghidra 12.2

Admit 12.x from minor 2 upward, with 12.2 and JDK 25 as the verified
pair. The bridge now calls the four-argument storage API added in 12.2,
so 12.1.x cannot compile it and is no longer accepted.

BREAKING CHANGE: Ghidra 12.1.x is rejected. Use Ghidra 12.2 or another
12.x build at or above minor 2, and a JDK inside that installation's
declared range (25 or newer for the verified 12.2 build).

* docs(ghidra): point remaining lanes at Ghidra 12.2

The Windows, 6502, and m68k prerequisites still named 12.1.4 and JDK 21,
which the verified-build check now rejects. The bridge compile lane names
the 12.2 jars it actually compiles against.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): admit the JDK the verified install declares

The Java home framing probe still reported JDK 21 while the verified
installation fixture now declares a minimum of 25, so doctor admission
failed before the path framing was checked.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): derive admitted install fixtures from the verified release

Boundary hosts and assertions still named Ghidra 12.1.4 after admission
moved to 12.2, so list_procedures evidence and completed property reads
disagreed with the install the provider actually reported.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): record the exact 12.2 Clang switch-recovery defect

Ghidra 12.2 stays the verified build. Sessions and decompiler results on
that exact version name upstream issue 9996 and the 12.2.1 fix commit.
Other version strings, including 12.2.1, do not carry the limitation.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): check switch-defect facts instead of the warning sentence

The policy test keeps the structured defect record and checks that the
owning formatter delivers its id, commit, release, and scope fields.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): name the Playwright launch boundary the lifecycle catalog checks

Main retitled that case with a platform placeholder. The coverage catalog
still required the old literal, so the merged full suite reported a missing
title.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): point the lifecycle catalog at main's launch title

The merged suite uses main's platform-specific Playwright launch test.
The coverage catalog now names that title, and this branch keeps main's
test body so the merge stays clean.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): cover the platform launch title on this branch

The lifecycle catalog names main's platform launch title. This branch
now has that quoted test too, so the check passes before and after the
merge.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): record the exact 12.2 masked byte-switch defect

Ghidra 12.2 leaves an AArch64 and-0xff byte-offset switch unrecovered.
Exact 12.2 sessions now cite open upstream issue 10154, and the AArch64
lane expects that jump table to stay unrecovered.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(browser): keep one platform launch environment check

The second launch test repeated the selected environment check. The
remaining test is the parameterized title, and the launcher forwards
SYSTEMROOT on win32 so that assertion holds.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): keep the open switch defect on admitted builds

The exact-version check cleared ghidra-10154 on every build except 12.2.
That defect stays on admitted releases until one is known to fix it.
ghidra-9996 still clears after the exact 12.2 build.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* style(docs): format the Ghidra testing-lane table

The AArch64 jump-table row wrapped past the formatter width and failed
static checks.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* test(ghidra): give the masked switch its full byte range

The unrecovered oracle now uses 256 readable table bytes, and the same
object must still recover its compare-bounded switch.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* docs(website): point Ghidra setup at 12.2 and JDK 25

The public setup pages still told new users to install Ghidra 12.1.4 and
JDK 21, which this release rejects. Changed setup sentences are extracted
and left untranslated so those editions use the English page.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* docs(website): keep catalog edits to the changed setup strings

The catalog check compares active message ids, not a full rewrite.
Restore the previous catalogs and update only the Ghidra 12.2 setup
strings, leaving their translations empty.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): apply the closed switch defect from the parsed patch

12.2, 12.2.0, and 12.2.0 with a suffix all precede 12.2.1, so they keep
ghidra-9996. The masked-switch table lists all 256 byte entries.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(ghidra): share the AArch64 switch fixture compiler invocation

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
2026-11-18 16:06:51 -05:00
Ahmedandmorluto dc6799d488 fix(android): report method disassembly failure as unavailable body (#12090)
* fix(android): report method disassembly failure as unavailable body

Catch JADX bridge get_method_body failures in inspectMethod and project as an unavailable body with disassembly_failed marker, avoiding generic execution_failure with irrelevant rea doctor remediation.

Fixes #10482

* fix(android): preserve method identity when disassembly is unavailable

* fix(android): retain method identity when smali generation fails

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 15:23:34 -05:00
Nianze Wuandmorluto 4992ca5b2f fix(agentenv): preserve helper teardown results on signals (#9237)
* fix(agentenv): preserve helper teardown results on signals

* fix(agentenv): avoid taking EOF event lock in signal handlers

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-18 13:28:31 -05:00
Gouru Prakarsha 25110121 7005e2780b fix(bridge): remove unused resource module import on Windows (#10535) 2026-11-18 13:15:41 -05:00
morluto ceb0370281 perf(tests): speed up desktop build polling and fixture setup (#11770)
Fixes #11663
2026-11-16 14:19:12 -05:00
morluto 9b1c739da6 test(agentenv): skip /proc session tests off Linux and release held descendants (#11495)
* test(agentenv): skip /proc session tests off Linux and release held descendants

Two LongRunTest cases need the supervisor's /proc same-session
enumeration, which only Linux provides; skip them when /proc is absent.

Every held descendant also leaked: the test touched its release file and
then removed the folder before the child's 20 ms poll saw it. A cleanup
now touches the release files and waits for the recorded descendant to
exit before the folder is removed.

Fixes #11349

* test(agentenv): report a surviving descendant instead of signalling its pid

The cleanup holds no live handle to the held descendant, so its saved
pid does not prove ownership after exit or reuse.

* test(agentenv): count an unreaped zombie descendant as exited
2026-11-16 06:22:58 +08:00
morluto 8f8683544e fix(native): record breakpoint hits LLDB reports as exceptions and keep coverage partial for unattributed stops (#11276) 2026-11-15 23:50:48 +08:00
ce9bdc526a fix(agentenv): settle cancelled long runs and preserve teardown receipts (#11095)
Bound AgentEnv long-run cancellation, preserve partial command facts and
complete computer teardown before resolving retained jobs. Includes the
supervisor and cleanup implementation from #10675 plus polled-receipt and
explicit-unknown exit-status fixes.

Validation: 14 Python controller tests, 31 host tests and 30 compiled
MCP/lifecycle tests passed. Static, documentation and discovery checks
passed. Real AgentEnv deployment was not exercised: runner unavailable.

Fixes #10676
Related: #10675

Co-authored-by: Adolanium <94890352+Adolanium@users.noreply.github.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-15 20:20:47 +08:00
morluto da3541bae3 refactor(jadx): read the bridge identity from the bridge source it launches (#10720)
* refactor(jadx): read the bridge identity from the bridge source it launches

* fix(jadx): read the bridge identity before launching the bridge

* fix(jadx): read the bridge identity from the outer class's own fields

* fix(jadx): read the bridge identity only from the ReaJadxBridge class body

* fix(jadx): return a malformed packaged bridge source as a read result

JadxRelease.ts is loaded by fixture scripts without a build, so it cannot import src/domain modules (the ParseFailure import broke the android-metadata job and the spawned JADX fixture). The identity read now returns a Result-shaped value; JadxProvider refuses a malformed packaged source as AnalysisCapabilityUnavailableError before acquiring resources, and tests and the fixture unwrap it.
2026-11-15 14:49:27 +08:00
morluto 52d6725d63 fix(cutter)!: report undeclared output truncation and document generation as unknown (#10726)
* fix(cutter)!: report undeclared output truncation and document generation as unknown

cutter_command filled a missing output_truncated with false and a missing
document_generation with the caller's expected_generation, so a reply that
did not declare them read as "nothing omitted" and "document unchanged".
Both are now null when the plugin did not declare them, with an Evidence
limitation for each. A command that never started still reports
output_truncated false, because there was no output to omit. The packaged
plugin now declares output_truncated on every command reply and the current
generation on its not-started replies.

BREAKING CHANGE: cutter_command's result fields output_truncated and
document_generation are now nullable. A caller that read document_generation
as a number must handle null by listing Cutter sessions again before choosing
an expected_generation. A caller that read output_truncated as a boolean must
treat null as "the output may be incomplete".

* test(cutter): cover the unknown-truncation limitation
2026-11-15 13:45:23 +08:00
morluto 0c38229dd3 feat(cutter): identify the running plugin's source and refuse a modified one (#10731)
* feat(cutter): identify the running plugin's source and refuse a modified one

The Cutter plugin now publishes the SHA-256 of its own file on its session
descriptor (an additive field). Discovery reports each session's
bridge_source as packaged, modified, or unknown (an older plugin without the
field). cutter_command refuses a modified plugin before sending anything and
names the packaged plugin to copy into Cutter's plugins/python directory.

* fix(cutter): report an unreadable packaged plugin instead of hiding the live session

* test(cutter): give the discovery fixture sessions their bridge source
2026-11-15 13:45:19 +08:00
morluto d8c3be9ba5 fix(ghidra): deliver the bridge's invalid_request rejection to the caller (#10659)
The Java bridge answered an unparseable request with a fixed id 1 and
closed the connection. The client ignored that reply because id 1 was
already settled, so the caller saw a socket-close process failure instead
of invalid_request. The bridge now reserves id 0 for connection-level
failures, and the client fails the request in flight with the remote
reason (or reports a protocol failure when nothing is in flight).
2026-11-14 18:59:58 -05:00
gensokyo-devandgensokyo-dev 9943c1c8bc fix(android): bound split facts and keep saved JNI reports readable
Charge the manifest split facts against the native inventory's retained JSON
allowance and refuse more than 64 split types or 256-character names as an
unknown, so a crafted manifest cannot overflow the response. Reports saved
before split facts existed still parse: the report schema treats absent
facts as optional while the live bridge contract requires them. The JADX
regression now decodes a generated binary manifest through
nativeDeclarations, with named and resource-ID-only attributes.

Refs #9756

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:15:32 +01:00
18b72ca461 fix(android): qualify the JNI library inventory by required splits
A base APK whose manifest requires ABI or density splits keeps its native
libraries in those splits, yet inspect_android_jni_bindings reported a
complete library inventory with zero libraries. The bridge's native
declaration inventory now also decodes the root binary manifest without a
session and reports its requiredSplitTypes and isSplitRequired facts, or why
they are unknown (bridge identity 11). When splits are required or unknown,
the library inventory is partial with an unknown that says so, and a binding
without a candidate is unknown instead of unmatched.

The binary manifest fixture from #9769 was used to check the bridge with the
real jadx-headless-mcp 0.7.1 JAR, including stripped attribute names that
resolve through framework resource IDs.

Fixes #9756

Co-Authored-By: 2SinceJuly <202121119+2SinceJuly@users.noreply.github.com>
Co-Authored-By: Phon <twilyt1@proton.me>
Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 16:15:32 +01:00
Cursor Agentandgensokyo-dev 3fbc940330 fix(ghidra): report byte-search cursor mismatches without schema repair
A cursor for another target, profile, pattern, mask, bounds, or document
was reported as invalid input and pointed at schema repair. Name the
binding, attribute the issue to the cursor, and leave the differing
component unknown.

Fixes #8366
Supersedes #8420

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-14 14:06:23 +01:00