ROM Hack Batch Scripts for Windows (to make things easier)

  • Thread starter Thread starter FlyingPoo
  • Start date Start date
  • Views Views 2,443
  • Replies Replies 2

FlyingPoo

Active Member
Newcomer
Joined
Mar 25, 2018
Messages
44
Reaction score
27
Trophies
0
Age
39
XP
484
Country
United States
ALL SCRIPTS REQUIRE HACTOOL IN WINDOWS ENVIRONMENT PATH
rWgiUTN.jpg


Create a new text file and name it "extract_xci.bat" (also you must have "hide known file extensions turned off")
Right click -> Edit (should open notepad) paste which ever script you want. You're welcome to edit it or use it in any applications you want.


First script extracts just the Secure partition of an xci (nca files containing games)... and look! It's a one-liner!
Code:
hactool -txci --securedir="%CD%" "%~1"

When using an xci file, the second script goes further and extracts Section0 (exefs) and Section1 (romfs) into an "extracted" folder with the name of each nca inside that folder, contents inside.
Code:
hactool -txci --securedir="%CD%" "%~1"
if not exist "%CD%\extracted\" mkdir "%CD%\extracted"
for /r %%i in (*.nca) do (
if not exist "%CD%\extracted\%%~nxi" mkdir "%CD%\extracted\%%~nxi"
hactool --section0dir="%CD%\extracted\%%~nxi\ExeFs" "%%i"
hactool --section1dir="%CD%\extracted\%%~nxi\RomFs" "%%i"
)

Usage extract_xci.bat <name of xci>.xci
or
drag-and-drop the xci file over the batch file.

I will soon finish my "Master" script that extracts a folder full of XCIs putting them each in their own folder. (requires a lot of free space)
Anyone is welcome to add their scripts to this thread. If you are sharing a *NIX based script, make note of it or someone is welcome to start their own *Nix thread of scripts.

Possibly more scripts to come.
 
Last edited by FlyingPoo,

Site & Scene News

Popular threads in this forum