Hacking Help with extracting files using hactool

RyanTheArchivist

Well-Known Member
Member
Joined
Aug 9, 2017
Messages
4,230
Solutions
1
Reaction score
3,188
Trophies
1
XP
6,714
Country
United States
So I was going to try out this backup loading and the thing thats giving me issues is extracting the files needed from my XCI I need the Romfs.bin and the exefs and ive been messing around with hactool for about and hour and I just cant seem to figure it out.
 
So I was going to try out this backup loading and the thing thats giving me issues is extracting the files needed from my XCI I need the Romfs.bin and the exefs and ive been messing around with hactool for about and hour and I just cant seem to figure it out.
second this maybe im doing something wrong but once i extract the biggest file from secure there is no romfs.bin
 
Same. Tried using the automatic .npdm patcher to open up my .nca to no avail. Tried extracting .nca with hactool gui and it just showed a cmd line for one second and went back to normal.
 
So I was going to try out this backup loading and the thing thats giving me issues is extracting the files needed from my XCI I need the Romfs.bin and the exefs and ive been messing around with hactool for about and hour and I just cant seem to figure it out.

second this maybe im doing something wrong but once i extract the biggest file from secure there is no romfs.bin

Same. Tried using the automatic .npdm patcher to open up my .nca to no avail. Tried extracting .nca with hactool gui and it just showed a cmd line for one second and went back to normal.

- Create a new folder and name it Hactool, download the newest Hactool and extract in this folder.
- Download the attached "decr.bat.txt" rename it to "decr.bat" then put it in the Hactool folder.
- Have all your keys in a file and name it "keys.ini" (i.e .ini is the extend/file type) and put in the Hactool folder.
- Copy/move your gamename.XCI you like to decrypt into Hactool folder.
- Drag and drop the gamename.XCI onto the decr.bat
- Once the Hactool/CMD window is done you gonna end up with a "xciDecrypted" folder. The biggest file will be your romfs.romfs.
- Then you have to patch "main.npdm" with some hex editor like HxD.
 

Attachments

- Create a new folder and name it Hactool, download the newest Hactool and extract in this folder.
- Download the attached "decr.bat.txt" rename it to "decr.bat" then put it in the Hactool folder.
- Have all your keys in a file and name it "keys.ini" (i.e .ini is the extend/file type) and put in the Hactool folder.
- Copy/move your gamename.XCI you like to decrypt into Hactool folder.
- Drag and drop the gamename.XCI onto the decr.bat
- Once the Hactool/CMD window is done you gonna end up with a "xciDecrypted" folder. The biggest file will be your romfs.romfs.
- Then you have to patch "main.npdm" with some hex editor like HxD.

Thank you so much. I just got more progress in 5 minutes than I did the entire day. Would you happen to know how to get saving to work? The main thread is a clusterfuck.
 
Thank you so much. I just got more progress in 5 minutes than I did the entire day. Would you happen to know how to get saving to work? The main thread is a clusterfuck.
if saving didnt work with the donor title you used theres no way to fix it you can try it with another title if you want
 
- Create a new folder and name it Hactool, download the newest Hactool and extract in this folder.
- Download the attached "decr.bat.txt" rename it to "decr.bat" then put it in the Hactool folder.
- Have all your keys in a file and name it "keys.ini" (i.e .ini is the extend/file type) and put in the Hactool folder.
- Copy/move your gamename.XCI you like to decrypt into Hactool folder.
- Drag and drop the gamename.XCI onto the decr.bat
- Once the Hactool/CMD window is done you gonna end up with a "xciDecrypted" folder. The biggest file will be your romfs.romfs.
- Then you have to patch "main.npdm" with some hex editor like HxD.
So I followed this guide to get my keys.ini https://gbatemp.net/threads/how-to-get-switch-keys-for-hactool-xci-decrypting.506978/ and when I drag my xci over the bat file it generates the romfs.romfsbut I can see in the cmd it says Error Section 0 is corrupted saving section 1 to romfs.romfs but wheres my main.npdm?
 
  • Like
Reactions: iiTzSamurai
Extracting the SECURE partition of a XCI file (no need for keys):
Code:
[path to hactool exe] -t xci --securedir=[path to a directory]
Example:
Code:
C:\Users\[...]\Desktop\Switch\Tools\hactool-1.1.0.windows\hactool.exe -t xci C:\Users\[...]\Downloads\SMO.xci --securedir=C:\Users[...]\Downloads\SMO



Decrypting NCA files the wanted way (keys needed):
Code:
[path to hactool exe] [path to your NCA] -k [path to your keyset file] --romfs=[path to a romfs.bin file] --exefsdir=[path to a exefs directory]
Example:
Code:
C:\Users\[...]\Desktop\Switch\Tools\hactool-1.1.0.windows\hactool.exe C:\Users\[...]\Downloads\SMO\08c1d23a902a841b497f7be217c8ad6d.nca --romfs=C:\Users\[...]\Downloads\SMO\romfs.bin --exefsdir=C:\Users\[...]\Downloads\SMO\exefs
(I don't need to specify a path to my keyset file since I have mine in C:\Users\[...]\.switch\prod.keys, hactool will automatically look for this specific location)

There are a lot of other things you can do with hactool, I really recommend testing things out. Note that it can't create more than one directory, though.
 
Last edited by ,
@Everyone here:
Seems like his keys.py is outdated, so it doesn't extract all needed keys (master_key01-03 are missing and some others)!

This will get you an error section 0 is corrupted
 
I'm stuck here too with the "error section 0 is corrupted" message. Is this the current roadblock to running a game backup?
 
Last edited by DaveMode,
Xcidecrypted folder is empty :'(

Trying to get rom.fs folder for pokemon lets go eeve. Wanna randomized it
 

Site & Scene News

Popular threads in this forum