From 12bc19cc43e847ae9ce9f238f01f201f7483ba4f Mon Sep 17 00:00:00 2001 From: TurdPooCharger <35666439+TurdPooCharger@users.noreply.github.com> Date: Tue, 24 Dec 2019 00:02:37 -0500 Subject: [PATCH] Disarm anti savegame restore in scripts. This stops certain games such as _Animal Crossing: New Leaf_, _Super Smash Bros._, and the _Pokemon_ series from erasing their saves due to changes in "Secure Value" after CTRTransfer or NAND restore. --- resources/gm9/scripts/GM9Megascript.gm9 | 4 ++++ resources/gm9/scripts/NANDManager.gm9 | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/resources/gm9/scripts/GM9Megascript.gm9 b/resources/gm9/scripts/GM9Megascript.gm9 index 7850fe3..8076201 100644 --- a/resources/gm9/scripts/GM9Megascript.gm9 +++ b/resources/gm9/scripts/GM9Megascript.gm9 @@ -97,6 +97,7 @@ end if inject -n I:/nand_minsize.bin S:/nand.bin@0 imgumount + rm -o -s 1:/data/$[SYSID0]/sysdata/00010011/00000000 echo "$[NANDBAK]\nsuccessfully restored to SysNAND." else echo "An error occurred during the transfer\nPlease try again." @@ -135,6 +136,7 @@ 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 +rm -o -s 1:/data/$[SYSID0]/sysdata/00010011/00000000 echo "$[NANDBAK]\nsuccessfully restored to SysNAND." goto MainMenu_Restore_Options @@ -165,6 +167,7 @@ end imgmount $[NANDBAK] inject -n I:/nand_minsize.bin E:/nand.bin@0 imgumount +rm -o -s 4:/data/$[EMUID0]/sysdata/00010011/00000000 echo "$[NANDBAK] successfully restored to EmuNAND." goto MainMenu_Restore_Options @@ -219,6 +222,7 @@ fixcmac 1:/title mv -n -w 1:/ticket.bak 1:/dbs/ticket.bak imgumount +rm -o -s 1:/data/$[SYSID0]/sysdata/00010011/00000000 echo "CTRNAND transfer successful." goto Start diff --git a/resources/gm9/scripts/NANDManager.gm9 b/resources/gm9/scripts/NANDManager.gm9 index bd9e716..8c6143d 100644 --- a/resources/gm9/scripts/NANDManager.gm9 +++ b/resources/gm9/scripts/NANDManager.gm9 @@ -47,6 +47,7 @@ if filesel "Select NAND Backup." $[GM9OUT]/*nand_???.bin NANDBAK #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 + rm -o -s 4:/data/$[EMUID0]/sysdata/00010011/00000000 imgumount else echo "Not a valid NAND backup." @@ -73,6 +74,7 @@ if filesel "Select NAND Backup." $[GM9OUT]/*nand_???.bin NANDBAK if 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 + rm -o -s 1:/data/$[SYSID0]/sysdata/00010011/00000000 imgumount else echo "Not a valid NAND backup." @@ -112,6 +114,7 @@ if filesel "Select NAND Backup." $[GM9OUT]/*nand_???.bin NANDBAK 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 + rm -o -s 1:/data/$[SYSID0]/sysdata/00010011/00000000 imgumount else echo "Not a valid NAND backup." @@ -137,6 +140,7 @@ if find E:/nand.bin NULL cp -w -n E:/ctrnand_full.bin S:/ctrnand_full.bin cp -w -n E:/twln.bin S:/twln.bin cp -w -n E:/twlp.bin S:/twlp.bin + rm -o -s 1:/data/$[SYSID0]/sysdata/00010011/00000000 end else echo "No qualifying exploit found.\nAborting to avoid bricking the device." @@ -153,6 +157,7 @@ if find E:/nand.bin NULL if ask "Please make sure you have a backup of your EmuNAND.\nAre you certain you want to continue?" allow E:/nand_minsize.bin inject -n S:/nand_minsize.bin E:/nand.bin@0 + rm -o -s 4:/data/$[EMUID0]/sysdata/00010011/00000000 end else echo "EmuNAND not found."