Repository navigation
fix: accept another genuine retail dump of the same version (ACID-signed npdm, other firmware fonts) - #47
Merged
Conversation
…05010419#45) A pinned SHA-256 names the dump it was taken from, not every genuine one. A retail 1.0.0 NSP matched the four rewritten modules, but its main.npdm and four of the six shared fonts from firmware 22.5.0 did not match the pinned hashes, and the build stopped: the dump is complete and Nintendo-signed, its npdm verifies with Nintendo's public ACID key, and two of the six fonts are byte-identical to the reference dump's. - main.npdm: when the pinned hash differs, verify the ACID block's RSA-2048 PSS/SHA-256 signature with Nintendo's public ACID signing key (key generation 0), exactly the check the Horizon loader makes (Atmosphere ldr_meta.cpp ValidateAcidSignature over acid->modulus .. acid->size). The pinned hash remains the fast path; other ExeFS modules are still required byte-exact. - shared fonts: a font from another firmware version is accepted when it is a structurally valid BFTTF (the same size check extract_shared_fonts.py makes) and is bound by the SHA-256 of its actual bytes, so the manifest and shared_fonts_config.h describe the bytes the runtime gets. - identify_update() and step_code() share exefs_matches(), so a cached extraction and an update's module hashes accept a signed npdm too. - tests: synthetic RSA-PSS npdm (accepted, tampered and other key generation rejected) and six synthetic valid BFTTF fonts accepted with their actual hashes while a corrupt one is refused. - README: both languages say other genuine dumps are accepted. python -m unittest discover -s tests: 85 tests, OK.
ly05010419
added a commit
that referenced
this pull request
Oct 20, 2026
…ultrawide HUD, 1.4.3 survey, mods, controls.txt) into the Breath of the Wild branch Resolved by hand: nvn_mtl.m (PR #34's paged-bitmap serial sets keep the serial forgetting of 635fb31: totk_serial_del clears a bit; the memory line shows both; the BotW frame reset stays in mtl_present), build_app.py (make -j and the per-game launcher defines), the Makefile (the BotW targets and the Opus test), loader.c (the #57 stale-reference handler and 1.4.3's survey return address are TOTK-only: Breath of the Wild has no GAME_ADDR for them), world_survey.c (BotW keeps its stub, with runtime_survey_sync), README (both update-history rows). Found by the merged build: Breath of the Wild lacked runtime_output_size_current (frontend.m's shortcut text) and runtime_survey_sync (hle_nvn.c); and the add-on content file handles shared fs_host.c's 0x200000000 range, so closing a host file at the title ended the game ("close invalid add-on content handle"): they now start at 0x400000000. Tested on the merged binaries: TOTK 1.2.1 jump session (anomalies 0, occlusion normal, serial set 48,606 / 13 pages), Breath of the Wild DLC + key 3 (k3a6) and key 2 (k2c, 11 of 12 pairs within 5 px). Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A pinned SHA-256 names the dump it was taken from, not every genuine dump of that version. From #45: a retail 1.0.0 NSP matched all four rewritten modules, but its
main.npdm(890c6174…vs pinnedf5a5eecc…) and four of the six shared fonts from firmware 22.5.0 did not match the pinned hashes; the dump is complete (every ExeFS block hash and IVFC level verifies) and its npdm verifies with Nintendo's public ACID signing key. Two of the six fonts are byte-identical to the reference dump's, which shows only the firmware version differs (README still says a retail NSP had not been tested).This PR keeps the pinned hashes as the fast path and accepts another genuine dump of the same version:
main.npdm: when the pinned hash differs, verify the ACID block's RSA-2048 PSS/SHA-256 signature with Nintendo's public ACID signing key (key generation 0) — the check the Horizon loader itself makes (ValidateAcidSignatureoveracid->modulus .. acid->size; salt 32, MGF1-SHA256, trailer 0xBC). Only the npdm gets this exception; the other modules are still required byte-exact.extract_shared_fonts.pymakes) and is bound by the SHA-256 of its actual bytes, somanifest.jsonandshared_fonts_config.hdescribe exactly the bytes the runtime gets.identify_update()andstep_code()both go through the newexefs_matches(), so a cached extraction and an update's module hashes accept a signed npdm too.End-to-end check (this branch, the repository's unmodified
expected-v1.0.0.json): the retail 1.0.0 NSP from #45 built successfully — the log showsmain.npdm is a Nintendo-signed 1.0.0 file from another dump; using itand fourshared font … comes from another firmware version; its bytes are bound insteadnotes, thendone in 18 min.python -m unittest discover -s tests: 85 tests, OK.Fixes #45.