Hacking Question How to extract romfs and exefs using hactool?

CartoonPeacock

Member
OP
Newcomer
Joined
May 30, 2018
Messages
21
Trophies
0
Age
33
XP
294
Country
United States
I'm trying to just make a simple music mod for games like Pokken since the music in the game itself just isn't for me, but while I'm used to having to extract the romfs and exefs in the 3DS scene to edit the Pokemon games, I'm unsure of how exactly how to do it with the Switch. Plus when Pokemon Let's Go and Smash Ultimate come out I want to be able to mod them when mods are eventually released for those games, so I need to know this for future reference anyways.

As for getting Switch keys and all I have mine already fyi so I won't be asking where to find those to use hactool or anything.
 

Bigjokker

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
98
Trophies
0
Age
47
XP
356
Country
United States
To show all options type in command prompt:
Code:
hactool

First you have to extract the NCA files.

For NSP:
Code:
hactool -k keys.txt -t pfs0 --outdir=OUTPUT_FILES <any_nsp_game.nsp>

For XCI:
Code:
hactool -k keys.txt -t xci --outdir=OUTPUT_FILES <any_xci_game.xci>

Then you need to extract the romfs from the NCA file. Most of the time it will be in the biggest NCA file.

For NSPs NCA you will need the titlekey as it is encrypted. To find the titlekey in the NSPs OUTPUT_FILES folder will be a ".tik" file with the NCAs.
Open the ".tik" with a HEX editor and offset line 180 is the titlekey. Just remove the spaces.

NSPs biggest NCA:
Code:
hactool -k keys.txt --titlekey=<32 bit hex key> -t nca --romfsdir=OUTPUT_ROMFS <biggest_NCA_here.nca>

XCIs biggest NCA is in the "secure" folder:
Code:
hactool -k keys.txt -t xci --romfsdir=OUTPUT_ROMFS <biggest_NCA_here.nca>

If you don't want to deal with typing code in the cmd line you can use this bat file I made. Just drag the NSP or XCI onto the bat file and it will extract the entire game for you.
The romfs will be in the "program" folder. Just place .bat and tf files in folder with hactool and keys.txt.
 

Attachments

  • EXTRT_v2.1.rar
    3.6 KB · Views: 1,225
Last edited by Bigjokker,

CartoonPeacock

Member
OP
Newcomer
Joined
May 30, 2018
Messages
21
Trophies
0
Age
33
XP
294
Country
United States
To show all options type in command prompt:
Code:
hactool

First you have to extract the NCA files.

For NSP:
Code:
hactool -k keys.txt -t pfs0 --outdir=OUTPUT_FILES <any_nsp_game.nsp>

For XCI:
Code:
hactool -k keys.txt -t xci --outdir=OUTPUT_FILES <any_xci_game.xci>

Then you need to extract the romfs from the NCA file. Most of the time it will be in the biggest NCA file.

For NSPs NCA you will need the titlekey as it is encrypted. To find the titlekey in the NSPs OUTPUT_FILES folder will be a ".tik" file with the NCAs.
Open the ".tik" with a HEX editor and offset line 180 is the titlekey. Just remove the spaces.

NSPs biggest NCA:
Code:
hactool -k keys.txt --titlekey=<32 bit hex key> -t nca --romfsdir=OUTPUT_ROMFS <biggest_NCA_here.nca>

XCIs biggest NCA is in the "secure" folder:
Code:
hactool -k keys.txt -t xci --romfsdir=OUTPUT_ROMFS <biggest_NCA_here.nca>

If you don't want to deal with typing code in the cmd line you can use this bat file I made. Just drag the NSP or XCI onto the bat file and it will extract the entire game for you.
The romfs will be in the "program" folder. Just place .bat and tf files in folder with hactool and keys.txt.
I unfortunately had a weird issue using the classic command line method but your bat file basically worked perfectly and I'm definitely going to be getting some good use out of it in the future. Thank you!
 

nonameboy

Well-Known Member
Member
Joined
Jul 24, 2013
Messages
189
Trophies
1
XP
531
Country
Germany
I unfortunately had a weird issue using the classic command line method but your bat file basically worked perfectly and I'm definitely going to be getting some good use out of it in the future. Thank you!
To show all options type in command prompt:
Code:
hactool

First you have to extract the NCA files.

For NSP:
Code:
hactool -k keys.txt -t pfs0 --outdir=OUTPUT_FILES <any_nsp_game.nsp>

For XCI:
Code:
hactool -k keys.txt -t xci --outdir=OUTPUT_FILES <any_xci_game.xci>

Then you need to extract the romfs from the NCA file. Most of the time it will be in the biggest NCA file.

For NSPs NCA you will need the titlekey as it is encrypted. To find the titlekey in the NSPs OUTPUT_FILES folder will be a ".tik" file with the NCAs.
Open the ".tik" with a HEX editor and offset line 180 is the titlekey. Just remove the spaces.

NSPs biggest NCA:
Code:
hactool -k keys.txt --titlekey=<32 bit hex key> -t nca --romfsdir=OUTPUT_ROMFS <biggest_NCA_here.nca>

XCIs biggest NCA is in the "secure" folder:
Code:
hactool -k keys.txt -t xci --romfsdir=OUTPUT_ROMFS <biggest_NCA_here.nca>

If you don't want to deal with typing code in the cmd line you can use this bat file I made. Just drag the NSP or XCI onto the bat file and it will extract the entire game for you.
The romfs will be in the "program" folder. Just place .bat and tf files in folder with hactool and keys.txt.
I'm getting this error : : Wrong Titlekey! will not be extracted!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Skelletonike @ Skelletonike: Welp, already have 40h in Stellar Blade and dying to home and put some more.