Hacking How to repack an NSP with custom files? Is there a manual somewhere

Reploid

Well-Known Member
OP
Member
Joined
Jan 20, 2010
Messages
2,807
Trophies
2
XP
6,201
Country
Serbia, Republic of
I saw people doing cool stuff with switch games, like removing extra languages or inserting translation and graphical mods directly into the package, without relying on LFS.

I've actually tried to do something like this myself a couple of times, but never was able to correctly put an NCA file back together. But it is definitely possible, I would like to do something like this myself. Maybe there is a sensible tutorial that explains things step by step?

I want to take a game, latest update, insert some mods, delete bloated stuff and get a single customized NSP files. If you used an app like UMDgen back in the day, you prolly know what I'm talking about.
 
Last edited by Reploid,

fate6

Haha, I killed a Pumpkin!
Member
Joined
Aug 2, 2014
Messages
419
Trophies
0
Location
[fate6@Canterlot ~]$
XP
2,253
Country
United States
Haven't done it in some time but i recall using a combo of hactool to dump contents and hacpack to put it back together, Just make sure you remake the nca's/nsp with retail keys.
Never bothered to merge updates so IDK about that part.


Nothing like UMDGen but it did the job.
 

Reploid

Well-Known Member
OP
Member
Joined
Jan 20, 2010
Messages
2,807
Trophies
2
XP
6,201
Country
Serbia, Republic of
Haven't done it in some time but i recall using a combo of hactool to dump contents and hacpack to put it back together, Just make sure you remake the nca's/nsp with retail keys.
Never bothered to merge updates so IDK about that part.


Nothing like UMDGen but it did the job.
I've tried something like that, but my problem was that when I try to put back NCA with trimmed contents back together it always appears really small, since romfs contents are never included, which is the most data. No error reporting, no nothing, so I had no idea how to fix that.
 

fate6

Haha, I killed a Pumpkin!
Member
Joined
Aug 2, 2014
Messages
419
Trophies
0
Location
[fate6@Canterlot ~]$
XP
2,253
Country
United States
I wrote a readme for myself back then and i happen to still have it, its kinda just some random rambelings but it is what i used to do and it did produce working nsp's

Reading this back it seems I did used to merge updates into the base game, neat i guess.

Unpack NSP
./hactool.exe -t pfs0 --pfs0dir="Whatever named directory" "drag and drop nsp here"

If a "tik" file is extracted then it has the titlekey! open it in a hex editor and look for "Root-CA", under that should be the 32 digits that are the titlekey!
If there is no tif file then install game on prod and dump keys with lockpick.

Extract Largest NCA
./hactool.exe -k prod.keys -t nca --romfsdir=romfs --exefsdir=exefs --titlekey=XXXXXXXX "drag and drop largest nca file here"

Extract Controlromfs, It's in diffrent smaller nca
./hactool.exe -k prod.keys -t nca --romfsdir=controlromfs --titlekey=XXXXXXXX "drag and drop nca"

If using update then use control from the update nsp so it shows the correct version

Using hacPack GUI or CLI remake the "Program" NCA
./hacpack -o outNCA --type=nca --ncatype=program --titleid=XXXXXXXX --titlekey=XXXXXXXX --exefsdir= --romfsdir=

Once "Program" NCA is done, build "Control" NCA using the RomFS Dir to the Controlromfs
./hacpack -o outNCA --type=nca --ncatype=control --titleid=XXXXXXXX --romfsdir=

Creat a "META" NCA using the "Program" and "Control" NCA's
./hacpack -o outNCA --type=nca --ncatype=meta --titletype application --titleid=XXXXXXXX --programnca= --controlnca=

Finally build the NSP from the NSP tab.
./hacpack -o outNSP --type=nsp --titleid=XXXXXXXX --ncadir=outNCA

Extract with UPDATE
./hactool.exe -k prod.keys --romfsdir=romfs --exefsdir=exefs --titlekey="update titlekey" --basenca="drag and drop base game NCA file here" "drag and drop update NCA file here"

For UPDATE extract to work you must use a plain text version of the base main NCA

Check info for the NCA
./hactool.exe -k prod.keys --titlekey=XXXXXXXX -i "drag and drop NCA file here"

Decrypt NCA for use with UPDATE
./hactool.exe -k prod.keys --titlekey=XXXXXXXX --plaintext="name to save decrypted NCA as" "drag and drop encrypted NCA here"
 
  • Like
Reactions: CymraegAce

AinzOoalGown

Member
Newcomer
Joined
Jan 27, 2023
Messages
5
Trophies
0
XP
77
Country
France
I wrote a readme for myself back then and i happen to still have it, its kinda just some random rambelings but it is what i used to do and it did produce working nsp's

Reading this back it seems I did used to merge updates into the base game, neat i guess.
Hello ,
from there I did not understand, the NCA Program I take the original one ? or I create a new Program NCA ?

I followed your instructions but there is an error ( Failed to open \main.npdm! )

hacpack.exe -o outNCA --type=nca --ncatype=program --titleid=010********** --titlekey=************* --exefsdir= --romfsdir=

hacPack v1.36 by The-4n
----> Preparing:
[WARN]: Failed to match key ..... Here this error.

Removing existing temp directory
Creating temp directory
Creating out directory
Creating backup directory

----> Processing NPDM
Failed to open \main.npdm!

Thank you -_-
 

fate6

Haha, I killed a Pumpkin!
Member
Joined
Aug 2, 2014
Messages
419
Trophies
0
Location
[fate6@Canterlot ~]$
XP
2,253
Country
United States
Hello ,
from there I did not understand, the NCA Program I take the original one ? or I create a new Program NCA ?

I followed your instructions but there is an error ( Failed to open \main.npdm! )

hacpack.exe -o outNCA --type=nca --ncatype=program --titleid=010********** --titlekey=************* --exefsdir= --romfsdir=

hacPack v1.36 by The-4n
----> Preparing:
[WARN]: Failed to match key ..... Here this error.

Removing existing temp directory
Creating temp directory
Creating out directory
Creating backup directory

----> Processing NPDM
Failed to open \main.npdm!

Thank you -_-

It's been years since i last messed around with the switch let alone this repack stuff.

Looking at that error i assume you got the title key wrong
 

AinzOoalGown

Member
Newcomer
Joined
Jan 27, 2023
Messages
5
Trophies
0
XP
77
Country
France
It's been years since i last messed around with the switch let alone this repack stuff.

Looking at that error i assume you got the title key wrong
All right . the title key is right, i used it to extract my nsp file.
I think I found a solution, I'll do a tutorial after testing it twice.
 
  • Love
Reactions: binkinator

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,148
Country
United States
All right . the title key is right, i used it to extract my nsp file.
I think I found a solution, I'll do a tutorial after testing it twice.
A tut would be awesome!

I’m going down a similar path. This thread has helped a bit.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,148
Country
United States
I can't put the tutorial on the site because it has forbidden words, I'll give you the link
github AinzOoalGown-fun/Nsp-XCI-Nca-unpack/blob/main/README.md
Appreciated! Will give this an idiot test after work!

(I somehow didn’t see any bad words.)
 

Kiriox

New Member
Newbie
Joined
Jul 2, 2022
Messages
3
Trophies
0
Age
22
Location
sss
XP
39
Country
France
I can't put the tutorial on the site because it has forbidden words, I'll give you the link
github AinzOoalGown-fun/Nsp-XCI-Nca-unpack/blob/main/README.md
This tutorial helped me a lot but there are still a few things that I need help with already how can I use this method to create an update that only includes the files that I want to modify like this the .nsp can be shared freely also I would like to be able to change the icon and the title of the game (always just with an update file) thanks in advance
 

newc22

Member
Newcomer
Joined
Jan 16, 2024
Messages
7
Trophies
0
Age
41
XP
42
Country
Hungary
If I modify one file how can I repack the New file to my nsp file?! and what it's mean dump keys with lockpick? I use PC. Thx the Reply!
 

kasai2713

Member
Newcomer
Joined
Jan 30, 2024
Messages
5
Trophies
0
XP
15
Country
United States
Does this work for update data alone? Since new switches can't be modded, is it possible to install mods through the update data and DLC themselves?
 

kasai2713

Member
Newcomer
Joined
Jan 30, 2024
Messages
5
Trophies
0
XP
15
Country
United States
Wrong.

And how do you want to install modified update or DLC with unhacked Switch?
You have to take apart your Switch if it's a newer model right? The DLC is in the update data which is stored on the SD card, but I just want to change some music and models. Is it possible to modify the update data without a hacked Switch? I have the update data from the SD card but it is packed and I do not know what file type it is. Also it looks like it is missing some bytes compared to an online dump of the same update that is in the NSP file format.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    straferz @ straferz: Anybody know why this is happening to my ACWW town...