Hacking Help with extracting files using hactool

Ryab

Well-Known Member
OP
Member
Joined
Aug 9, 2017
Messages
3,234
Trophies
1
XP
4,465
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.
 

Swan1360

Well-Known Member
Member
Joined
Mar 25, 2017
Messages
110
Trophies
0
Age
34
XP
529
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.
second this maybe im doing something wrong but once i extract the biggest file from secure there is no romfs.bin
 

WiiHomebrew+Snes

Member of GBAtemp's shadow district
Member
Joined
May 4, 2016
Messages
640
Trophies
1
Age
39
Location
Floridia
Website
www.lucar.io
XP
2,782
Country
United States
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.
 

Finalxfantasy

Well-Known Member
Newcomer
Joined
Feb 28, 2018
Messages
60
Trophies
0
XP
664
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.

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

  • decr.bat.txt
    341 bytes · Views: 14,101

Tmsrise

Member
Newcomer
Joined
Jun 3, 2018
Messages
9
Trophies
0
Age
24
XP
95
Country
United States
- 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.
 

Ryab

Well-Known Member
OP
Member
Joined
Aug 9, 2017
Messages
3,234
Trophies
1
XP
4,465
Country
United States
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
 

Ryab

Well-Known Member
OP
Member
Joined
Aug 9, 2017
Messages
3,234
Trophies
1
XP
4,465
Country
United States
- 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
D

Deleted-451877

Guest
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 ,

Finalxfantasy

Well-Known Member
Newcomer
Joined
Feb 28, 2018
Messages
60
Trophies
0
XP
664
Country
United States

SH3RLOCK

Well-Known Member
Newcomer
Joined
Jul 29, 2014
Messages
50
Trophies
0
Age
26
XP
295
Country
Swaziland
@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
 

Ryab

Well-Known Member
OP
Member
Joined
Aug 9, 2017
Messages
3,234
Trophies
1
XP
4,465
Country
United States
@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
ah that explains it hope someone updates it soon
 

DaveMode

Well-Known Member
Newcomer
Joined
Oct 29, 2007
Messages
74
Trophies
0
XP
195
Country
United States
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,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: Push it :creep: