Commit Graph
95 Commits
Author SHA1 Message Date
morluto c8a783d7cf refactor(windows): share Shell Link location field reads (#12584) 2026-11-19 23:54:18 +00:00
RRFZandmorluto 6f3c016a5a refactor(native): read Mach-O initializer symbols and relocations with the image reader (#12571)
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-19 23:49:04 +00:00
morluto cddaef83ae refactor(elf): share fixed-width unwind field reads (#12574)
* refactor(elf): share fixed-width unwind field reads

* refactor(elf): share dynamic hash header word reads (#12577)

refactor(elf): share bounded hardening hash reads
2026-11-19 23:42:01 +00:00
morluto d95287056d fix(managed): bound CIL method headers to their PE section (#12575)
fix(dotnet): bound CIL headers to mapped section bytes
2026-11-19 23:37:16 +00:00
RRFZ 9ed9d6c8a2 refactor(apple): share fixed-width reads across dyld chained fixups (#12560) 2026-11-19 22:59:05 +00:00
RRFZ 3e40979b42 refactor(native): share file-backed ELF and Mach-O initializer word reads (#12559) 2026-11-19 17:51:40 -05:00
RRFZ 5c3fe9caeb refactor(il2cpp): decode metadata tables through one shared binary reader (#12554) 2026-11-19 22:44:20 +00:00
RRFZ d51dd4a996 refactor(apple): read streamed Mach-O command fields through the shared word reader (#12552) 2026-11-19 17:37:18 -05:00
morluto 4edbbf0df9 refactor(go): share bounded string header word reads (#12553) 2026-11-19 22:35:22 +00:00
RRFZ 4e30dbef14 refactor(pe): read icon group fields within their resource payload (#12547) 2026-11-19 22:24:24 +00:00
morluto 4892615ecb refactor(macho): share encryption command word reads (#12543) 2026-11-19 17:15:30 -05:00
morluto 0efd54e1c1 refactor(apple): share bounded JVM class field reads (#12540) 2026-11-19 22:04:16 +00:00
RRFZ d5e5aaa062 refactor(elf): read module version CRCs through BinaryReader (#12530) 2026-11-19 16:59:01 -05:00
RRFZ 756f772430 refactor(apple): share lazy dylib payload field reads (#12536) 2026-11-19 16:56:25 -05:00
RRFZ 503379b953 refactor(pe): read TLS and load configuration fields through BinaryReader (#12533) 2026-11-19 16:56:22 -05:00
RRFZ 846052b410 refactor(managed): share fixed-width GUID and user-string heap reads (#12535) 2026-11-19 16:55:46 -05:00
RRFZ 4ecc4f17a5 refactor(managed): share checked reads for metadata stream and table headers (#12526) 2026-11-19 16:55:41 -05:00
morluto 8fb1a3ce99 refactor(artifacts): share bounded NES header reads (#12524) 2026-11-19 16:29:37 -05:00
morluto b239ea8011 refactor(elf): share bounded note header reads (#12527) 2026-11-19 21:17:34 +00:00
RRFZandmorluto b824f9510d refactor(elf): decode REL and RELA entries through BinaryReader (#12522)
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-19 21:04:02 +00:00
RRFZ 84731eefdf refactor(elf): read IKCONFIG gzip and boot fields through BinaryReader (#12525) 2026-11-19 15:59:21 -05:00
RRFZ 66189e3b45 refactor(pe): read COFF section records through BinaryReader (#12520) 2026-11-19 15:57:39 -05:00
David Muñoz Reyandmorluto cd3590c8ee feat(artifacts): inspect NES 2.0 container headers and regions (#10674)
* feat(artifacts): inspect NES 2.0 container headers and regions

Problem: the iNES lane refused every header whose byte 7 bits 2-3 select
NES 2.0, so NES 2.0 cartridges could not be inventoried, extracted or
reconstructed even though their file layout extends classic iNES.

Fix: the single iNES-family header parser now reads NES 2.0 alongside
classic iNES. It reports the 12-bit mapper, submapper, 12-bit and
exponent-multiplier PRG/CHR sizes, declared PRG/CHR RAM and NVRAM sizes,
CPU/PPU timing, console type with Vs. System and extended console codes,
miscellaneous ROM count and default expansion device in a "nes-2.0"
header variant; classic headers keep their exact serialization. Regions
add one prg.bin/chr.bin for exponent sizes and misc-rom.bin for the bytes
after CHR-ROM when miscellaneous ROMs are declared. Oversized
declarations (with exact totals, including exponent sizes beyond safe
integers), nonzero unused header bits, empty PRG-ROM and declared but
absent miscellaneous ROM bytes are refused through the existing format
error. Nested byte classification now admits NES 2.0 through the same
parser. The reader limitation, tool description, guide and skill
reference now state that UNIF remains unsupported and that RAM, timing
and console values are declarations.

Validation: new synthetic NES 2.0 unit cases fail on the base (15 of 24)
and pass after the change; focused boundary and acceptance iNES suites
(75 tests) pass, including NES 2.0 inventory, extraction, reconstruction
and compiled CLI inspection; npm run check:fast passes.

Refs morluto/rea#2072

* test(artifacts): extract an exponent-sized NES 2.0 ROM area

Review follow-up for NES 2.0 headers.

The exponent-multiplier case stopped at parseInesLayout, and the
extraction test used counted ROM units, so prg.bin and chr.bin from
an exponent-sized area never went through the reader or extraction.
A boundary case now builds a NES 2.0 file with a 2^10 * 3 byte PRG-ROM
area beside one counted 8 KiB CHR-ROM unit. It checks the header omits
the PRG unit count, the source offsets of prg.bin and chr/000.bin,
the verified reconstruction order, and that the extracted regions
match the original bytes exactly.

Tests: tests/boundary/filesystem/inesArtifact.test.ts passes (38).

* refactor(artifacts): read NES header bytes through one helper

The NES 2.0 declaration added a sixth raw Buffer read to
inesContainer.ts. On current main the architecture guard allows five
there, so the merged tree failed Static checks. iNES and NES 2.0
declarations and the format probe now read header bytes through one
headerByte helper. The file has one raw read, and its counted baseline
drops from 5 to 1 through --shrink-baselines.

Tests: inesContainer domain tests (24) and the NES boundary and
acceptance tests (76) pass. architecture-guards, format:check and
check:ci:fast pass on the branch merged with main.

* refactor(artifacts): report iNES header failures through ParseFailure

Review follow-up: the NES 2.0 declaration added plain-string failures.
The iNES-family parser now returns Result<_, ParseFailure> with its
kind and where it was found:
- malformed: a missing signature, a dirty legacy header, an empty
  PRG-ROM area, reserved NES 2.0 bits or an invalid file extent;
- truncated: a short header, a short payload, or declared
  miscellaneous ROM with no bytes;
- unsupported: UNIF or another header variant, with undecoded content.
The detail text is unchanged.

The format registry refuses with the detail, and the iNES reader and
root classifier translate the failure at their boundary into the
existing format ArtifactReaderFailure, with the ParseFailureError as
its cause.

Tests: the refusal table now asserts each failure's kind and format
as well as its detail. iNES domain and recognition tests, NES boundary
and acceptance tests (76), architecture-guards, format:check and
check:ci:fast pass on the branch merged with main.

* fix(artifacts): preserve NES header declarations and iNES evidence

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-11-19 20:49:33 +00:00
morluto aaa8e1cee0 refactor(elf): share bounded RISC-V attribute reads (#12515) 2026-11-19 20:41:56 +00:00
morluto 7f151e9d0f refactor(flutter): share Dart ELF and snapshot field reads (#12507) 2026-11-19 20:19:09 +00:00
RRFZ 6cbd9cf994 refactor(managed): read CLI header fields through BinaryReader (#12503) 2026-11-19 15:11:23 -05:00
吴佳浩Albenand吴佳浩 3d0fa7dae2 refactor(managed): read metadata pointer rows through BinaryReader (#12483)
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
2026-11-19 14:23:54 -05:00
morluto 1b0a118192 fix(hopper): verify Mach-O profile signature before loader selection (#12485)
fix(hopper): verify the admitted Mach-O profile signature
2026-11-19 19:23:29 +00:00
吴佳浩Albenand吴佳浩 410b64ab1f refactor(native): read the format sniff magic through BinaryReader (#12473)
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
2026-11-19 18:52:41 +00:00
吴佳浩Albenand吴佳浩 acc3fbb12a refactor(native): read recorded-crash fields through BinaryReader (#12464)
* refactor(pwndbg): read the mapping-table count through BinaryReader

* refactor(pwntools): read a recorded register through BinaryReader

---------

Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
2026-11-19 13:40:11 -05:00
吴佳浩Albenand吴佳浩 0356ea8cdd refactor(apple): read an ObjC binding slot through BinaryReader (#12466)
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
2026-11-19 13:39:56 -05:00
morluto 8349201627 fix(elf): report empty kernel module signature ranges as malformed (#12471) 2026-11-19 18:39:07 +00:00
morluto 5a62623cd1 fix(macho): validate symbol extents before the hardening scan limit (#12465)
fix(macho): validate hardening symbol extents before capacity
2026-11-19 18:23:37 +00:00
morluto 11c014f022 fix(dol): require exact file extent for header admission (#12460) 2026-11-19 18:10:34 +00:00
speedcubing d58942a4ea refactor(apk): read signing block and v1 local header fields through BinaryReader (#12450)
Move the eight remaining raw DataView reads in src/domain/apkSignature
onto the shared BinaryReader and drop the three APK signature entries
from the raw-buffer-read baseline. Every read stays behind its existing
range check, so results, error kinds and messages are unchanged.

Refs #11865
2026-11-19 17:59:56 +00:00
morluto 1ba93c8a1b refactor(elf): share fixed header declaration widths (#12391) 2026-11-19 15:59:06 +00:00
morluto ad996352c3 refactor(macho): own complete fixed segment and section fields (#12405) 2026-11-19 15:44:31 +00:00
morluto e9af636128 fix(macho): share marker-bearing dylib field decoding (#12400)
* fix(macho): share marker-bearing dylib field decoding

* fix(macho): retain legacy lazy dylib timestamps
2026-11-19 15:33:09 +00:00
morluto 205ab4a587 refactor(elf): share fixed symbol record widths (#12379) 2026-11-19 15:28:37 +00:00
morluto 0eac37277d fix(pe): distinguish positional resource framing from capacity (#12402) 2026-11-19 15:26:52 +00:00
morluto 88983ebac7 fix(macho): prove command table framing before capacity (#12376)
* fix(macho): prove command table framing before capacity

* test(macho): match shared table admission precedence

* test(macho): separate encryption capacity from invalid framing
2026-11-19 15:19:50 +00:00
morluto cf9b474292 refactor(nativeaot): share checked MethodTable framing (#12375) 2026-11-19 15:00:02 +00:00
morluto 1b172f1e02 refactor(dotnet): share checked CIL operand and exception reads (#12372) 2026-11-19 14:43:25 +00:00
morluto 7eac002d5e fix(pcap): retain admitted DNS truncation facts (#12373) 2026-11-19 14:35:56 +00:00
morluto 091b8b0339 refactor(dotnet): read metadata constant scalars through BinaryReader (#12371) 2026-11-19 14:26:54 +00:00
morluto 17ad9c14ff fix(pe): validate resource name extents before capacity (#12368) 2026-11-19 14:22:26 +00:00
morluto 5f258086b0 refactor(macho): share checked segment and section framing (#12366) 2026-11-19 09:08:25 -05:00
morluto 156303f6ed refactor(python): read marshal scalars and bytecode magic through BinaryReader (#12362)
refactor(python): read marshal numbers through BinaryReader
2026-11-19 09:07:48 -05:00
morluto 7758d03c5d fix(artifacts): require DOS magic before applying Windows path semantics (#12340) 2026-11-19 13:52:31 +00:00
morluto 7e7516fbe9 refactor(il2cpp): share metadata section table framing (#12364) 2026-11-19 13:50:12 +00:00