Skip to content

NSP script: read the title ID from the package when it has no ticket and no tag - #217

Merged
v0lumehi merged 1 commit into
mainfrom
v0lumehi/nsp-title-id-from-package
Oct 29, 2026
Merged

v0lumehi merged 1 commit into
mainfrom
v0lumehi/nsp-title-id-from-package

Conversation

@v0lumehi

Copy link
Copy Markdown
Collaborator

What and why

An NSP with no ticket (a standard-crypto dump, a repack) and no [0100…] tag in its file name ends the build with no NSP with a readable title ID, although the keys open the package. title_of read a title ID only from the ticket's file name or from a tag in the package's file name. With neither, it now reads the title ID from the package: nx_extract <prod.keys> --title <package> decrypts each meta NCA's header with the keys' header_key and prints the lowest title ID. NSP, NSZ, XCI and XCZ take the same path, and the ticket and the tag keep their precedence. No key value is printed.

Reported in #177 by @ericklobet-beep, and @1upbyte's rename of the file pointed at the cause. The upstream pull request is seedds/nxnative#666, and this patch carries it as forwarded until it merges.

Fixes #177

Checked

  • Tests: python3 scripts/patches.py check passes (patch queue: ok), python3 -m unittest discover -s scripts/tests passes (39 tests), and so does dm/tools/tests/test_nsp_scan.py. The upstream run of all of dm/tools/tests passed (612 tests). The new tests stub the reader at its boundary, the C# side needs real keys.
  • Visual QA: not a UI change.
  • Run on a device or Mac: nx_extract --title was run with a real prod.keys on the Tears of the Kingdom base NSP, which has no ticket, and it printed 0100F2C0115B6000. With a tag-less symlink the scan resolved base and update to that game. macOS 27, Apple silicon. No game was built or played.

Scope

  • No vendored file (dm/, scripts/, docs/, ref/, AGENTS.md) is edited directly: a change there is a patch in patches/ (scripts/patches.py export, and patches.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile is also (or first) a PR at seedds/nxnative: this PR's patch says forwarded seedds/nxnative#666
  • No keys, game files or data extracted from a game in the change or the attachments

…ves its title ID from its own meta NCA

title_of took the title ID only from the ticket's file name or a [title ID] tag in the file name. With neither, it now asks nx_extract --title, which reads the meta NCA's header with the keys' header_key.
@v0lumehi
v0lumehi merged commit 6c5c134 into main Oct 29, 2026
9 checks passed
@v0lumehi
v0lumehi deleted the v0lumehi/nsp-title-id-from-package branch October 29, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NX2Apple 0.5.0 — No NSP with a readable title ID

1 participant