diff --git a/Makefile b/Makefile index cd432a6..165247d 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ INCLUDES := include EXEFS_SRC := exefs_src APP_TITLE := Haku33 APP_AUTHOR := Kronos2308 -APP_VERSION := 5.4 +APP_VERSION := 5.6 ROMFS := romfs #--------------------------------------------------------------------------------- diff --git a/compile.cmd b/compile.cmd index 0247148..e445d9b 100644 --- a/compile.cmd +++ b/compile.cmd @@ -1,6 +1,6 @@ @echo off -set /p IP=%temp%\filete.txt set /p File=<%temp%\filete.txt @@ -15,5 +15,6 @@ if %a% equ 0 color 0a echo ----------------------------------- "C:\devkitPro\tools\bin\nxlink.exe" %File% +"C:\devkitPro\tools\bin\nxlink.exe" %File% -a %IP% %systemroot%\system32\timeout.exe 55 diff --git a/romfs/TegraExplorer.bin b/romfs/TegraExplorer.bin index 36af78b..fec5b3b 100644 Binary files a/romfs/TegraExplorer.bin and b/romfs/TegraExplorer.bin differ diff --git a/romfs/startup.te b/romfs/startup.te index d75df5b..00e46ec 100644 --- a/romfs/startup.te +++ b/romfs/startup.te @@ -1,16 +1,16 @@ #REQUIRE KEYS -is=["8000000000000120","8000000000000047"] +is=["8000000000000120","8000000000000047","8000000000000000"] p=println pr=print -pe={pause() exit()} +pe={hwfly() pause() exit()} 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")}} +emumenu={op=["Wipe Console","Wipe emunand only"].copy()r=menu(op,0)clear()if(r==0){p("Selected sysmmc")mount=mountsys}if(r==1){p("Selected emummc")mount=mountemu}} +hwfly={if(fsexists("sd:/payload.bin.bak")){copyfile("sd:/payload.bin.bak", "sd:/payload.bin")delfile("sd:/payload.bin.bak")}} + p("System wiper\n") -op=["Wipe Console"].copy() -if (emu()){op+"Wipe emunand only"} -r=menu(op,0)clear() -if(r==0){p("Selected sysmmc")mount=mountsys} -if(r==1){p("Selected emummc")mount=mountemu} +mount=mountsys +if (emu()){emumenu()} 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!") @@ -39,6 +39,7 @@ delfile("sd:/startup.te") delfile("sd:/Haku33.nro") delfile("sd:/Switch/Haku33.nro") delfile("sd:/Switch/Haku33/Haku33.nro") +hwfly() p("\n\nDone!") p("\n\nPress Any button to full power off!") diff --git a/romfs/startup_mariko.te b/romfs/startup_mariko.te deleted file mode 100644 index ef522ec..0000000 --- a/romfs/startup_mariko.te +++ /dev/null @@ -1,37 +0,0 @@ -#REQUIRE KEYS -is=["8000000000000120","8000000000000047"] -p=println -pr=print -pe={copyfile("sd:/payload.bin.bak", "sd:/payload.bin") pause() exit()} -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(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!\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\nCleaning!") - -movefile("sd:/Nintendo", "sd:/Hamburgesa_Nintendo") -movefile("sd:/Nintendo", "sd:/Hamburgesa_Nintendo_1") -movefile("sd:/Nintendo", "sd:/Hamburgesa_Nintendo_2") - -delfile("sd:/TegraExplorer.bin") -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!") -p("\n\nPower off!") -power(3) \ No newline at end of file diff --git a/source/main.cpp b/source/main.cpp index 6dd9082..06ac1b9 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -143,7 +143,7 @@ void SetupClean (){ copy_me("romfs:/boot.dat", "/boot.dat"); copy_me("romfs:/boot.ini", "/boot.ini"); - //force boot HWFLY + //force boot HWFLY PicoFly copy_me("sdmc:/payload.bin","sdmc:/payload.bin.bak"); copy_me("romfs:/TegraExplorer.bin", "/payload.bin"); @@ -152,7 +152,7 @@ void SetupClean (){ copy_me("romfs:/hekate_keys.ini", "/bootloader/hekate_keys.ini"); //copy Script - copy_me("romfs:/startup_mariko.te", "/startup.te"); + copy_me("romfs:/startup.te", "/startup.te"); led_on(1); spsmInitialize(); @@ -163,7 +163,7 @@ void SetupClean (){ copy_me("romfs:/startup.te", "/startup.te"); led_on(1); bpcInitialize(); - if(init_slp()){reboot_to_payload();} + if(init_slp()){reboot_to_payload("romfs:/TegraExplorer.bin");} bpcExit(); } } diff --git a/source/reboot.c b/source/reboot.c index 4849866..5e3c2e0 100644 --- a/source/reboot.c +++ b/source/reboot.c @@ -11,6 +11,7 @@ static alignas(0x1000) u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE]; static alignas(0x1000) u8 g_ff_page[0x1000]; static alignas(0x1000) u8 g_work_page[0x1000]; +bool can_reboot = true; void do_iram_dram_copy(void *buf, uintptr_t iram_addr, size_t size, int option) { memcpy(g_work_page, buf, size); @@ -41,9 +42,19 @@ static void clear_iram(void) { } } -void reboot_to_payload(void) { +void reboot_to_payload(const char* payload) { clear_iram(); + FILE *f = fopen(payload, "rb"); + if (f == NULL) { + can_reboot = false; + return 0; + } else { + can_reboot = true; + fread(g_reboot_payload, 1, sizeof(g_reboot_payload), f); + fclose(f); + } + for (size_t i = 0; i < IRAM_PAYLOAD_MAX_SIZE; i += 0x1000) { copy_to_iram(IRAM_PAYLOAD_BASE + i, &g_reboot_payload[i], 0x1000); } @@ -53,18 +64,11 @@ void reboot_to_payload(void) { bool init_slp() { - bool can_reboot = true; Result rc = splInitialize(); if (R_FAILED(rc)) { can_reboot = false; } else { - FILE *f = fopen("romfs:/TegraExplorer.bin", "rb"); - if (f == NULL) { - can_reboot = false; - } else { - fread(g_reboot_payload, 1, sizeof(g_reboot_payload), f); - fclose(f); - } + can_reboot = true; } return can_reboot; } diff --git a/source/reboot.h b/source/reboot.h index f3f1c70..94e111b 100644 --- a/source/reboot.h +++ b/source/reboot.h @@ -5,6 +5,6 @@ #include #include -void reboot_to_payload(void); +void reboot_to_payload(const char* payload); bool init_slp(void); void exit_spl(bool can_reboot); \ No newline at end of file diff --git a/stuff/iconUP.jpeg b/stuff/iconUP.jpeg new file mode 100644 index 0000000..ce07bb8 Binary files /dev/null and b/stuff/iconUP.jpeg differ