Files
threeSD/dist/threeSDumper.gm9
T
2021-08-25 20:53:07 +08:00

129 lines
3.2 KiB
Plaintext

# Copyright 2019 threeSD Project
# Licensed under GPLv2 or any later version
# Refer to the license.txt file included.
# GM9 Script for dumping necessary files automatically.
set PREVIEW_MODE "threeSD Dumper\nby zhaowenlan1779"
set OUT "0:/threeSD"
if not find $[OUT] NULL
mkdir $[OUT]
end
if not ask "Execute threeSD Dumper?"
goto Exit
end
set PREVIEW_MODE "threeSD Dumper\nby zhaowenlan1779\n \nWorking..."
# === movable.sed
cp -w -n "1:/private/movable.sed" $[OUT]/movable.sed
# === bootrom
if find "M:/boot9.bin" NULL
cp -w -n "M:/boot9.bin" $[OUT]/boot9.bin
elif find "0:/3DS/boot9.bin" NULL
cp -w -n "0:/3DS/boot9.bin" $[OUT]/boot9.bin
else
echo "ERROR: \nboot9.bin not found. \nIf you use fastboot3ds, hold HOME while booting, \nand go to Miscellaneous... > Dump bootroms & OTP. \nWhen finished, simply execute this script again."
goto Exit
end
# === certs.db
if chk $[RDTYPE] "devkit"
echo "WARNING: \nDev kit detected. \nCIA building will not be usable."
else
cp -w -n "1:/dbs/certs.db" $[OUT]/certs.db
end
# === ticket.db
cp -w -n "1:/dbs/ticket.db" $[OUT]/ticket.db
# === title.db
cp -w -n "1:/dbs/title.db" $[OUT]/title.db
# === Secret sector (N3DS only)
if chk $[ONTYPE] "N3DS"
cp -w -n "S:/sector0x96.bin" $[OUT]/sector0x96.bin
end
# === NAND data
if not find $[OUT]/data NULL
mkdir $[OUT]/data
end
if not find $[OUT]/data/extdata NULL
mkdir $[OUT]/data/extdata
end
cp -w -n "1:/data/$[SYSID0]/extdata" $[OUT]/data/extdata
if not find $[OUT]/data/sysdata NULL
mkdir $[OUT]/data/sysdata
end
cp -w -n "1:/data/$[SYSID0]/sysdata" $[OUT]/data/sysdata
# === Other system titles
if find $[OUT]/title NULL
rm $[OUT]/title
end
mkdir $[OUT]/title
# System Applications
if not find $[OUT]/title/00040010 NULL
mkdir $[OUT]/title/00040010
end
cp -w -n "1:/title/00040010" $[OUT]/title/00040010
# System Data Archives
if not find $[OUT]/title/0004001b NULL
mkdir $[OUT]/title/0004001b
end
cp -w -n "1:/title/0004001b" $[OUT]/title/0004001b
# System Applets
if not find $[OUT]/title/00040030 NULL
mkdir $[OUT]/title/00040030
end
cp -w -n "1:/title/00040030" $[OUT]/title/00040030
# Shared Data Archives
if not find $[OUT]/title/0004009b NULL
mkdir $[OUT]/title/0004009b
end
cp -w -n "1:/title/0004009b" $[OUT]/title/0004009b
# System Data Archives
if not find $[OUT]/title/000400db NULL
mkdir $[OUT]/title/000400db
end
cp -w -n "1:/title/000400db" $[OUT]/title/000400db
# System Modules
if not find $[OUT]/title/00040130 NULL
mkdir $[OUT]/title/00040130
end
cp -w -n "1:/title/00040130" $[OUT]/title/00040130
# System Firmware
if not find $[OUT]/title/00040138 NULL
mkdir $[OUT]/title/00040138
end
cp -w -n "1:/title/00040138" $[OUT]/title/00040138
# === seeddb.bin
sdump -o -s -w seeddb.bin
if not find 0:/gm9/out/seeddb.bin NULL
echo "WARNING: \nseeddb.bin couldn't be built. \nThis may be because your system \ndoes not have any seeds. \nOtherwise, imported games may fail \nto run if they use seed encryption."
else
cp -w -n "0:/gm9/out/seeddb.bin" $[OUT]/seeddb.bin
rm "0:/gm9/out/seeddb.bin"
end
# === Write version
dumptxt $[OUT]/version.txt 4
set PREVIEW_MODE "threeSD Dumper\nby zhaowenlan1779\n \nSuccess!"
echo "Successfully dumped necessary\nfiles for threeSD."
@Exit