Tutorial  Updated

How to easy extract game files from NSP & XCI

EDIT: THIS TUTORIAL IS OUTDATED! NO SUPPORT!

I made this tutorial with my own *.cmd file. Tools for easy unpacking files are hard to find and didn't work for me.
Tool doesn't support putting titlekey manually and never will.

My pack is good for 5 situations:
- Unpack only base game from *.NSP file
- Unpack *.NSP base game patched with *.NSP update
- Unpack only base game from *.XCI file
- Unpack *.XCI base game patched with *.NSP update
- Unpack *.XCI base game patched with *.NCA update that was already inside *.XCI

What you need is the newest as possible "keys.txt" which can be found in Google or derived from your own Switch with Lockpick tool
https://gbatemp.net/threads/lockpick-switch-key-derivation-homebrew.525575/
https://gbatemp.net/threads/switch-7-0-key-derivation-lockpick_rcm-payload.532916/
As sharing keys is illegal, it cannot be uploaded to my package.

Unpackv2.zip unlike Unpack.zip can find correct files in NSP to unpack automatically. It will crash if one NSP contains more than one game possible to launch from Home Menu.
Additionally contains countermeasures in case when there will be different quantity than 1 *.tik file (Execution aborted) or 1 *.xml file (goes to manually drop NCA file).

Download "Unpack.zip" or "Unpackv2.zip" from attachments and unpack it.
Put "keys.txt" in the same folder as "Unpack.cmd".
If your keys file is named "keys.ini" or "prod.keys", you need to rename it to "keys.txt".

Tested on Windows 10.
For best results move your game files to unpack folder.

NSPXCINSPv2XCIv2Thanks

  1. For Unpack.zip
    1. Drop your game with *.NSP extension to "Unpack.cmd".
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedNSP" folder with unpacked temporary files.

    2. If you don't have update, press ENTER without writing or dropping anything and go to point 3.

    2.1. Drop update file with *.NSP extension to command line.
    Press ENTER.
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedNSPatch" folder with unpacked temporary files.

    2.2 Drop correct NCA file (probably the biggest one) from "ExtractedNSPatch" folder to command line.
    Press ENTER.

    3. Drop correct NCA file (probably the biggest one) from "ExtractedNSP" folder to command line.
    Press ENTER.

    4. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  2. For Unpack.zip
    1. Drop your game with *.XCI extension to "Unpack.cmd".
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedXCI" folder with unpacked temporary files.

    2. If you have patch with *.NSP extension, go to 2.1.1. if it's with *.NCA extension (Custom XCIs) inside ExtractedXCI, go to point 2.2.1.
    If you don't have patch, press ENTER without writing or dropping anything and go to point 3.

    2.1.1 Drop update file with *.NSP extension to command line. Press ENTER.
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedNSPatch" folder with unpacked temporary files.

    2.1.2 Drop correct NCA file (probably the biggest one) from "ExtractedNSPatch" folder to command line.
    Press ENTER. Go to point 3.

    2.2.1 Write "1" and press ENTER.
    Drop correct NCA file (probably the second biggest file) from "ExtractedXCI" folder to command line.
    Press ENTER.

    3. Drop correct NCA file (probably the biggest one) from "ExtractedXCI" folder to command line.
    Press ENTER.

    4. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  3. For Unpackv2.zip
    1. Drop your game with *.NSP extension to "Unpack.cmd".
    Wait until window will be refreshed.

    2. If you don't have update, press ENTER without writing or dropping anything and go to point 3.

    2.1. Drop update file with *.NSP extension to command line.
    Press ENTER.

    3. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  4. For Unpackv2.zip
    1. Drop your game with *.XCI extension to "Unpack.cmd".
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedXCI" folder with unpacked temporary files.

    2. If you have patch with *.NSP extension, go to 2.1.1. if it's with *.NCA extension (Custom XCIs) inside ExtractedXCI, go to point 2.2.1.
    If you don't have patch, press ENTER without writing or dropping anything and go to point 3.

    2.1.1 Drop update file with *.NSP extension to command line. Press ENTER.
    Wait until window will be refreshed.
    Go to point 3.

    2.2.1 Write "1" and press ENTER.
    Drop correct NCA file (probably the second biggest file) from "ExtractedXCI" folder to command line.
    Press ENTER.

    3. Drop correct NCA file (probably the biggest one) from "ExtractedXCI" folder to command line.
    Press ENTER.

    4. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  5. Thanks to:
    @SciresM for hactool
    https://github.com/SciresM/hactool
    @Ericjwg for tf.exe
    https://gbatemp.net/threads/extract...tool-for-layeredfs.511156/page-3#post-8157621
    Aacini for findrepl
    https://www.dostips.com/forum/viewtopic.php?t=4697


Changelog:
Code:
#01.04: Pushed another version of Unpackv2 resolving conflicts with findrepl and XCI NCA Patch.
#08.04: Next Unpackv2 with fixed crashing when NSP doesn't contain XML
#10.04: Updated echos about different quantity of XML file
#11.04: Fixed unpacking XCA without patch in Unpackv2
#05.07: updated hactool to latest build
 

Attachments

  • Unpack.zip
    217.2 KB · Views: 3,833
  • Unpackv2.zip
    227.8 KB · Views: 4,524
Last edited by masagrator,

failingupwards

Member
Newcomer
Joined
Feb 23, 2020
Messages
7
Trophies
0
Age
36
XP
241
Country
Spain
Hey, good news, I managed to extract the file. Bad news, I'm an idiot: the NSP had spaces in its filename and that's why it failed. Sorry for bothering you.
 

Xerum

New Member
Newbie
Joined
Aug 16, 2020
Messages
1
Trophies
0
Age
33
XP
133
Country
United States
Sorry for the trouble, but does anyone know why I always get "Wrong quantity of .tik file" which makes the extraction fail? I don't know if it's a problem with my keys, but I certainly did everything else correctly.

E: My guess is the NSP I have is bad somehow, so I'll be trying another copy, but I'd still like to hear any other suggestions.

E: Nope, another copy from a different source gave me the same error.
 
Last edited by Xerum,

Perfect One

Well-Known Member
Member
Joined
Jul 13, 2017
Messages
211
Trophies
0
Age
33
XP
684
Country
Brazil
I'm going to extract Jump Rope Challenge files, but once i add files as instructions show, this error appears: http://prntscr.com/uoq98b

It also show some tsec_root_key erros, but i think they are ok to see, as pointed out by some people previously.

My keys.txt file has 117 lines and has keys from _00 up to _0a for key_area_key_application, key_area_key_ocean and several other keys.

So, what am i doing wrong?
 
Last edited by Perfect One,

Adamillo

New Member
Newbie
Joined
Nov 27, 2020
Messages
1
Trophies
0
Age
19
XP
50
Country
Austria
I get an error when I'm trying to extract my NSP copy of Super Mario 3D All Stars with this error message:
"Wrong quanity of *.tik file in ExtractedNSP folder. Extracting canceled."
"Press ENTER to delete ExtractedNSP folder"
 

GuglioIsStupid

Well-Known Member
Newcomer
Joined
Oct 22, 2020
Messages
90
Trophies
0
Age
23
XP
229
Country
Canada
I made this tutorial with my own *.cmd file. Tools for easy unpacking files are hard to find and didn't work for me.
Tool doesn't support putting titlekey manually and never will.

My pack is good for 5 situations:
- Unpack only base game from *.NSP file
- Unpack *.NSP base game patched with *.NSP update
- Unpack only base game from *.XCI file
- Unpack *.XCI base game patched with *.NSP update
- Unpack *.XCI base game patched with *.NCA update that was already inside *.XCI

What you need is the newest as possible "keys.txt" which can be found in Google or derived from your own Switch with Lockpick tool
https://gbatemp.net/threads/lockpick-switch-key-derivation-homebrew.525575/
https://gbatemp.net/threads/switch-7-0-key-derivation-lockpick_rcm-payload.532916/
As sharing keys is illegal, it cannot be uploaded to my package.

Unpackv2.zip unlike Unpack.zip can find correct files in NSP to unpack automatically. It will crash if one NSP contains more than one game possible to launch from Home Menu.
Additionally contains countermeasures in case when there will be different quantity than 1 *.tik file (Execution aborted) or 1 *.xml file (goes to manually drop NCA file).

Download "Unpack.zip" or "Unpackv2.zip" from attachments and unpack it.
Put "keys.txt" in the same folder as "Unpack.cmd".
If your keys file is named "keys.ini" or "prod.keys", you need to rename it to "keys.txt".

Tested on Windows 10.
For best results move your game files to unpack folder.

NSPXCINSPv2XCIv2Thanks

  1. For Unpack.zip
    1. Drop your game with *.NSP extension to "Unpack.cmd".
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedNSP" folder with unpacked temporary files.

    2. If you don't have update, press ENTER without writing or dropping anything and go to point 3.

    2.1. Drop update file with *.NSP extension to command line.
    Press ENTER.
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedNSPatch" folder with unpacked temporary files.

    2.2 Drop correct NCA file (probably the biggest one) from "ExtractedNSPatch" folder to command line.
    Press ENTER.

    3. Drop correct NCA file (probably the biggest one) from "ExtractedNSP" folder to command line.
    Press ENTER.

    4. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  2. For Unpack.zip
    1. Drop your game with *.XCI extension to "Unpack.cmd".
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedXCI" folder with unpacked temporary files.

    2. If you have patch with *.NSP extension, go to 2.1.1. if it's with *.NCA extension (Custom XCIs) inside ExtractedXCI, go to point 2.2.1.
    If you don't have patch, press ENTER without writing or dropping anything and go to point 3.

    2.1.1 Drop update file with *.NSP extension to command line. Press ENTER.
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedNSPatch" folder with unpacked temporary files.

    2.1.2 Drop correct NCA file (probably the biggest one) from "ExtractedNSPatch" folder to command line.
    Press ENTER. Go to point 3.

    2.2.1 Write "1" and press ENTER.
    Drop correct NCA file (probably the second biggest file) from "ExtractedXCI" folder to command line.
    Press ENTER.

    3. Drop correct NCA file (probably the biggest one) from "ExtractedXCI" folder to command line.
    Press ENTER.

    4. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  3. For Unpackv2.zip
    1. Drop your game with *.NSP extension to "Unpack.cmd".
    Wait until window will be refreshed.

    2. If you don't have update, press ENTER without writing or dropping anything and go to point 3.

    2.1. Drop update file with *.NSP extension to command line.
    Press ENTER.

    3. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  4. For Unpackv2.zip
    1. Drop your game with *.XCI extension to "Unpack.cmd".
    Wait until window will be refreshed.
    In Unpack folder there is now "ExtractedXCI" folder with unpacked temporary files.

    2. If you have patch with *.NSP extension, go to 2.1.1. if it's with *.NCA extension (Custom XCIs) inside ExtractedXCI, go to point 2.2.1.
    If you don't have patch, press ENTER without writing or dropping anything and go to point 3.

    2.1.1 Drop update file with *.NSP extension to command line. Press ENTER.
    Wait until window will be refreshed.
    Go to point 3.

    2.2.1 Write "1" and press ENTER.
    Drop correct NCA file (probably the second biggest file) from "ExtractedXCI" folder to command line.
    Press ENTER.

    3. Drop correct NCA file (probably the biggest one) from "ExtractedXCI" folder to command line.
    Press ENTER.

    4. Now wait until is finished. It will show you where tool unpacked game files.
    If you want to delete temporary files, press two times ENTER when asked. Otherwise close window.
  5. Thanks to:
    @SciresM for hactool
    https://github.com/SciresM/hactool
    @Ericjwg for tf.exe
    https://gbatemp.net/threads/extract...tool-for-layeredfs.511156/page-3#post-8157621
    Aacini for findrepl
    https://www.dostips.com/forum/viewtopic.php?t=4697


Changelog:
Code:
#01.04: Pushed another version of Unpackv2 resolving conflicts with findrepl and XCI NCA Patch.
#08.04: Next Unpackv2 with fixed crashing when NSP doesn't contain XML
#10.04: Updated echos about different quantity of XML file
#11.04: Fixed unpacking XCA without patch in Unpackv2
#05.07: updated hactool to latest build
Not getting the folder so I can't put the NCA file in it
 

SCArkadia

Member
Newcomer
Joined
Feb 28, 2021
Messages
5
Trophies
0
Age
29
XP
44
Country
Indonesia
Sorry to interrupt you sir, masagrator. I need to ask how did you manage to get dump file assets?

Is it involving with the unpack nsp or Xci from your thread?

I need to get Tokyo mirage session or smt nocturne or P5S dump files. So please do tell me if this thread is the answer :)
 

MultiKoopa

Well-Known Member
Member
Joined
Jun 11, 2018
Messages
469
Trophies
0
Age
34
XP
1,099
Country
United States
Why am I getting "Failed to match key" errors in the command line? These are my own keys I dumped with Lockpick

The extraction also fails at the end:
INFO: Could not find files for the given pattern(s).
"Wrong quanity of *.tik file in ExtractedNSP folder. Extracting canceled."
"Press ENTER to delete ExtractedNSP folder"
Press any key to continue . . .
 

Deastrumquodvicis

Member
Newcomer
Joined
Jan 18, 2021
Messages
16
Trophies
0
Age
34
XP
216
Country
United States
Okay, so I extracted the NSP and wound up with a fair few files, I'm just not sure what to do next. "Drag to the command line" doesn't really tell me anything--when I use just a plain old CPrompt for the NCA it tells me it wants to open with a program and gives me that dialogue option, but when I use unpack.cmd it says it can't do it.
 

Imancol

Otak Productions
Member
Joined
Jun 29, 2017
Messages
1,376
Trophies
0
XP
2,770
Country
Colombia
upload_2021-4-29_16-7-55.png

upload_2021-4-29_16-10-57.png

upload_2021-4-29_16-11-39.png
 
Last edited by Imancol,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: @K3Nv2, try SanDisk format tool?