2019-01-31 09:10:19 +00:00
|
|
|
# Nintendo Switch Tool (NSTool) ![DeviceTag](https://img.shields.io/badge/Device-SWITCH-e60012.svg)
|
|
|
|
General purpose reading/extraction tool for Nintendo Switch file formats.
|
2017-07-18 14:23:37 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
## Supported File Formats
|
|
|
|
* Meta (.npdm)
|
2021-10-16 08:01:09 +00:00
|
|
|
* PartitionFS (and Sha256PartitionFS) (includes raw .nsp)
|
|
|
|
* RomFS
|
2021-11-05 06:11:01 +00:00
|
|
|
* NX GameCard Image (.xci)
|
|
|
|
* Nintendo Content Archive (.nca)
|
|
|
|
* Content Metadata (.cnmt)
|
|
|
|
* Nintendo Shared Object (`NSO0`) (.nso)
|
|
|
|
* Nintendo Relocatable Object (`NRO0`) (.nro)
|
|
|
|
* Initial Program Bundle (`INI1`) (.ini)
|
|
|
|
* Initial Program (`KIP1`) (.kip)
|
|
|
|
* Nintendo Application Control Property (.nacp)
|
|
|
|
* ES Certificate (.cert)
|
|
|
|
* ES Ticket (v2 only) (.tik)
|
2017-07-18 14:23:37 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
# Usage
|
|
|
|
```
|
|
|
|
Usage: nstool [options... ] <file>
|
2018-04-24 09:25:05 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
General Options:
|
|
|
|
-d, --dev Use devkit keyset.
|
|
|
|
-k, --keyset Specify keyset file.
|
|
|
|
-t, --type Specify input file type. [xci, pfs, romfs, nca, meta, cnmt, nso, nro, ini, kip, nacp, aset, cert, tik]
|
|
|
|
-y, --verify Verify file.
|
2018-04-24 09:25:05 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
Output Options:
|
|
|
|
--showkeys Show keys generated.
|
|
|
|
--showlayout Show layout metadata.
|
|
|
|
-v, --verbose Verbose output.
|
2018-08-07 05:39:55 +00:00
|
|
|
|
2021-10-23 03:51:06 +00:00
|
|
|
PFS0/HFS0 (PartitionFs), RomFs, NSP (Nintendo Submission Package)
|
2021-11-09 12:23:20 +00:00
|
|
|
nstool [--fstree] [-x [<virtual path>] <out path>] <file>
|
|
|
|
--fstree Print filesystem tree.
|
|
|
|
-x, --extract Extract a file or directory to local filesystem.
|
2021-11-09 08:30:11 +00:00
|
|
|
|
|
|
|
XCI (GameCard Image)
|
2021-11-09 12:23:20 +00:00
|
|
|
nstool [--fstree] [-x [<virtual path>] <out path>] <.xci file>
|
|
|
|
--fstree Print filesystem tree.
|
|
|
|
-x, --extract Extract a file or directory to local filesystem.
|
2021-11-09 08:30:11 +00:00
|
|
|
--update Extract "update" partition to directory. (Alias for "-x /update <out path>")
|
|
|
|
--logo Extract "logo" partition to directory. (Alias for "-x /logo <out path>")
|
|
|
|
--normal Extract "normal" partition to directory. (Alias for "-x /normal <out path>")
|
|
|
|
--secure Extract "secure" partition to directory. (Alias for "-x /secure <out path>")
|
2018-08-07 05:43:58 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
NCA (Nintendo Content Archive)
|
2021-11-09 12:23:20 +00:00
|
|
|
nstool [--fstree] [-x [<virtual path>] <out path>] [--bodykey <key> --titlekey <key> -tik <tik path>] <.nca file>
|
|
|
|
--fstree Print filesystem tree.
|
|
|
|
-x, --extract Extract a file or directory to local filesystem.
|
2019-01-31 09:10:19 +00:00
|
|
|
--titlekey Specify title key extracted from ticket.
|
2021-11-09 12:23:20 +00:00
|
|
|
--bodykey Specify body encryption key.
|
2019-01-31 09:10:19 +00:00
|
|
|
--tik Specify ticket to source title key.
|
|
|
|
--cert Specify certificate chain to verify ticket.
|
2021-11-09 12:23:20 +00:00
|
|
|
--part0 Extract partition "0" to directory. (Alias for "-x /0 <out path>")
|
|
|
|
--part1 Extract partition "1" to directory. (Alias for "-x /1 <out path>")
|
|
|
|
--part2 Extract partition "2" to directory. (Alias for "-x /2 <out path>")
|
|
|
|
--part3 Extract partition "3" to directory. (Alias for "-x /3 <out path>")
|
2019-01-31 09:10:19 +00:00
|
|
|
|
2021-10-23 03:43:07 +00:00
|
|
|
NSO (Nintendo Shared Object), NRO (Nintendo Relocatable Object)
|
2019-01-31 09:10:19 +00:00
|
|
|
nstool [--listapi --listsym] [--insttype <inst. type>] <file>
|
|
|
|
--listapi Print SDK API List.
|
|
|
|
--listsym Print Code Symbols.
|
|
|
|
--insttype Specify instruction type [64bit|32bit] (64bit is assumed).
|
|
|
|
|
2021-11-09 08:30:11 +00:00
|
|
|
INI (Initial Program Bundle)
|
2019-01-31 09:10:19 +00:00
|
|
|
nstool [--kipdir <dir>] <file>
|
2021-11-10 08:08:33 +00:00
|
|
|
--kipdir Extract embedded Initial Programs to directory.
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
ASET (Homebrew Asset Blob)
|
2021-11-09 12:23:20 +00:00
|
|
|
nstool [--fstree] [-x [<virtual path>] <out path>] [--icon <file> --nacp <file>] <file>
|
|
|
|
--fstree Print RomFS filesystem tree.
|
|
|
|
-x, --extract Extract a file or directory from RomFS to local filesystem.
|
2019-01-31 09:10:19 +00:00
|
|
|
--icon Extract icon partition to file.
|
|
|
|
--nacp Extract NACP partition to file.
|
|
|
|
```
|
2018-04-25 04:59:42 +00:00
|
|
|
|
2019-01-31 09:10:19 +00:00
|
|
|
# External Keys
|
|
|
|
NSTool doesn't embed any keys that are copyright protected. However keys can be imported via various keyset files.
|
|
|
|
|
|
|
|
See [SWITCH_KEYS.md](/SWITCH_KEYS.md) for more info.
|
|
|
|
|
|
|
|
# Building
|
|
|
|
See [BUILDING.md](/BUILDING.md).
|