Homebrew RELEASE hacPack - Build and Repack NCAs and NSPs

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
hacPack is a tool for make/build and repacking ncas and nsps

with hacPack, you can mod your game and repack them into nsp, make custom ncas and nsps, remove and add contents to ncas and etc...
there's also a gui interface for hacPack to make it easy to use for everyone, but cli is version is recommended

Current version: v1.36-r2

https://github.com/The-4n/hacPack/
https://github.com/The-4n/hacPack/releases

Changelog:
v1.36-r2
hacPack-GUI:
Fixed a bug cause hacPack-GUI to display an invalid titleid error while titleid is valid

v1.36
Fixed a bug cause titletype error when creating metadata nca with cnmt
Changed Valid titleid range

v1.35
Added option for setting nca distribution type to gamecard
Removed --noromfs and --nologo options, hacPack now skips creating romfs and logo sections for program nca if romfsdir and logodir are not set
Changed pfs0 padding size and hash table block size for better compatiblity and less nca size

v1.33
Added support for keygeneration 7
Changed default ncasig to zero

v1.32
Changed hash block size for better compatibility
Increased NCA section encryption buffer size

v1.31
Fixed a bug cause invalid IVFC level 6 when romfs section is big

v1.30
Added TitleKey encryption
Added Signature generation
Added NPDM verification and signature zeroing
Added NPDM backup
Fixed sdkversion valid range
hacPackTools-NACP v1.03:
Fixed videocapture invalid value error message
Added error message for unknown xml elements

v1.20-r3
hacPack-Tools:
Fixed a bug cause compiled version of hacPackTools-NACP not running on windows machines

v1.20-r2
hacPack-Tools:
Added RequiredNetworkServiceLicenseOnLaunch and UserAccountSwitchLock options for hacPackTools-NACP

v1.20
hacPack:
Added option for creating Metadata nca from cnmt
hacPack-GUI:
Added option for creating Metadata nca from cnmt in gui
hacPack-Tools:
Added hacPackTools-NACP v1.00

v1.12
Fixed a bug cause making bad PFS0 for files larger than 4GB in 32-bit platforms

v1.11:
Added buffer for creating PFS0
Increased buffer size for creating RomFS

v1.10:
Added support for creating SystemProgram and SystemData Metadata NCA
Added titleversion option for creating Metadata NCA

v1.02
GUI:
Fixed a bug cause failure of building meta ncas with legal information nca and without data nca

v1.01
Fixed a bug cause failure of control.nacp validation in titles without AmericanEnglish title name and title author

v1.00
Initial Release.
 
Last edited by The-4n,

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
first of all: thank you!
isnt really a problem but is there an specific reason why it doesnt just use the prod.keys in the .switch folder like hactool?

they get outdated by every major new firmware update and cause some problems
i prefer to remind ppl they need keys for my programs so they always care that their keys are updated
 
Last edited by The-4n,

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
624
Trophies
1
XP
2,179
Country
Russia
Can you provide examples of CLI options to:
1) Unpack retail NSP file to it's contents
2) Pack it back to nsp after changing resources
?
 

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
Can you provide examples of CLI options to:
1) Unpack retail NSP file to it's contents
2) Pack it back to nsp after changing resources
?

you can unpack your nsps with hactool
hacPack is just for repacking them

here are the examples of packing ncas/nsps with hacPack:
https://github.com/The-4n/hacPack/tree/master/docs

there's also a GUI version which runs cli command in background

overall, even making ncas with sdk is not an easy job
 

vebririon

Well-Known Member
Newcomer
Joined
Mar 8, 2016
Messages
61
Trophies
0
Age
37
XP
183
Country
France
thanks for utility, sadly, i tried it, and i cant install the custom nsp file, (result : 0x00320002)

i have modified the romfs content by changing some file by some other for the game named "the binding of isaac", those files are universal for PC/PS4/vita etc etc, some other mod already works perfectly, but this one replacing the original image on an in game item by a modified image on an in game item + description make me fail hard for weeks now :'(
 

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
thanks for utility, sadly, i tried it, and i cant install the custom nsp file, (result : 0x00320002)

i have modified the romfs content by changing some file by some other for the game named "the binding of isaac", those files are universal for PC/PS4/vita etc etc, some other mod already works perfectly, but this one replacing the original image on an in game item by a modified image on an in game item + description make me fail hard for weeks now :'(

did you uninstall the game before re-installing it?
and also did you remake meta nca?
 

vebririon

Well-Known Member
Newcomer
Joined
Mar 8, 2016
Messages
61
Trophies
0
Age
37
XP
183
Country
France
yes, game is already uninstalled before trying to install the new created one.

The 4 nca files are extracted from the .xci game (3 old, 1 new created and replaced by yours, btw should i rename it to the last .nca name ? "c097bf8c8be17b765c012021ba33a789.nca" is the new created nca with modified files, size 583 413 ko | "fd85349fd867558b0bca88fdddca4a73.nca" is the old file, size 581 905 ko)

also, should i rebuild the game from the xci file or from the nsp encrypted one ? does it change anything ?
 

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
yes, game is already uninstalled before trying to install the new created one.

The 4 nca files are extracted from the .xci game (3 old, 1 new created and replaced by yours, btw should i rename it to the last .nca name ? "c097bf8c8be17b765c012021ba33a789.nca" is the new created nca with modified files, size 583 413 ko | "fd85349fd867558b0bca88fdddca4a73.nca" is the old file, size 581 905 ko)

also, should i rebuild the game from the xci file or from the nsp encrypted one ? does it change anything ?

use 4nxci to convert xci to nsp
extract the nsp (don't use 4nxci extracted files)
extract remake your program nca
delete your meta nca (.cnmt.nca) and remake your meta nca
pack them into nsp

also tell me the result
 

vebririon

Well-Known Member
Newcomer
Joined
Mar 8, 2016
Messages
61
Trophies
0
Age
37
XP
183
Country
France
i'm stuck here :

i got my extracted NSP here :

9241d7f07d.png


+

e900dc0650.png

(files are already replaced on the romfs folder)

keyset field on hacpack GUI is the keys.txt i've build from my own switch right ? (i prefer to be sure)

i have to delete both cnmt.nca + cnmt.xml ?

also, i dont know how to remake new files :/

16574089f3.png


new modified nca created, do i have to rename it to the previous original nca name ?


" a65e6e2c3ff8fb76cc36b86e0d2b4981.nca to => 94d0d724f51748ae664977ca174118ca.nca "

edit :

i can see the "meta NCA part on hacPack GUI, but i dont know wich file i should use for every categories:/

6dbefcf277.png
 
Last edited by vebririon,

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
i'm stuck here :

i got my extracted NSP here :

9241d7f07d.png


+

e900dc0650.png

(files are already replaced on the romfs folder)

keyset field on hacpack GUI is the keys.txt i've build from my own switch right ? (i prefer to be sure)

i have to delete both cnmt.nca + cnmt.xml ?

also, i dont know how to remake new files :/

16574089f3.png


new modified nca created, do i have to rename it to the previous original nca name ?


" a65e6e2c3ff8fb76cc36b86e0d2b4981.nca to => 94d0d724f51748ae664977ca174118ca.nca "

well delete .cnmt.xml, .cnmt.nca and your program nca
make program nca (btw, logo is program nca section2 and you can extract it with --section2dir= in hacotol) there's no need to rename it
after that, go to meta nca tab, chooe your program nca and control nca, also choose the nca type with manual content type as legal information, it'll make new .cnmt
after that put your program and meta ncas in the same directory of other ncas and go to make nsp tab and make nsp
 

vebririon

Well-Known Member
Newcomer
Joined
Mar 8, 2016
Messages
61
Trophies
0
Age
37
XP
183
Country
France
that's the problem i think, i dont know how to fill the program NCA/control NCA/legal information NCA/offline manual NCA/ data NCA field :'(

program NCA is the fresh created NCA ?

but what is the control NCA one ?

also, i tried to use hactool.exe, but it crash everytime i start it, i might be too stupid -.-
 
Last edited by vebririon,

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
that's the problem i think, i dont know how to fill the program NCA/control NCA/legal information NCA/offline manual NCA/ data NCA field :'(

program NCA is the fresh created NCA ?

also, i tried to use hactool.exe, but it crash everytime i start it, i might be too stupid -.-

how did you extract exefs and romfs?
 

vebririon

Well-Known Member
Newcomer
Joined
Mar 8, 2016
Messages
61
Trophies
0
Age
37
XP
183
Country
France
i used NCA-NSP-XCI_TO_LayeredFS.bat :

choice 2 then 1 then drag and drop my nsp file created with 4nxci

8d3184f125.png


wich gave me

9241d7f07d.png


then used again NCA-NSP-XCI_TO_LayeredFS.bat, choice 1 then 1 then drag and drop the biggest nca file extracted above
 

The-4n

Well-Known Member
OP
Member
Joined
Aug 3, 2018
Messages
372
Trophies
0
Age
43
XP
2,764
Country
United States
i used NCA-NSP-XCI_TO_LayeredFS.bat :

choice 2 then 1 then drag and drop my nsp file created with 4nxci

8d3184f125.png


wich gave me

9241d7f07d.png


then used again NCA-NSP-XCI_TO_LayeredFS.bat, choice 1 then 1 then drag and drop the biggest nca file extracted above

your program nca is the one you created in nca section
your control nca is the one with 296k size, your legal information nca is the one with 134k size
idk if the tool you are using works fine or not but make sure to make your hactool working, it's a great app for this purpose
 

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3N1 @ K3N1: https://youtu.be/VRL32CEyMH8?si=RnsYn9iC5267Xgo0