1
0
Fork 0
mirror of https://github.com/DarkMatterCore/nxdumptool.git synced 2024-09-16 20:13:25 +01:00
Generates XCI/NSP/HFS0/ExeFS/RomFS/Certificate/Ticket dumps from Nintendo Switch gamecards and installed SD/eMMC titles.
Go to file
Pablo Curiel 9c7a57e028 title: init gc title storage by HFS as fallback
Makes it possible to generate TitleInfo and TitleApplicationMetadata elements for gamecards that can't be used with ncm (e.g. Kiosk / Quest gamecards under retail, non-Quest units). This is achieved by:

1. Retrieving a Hash FS context for the gamecard's secure partition.
2. Initializing NCA and CNMT contexts for all of the Meta NCAs within the secure partition.
3. Manually generating NcmContentMetaKey and NcmContentInfo elements per each CNMT context.
4. Creating TitleInfo elements using the generated NcmContentMetaKey and NcmContentInfo elements.
5. Initializing NCA and NACP contexts for the base (or update) Control NCAs within the secure partition.
6. Manually generating a NsApplicationControlData element per each NACP context.
7. Creating TitleApplicationMetadata elements using the generated NsApplicationControlData elements.

Afterwards, gamecard title/content enumeration and all other features that rely on it (e.g. NSP, NCA, NCA FS) work as expected. Please note that this process is only carried out if regular title storage initialization fails.

Other changes include:

* title: reorder code.
* title: add TitleGameCardContentMetaContext struct.
* title: rename titleGetInfoFromStorageByTitleId() -> titleGetTitleInfoEntryFromStorageByTitleId().
* title: add titleInitializeGameCardTitleStorageByHashFileSystem().
* title: rename titleGenerateDummySystemMetadataEntry() -> titleGetSystemMetadataEntry().
* title: rename titleRetrieveUserApplicationMetadataByTitleId() -> titleGenerateUserMetadataEntryFromNs().
* title: move ns logic from titleRetrieveUserApplicationMetadataByTitleId() into a new function: titleGetApplicationControlDataFromNs().
* title: add titleGenerateUserMetadataEntryFromControlNca().
* title: add titleGetApplicationControlDataFromControlNca().
* title: add titleInitializeUserMetadataEntryFromControlData().
* title: add titleGenerateTitleInfoEntriesByHashFileSystemForGameCardTitleStorage().
* title: move TitleInfo generation logic from titleGenerateTitleInfoEntriesForTitleStorage() into a new function: titleGenerateTitleInfoEntry().
* title: add titleInitializeTitleInfoApplicationMetadataFromControlNca().
* title: add titleGetGameCardContentMetaContexts().
* title: add titleFreeGameCardContentMetaContexts().
* title: add titleGetContentInfosByGameCardContentMetaContext().
* title: rename _titleGetInfoFromStorageByTitleId() -> _titleGetTitleInfoEntryFromStorageByTitleId().
* title: rename titleSystemTitleMetadataEntrySortFunction() -> titleSystemMetadataSortFunction().
* title: rename titleUserApplicationMetadataEntrySortFunction() -> titleUserMetadataSortFunction().
* title: rename titleInfoEntrySortFunction() -> titleInfoSortFunction().
* title: add titleGameCardContentMetaContextSortFunction().

* codebase: update to reflect the rest of the changes.
2024-08-18 15:29:57 +02:00
.github Remove all references to NSWDB. 2024-05-02 15:38:39 +02:00
code_templates title: init gc title storage by HFS as fallback 2024-08-18 15:29:57 +02:00
host [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
include title: init gc title storage by HFS as fallback 2024-08-18 15:29:57 +02:00
libs LayeredErrorFrame: use focus stack references 2024-05-10 12:18:57 +02:00
romfs Remove all references to NSWDB. 2024-05-02 15:38:39 +02:00
source title: init gc title storage by HFS as fallback 2024-08-18 15:29:57 +02:00
.gitignore host: drop Nuitka's "--onefile" arg 2024-01-20 23:11:21 +01:00
.gitmodules libs: update libusbhsfs. 2022-03-04 13:24:28 +01:00
build.sh workflow: fix issues + remove ccache support 2024-05-02 14:27:32 +02:00
LICENSE.md Change project layout + upgrade license to GPLv3. 2021-03-25 15:26:58 -04:00
Makefile [ci skip] Update Makefile 2024-05-01 21:18:05 +02:00
README.md Update README.md 2023-12-31 18:33:49 +01:00
todo.txt Remove all references to NSWDB. 2024-05-02 15:38:39 +02:00

nxdumptool

Nintendo Switch Dump Tool

Official Discord server: https://discord.gg/SCbbcQx

This branch is used for the development of the ongoing nxdumptool rewrite. Code is highly experimental and lacks a proper UI at this time, but it has been thoroughly tested and should be safe to use. Proof-of-concept (PoC) builds are provided to test different aspects of the codebase.

If a nxdumptool build from the releases page isn't working for whatever you're trying to do (e.g. RomFS dumping), odds are it will work with a PoC build from this particular branch. The old branch will not receive any further updates.

A GitHub workflow is used to automatically build each new commit -- feel free to check it out. Furthermore, the assets from the rewrite-prerelease tag are automatically updated by this workflow, so you can always find the latest NRO binary there.

This readme will be updated whenever the rewrite branch is ready for a proper release.

Currently planned changes for this branch include:

  • USB ABI (dump data directly to a PC).
  • USB Mass Storage device support (FAT, NTFS, EXT) via libusbhsfs.
  • NX Card Image (XCI) gamecard dumps, with optional KeyArea prepending and certificate removal.
  • Gamecard header dumps.
  • Gamecard certificate dumps.
  • Plaintext gamecard CardInfo area dumps.
  • Gamecard InitialData area dumps.
  • Gamecard CardIdSet dumps.
  • Gamecard Hash FS partition dumps (in both extracted and raw inage forms).
  • Lotus ASIC firmware (LAFW) blob dumping from RAM.
  • Properly detect if an inserted gamecard requires a LAFW update.
  • Nintendo Submission Package (NSP) dumps for both digital and gamecard-based titles.
  • Individual Ticket dumps from digital titles, with support for temporary/volatile tickets with AES-128-CTR crypto data kept in RAM.
  • Individual Nintendo Content Archive (NCA) dumps from a specific title.
  • Individual NCA filesystem section (Partition FS / ExeFS, RomFS, Patch RomFS) dumps from a specific NCA belonging to a specific title, in both extracted and raw image forms.
  • Better support for NCA BucketTree storages (Indirect, AesCtrEx, Sparse, Compressed), as well as better handling of multi-layered reads in combination with game updates.
  • System title support (e.g. dump qlaunch, shared fonts and much, much more at runtime).
  • Better memory handling while dealing with compressed NRO binaries.
  • Event-driven background threads to manage gamecard insertions/ejections, gamecard application metadata parsing (e.g. the game would be properly identified even if its gamecard has never been used on your console), USB ABI sessions and USB Mass Storage devices.
  • Improved support for multigame gamecards and titles with more than one Program NCA (e.g. SM3DAS).
  • Control.nacp patching while dumping NSPs (lets you patch screenshot, video, user account and HDCP restrictions).
  • Partition FS / Hash FS / RomFS browser using custom devoptab wrappers.
  • Full system update dumps.
  • Batch NSP dumps.
  • FsFileSystem + FatFs based eMMC browser using a custom devoptab wrapper (allows copying files protected by the FS sysmodule at runtime).
  • New UI using a customized borealis fork. ⚠️

Legend:

  • - Implemented
  • ⚠️ - Partially implemented
  • - Not implemented