Nintendo Switch Dumping Guide

From No-Intro ~ Wiki
Jump to navigation Jump to search

note: "Initial Area" was previously refered to on this page (and in the dat) as "Key Area"
todo: some more detailed serial documentation: https://gameverifying.com/wiki/cart-based-systems/switch

Dumping Methods

nxdumptool

It's an open-source homebrew application capable of generating NX Card Image (XCI) dumps from Nintendo Switch gamecards.

Requirements

  • A Nintendo Switch console with a firmware version greater than or equal to 3.0.0. Must either be vulnerable to Fusée Gelée or have a firmware version compatible with Caffeine. The exact details on how to use these exploits to launch homebrew applications aren't covered in this guide.
  • nxdumptool saved to sdmc:/switch/nxdumptool/nxdumptool.nro.
    • For XCI dumping, you can either one of the following:
      • The latest stable build.
      • A build of the rewrite branch (offers SD card and USB -> PC dumping, Initial Area dumping, Card ID Set dumping and LAFW blob dumping). Additionally, this build is capable of generating additional TXT files with information about nxdumptool itself, which can be used when submitting information about a dump. See Note #3 if you wish to use USB -> PC dumping.

Note #1: if you use a SD card with a FAT32 partition and the game you wish to dump is bigger than 4 GiB, you can dump it in smaller parts, but you must reassemble them afterwards.

Note #2: if you use the latest stable build, you don't need to have enough free space in your SD card for a whole dump. Sequential (multi-session) dumping is available in nxdumptool, and it's automatically triggered if there's not enough space for a whole dump - but there must be at least 1 GiB of free space. After each session, you'll have to transfer the generated part files to your PC before continuing the dump process in the next session. This feature isn't available in builds from the rewrite branch.

Note #3: to use USB -> PC dumping capabilities from the rewrite branch, and only if you're using Windows, you need to install the libusbK driver:

  • Download and use Zadig to install the libusbK driver for your Switch.
  • Connect your Switch via USB cable to your Windows PC.
  • Download the 7z archive of the rewrite branch linked above and unpack its contents to sdmc:/switch.
  • On your console, enter the Homebrew Menu, and load one of the new binaries (preferrably gc_dumper, which is the actual gamecard dumper PoC).
  • Open Zadig, click on Options -> List all devices.
  • In Zadig, select the name of the the loaded binary in the main dropdown menu. Then, in the Driver section, choose the libusbK option from the dropdown menu, and click Replace/Reinstall. Your driver should now be libusbK instead of WinUSB, and should now work with the host application.
  • Download the host app for nxdumptool, either in EXE form (Windows only) or in Python script form.
    • To use the Python script under Linux and/or MacOS, you will need to install PyUSB and tqdm -- you can do this by downloading the requirements.txt file and running pip install -r requirements.txt.
    • To use the Python script under Windows, download the requirements.txt file linked above, as well as the requirements-win32.txt and windows_install_deps.py files. Place all three files in the same directory and double-click windows_install_deps.py.

Dumping

Stable build

  1. Using either Fusée Gelée or Caffeine, boot into the CFW of your preference and load the Homebrew Menu using title override (hold R while launching a game).
  2. Load nxdumptool.
  3. Select Dump gamecard content.
  4. Select NX Card Image (XCI) dump.
  5. Set the available options to the following values:
    • Split output dump (FAT32 support): set it to Yes if you're using a FAT32 partition in your SD card. Otherwise, set it to No.
    • Create directory with archive bit set: No.
    • Keep certificate: No. This will wipe the gamecard-unique certificate from the output XCI dump.
    • Trim output dump: No.
    • CRC32 checksum calculation + dump verification: No.
  6. Select Start XCI dump process, press A, wait for the process to finish, then press + to exit the application. You'll be able to find the output file(s) in sdmc:/switch/nxdumptool/XCI.
  7. Copy the output dump to your PC. If you used the split method for FAT32, or if you used sequential (multi-session) dumping, you'll need to reassemble the part files into a single XCI dump.

Rewrite build

  1. Using either Fusée Gelée or Caffeine, boot into the CFW of your preference and load the Homebrew Menu using title override (hold R while launching a game).
  2. Load the gc_dumper PoC build from the nxdumptool rewrite.
  3. Set the output storage option to the desired output storage medium for the dumped data (sd card, usb host).
    • If sd card is selected, output files will be saved to sdmc:/switch/gc_dumper/Gamecard.
    • If usb host is selected, connect your Switch to your PC using a USB-C cable, then run the host app on your PC, select the output directory and start the server.
  4. Select dump gamecard initial data, press A, wait for the process to finish, then press any button to go back to the main menu. This will dump the gamecard's Initial Data area.
  5. Select dump gamecard id set, press A, wait for the process to finish, then press any button to go back to the main menu. This will dump the gamecard's ID set.
  6. Select dump gamecard xci, press A and set the available options to the following values:
    • keep certificate: no. This will wipe the gamecard-unique certificate from the output XCI dump.
    • trim dump: no.
    • calculate crc32: no.
  7. Select start dump, press A, wait for the process to finish, press any button to go back to the XCI menu, then press B twice to exit the application.
    • If you're using SD card dumping, copy the output files to your PC. If you're using a FAT32 partition and the gamecard size is greater than 4 GiB, you'll need to reassemble the part files into a single XCI dump.
    • If you're using USB host dumping, you'll be able to find the output files in the directory you selected in the host app on your PC.
Merge part files (FAT32 only)
  1. Copy all part files of your XCI dump to your PC.
  2. Merge your part files into a complete dump:
    1. On Windows:
      1. Open the command prompt and use cd to change the current working directory to the one that holds your split files (e.g. cd C:\switch_dumps).
        • If you used the stable build, type copy /b *.xc* game.xci and then press Enter.
        • If you used the rewrite build, type copy /b * game.xci and then press Enter.
    2. On Linux / MacOS:
      1. Open your terminal emulator and use cd to change the current working directory to the one that holds your split files (e.g. cd /media/USERNAME/SDCARD/switch/nxdumptool/xci/ on Linux or cd /Volumes/SDCARD/switch/nxdumptool/xci/ on MacOS).
        • If you used the stable build, type cat *.xc* > game.xci and then press Enter.
        • If you used the rewrite build, type cat * > game.xci and then press Enter.
  3. Your part files should be reassembled into a full game.xci file. You can safely delete your part files afterwards.

Gathering Dump Info

  • CRC32: Generated from the ROM file using HxD or OpenHashTab on windows, or by using crc32 in a terminal emulator for linux/mac.
  • MD5: As above, or by using md5 in a terminal emulator for linux/mac.
  • SHA-1: As above, or by using shasum -a 1 in a terminal emulator for linux/mac.
  • SHA-256: As above, or by using shasum -a 256 in a terminal emulator for linux/mac.

Also, submit the same info for the Initial Area and Card ID Set files.

  • Game title: If it differs between different places (e.g. title screen, console menu banner, box, cart) then go with the one on the front of the box.
  • Region: The region the cart originated from such as USA, Japan, Europe, Korea, China or "World" if it is being sold in three or more regions If you're unsure, consult the DAT-o-MATIC or simply use the region from the label of your cart.
  • Cart Serial: It is located on the label on the front of the cart the form of "LA-H-XXXXX-XXX" (where X is a letter). The last three letters are the cartridge's region, not necessarily the region of the game itself. For additional information on cartridge serials, see Understanding Serials.
  • Cart Reverse Serial: It is located on the back of the cartridge printed on the plastic in the form "AAAAABBBCCC" where A is Cart Serial, B is unknown, and C is cartridge revision.
  • Cart Revision (If applicable): last 3 digits on the reverse cartridge serial.
  • Box Barcode: The number on the case displayed beneath the vertical lines, see Barcode.
  • Box Serial: The serial on the case. Example: HAC P AAAAA USA
  • Size: The size of the ROM in bytes.
  • Scans: The following scans (or photos) would be good to have: Front and back of the following items - box, cart and PCB.
  • Dumping Tool(s): Please explicitly state which dump tool you use for the XCI, and which for the Initial Area (even if they are the same). If you are using a non-release version, then state the commit hash. If you used a rewrite build, the additional TXT file(s) will easily provide this information.
  • ROM check: run hactool --intype=xci --verify dump.xci > hactool_log.txt. This will create a file called hactool_log.txt, which you should include in your submission.

Submitting Dump Info

Register on the forum (if you aren't already registered) and once your account has been activated, post the info in the "New Dumps & Redumps" sub-forum.

Or if you have a login for it, you can submit the dump info directly to the DAT-o-MATIC database.

Note: DAT-o-MATIC supports importing XMLs in this format directly: https://datomatic.no-intro.org/stuff/example_upload_custom.xml, although there isn't a proper specification (or tool to generate this format from folder(s)/file(s)) yet