# Nintendo Switch Tool (NSTool) ![DeviceTag](https://img.shields.io/badge/Device-SWITCH-e60012.svg) General purpose reading/extraction tool for Nintendo Switch file formats. ## Supported File Formats * Meta (.npdm) * PartitionFS (and Sha256PartitionFS) (includes raw .nsp) * RomFS * 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) # Usage ``` Usage: nstool [options... ] 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. Output Options: --showkeys Show keys generated. --showlayout Show layout metadata. -v, --verbose Verbose output. XCI (GameCard Image) nstool [--listfs] [--update --logo --normal --secure ] <.xci file> --listfs Print file system in embedded partitions. --update Extract "update" partition to directory. --logo Extract "logo" partition to directory. --normal Extract "normal" partition to directory. --secure Extract "secure" partition to directory. PFS0/HFS0 (PartitionFs), RomFs, NSP (Nintendo Submission Package) nstool [--listfs] [--fsdir ] --listfs Print file system. --fsdir Extract file system to directory. NCA (Nintendo Content Archive) nstool [--listfs] [--bodykey --titlekey ] [--part0 ...] <.nca file> --listfs Print file system in embedded partitions. --titlekey Specify title key extracted from ticket. --bodykey Specify body encryption key. --tik Specify ticket to source title key. --cert Specify certificate chain to verify ticket. --part0 Extract "partition 0" to directory. --part1 Extract "partition 1" to directory. --part2 Extract "partition 2" to directory. --part3 Extract "partition 3" to directory. NSO (Nintendo Shared Object), NRO (Nintendo Relocatable Object) nstool [--listapi --listsym] [--insttype ] --listapi Print SDK API List. --listsym Print Code Symbols. --insttype Specify instruction type [64bit|32bit] (64bit is assumed). INI1 (Initial Program Bundle) nstool [--kipdir ] --kipdir Extract embedded Initial Programs to directory. ASET (Homebrew Asset Blob) nstool [--listfs] [--icon --nacp --fsdir ] --listfs Print filesystem in embedded RomFS partition. --icon Extract icon partition to file. --nacp Extract NACP partition to file. --fsdir Extract RomFS partition to directory. ``` # 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).