2021-07-23 15:06:52 +01:00
|
|
|
#REQUIRE KEYS
|
2021-07-27 20:05:32 +01:00
|
|
|
#REQUIRE SD
|
2021-07-23 15:06:52 +01:00
|
|
|
p=println
|
|
|
|
pe={pause() exit()}
|
|
|
|
fwstr={fw=maj.str()+"."+min.str()+"."+pat.str()}
|
|
|
|
fv={a=readsave("bis:/save/8000000000000120")
|
2021-07-26 00:45:35 +01:00
|
|
|
b=a.read("/meta/imkvdb.arc")
|
2021-07-23 15:06:52 +01:00
|
|
|
c=["BYTE[]",9,8,0,0,0,0,0,1]
|
|
|
|
d=b.find(c)
|
|
|
|
if(d>0){
|
|
|
|
e=b.slice(d+8,4).project()
|
|
|
|
ver=(e[3]<<24)|(e[2]<<16)|(e[1]<<8)|(e[0])
|
|
|
|
pat=((ver>>16)&((1<<4)- 1))
|
|
|
|
min=((ver>>20)&((1<<6)- 1))
|
|
|
|
maj=((ver>>26)&((1<<6)- 1))
|
|
|
|
}.else(){print("Fw not found")pe()}
|
|
|
|
a=0 fwstr()}
|
|
|
|
if(mountsys("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}
|
|
|
|
fv()
|
|
|
|
sysfw=fw
|
|
|
|
p("Sys' fw is",fw)
|
|
|
|
emufw=""
|
2021-07-24 22:00:05 +01:00
|
|
|
if (emu()){if(!mountemu("SYSTEM")){fv()emufw=fw p("Emu's fw is",fw)}}
|
2021-07-23 15:06:52 +01:00
|
|
|
op=["Exit","Dump sysmmc"].copy()
|
|
|
|
if (emufw!=""){op+"Dump emummc"}
|
2021-07-24 22:00:05 +01:00
|
|
|
p()r=menu(op,0)clear()
|
2021-07-23 15:06:52 +01:00
|
|
|
if(r==0){exit()}
|
|
|
|
if(r==1){fw=sysfw if(mountsys("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}}
|
|
|
|
if(r==2){fw=emufw if(mountemu("SYSTEM")){print("SYSTEM MOUNT FAIL")pe()}}
|
2021-07-21 14:19:27 +01:00
|
|
|
mkdir("sd:/tegraexplorer")
|
|
|
|
mkdir("sd:/tegraexplorer/Firmware")
|
2021-07-24 22:00:05 +01:00
|
|
|
bsp="sd:/tegraexplorer/Firmware/"+fw
|
|
|
|
if(fsexists(bsp)){p("Dir already exists! Press power to replace, any other key to exit") a=pause() if(!a.power){exit()} deldir(bsp)}
|
2021-07-23 15:06:52 +01:00
|
|
|
mkdir(bsp)
|
|
|
|
p("Dumping to",bsp)
|
|
|
|
con=readdir("bis:/Contents/registered")
|
|
|
|
if(con.result!=0){println("Fail reading dir")pe()}
|
|
|
|
c=(con.files.len()+con.folders.len()).str()
|
|
|
|
i=1 f=0 t=timer()
|
|
|
|
dump={
|
|
|
|
fi.foreach("x"){
|
|
|
|
if(f){fp="bis:/Contents/registered/"+x+"/00"}
|
|
|
|
.else(){fp="bis:/Contents/registered/"+x}
|
|
|
|
name=x
|
|
|
|
if(ncatype(fp)==1){name=name- 4+".cnmt.nca"}
|
|
|
|
color(0x00FF00)
|
|
|
|
print("\r["+i.str()+"/"+c+"]", x)
|
2021-07-25 16:49:00 +01:00
|
|
|
if(copyfile(fp,bsp+"/"+name)){println("\nErr during copy")pe()}
|
2021-07-23 15:06:52 +01:00
|
|
|
i=i+1
|
2021-07-21 14:19:27 +01:00
|
|
|
}
|
|
|
|
}
|
2021-07-23 15:06:52 +01:00
|
|
|
fi=con.files dump()
|
|
|
|
f=1 fi=con.folders dump()
|
2021-07-24 22:05:09 +01:00
|
|
|
p("\nDone! Took",timer()-t/1000,"s")pause()
|