* fix(pe)!: share one loader-equivalent PE header owner across static readers
Resources and certificates now admit headers through readPeImage, and
resources map RVAs through the shared file-backed mapping. The owner reads
the optional header at fixed offsets, caps data directories at 16, and lets
a PE signature at e_lfanew override a DOS relocation table. Export, import,
TLS and resource directories are read at their RVA whatever Size declares.
Disregarded declarations are reported in header_anomalies.
BREAKING CHANGE: import and delay-import walks continue to the null
descriptor past a short directory Size instead of stopping with a
malformed_entry issue, and inspect-pe-resources reports an unsupported
optional-header magic as unsupported_target.
* fix(pe): keep valid DOS relocation tables owning e_lfanew
Only a relocation table that describes no DOS load module yields e_lfanew
to a PE signature; update MZ/PE conformance to the shared owner.
* fix(pe): walk resource trees within file-backed bytes and cite TLS reads
The resource walk is bounded by the file-backed run from the directory RVA
rather than its Size, and a Size that ends before the bytes walked is a
directory_size_below_structure anomaly. The TLS result carries
structure_location for the structure read past a short Size, and Evidence
cites it.
* test(pe): use a resource cycle as damage now that a short Size is read
* fix(pe): read resource trees past an oversized Size and keep damaged MZ headers malformed
An oversized resource Size is reported without requiring its unused bytes
to map. A Windows-header candidate is malformed when the DOS module is also
invalid, and the guide states that a valid DOS relocation table owns
e_lfanew.
* fix(macho)!: report a FAT header or table cut off by the file's end as truncated
The universal Mach-O container reader measured the file's size but
reported a FAT header shorter than 8 bytes as malformed, and a FAT table
that runs past the file's end as not FAT at all. Callers could not tell a
cut-off download from corrupt bytes.
readFatContainerHeader now returns a typed truncated state carrying the
measured file size and the length the header or table needs. A CAFEBABE
count that reads as a JVM class version stays not FAT, because a short
class file is not evidence of a universal file. Universal image
selection, the native container reader and the lipo-selected slice
resolver raise that fact as a truncated ParseFailure with an extent, and
the malformed-target projection reports it as details.available_bytes and
details.required_bytes. Complete but corrupt FAT data (zero count,
overlapping slices, slices inside the table) stays malformed.
BREAKING CHANGE: inspect_go_binary, inspect_rust_binary,
inspect_dwarf_units, inspect_native_initializers,
inspect_native_dispatch_metadata, the IL2CPP binary readers and the
macOS provider's lipo-selected slice reads now report a FAT header or
table cut off by the file's end with details.format_failure "truncated"
(previously "malformed", or an unsupported or not-universal result for a
table past the end), plus details.available_bytes and
details.required_bytes.
* test(macho): type every format-owner row with its asserted format failure
Three formats had their own error mappers that still reported a selected
file's corrupt bytes as an invalid_format path issue (invalid_request):
managedInspectionInputFailure, Il2cppMetadataProvider and the Mach-O slice
selection mappers. Each now projects its format owner's own failure through
AnalysisMalformedTargetError at the path of the file whose bytes are at fault.
- Managed PE/CLI: a broken rule is a malformed pe-cli target with the
reader's scope and offset; unsupported-metadata and unsupported-signature
are unsupported targets; resource limits stay with their producer.
- Universal Mach-O: the container reader raises a ParseFailure once
(malformed, truncated where it measured the end, unsupported from the
container's own category), and requireSelectedNativeImage(FromReader)
project it at the universal file's path. An unknown or ambiguous
architecture stays invalid_request on the architecture field.
SliceSelectionInput.pathField is removed.
- IL2CPP: metadata and binary format failures each name their own file. A
binary that parses but does not link to the metadata is a link conflict:
invalid_request with invalid_value issues on both path and binary_path,
no input-contract recovery, and the partial observation keeps both file
identities. Neither file is called malformed.
BREAKING CHANGE: inspect_managed_artifact, inspect_managed_members,
inspect_managed_native_boundaries, compare_managed_members,
inspect_il2cpp_metadata, inspect_go_binary, inspect_rust_binary,
inspect_dwarf_units and inspect_native_initializers report corrupt or
truncated target bytes as code unsupported_target with details.path,
format, format_failure and reason instead of invalid_request with an
invalid_format issue. IL2CPP link conflicts list both path and binary_path
with reason invalid_value instead of one invalid_format binary_path issue.
* perf(ghidra): retain literal search candidates only when filtering narrows them
The Ghidra bridge folds ASCII exactly, so a case-insensitive literal
search with an ASCII-foldable pattern already returns its matches.
Attaching the unnarrowed reply as rawResult repeated the full match list
in every default search_strings/search_procedures response and Evidence
record. Retain it, with the candidate limitation, only when Unicode
filtering removed a row or secondary name.
Closes#14142
* docs(ghidra): state when a literal search retains raw candidates
The native investigation guide still said every case-insensitive literal
search puts bridge candidates in raw_result. It now states the
condition. A test covers the case where filtering removes only a matched
secondary name, which keeps every procedure but must still retain the
candidates.
* fix(native-exports): preserve uncertainty in incomplete ELF version lookups
* test(native-exports): prove ELF version cache exhaustion ends the scope
* feat(elf): inspect exports without section headers
Use the dynamic segment and hash tables to enumerate exports when an ELF image has no dynamic symbol section. Preserve symbol coverage, version qualifications, and typed failures through the existing native export path.
* test(elf): cover dynamic exports with retained sections
* test(setup): retain a valid lowercase Kimi schema profile
Use the supported compact profile in the Windows environment-spelling regression. Keep the exact environment assertion so a duplicate uppercase key still fails, and retain separate coverage rejecting the removed full profile.
---------
Signed-off-by: Afloat <ShuffleMonkey@163.com>
* 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>
An ARM STT_FUNC or STT_GNU_IFUNC value for Thumb code is the code
address with bit 0 set (AAELF32 symbol values), while an FDE initial
location is the even code address. inspect_elf_unwind_ranges matched
symbol values to FDE starts exactly, so a Thumb function described by an
.eh_frame FDE lost its name: the range was named by a local label or
mapping symbol from .symtab, or had no name when only .dynsym was left.
On ARM EABI such FDEs come mostly from hand-written assembly with .cfi
directives; compiled code unwinds through .ARM.exidx.
Clear bit 0 of ARM function and IFUNC symbol values before the lookup, as
the ELF initializer and Android JNI readers already do. Mapping symbols
and other machines keep their values.
`file -b` reports `data` for an XML plist containing a control character
or NUL byte, which CoreFoundation still reads. plistSourceFormat only
probed the source for markup when `file` reported text, so these sources
were labelled `unknown` and skipped REA's XML reader. When that reader
would have refused them, the result also lacked the limitation that says
the value came from plutil's conversion. Two plists shipped with macOS
27.2.1 are affected.
Probe the source prefix for any description that does not name binary,
XML or JSON. Such XML now takes the same route as XML that `file`
recognizes: REA's reader decodes it directly, or #12251's plutil fallback
records REA's refusal reason. OpenStep and other non-markup sources stay
`unknown`.
* fix(native): record inspected plist bytes and refuse files outside the bundle
An open app session keeps the executable as the Evidence subject for
inspect_plist, same as the other bundle-resource tools, but the result had
no digest of the plist bytes and any absolute path was sealed under that
subject. Record source_sha256 for the bytes read, and refuse a selection
that resolves outside the opened bundle.
Fixes#9479
* fix(native)!: scope plist selection to the opened bundle
BREAKING CHANGE: To inspect a plist outside an opened app bundle or resource root, open the plist as a separate target.
* fix(native): report plist snapshot filesystem effects
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
* docs(limits): refresh the limit inventory and state the runtime-setting rule
Recompute the inventory from ANALYSIS_SETTINGS and the numeric-limit
check, and make a hardcoded limit a runtime setting unless a fixed
ceiling has a stated format, protocol, or representation reason.
* docs(limits): distinguish runtime settings from per-call overrides
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
A LinkInfoHeaderSize below 0x1C no longer lowers the string-offset floor.
Reserved 0x1D..0x23 headers still end at their declared size, so ANSI
fields after that header stay readable.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
CoreFoundation reads some XML plists that strict XML rejects, such as
documents with a double hyphen in a comment or a control character in a
string. inspect_plist refused them although plutil -lint accepts them,
and the outcome depended on how file(1) described the bytes.
When REA's XML reader refuses a document's syntax, inspection now takes
the existing plutil conversion route. The result keeps format xml and a
limitation names REA's reason. A document plutil also rejects stays
refused with its diagnostic, and plist structure errors in well-formed
XML are still refused without conversion.
Fixes#12234
* 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>
* 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>