-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added NAND restore scripts by Kazuma77
- Loading branch information
Showing
5 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# EmuNAND restore GM9 script | ||
# This will restore a backup from 0:/gm9/out, expecting the name scheme from the backup scripts | ||
# author: Kazuma77 | ||
|
||
set SUCCESSMSG "Successfully Restored EmuNAND." | ||
|
||
set ERRORMSG "EmuNAND not changed." | ||
filesel "Select NAND Backup." $[GM9OUT]/*nand_???.bin NANDBAK | ||
ask "Restore\n$[NANDBAK]\nto EmuNAND?" | ||
allow E:/nand.bin | ||
|
||
set ERRORMSG "Not a valid NAND backup." | ||
imgmount $[NANDBAK] | ||
find I:/nand_minsize.bin NULL | ||
|
||
# Uncomment the "verify" line below to enable verification. | ||
# I left it out since EmuNAND isn't vital. | ||
# Besides, EmuNANDs don't even use their firm partitions. | ||
#verify I:/nand_minsize.bin | ||
|
||
set ERRORMSG "An error occurred during the transfer\nPlease try again." | ||
inject -n I:/nand_minsize.bin E:/nand.bin@0 | ||
imgumount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SysNAND full restore GM9 script | ||
# This will restore a backup from 0:/gm9/out, expecting the name scheme from the backup scripts | ||
# author: Kazuma77 | ||
|
||
set SUCCESSMSG "Successfully Restored SysNAND." | ||
|
||
set ERRORMSG "This script requires ntrboot to run." | ||
chk $[HAX] "ntrboot" | ||
|
||
set ERRORMSG "SysNAND not changed." | ||
filesel "Select NAND Backup." $[GM9OUT]/*nand_???.bin NANDBAK | ||
ask "WARNING:\nSystem exploit will not be protected.\nNEVER use an EmuNAND image with this\nscript - it may brick your device.\n \nFully restore\n$[NANDBAK]\nto SysNAND?" | ||
|
||
allow S:/nand.bin | ||
set ERRORMSG "Not a valid NAND backup." | ||
imgmount $[NANDBAK] | ||
verify I:/nand_minsize.bin | ||
|
||
set ERRORMSG "An error occurred during the transfer\nPlease try again." | ||
inject -n I:/nand_minsize.bin S:/nand.bin@0 | ||
imgumount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# SysNAND safe restore GM9 script | ||
# This will restore a backup from 0:/gm9/out, expecting the name scheme from the backup scripts | ||
# author: Kazuma77 | ||
|
||
set SUCCESSMSG "Successfully Restored SysNAND." | ||
|
||
set ERRORMSG "No qualifying exploit was found.\nAborting to avoid bricking the unit." | ||
chk -u $[HAX] "" | ||
|
||
set ERRORMSG "Safe restore is not available on\nntrboot. Aborting to avoid a brick." | ||
chk -u $[HAX] "ntrboot" | ||
|
||
set ERRORMSG "SysNAND not changed." | ||
filesel "Select NAND Backup." $[GM9OUT]/*nand_???.bin NANDBAK | ||
ask "Safe restore\n$[NANDBAK]\nto SysNAND?" | ||
allow S:/ctrnand_full.bin | ||
allow S:/twln.bin | ||
allow S:/twlp.bin | ||
|
||
set ERRORMSG "Not a valid NAND backup." | ||
imgmount $[NANDBAK] | ||
find I:/ctrnand_full.bin NULL | ||
find I:/twln.bin NULL | ||
find I:/twlp.bin NULL | ||
|
||
# Uncomment the "verify" line below to enable verification. | ||
# I left it out since the firm partitions are not being touched. | ||
# If you do not want the script to even try to recover content from a bricked image, enable it. | ||
#verify I:/nand_minsize.bin | ||
|
||
set ERRORMSG "An error occurred during the transfer.\nPlease try again." | ||
cp -w -n I:/ctrnand_full.bin S:/ctrnand_full.bin | ||
cp -w -n I:/twln.bin S:/twln.bin | ||
cp -w -n I:/twlp.bin S:/twlp.bin | ||
imgumount |