feat(artifacts): inventory Nintendo Switch NSO and NRO executables offline (#14655)

* feat(artifacts): inventory Nintendo Switch NSO and NRO executables offline

Detection uses the bytes: NSO0 at the start of the file, or NRO0 at
offset 0x10. Inventory records the module id, flags, and MOD0 offset,
lists the text, rodata, and data segments, and for an NRO adds the ASET
icon, NACP, and RomFS when that trailer is present. Compressed NSO
segments are raw LZ4 blocks decoded under
artifact_limits.expanded_bytes, with the stored size and the decoded
size both reserved before allocation, and hash_status is match,
mismatch, not-checked, or unavailable. Truncated, over-budget, and
invalid-LZ4 entries stay listed while their bytes are refused, and a
positional reader can stream those decoded bytes instead of the stored
file range.

* fix(artifacts): keep valid NRO assets when one ASET range is unsafe

* docs: move the Switch executables guide under guides/firmware

* Address review feedback

* Address review feedback

* fix(artifacts): unify Switch NSO budget admission and test deadlines

- Remove the duplicate NSO decoded-only budget pre-check in #prepareNso so
  #admitStoredInput owns all compressed-segment admission and reports an
  accurate required_value covering both stored and decoded bytes.
- Use testWaitDeadline() in SwitchExecutableArtifactReader.boundaries.test.ts
  instead of a hardcoded 2_000 ms timeout.
- Reuse tests/fixtures/lz4LiteralBlock.ts in switchExecutable.fixture.ts.

* test(domain): throw typed parse errors in Switch parser tests and fix doc formatting

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <mvanhorn@MacBook-Pro-10.local>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
Matt Van Horn
2026-11-26 19:24:25 +00:00
committed by GitHub
co-authored by Matt Van Horn Matt Van Horn morluto
parent 51b3671b08
commit 3970afecc6
27 changed files with 2535 additions and 15 deletions
+10
View File
@@ -465,6 +465,16 @@ rea extract-artifact ./installer.iso --json
See [ISO 9660 disc images](../guides/firmware/iso9660-images.md) for volume facts, Joliet
names, multi-extent and interleaved files, and what is not decoded.
Inventory and extract a Nintendo Switch NSO module or NRO executable:
```sh
rea inspect-artifact ./main.nso --json
rea extract-artifact ./main.nso --json
```
See [Switch executables](../guides/firmware/switch-executables.md) for header facts, segment
hashes, LZ4 decompression limits and NRO assets.
Inventory and extract a uClinux bFLT flat executable:
```sh