Skip to content

Backup, restore, encrypt or decrypt Nintendo Switch's NAND

Notifications You must be signed in to change notification settings

wangdandanqq/NxNandManager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

NxNandManager

NxNandManager is a command line (and GUI) utility for Windows 7 & 10, the primary purpose of which is to copy, decrypt and encrypt Nintendo Switch content (full NAND or specific partition) from/to a file or physical drive.

Png

Features

  • Full NAND backup & restore (BOOT0, BOOT1, RAWNAND)
  • Copy from/to specific partition (RAWNAND)
  • NAND decryption/encryption using bis keys
  • Option to wipe all console unique ids and certificates (a.k.a Incognito)
  • Display useful information about NAND file/drive (Firmware ver., exFat driver, S/N, etc.)
  • Enable/Disable auto RCM (BOOT0)

Compatibility

All dumps made with Hekate are supported by NxNandManager (and vice versa).

NxNM also supports splitted dumps (such as SX OS's (emu)NAND dumps).
Split filenames should be :
basename[00->99].(bin|.*) or basename[0->9].(bin|.*) or basename.[0->∝]
Set the first split file as input

How to mount and open your Nintendo Switch's NAND ?

  1. Use memloader v3 to mount eMMC on your computer (TegraRcmGUI provides an easy means to do it).
  2. Open NxNandManager (CLI : add argument --list to list all available physical drives, GUI : File > Open drive).
  3. Select the mounted drive. You can now perform backup/restore operations.

Png

CLI Usage

NxNandManager.exe [--list] -i inputFilename|\\.\PhysicalDriveX [-o outputFilename|\\.\PhysicalDriveX] [-part=nxPartitionName] [--info] [--enable_autoRCM] [--disable_autoRCM] [--incognito] [lFlags]

Arguments Description
-i Path to input file or physical drive
-o Path to output file or physical drive
-part= Partition to copy (apply to both input & output if possible)
Possible values are PRODINFO, PRODINFOF, SAFE, SYSTEM, USER,
BCPKG2-2-Normal-Sub, BCPKG2-3-SafeMode-Main, etc. (see --info)
-d Decrypt content (-keyset mandatory)
-e Encrypt content (-keyset mandatory)
-keyset Path to keyset file (bis keys)
--gui Launch graphical user interface (optional)
--info Display information about input/output (depends on NAND type):
NAND type, partitions, encryption, autoRCM status...
...more info when -keyset provided: firmware ver., S/N, last boot date
--list List compatible physical drives`
--incognito Wipe all console unique ids and certificates from CAL0 (a.k.a incognito)
Only apply to input type RAWNAND or PRODINFO partition
--enable_autoRCM Enable auto RCM. -i must point to a valid BOOT0 file/drive
--disable_autoRCM Disable auto RCM. -i must point to a valid BOOT0 file/drive
Flags Description
BYPASS_MD5SUM Used to by-pass all md5 verifications
Dump/Restore is faster but less secure
FORCE Program will never prompt for user confirmation

Examples

Dump full NAND to file

  • From physical drive (you first need to mount NX eMMC with memloader (via TegraRcmGUI for ex) :
    .\NxNandManager.exe -i \\.\PhysicalDrive3 -o "C:\Users\Public\NAND dump\rawnand.bin"

  • From existing dump file :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\rawnand.bin" -o D:\rawnand2.bin

Dump specific partition to file

  • Dump SYSTEM partition from physical drive :
    .\NxNandManager.exe -i \\.\PhysicalDrive3 -o "C:\Users\Public\NAND dump\SYSTEM.bin" -part=SYSTEM

  • Extract PRODINFOF partition from existing dump file :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\rawnand.bin" -o D:\PRODINFOF.bin -part=PRODINFOF

Restore NAND dump

  • Restore full raw NAND to physical drive :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\rawnand.bin" -o \\.\PhysicalDrive3

  • Restore full splitted raw NAND to physical drive :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\full00.bin" -o \\.\PhysicalDrive3

  • Restore specific partition to physical drive :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\rawnand.bin" -o \\.\PhysicalDrive3 -part=PRODINFO
    or
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\PRODINFO" -o \\.\PhysicalDrive3 -part=PRODINFO

Copy partition from file to rawNand file

  • Copy specific partition from rawNand file :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\rawnand.bin" -o "C:\Users\Public\NAND dump\rawnand2.bin" -part=BCPKG2-1-Normal-Main

  • Copy specific partition from partition file :
    .\NxNandManager.exe -i "C:\Users\Public\NAND dump\BCPKG2-1-Normal-Main" -o "C:\Users\Public\NAND dump\rawnand2.bin" -part=BCPKG2-1-Normal-Main

NAND decryption/encryption (AES-XTS)

NxNandManager can decrypt or encrypt NAND file/drive (rawnand or encrypted partition file "PRODINFO", "SAFE", "SYSTEM", etc).
A keyset file containing biskeys must be provided.

Use -d argument to decrypt, -e to encrypt.

Keys can be provided by the -keyset argument to the keyset filename.
The program can parse keyset files made with biskeydump or lockpick :

   BIS Key 0 (crypt): <16-byte hex key>
   BIS Key 0 (tweak): <16-byte hex key>
   ...

or

   bis_key_00 = <32-byte hex key>
   bis_key_01 = <32-byte hex key>
   ...

When -keyset and --info arguments are provided, the program can also retrieve some useful information, such as firmware version, exFat driver, last boot time, etc.

Examples

Decrypt full rawnand :
NxNandManager.exe -i rawnand.bin -o rawnand.dec -d -keyset keys.dat

Decrypt single partition file :
NxNandManager.exe -i PRODINFO -o PRODINFO.dec -d -keyset keys.dat

Encrypt single partition file :
NxNandManager.exe -i PRODINFO.dec -o PRODINFO.enc -e -keyset keys.dat

Decrypt & restore single partition file to physical drive
NxNandManager.exe -i PRODINFO.dec -o \\.\PhysicalDrive3 -part=PRODINFO -e -keyset keys.dat

Encrypt & restore full rawnand
NxNandManager.exe -i rawnand.dec -o \\.\PhysicalDrive3 -e -keyset keys.dat

Build

CLI : MinGW (recommended if not using Visual Studio), MSYS and MSYS2 with GCC

Dependency : OpenSSL. You can grab my own pre-compiled binaries for mingw32/64 here.

git clone https://github.com/eliboa/NxNandManager   
cd NxNandManager/NxNandManager
make

Note : Line #define ENABLE_GUI of "NxNandManager.h" file has to be commented

CLI + GUI (Qt) : MinGW64, MSVC

Dependency : Qt, OpenSSL

QtCreator : Use NxNandManager/NxNandManager.pro project file

Visual Studio (Qt Visual Studio Tools needed) : Use NxNandManager.sln solution file

Credits

About

Backup, restore, encrypt or decrypt Nintendo Switch's NAND

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 97.6%
  • QMake 1.4%
  • Other 1.0%