Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Mar 21, 2023
1 parent a3b62bf commit 11078a9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ INCLUDES := include
EXEFS_SRC := exefs_src
APP_TITLE := Haku33
APP_AUTHOR := Kronos2308
APP_VERSION := 5.2
APP_VERSION := 5.3
ROMFS := romfs

#---------------------------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions romfs/startup_mariko.te
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
is=["8000000000000120","8000000000000047"]
p=println
pr=print
pe={pause() exit()}
pe={pause() exit() movefile("sd:/payload.bin.bak", "sd:/payload.bin")}
println("Haku33 Kronos2308 Hard Reset, Kronos2308 - Fork from TegraExplorer")
wait={t=timer()while(timer()<(t+tw)){print("Wait for",(t+tw-timer()/1000),"seconds \r")}}
p("System wiper\n")
mount=mountsys
if(mount("SYSTEM")){p("Mount failed!")pe()}
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")
Expand All @@ -30,6 +28,7 @@ delfile("sd:/startup.te")
delfile("sd:/Haku33.nro")
delfile("sd:/Switch/Haku33.nro")
delfile("sd:/Switch/Haku33/Haku33.nro")
delfile("sd:/payload.bin")
movefile("sd:/payload.bin.bak", "sd:/payload.bin")

p("\n\nDone!")
Expand Down
10 changes: 6 additions & 4 deletions source/lang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ typedef struct {
const char* text9;
const char* text0;
const char* text11;
/* const char* text12;
const char* text;
const char* text12;
/* const char* text;
const char* text;
const char* text;
const char* text;
Expand Down Expand Up @@ -71,8 +71,9 @@ language LG;
LG.text7 = "\x1b[33;1m*\x1b[0m Luego del Reinicio ve a Hekate -> More configs -> Haku33\n\n";
LG.text8 = " No se puede Reiniciar al Payload en una consola Mariko\n";
LG.text9 = "\n\x1b[33;1m*\x1b[0m Si se congela mucho tiempo, Es que ha fallado. Pulsa POWER 15s \n\ny haslo de nuevo\n\n";
LG.text0 = "\x1b[32;1m*\x1b[0m Desabilitando FTP de SXOS\n";
LG.text11 = "\x1b[32;1m*\x1b[0m Esto no esta pensado para uasrse en EMU\n";
LG.text0 = "\x1b[32;1m*\x1b[0m Deshabilitando FTP de SXOS\n";
LG.text11 = "\x1b[32;1m*\x1b[0m Esto no esta pensado para usarse en EMU\n";
LG.text12 = "\x1b[32;1m*\x1b[0m NO Existe /switch/prod.keys, usa LockPick_RCM\n";
break;
default: //all
LG.text1 = "\n\x1b[30;1m YOUR CONSOLE WILL BE COMPLETELY CLEANED: SAVES, GAMES, ETC \x1b[0m\n";
Expand All @@ -86,6 +87,7 @@ language LG;
LG.text9 = "\n\x1b[33;1m*\x1b[0m If it freezes for a long time, It has failed. Press POWER 15s \n\nand try again \n\n";
LG.text0 = "\x1b[32;1m*\x1b[0m Disabling SXOS FTP\n";
LG.text11 = "\x1b[32;1m*\x1b[0m This is not intended to be used at EMU\n";
LG.text12 = "\x1b[32;1m*\x1b[0m /switch/prod.keys does not exist, use LockPick_RCM\n";
break;
}
setsysExit();
Expand Down
42 changes: 32 additions & 10 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ void close_Services()
psmExit();
}

bool IsExist(std::string Path)
{
std::ifstream ifs(Path);
bool ex = ifs.good();
ifs.close();
return ex;
}

void copy_me(string origen, string destino) {
ifstream source(origen, ios::binary);
ofstream dest(destino, ios::binary);
Expand All @@ -128,23 +136,30 @@ void CheckHardware()

void SetupClean (){
if (is_patched){
//force boot

led_on(2);

//force boot sxcore
copy_me("romfs:/boot.dat", "/boot.dat");
copy_me("romfs:/boot.ini", "/boot.ini");

//force boot HWFLY
copy_me("sdmc:/payload.bin","sdmc:/payload.bin.bak");
copy_me("romfs:/TegraExplorer.bin", "/payload.bin");

//copy keys
mkdir("sdmc:/bootloader",0777);
copy_me("romfs:/hekate_keys.ini", "/bootloader/hekate_keys.ini");
//copy Start
mkdir("sdmc:/bootloader/res",0777);
mkdir("sdmc:/bootloader/ini",0777);
rename("/payload.bin","/payload.bin.bak");
copy_me("romfs:/TegraExplorer.bin", "/payload.bin");

//copy Script
copy_me("romfs:/startup_mariko.te", "/startup.te");

led_on(1);
spsmInitialize();
spsmShutdown(true);
}else{
copy_me("romfs:/TegraExplorer.bin", "/TegraExplorer.bin");
//Erista boot
led_on(2);
copy_me("romfs:/startup.te", "/startup.te");
led_on(1);
bpcInitialize();
Expand All @@ -163,7 +178,7 @@ int main(int argc, char **argv)
PadState pad;
padConfigureInput(8, HidNpadStyleSet_NpadStandard);
padInitializeDefault(&pad);

bool keysok = IsExist("/switch/prod.keys");
Result rc = 0;

//keys
Expand Down Expand Up @@ -208,15 +223,22 @@ int main(int argc, char **argv)
printf("\n\n %s",LG.text7);
}
printf("\n\x1b[31;1m%s \x1b[0m ",Logs);
if (is_patched && !keysok){
printf(LG.text12);
}
printf(LG.text5);


consoleUpdate(NULL);

//call clean after combo
if (kHeld & KEY_A)
{
SetupClean();
if (is_patched){
if (keysok){
SetupClean();
}
} else SetupClean();
//break;
}

Expand Down

0 comments on commit 11078a9

Please sign in to comment.