mirror of
https://github.com/suchmememanyskill/TegraExplorer.git
synced 2024-11-09 21:51:48 +00:00
70 lines
No EOL
2.4 KiB
Text
70 lines
No EOL
2.4 KiB
Text
#REQUIRE KEYS
|
|
is=["8000000000000120","8000000000000000"]
|
|
p=println
|
|
pr=print
|
|
pe={pause() exit()}
|
|
wait={t=timer()while(timer()<(t+tw)){print("Wait for",(t+tw-timer()/1000),"seconds \r")}}
|
|
p("System wiper\n")
|
|
op=["Exit","Wipe sysmmc"].copy()
|
|
if (emu()){op+"Wipe emummc"}
|
|
r=menu(op,0)clear()
|
|
if(r==0){exit()}
|
|
if(r==1){p("Selected sysmmc")mount=mountsys}
|
|
if(r==2){p("Selected emummc")mount=mountemu}
|
|
if(mount("SYSTEM")){p("Mount failed!")pe()}
|
|
color(0xFF0000)
|
|
p("Are you sure you want to wipe everything?\nThis includes:\n- Saves\n- Game Data\n- All other data on the system\n\nUse this only as a last resort!")
|
|
color(0xFFFF00)
|
|
tw=10000
|
|
wait()
|
|
color(0x0000FF)
|
|
p("Press power to wipe, any other key to exit")a=pause()if(!a.power){exit()}clear()
|
|
color(0xFF0000)
|
|
pr("Deleting system saves... ")
|
|
f=readdir("bis:/save")
|
|
if(f.folders.len()!=0){p("Folders in save dir???")pe()}
|
|
f.files.foreach("x"){if(!is.contains(x)){if(delfile("bis:/save/"+x)){p("File deletion failed: ", x)pe()}}}
|
|
pr("Done!\nSetting up indexer save...")
|
|
s=getfilesize("bis:/save/"+is[0])
|
|
ba0=["BYTE[]",0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]
|
|
ba120=["BYTE[]",0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80]
|
|
s1=s&0xFF
|
|
s2=(s>>8)&0xFF
|
|
s3=(s>>16)&0xFF
|
|
s4=(s>>24)&0xFF
|
|
idb=["BYTE[]",0x49,0x4D,0x4B,0x56,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x49,0x4D,0x45,0x4E,0x40,0x00,0x00,0x00,0x40,0x00,0x00,0x00].copy()
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba120)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba120)
|
|
idb.add(s1)
|
|
idb.add(s2)
|
|
idb.add(s3)
|
|
idb.add(s4)
|
|
idb.add(0x00)
|
|
idb.add(0x00)
|
|
idb.add(0x00)
|
|
idb.add(0x00)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idb.addrange(ba0)
|
|
idxs=readsave("bis:/save/"+is[1])
|
|
if(idxs.resize("/imkvdb.arc",idb.len())){p("imkvdb resize failed")pe()}
|
|
if(idxs.write("/imkvdb.arc",idb)){p("imkvdb write failed")pe()}
|
|
if(idxs.resize("/lastPublishedId",ba0.len())){p("lastPublishedId resize failed")pe()}
|
|
if(idxs.write("/lastPublishedId",ba0)){p("lastPublishedId write failed")pe()}
|
|
if(idxs.commit()){p("Indexer save commit failed")pe()}
|
|
idxs=0
|
|
pr("Done!\nDeleting user dirs...")ud=["Album","Contents","save","saveMeta","temp"]
|
|
if(mount("USER")){p("Mount failed!")pe()}
|
|
ud.foreach("x"){pr("\n"+x,"")if(deldir("bis:/"+x)){p("Dir deletion failed")pe()}mkdir("bis:/"+x)}
|
|
mkdir("bis:/Contents/placehld")mkdir("bis:/Contents/registered")
|
|
color(0x00FF00)p("\n\nDone!")pause() |