WIP nxdumptool - Nintendo Switch Dump Tool

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by DarkMatterCore, Jun 21, 2018.

  1. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    Disclaimer:
    • Doesn't work under 1.0.0, and probably never will. The application needs some IPC calls that are only available from 2.0.0 onwards.
    • Doesn't work under FW > 1.0.0 and < 4.0.0 if the application is launched using PegaSwitch. This is because PegaSwitch doesn't give full access permissions to the application. This is a known bug that's being looked into.
    • Works under SX OS v1.2 and later, but only is your Switch is on FW > 1.0.0.
    • When used with the inserted gamecard, the NSP dumping, ExeFS dumping/browsing and RomFS dumping/browsing capabilities depend entirely on the FW version the console is on. This is because the SPL services are used to decrypt the NCA key area directly without deriving for key area encryption keys. If the console is not updated to a FW version that supports the crypto/keyslot used by the inserted gamecard, these features will fail.
    • NSP dumping, ExeFS dumping/browsing and RomFS dumping/browsing capabilities for installed SD/eMMC require the "sdmc:/switch/prod.keys" file. Likewise, ticket-less update NSP dumping from gamecard requires this file to be available. Use Lockpick_RCM to generate it.
    _____________________________

    nxdumptool

    Nintendo Switch Game Card Dump Tool

    Current version: v1.1.2.

    Download: https://github.com/DarkMatterCore/gcdumptool/releases/latest.

    Main features
    • Generates full Cartridge Image dumps (XCI) with optional certificate removal and optional trimming.
    • Generates installable Nintendo Submission Packages (NSP) from base applications, updates and DLCs stored in the inserted game card, SD card and eMMC storage devices.
    • Compatible with multigame carts.
    • CRC32 checksum calculation for XCI/NSP dumps.
    • Full XCI dump verification using XML database from NSWDB.COM (NSWreleases.xml).
    • XML database and in-app update via libcurl.
    • Precise HFS0 raw partition dumping, using the root HFS0 header from the game card.
    • HFS0 partition file data dumping.
    • HFS0 partition file browser with manual file dump support.
    • Program NCA ExeFS section file data dumping.
    • Program NCA ExeFS section file browser with manual file dump support.
    • Program NCA RomFS section file data dumping.
    • Program NCA RomFS section file browser with manual file dump support.
    • Manual game card certificate dump.
    • Free SD card space checks in place.
    • File splitting support for all operations.
    • Game card metadata retrieval using NCM and NS services.
    • Dump speed calculation, ETA calculation and progress bar.
    Operations related to installed SD/eMMC titles require a keys file located at "sdmc:/switch/prod.keys". Use Lockpick_RCM to generate it.

    Thanks to
    • MCMrARM, for creating the original application.
    • RSDuck, for vba-next-switch port. It's UI menu code was taken as a basis for this application.
    • foen, for giving me some pretty good hints about how to use the NCM service.
    • yellows8, for helping me fix a silly bug in my implementation of some NCM service IPC calls.
    • SciresM, for hactool (licensed under ISC). It's NCA content handling procedure is reproduced during the NSP dump process.
    • The-4n, for 4NXCI (licensed under ISC) and hacPack (licensed under GPLv2). The NCA content patching procedure used in 4NXCI is replicated in the application, as well as the NACP XML generation from hacPack.
    • shchmue, for Lockpick (licensed under GPLv2). It is used as a reference for the runtime key-collection algorithm needed for the NSP dump, ExeFS dump/browse and RomFS dump/browse procedures.
    • Björn Samuelsson, for his public domain CRC32 checksum calculation C-code.
    • Adubbz, for Tinfoil (licensed under MIT). Its wrappers for ES service IPC calls are used in the application.
    • ChaN, for the FatFs module (licensed under FatFs license). It is used to read ES savedata files from the BIS System partition.
    • AnalogMan, for his constant support and ideas.
    • RattletraPM, for the awesome icon used in the application.
    • The GNOME project, from which the high contrast directory/file icons for the filebrowser modes were retrieved.
    • The folks from ReSwitched, for working towards the creation of a good homebrew ecosystem.
    • The Comfy Boyes, for being both awesome and supportive. You know who you are.
    Donate

    If you like my work and you'd like to support me in any way, it's not necessary, but a donation would be greatly appreciated!

    [​IMG]

    Changelog
    Warning: Spoilers inside!

    Screenshots
    Warning: Spoilers inside!
    _____________________________

    You can use XCI-Cutter to trim your own XCI dumps and recover some precious storage space. You can also use it to re-insert padding to an already trimmed XCI dump. The application itself also offers an option to generate trimmed dumps.

    P.S.: If you go back to Horizon and get an error or black screen when trying to launch the inserted gamecard, just pull it out and re-insert it. No reboot needed. Any help on fixing this bug will be greatly appreciated.
    _____________________________

    How to merge parts under Windows:
    Code:
    copy /b game.xc0+game.xc1 game.xci

    How to merge parts under Linux:
    Code:
    cat game.xc0 game.xc1 > game.xci
    Make sure to replace the "game" prefix with the actual filename.

    If you don't want to deal with this manual process yourself, you can also use this Windows CMD script or this Linux Bash script, depending on the OS you're using. Both scripts are courtesy of @8BitWonder. Make sure to take a look at the README.txt for instructions.
     
    Last edited by DarkMatterCore, Jun 24, 2019
    Muxi, Aisuga, RattletraPM and 34 others like this.
  2. jakkal

    jakkal GBAtemp Addict

    Member
    12
    Apr 27, 2018
    United States
    nice thanks for this
     
  3. DogParty

    DogParty GBAtemp Regular

    Member
    5
    Sep 15, 2015
    United States
    These are great features not found elsewhere! Thanks for the work!
     
    CuriousTommy, hippy dave and thaikhoa like this.
  4. huma_dawii

    huma_dawii GBAtemp Psycho!

    Member
    10
    Apr 3, 2014
    United States
    Planet Earth

    Thanks a lot, I haven't tried your version yet.. but if im dumping games, do they get renamed to the actual game ID or its just game.xci? cause Im tired of renaming them manually :/
     
  5. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    The current naming scheme for XCI dumps is:

    sdmc:/[TitleID]_[timestamp].xci.[PartNumber]

    The part number is not appended to the name if you choose exFAT mode.
     
    hippy dave, huma_dawii and thaikhoa like this.
  6. SAKyle

    SAKyle Newbie

    Newcomer
    2
    Jan 5, 2018
    United States
    On 3.0.0 I get unable to get root hfs0 header then it crashes with 2011-0301.
     
  7. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    I developed the application under 5.0.2. I'll check that when I get home.
     
  8. huma_dawii

    huma_dawii GBAtemp Psycho!

    Member
    10
    Apr 3, 2014
    United States
    Planet Earth
    Thanks a lot! Seems im moving to other GameCard dumper ;)

    EDIT:

    Does it have the options to Dump the game without CERT? (or to patch the cert something like that)

    EDIT2:

    Main features
    • Generates full XCI cartridge dumps (with optional certificate removal). All dumps are padded with 0xFF up to the actual game card size.
    • Precise HFS0 raw partition dumping (using the root HFS0 header from the game card).
    • Partition filesystem data dumping.
    • Partition filesystem browser (with manual file dump support).
    • Manual game card certificate dump.
    • Free SD card space checks in place.
    • File splitting support for all operations, using 2 GiB parts.
    • Game card Title ID and Control.nacp retrieval support using NCM and NS services.


      EDIT3:

      My only suggestion... the font is WAY to small, my eyes hurt! But it works awesome!!! :D Thanks a lot. Dumping my first cartridge now!
     
    Last edited by huma_dawii, Jun 21, 2018
    Assasin1990 and willhack like this.
  9. thaikhoa

    thaikhoa GBAtemp Addict

    Member
    9
    Sep 16, 2008
    Australia
    It won't work on SX OS (WAINDumpCartNX works). Failed to initialize the NCM service.
     
  10. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    Access to the NCM service is necessary to retrieve the Title ID. I suppose I may end up adding a mode in which the Title ID is not used in the output filename.
     
    Assasin1990 and thaikhoa like this.
  11. thaikhoa

    thaikhoa GBAtemp Addict

    Member
    9
    Sep 16, 2008
    Australia
    Works good on Hekate. Awesome!
     
    DarkMatterCore likes this.
  12. MonMonz

    MonMonz GBAtemp Fan

    Member
    5
    Nov 7, 2014
    Egypt
    I can test it for 2.x if that will help
    Right now it just crash
     
    DarkMatterCore likes this.
  13. huma_dawii

    huma_dawii GBAtemp Psycho!

    Member
    10
    Apr 3, 2014
    United States
    Planet Earth
    Tried dumping DOOM and I get a crash when its at 89% trying again, (5.1.0)
     
  14. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    Could you please share the error code?
     
  15. huma_dawii

    huma_dawii GBAtemp Psycho!

    Member
    10
    Apr 3, 2014
    United States
    Planet Earth
    Let me see if I can reproduce the error! I'm retrying right now :)
     
    DarkMatterCore likes this.
  16. TheRedRacon79

    TheRedRacon79 Member

    Newcomer
    2
    Apr 11, 2018
    United States
    how do i fuse the split parts together?
     
  17. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    Thanks. I'll be waiting.

    If you use Windows:
    Code:
    copy /b game.xci.00+game.xci.01 game.xci

    If you use Linux:
    Code:
    cat game.xci.00 game.xci.01 > game.xci

    Make sure to replace the "game" prefix with the actual filename. I'm gonna add this to the first post.
     
    Last edited by DarkMatterCore, Jun 21, 2018
  18. huma_dawii

    huma_dawii GBAtemp Psycho!

    Member
    10
    Apr 3, 2014
    United States
    Planet Earth

    Nothing happened this time around, maybe it was because the system was docked? This time around I tried on handheld mode.
     
  19. TheRedRacon79

    TheRedRacon79 Member

    Newcomer
    2
    Apr 11, 2018
    United States
    i tried this nothing worked


    If you use Windows:
    Code:
    copy /b game.xci.00+game.xci.01 game.xci

    If you use Linux:
    Code:
    cat game.xci.00 game.xci.01 > game.xci

    Make sure to replace the "game" prefix with the actual filename. I'm gonna add this to the first post.[/QUOTE]
     
    Last edited by TheRedRacon79, Jun 21, 2018
  20. DarkMatterCore
    OP

    DarkMatterCore I like turtles.

    Member
    7
    May 30, 2009
    Venezuela
    Cabimas, Zulia, Venezuela
    Hmm, I don't really know. I never use the dock, I don't have a HD TV.

    You're supposed to run the command use cmd/powershell under Windows or bash/shell under Linux.
     
    Last edited by DarkMatterCore, Jun 21, 2018
    Assasin1990 likes this.
Loading...