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,641
Trophies
2
XP
5,457
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
400
Trophies
0
Location
[[email protected] ~]$
XP
2,007
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,641
Trophies
2
XP
5,457
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
400
Trophies
0
Location
[[email protected] ~]$
XP
2,007
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"
 

AinzOoalGown

Member
Newcomer
Joined
Jan 27, 2023
Messages
5
Trophies
0
XP
67
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
400
Trophies
0
Location
[[email protected] ~]$
XP
2,007
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
 
General chit-chat
Help Users
  • Skelletonike @ Skelletonike:
    link doesn't work
    +2
  • Skelletonike @ Skelletonike:
    1H left, such a slow week.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Okay, I had spaghetti :P
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
  • K3N1 @ K3N1:
    Your favorite activity
    K3N1 @ K3N1: Your favorite activity