Tutorial How to easy extract game files from NSP & XCI

masagrator

The patches guy
OP
Member
Joined
Oct 14, 2018
Messages
5,229
Trophies
2
XP
9,416
Country
Poland
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,684
  • Unpackv2.zip
    227.8 KB · Views: 4,424
Last edited by masagrator,

masagrator

The patches guy
OP
Member
Joined
Oct 14, 2018
Messages
5,229
Trophies
2
XP
9,416
Country
Poland
Unpackv2.zip added with automatically choosing NCA file from extracted NSP based on XML file.

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).
 
Last edited by masagrator,
  • Like
Reactions: MYFW

masagrator

The patches guy
OP
Member
Joined
Oct 14, 2018
Messages
5,229
Trophies
2
XP
9,416
Country
Poland
You're probably using modified nsp or you've two games unpacked to the same folder. I'm not supporting first one. Second: delete ExtractNSP before using this tool.
This tool is only for using not modified NSP/XCI or modified XCI.

And delete log as it contains licensed keys and sharing them is banned on gbatemp.

Edit: it looks like post above has been deleted. :P

I need to check newest hactool as it should resolve issues with 8.0.0 NSPs.
 
Last edited by masagrator,

babyjoe00069

Well-Known Member
Newcomer
Joined
Apr 3, 2009
Messages
47
Trophies
0
XP
307
Country
United States
Oh shoot was there keys in that msg I posted? I didnt know what is a key then, that was the error I didnt know lol

--------------------- MERGED ---------------------------

It was just Dragonball Fighterz I tried to extract that game and got that msg?
 

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,509
Trophies
0
Age
27
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,464
Country
Spain
I'm trying to extract Yoshi's Crafted World and the nca extracts fine but then I'm getting an error with the keys and they are the ones I use to convert from XCI to NSP so they should be fine :/

They are from 8.0.1. Does anyone know how to fix it?
 

linuxares

I'm not a generous god!
Global Moderator
Joined
Aug 5, 2007
Messages
9,828
Trophies
1
XP
11,929
Country
Sweden
I'm trying to extract Yoshi's Crafted World and the nca extracts fine but then I'm getting an error with the keys and they are the ones I use to convert from XCI to NSP so they should be fine :/

They are from 8.0.1. Does anyone know how to fix it?
Dump your keys with Lockpick_RCM and try again?
 

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,509
Trophies
0
Age
27
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,464
Country
Spain
Dump your keys with Lockpick_RCM and try again?

My keys are fine as I use them for NSP conversion. I doubt dumping them again would work :/

Edit: Nope, I dumped them again and they are not working. Same issue. They work for XCI > NSP
 
Last edited by Manurocker95,

Burorī

Well-Known Member
Member
Joined
Mar 23, 2018
Messages
308
Trophies
0
Age
27
XP
1,588
Country
Belgium
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

Everytime I try I get this:

*Redacted*
 
Last edited by Foxi4, , Reason: Removed copyrighted material

masagrator

The patches guy
OP
Member
Joined
Oct 14, 2018
Messages
5,229
Trophies
2
XP
9,416
Country
Poland
Everytime I try I get this:

[WARN] prod.keys does not exist.
...
This is normal.
And you should delete log as sharing keys is banned here.

And if it's not working - it's because hactool has some issues with files made by newest SDKs. I will probably update tutorial to include Squirrel.
 
Last edited by masagrator,

masagrator

The patches guy
OP
Member
Joined
Oct 14, 2018
Messages
5,229
Trophies
2
XP
9,416
Country
Poland
No, I made this tutorial for game modding.
And I've updated packages with newest hactool build. Latest one didn't work with newest NSPs and XCIs.
 
Last edited by masagrator,

Enderfacio

Member
Newcomer
Joined
Sep 18, 2019
Messages
6
Trophies
0
Age
34
XP
45
Country
Argentina
Hi, I'm having troubles trying to get the SZS files from a NCA. I can´t get the keys from the game I downloaded in XCI because my Switch is not a model compatible with CFW. Is it realy necessary to get keys to be able to generate the SZS files?
 

Enderfacio

Member
Newcomer
Joined
Sep 18, 2019
Messages
6
Trophies
0
Age
34
XP
45
Country
Argentina
Those keys need to be derived from Switch itself, not game. And yes - they are necessary
Well then I´m on a dead end... because CWF don't work with my Switch.
If I ask someone here to get those SZS for me, could that happen or is it to much for asking?
 

gamesquest1

Nabnut
Global Moderator
Joined
Sep 23, 2013
Messages
15,153
Trophies
2
XP
12,226
Well then I´m on a dead end... because CWF don't work with my Switch.
If I ask someone here to get those SZS for me, could that happen or is it to much for asking?
no you cannot ask for people to share copywritten files on gbatemp, I'm sure the keys you need exist somewhere on the internet, but gbatemp is not the place to be asking for any sort of decryption keys or for copies of files

good luck on your hunt though
 

Enderfacio

Member
Newcomer
Joined
Sep 18, 2019
Messages
6
Trophies
0
Age
34
XP
45
Country
Argentina
no you cannot ask for people to share copywritten files on gbatemp, I'm sure the keys you need exist somewhere on the internet, but gbatemp is not the place to be asking for any sort of decryption keys or for copies of files

good luck on your hunt though

Ok Sorry for asking. Thank you for your help
 
  • Like
Reactions: gamesquest1

Kaezzine

Well-Known Member
Newcomer
Joined
Oct 31, 2019
Messages
77
Trophies
0
Age
33
Location
Bonn, Germany
XP
130
Country
Germany
I get tf has stopped working every single time.
keys.txt are mine. Tried with internet keys, same error.
Deleted the Extracted NSP folder inbetween trials, same thing !
Extracted NSP folder has all the NCAs even the bigger one but the cmd crash right after NCA extraction to Extracted NSP folder with "tf has stopped working".
My NSP file is just a base game (Saints Row The Third) not modified. I was just aiming to take a look at the files and see what mods can be applied.

So what's this error about ? (I used both Unpack v1 and v2, same deal)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    KenniesNewName @ KenniesNewName: Was his name big bob behind a brick wall?