Commit Graph
765 Commits
Author SHA1 Message Date
morluto e012b68371 refactor(apple): share chained import decoding and proofs (#13788) 2026-11-23 00:58:37 +00:00
morluto 4a62303717 fix(elf): read build IDs without decoding unrelated notes (#13776) 2026-11-23 00:53:05 +00:00
morluto 7c75a5f91b fix(elf): validate core paths before charging mapping output (#13771) 2026-11-23 00:42:23 +00:00
morluto 33061332ef refactor(native): extract NativeMacosErrorProjection from NativeMacOSProvider (#13741)
* refactor(native): extract NativeMacosErrorProjection from NativeMacOSProvider

* refactor(native): remove unused error projection imports
2026-11-22 19:39:55 -05:00
morluto a4f9c2309b fix(elf): respect compressed note storage across inspectors (#13762)
* fix(elf): respect compressed note storage across inspectors

* test(elf): preserve independent hardening note failures
2026-11-23 00:31:02 +00:00
morluto f92a06226a perf(native/process): avoid symbol BigInt/string allocs and trim process polls (#13720) 2026-11-22 19:22:04 -05:00
morluto 9808545d6f fix(pe): preserve TLS section ownership across named ranges (#13743)
* fix(pe): preserve TLS section ownership across named ranges

* test(pe): verify encoded TLS fixture section names
2026-11-23 00:11:48 +00:00
RRFZ e6b30f945e fix(native): validate SHT_GNU_HASH bounds and fall back to DT_GNU_HASH (#13713) 2026-11-22 23:47:57 +00:00
morluto f404cdefa4 perf(core): hoist stateless decoders/regexes and avoid redundant copies (#13696) 2026-11-22 23:42:41 +00:00
morluto 43f5d2a78b perf(elf): cache BinaryReader and support offset reads in elfNoteLayout (#13688) 2026-11-22 23:13:38 +00:00
morluto fbd39b2570 perf(dwarf/model): LRU DwarfAbbrevCache and iterative Safetensors JSON (#13669)
* perf(dwarf/model): LRU eviction in DwarfAbbrevCache and iterative Safetensors JSON parser

* test(dwarf): cover selective abbreviation cache eviction
2026-11-22 18:06:37 -05:00
morluto 0fc591da7c refactor(uefi/native): cache UEFI BinaryReader and reuse hasDosMzMagic (#13659)
refactor(uefi/native): cache UEFI BinaryReader per buffer and reuse hasDosMzMagic
2026-11-22 17:22:09 -05:00
morluto 867dacc946 refactor(domain/pe): unify Asn1BerFailure and PeBinaryFailure (#13652)
refactor(domain/pe): unify Asn1BerFailure and PeBinaryFailure onto shared owners
2026-11-22 22:16:20 +00:00
morluto 841d41df31 perf(parsers): remove hot-loop allocs in UEFI, USN, PE, Go, Rust, Maven (#13647)
perf(parsers): eliminate hot-loop allocs in UEFI, NTFS USN, PE, Go, Rust, and Maven
2026-11-22 17:12:34 -05:00
morluto 8018344145 fix(windows-shortcuts): preserve unread target uncertainty (#13653) 2026-11-22 22:10:26 +00:00
morluto 94e038678e refactor(artifacts): consolidate magic checks and range reads (#13643)
refactor(artifacts): consolidate magic checks, probe windows, and range reads
2026-11-22 22:07:27 +00:00
morluto 20446e3746 perf(pwntools): validate only envelope and invariants in PwntoolsLayoutProvider (#13546)
* perf(pwntools): validate only envelope and invariants in PwntoolsLayoutProvider

* test: verify binary layout projection validation parity
2026-11-22 20:25:24 +00:00
morluto 69a691e058 perf(apple): eliminate Mach-O multi-pass schema/export re-parses and fuse AppleDispatchCoverage scans (#13550) 2026-11-22 15:10:39 -05:00
Iain 0aecef3726 fix(elf): name the auxv types current Linux kernels write (#13569) 2026-11-22 15:09:24 -05:00
morluto 3b6734bfae test(pe): consolidate certificate parsing and public error proofs (#13565)
* test(pe): consolidate certificate parsing and public error proofs

* test(pe): keep lifecycle coverage linked to the BER proof
2026-11-22 14:21:25 -05:00
morluto 9a85100b59 perf(process): fix expectedSize EOF probing in readBoundedFileBytes and eliminate 2x buffer copies (#13494)
* perf(process): fix expectedSize EOF probing in readBoundedFileBytes and eliminate 2x buffer copies (#13492)

* fix(setup): bound skill snapshots to the admitted file size
2026-11-22 18:23:12 +00:00
morluto 8da89da5e4 perf(elf): fuse dynamic symbol hardening predicates into single-pass scan with __ prefix pre-filter (#13513)
* perf(elf): fuse dynamic symbol hardening predicates into single-pass scan with __ prefix pre-filter (#13509)

* fix(elf): share symbol decoding and preserve short fortify imports
2026-11-22 13:11:47 -05:00
morluto 0a88a24d7a perf(native/sqlite/apple): eliminate double full-payload Zod re-validation and owned JSON deep-cloning (#13516)
perf(native/sqlite/apple): eliminate double full-payload Zod re-validation and owned JSON deep-cloning (#13511)
2026-11-22 12:57:41 -05:00
morluto 230105c681 perf(pe): compute ILT pefile cap in O(1) and eliminate BigInt allocation in IAT walk (#13484) 2026-11-22 11:49:45 -05:00
morluto 366dbc20bf perf(elf): fuse initializer section scans into one pass and eliminate symbol-map cloning (#13476)
perf(elf): fuse initializer section scans into one pass and eliminate symbol-map cloning (#13475)
2026-11-22 16:46:08 +00:00
morluto 6c6005ca9a perf(adapters/server): use ownedJsonValueSchema for freshly constructed internal results (#13459)
* perf(adapters/server): use ownedJsonValueSchema for freshly constructed internal results

* fix(server): keep defensive jsonValueSchema copy in jsonValueResult for shared session limits
2026-11-22 16:12:03 +00:00
morluto bb81b0a88d fix(elf): establish direct initializer slot mappings (#13452) 2026-11-22 15:57:43 +00:00
morluto 87180a86d9 test(go): consolidate native pointer mapping coverage (#13449) 2026-11-22 10:27:55 -05:00
morluto 2e1144b0ca fix(elf): bound dynamic version tables to mapped bytes (#13446) 2026-11-22 15:22:08 +00:00
morluto c7f89cd8b5 fix(elf): report proven version and dynamic symbol facts (#13441)
* fix(elf): use proven version and dynamic symbol facts

* perf(elf): avoid flattening versions for other retained views

* test(elf): consolidate dependency transport and budget coverage
2026-11-22 15:05:37 +00:00
morluto 7fc333ffa0 fix(elf): retain authenticated debug-link evidence on interruption (#13437)
* fix(elf): retain authenticated debug-link evidence on interruption

* test(elf): refresh debug-link lifecycle coverage references
2026-11-22 14:59:04 +00:00
morluto 0f771abed0 fix(apple): traverse deep Objective-C protocol graphs iteratively (#13431)
* fix(apple): traverse deep Objective-C protocol graphs iteratively

* test(apple): consolidate dispatch slice and ivar coverage
2026-11-22 14:07:55 +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 79887f7a3b perf(native): eliminate hot allocations in ELF/DWARF readers and enlarge signature copy chunks (#13318) 2026-11-22 03:42:58 -05:00
hhang 9ffaca5447 fix(native): preserve bundle provenance in partial reports 2026-11-22 15:41:50 +08:00
hhang e35780d042 fix(native): refresh bundle provenance on reopen 2026-11-22 15:41:50 +08:00
hhang b8995f8148 feat(native): retain Apple bundle executable provenance 2026-11-22 15:41:50 +08:00
morluto ac4f655858 perf(native): pre-screen IL2CPP slots and reuse ObjC/PE indices (#13314) 2026-11-22 03:51:45 +00:00
morluto b38a49656a perf(native): maintain owner index for ObjC dispatch implementations instead of O(C*M) filtering (#13269) 2026-11-22 02:06:31 +00:00
morluto 204434e087 test(native): isolate Objective-C ivar alignment coverage (#13205) 2026-11-21 15:36:31 -05:00
RRFZ ce3506e298 fix(elf): clear the ARM Thumb bit before naming unwind ranges (#9692)
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.
2026-11-21 21:32:08 +01:00
fengqiaoquandAnankequ 3dcd6b62e8 test(native): retain per-ivar alignment facts in mixed lists (#3424)
fix(apple): decode the ivar WORD_ALIGN sentinel as 8-byte alignment

Co-authored-by: Anankequ <2983852214@qq.com>
2026-11-21 21:24:28 +01:00
Dayan KijegeandClaude Opus 5.5 d955cd0d60 fix(elf): do not count SPARC register declarations as imports
On SPARC, symbol type 13 is STT_SPARC_REGISTER. An undefined entry of
that type declares use of the global register named by st_value and
may have an empty name (SPARC V9 ABI); it is not an import.
inspect-elf-dependencies listed each one as an unnamed import, recorded
a name_unreadable issue for its empty name, and marked coverage
partial. JNA's sunos-sparcv9 libjnidispatch.so (shipped in Eclipse
Installer) declares %g2 and %g3 this way and reported 47 imports, two
of them unnamed, with partial coverage.

parseImports now skips undefined type-13 entries when e_machine is
EM_SPARC, EM_SPARC32PLUS or EM_SPARCV9. Elsewhere type 13 is a
different processor-specific type and keeps today's row.

Validation (macOS arm64, Node 24.22.1):
- New parser regressions for machines 2, 18 and 43 (big-endian, 32-
  and 64-bit) fail before this change; a non-SPARC control keeps the
  unnamed row and partial coverage.
- ElfDependencyParser, ElfDependenciesProvider and ElfDependenciesView:
  79 passed. Format, typecheck, lint and architecture guards pass.
- Real file: libjnidispatch.so now reports 45 imports, complete
  coverage and no issues, matching the 45 named undefined dynamic
  symbols llvm-nm lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:24:17 +01:00
XiaoBinGan 985fa2fac9 fix(pe): keep pefile's unrounded raw offset for a sub-page section
`createPefileReadCompatibility` models pefile's section reads so an import hash is published only
when both readers see the same bytes. Its layout gate rejected any section whose
`PointerToRawData` was not 512-aligned — but pefile 2024.8.26's `get_PointerToRawData_adj()` skips
that rounding when `SectionAlignment < 0x1000` and `PointerToRawData == VirtualAddress`, the
`LdrpWx86FormatVirtualImage` layout ntoskrnl-era drivers use.

The gate already modelled the sub-page case two lines above (`SectionAlignment < 0x1000 ?
FileAlignment : SectionAlignment`), then rejected it against an absolute 512 rule — and
`docs/pe-imports.md` scopes the withhold to an incomplete table or a different row sequence, not to
a file offset.

Measured on a minimal image with `SectionAlignment = FileAlignment = 0x80` and `.idata` at RVA 0x300
== file offset 0x300:

| | before | after |
| --- | --- | --- |
| coverage | `complete` | `complete` |
| issues | `[]` | `[]` |
| `imphash.md5` | `null` | `92cef6cc91a85825f3c8a0516517c66f` |

The withheld hash is the only thing that differed: both readers were already reading the same bytes.

The exception is exact rather than approximate — a section with the same sub-page alignment whose
`PointerToRawData` differs from its `VirtualAddress` still withholds, because pefile does round it
there. That case is the second new test.

pefile's current `master` broadened the condition to every sub-page image; this matches the
2024.8.26 revision the module documents, which is the narrower and safer rule.

`tests/fixtures/binaryDiagnostics/peImports.ts` takes an optional `layout`, so the shared builder
produces the geometry instead of a test hand-encoding a second image. Its default is unchanged —
`SectionAlignment`/`FileAlignment` are written only when supplied, so every existing fixture keeps
its exact bytes.

`src/native/pe` — 265 passing. Restoring the absolute 512 rule fails the sub-page case.
2026-11-21 21:08:49 +01:00
Brahma Reddy f03cce9c01 fix(native): label XML plists that file calls data as xml (#12910)
`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`.
2026-11-21 20:00:31 +01:00
Lewis WangandClaude Opus 5.5 7a11884c08 fix(native): require dyld's __restrict section before reporting a restricted Mach-O (#13024)
dyld treats an image as restricted only when a __RESTRICT segment holds a
section named __restrict. inspect_binary_hardening reported restrict_segment
enabled for any segment named __RESTRICT, so a binary linked with
`-sectcreate __RESTRICT __other` was reported restricted although dyld still
honours DYLD_* variables for it.

The segment reader that already walks every section header now also returns
the first __restrict section. The row is enabled only for that section and
points at its name; a __RESTRICT segment without it is disabled with a basis
that names the missing section and points at the segment name.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:56:51 +01:00
gensokyo-devandgensokyo-dev 6543a3c1a1 refactor(pe): decode certificate BMP and UTF-32 strings through BinaryReader
BMPString and UniversalString decoding read code units with raw Buffer
reads after their length-multiple checks. Read them through the
pe-certificate-table BinaryReader instead.

Refs #11865

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-21 19:52:16 +01:00
gensokyo-devandgensokyo-dev 0ae58b4a1f refactor(apple): read dispatch relative displacements through the shared readers
The Objective-C method and Swift relative-pointer decoders read 32-bit
displacements straight from the image bytes, beside the checked u32 and
pointer readers. The shared dispatch readers now provide i32 through the
image BinaryReader and both facets use it, so they no longer take the raw
image bytes.

Refs #11865

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-21 19:52:16 +01:00
gensokyo-devandgensokyo-dev add4faf2ad refactor(elf): read GNU property words through BinaryReader
readGnuPropertyWords decoded property type, size and feature words with
endian-selected raw Buffer reads. Every read already sits behind the
record length checks, so the shared reader returns the same values.

Refs #11865

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-21 19:52:16 +01:00
gensokyo-devandgensokyo-dev 3af56cc7d5 refactor(native): compose LLDB resolver cleanup through the shared owner
The resolver retry built a multi-marker ProviderCleanupError and bound
the markers by hand; providerCleanupErrorFromFailures builds the same
composite, including the distinct resource list.

Refs #11859

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-11-21 19:34:01 +01:00