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 3e10421ec9 Add DataTransferTaskFrame and GameCardImageDumpTaskFrame classes
DataTransferTaskFrame is a template class that's derived from brls::AppletFrame, which automatically starts a background task using an internal object belonging to a class derived from DataTransferTask. A DataTransferProgressDisplay view is used to show progress updates. If the background task hits an error, the class takes care of switching to an ErrorFrame view with the corresponding error message.

GameCardImageDumpTaskFrame is a derived class of DataTransferTaskFrame that uses a GameCardImageDumpTask object as its background task. In layman's terms, this provides a way to fully dump gamecard images using the new UI.

DataTransferTaskFrame depends on the newly added is_base_template helper from goneskiing to check if the class for the provided task is derived from DataTransferTask.

Other changes include:

* DataTransferProgressDisplay: rename setProgress() method to SetProgress().

* DataTransferTask: move post-task-execution code into its own new private method, PostExecutionCallback(), and update both OnCancelled() and OnPostExecute() callbacks to invoke it.
* DataTransferTask: update OnProgressUpdate() to allow sending a last progress update to all event subscribers even if the background task was cancelled.
* DataTransferTask: update OnProgressUpdate() to allow sending a first progress update if no data has been transferred but the total transfer size is already known.
* DataTransferTask: update OnProgressUpdate() to avoid calculating the ETA if the speed isn't greater than 0.

* DumpOptionsFrame: remove UpdateOutputStorages() method.
* DumpOptionsFrame: update class to use the cached output storage value from our RootView.
* DumpOptionsFrame: add GenerateOutputStoragesVector() method, which is used to avoid setting dummy options while initializing the output storages SelectListItem.
* DumpOptionsFrame: update UMS task callback to add the rest of the leftover logic from UpdateOutputStorages().
* DumpOptionsFrame: update RegisterButtonListener() to use a wrapper callback around the user-provided callback to check if the USB host was selected as the output storage but no USB host connection is available.

* ErrorFrame: use const references for all input string arguments.

* FileWriter: fix a localization stirng name typo.
* FileWriter: fix an exception that was previously being thrown by a fmt::format() call because of a wrong format specifier.

* FocusableItem: add a static assert to check if the provided ViewType is derived from brls::View.

* gamecard: redefine global gamecard status variable as an atomic unsigned 8-bit integer, which fixes a "status-hopping" issue previously experienced by repeating tasks running under other threads that periodically call gamecardGetStatus().

* GameCardImageDumpOptionsFrame: define GAMECARD_TOGGLE_ITEM macro, which is used to initialize all ToggleListItem elements from the view.
* GameCardImageDumpOptionsFrame: update button callback to push a GameCardImageDumpTaskFrame view onto the borealis stack.

* GameCardImageDumpTask: move class into its own header and module files.
* GameCardImageDumpTask: update class to also take in the checksum lookup method (not yet implemented).
* GameCardImageDumpTask: update class to send its first progress update as soon as the gamecard image size is known.
* GameCardImageDumpTask: update class to avoid returning a string if the task was cancelled -- DataTransferTaskFrame offers logic to display the appropiate cancel message on its own.

* GameCardTab: update PopulateList() method to display the new version information available in TitleGameCardApplicationMetadataEntry elements as part of the generated TitlesTabItem objects.

* i18n: add new localization strings.

* OptionsTab: update background task callback logic to handle task cancellation, reflecting the changes made to DataTransferTask.
* OptionsTab: reflect changes made to DataTransferProgressDisplay.

* RootView: cache the currently selected output storage value at all times, which is propagated throughout different parts of the UI. Getter and setter helpers have been added to operate with this value.
* RootView: add GetUsbHostSpeed() helper, which can be used by child views to retrieve the USB host speed on demand.
* RootView: update UMS task callback to automatically reset the cached output storage value back to the SD card if a UMS device was previously selected.

* title: define TitleGameCardApplicationMetadataEntry struct, which also holds version-specific information retrieved from the gamecard titles.
* title: refactor titleGetGameCardApplicationMetadataEntries() to return a dynamically allocated array of TitleGameCardApplicationMetadataEntry elements.

* usb: redefine global endpoint max packet size variable as an atomic unsigned 16-bit integer, which fixes a "status-hopping" issue previously experienced by repeating tasks running under other threads that periodically call usbIsReady().

* UsbHostTask: add GetUsbHostSpeed() method.
2024-04-29 15:26:12 +02:00
.github Silly permissions 2024-04-15 14:43:00 +02:00
code_templates gamecard: add support for Header2-related areas 2024-04-19 15:58:16 +02:00
host [skip ci] Update copyright year. 2024-04-12 11:49:03 +02:00
include Add DataTransferTaskFrame and GameCardImageDumpTaskFrame classes 2024-04-29 15:26:12 +02:00
libs [ci skip] Add GameCardImageDumpTask and FileWriter classes 2024-04-25 01:49:04 +02:00
romfs Add DataTransferTaskFrame and GameCardImageDumpTaskFrame classes 2024-04-29 15:26:12 +02:00
source Add DataTransferTaskFrame and GameCardImageDumpTaskFrame classes 2024-04-29 15:26:12 +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 Update build.sh 2024-04-15 15:17:47 +02:00
LICENSE.md Change project layout + upgrade license to GPLv3. 2021-03-25 15:26:58 -04:00
Makefile bktr: perform binary search in bktrGetTreeNodeEntryIndex() 2024-02-16 23:31:24 +01:00
README.md Update README.md 2023-12-31 18:33:49 +01:00
todo.txt Update todo.txt 2023-12-22 12:41:34 +01: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