From 5532e54792d9eba397eb91847be3af9f1ec8939d Mon Sep 17 00:00:00 2001 From: Kronos2308 Date: Sun, 12 Nov 2023 17:31:33 +0000 Subject: [PATCH] w --- Makefile | 2 +- romfs/imkvdb.arc | Bin 0 -> 152 bytes romfs/startup.te | 10 +-------- source/lang.hpp | 4 +++- source/main.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++---- 5 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 romfs/imkvdb.arc diff --git a/Makefile b/Makefile index 137c6ed..c0e696c 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ INCLUDES := include EXEFS_SRC := exefs_src APP_TITLE := Haku33 APP_AUTHOR := Kronos2308 -APP_VERSION := 5.7 +APP_VERSION := 6.1 ROMFS := romfs #--------------------------------------------------------------------------------- diff --git a/romfs/imkvdb.arc b/romfs/imkvdb.arc new file mode 100644 index 0000000000000000000000000000000000000000..7eb51134cad568b71d2021a0dc53d894aa1835f0 GIT binary patch literal 152 rcmebD^$ueI0!ASA^mX-f0Ma0g3n+jTGB7lNNjwBxU4sxFRk)=99i{}f literal 0 HcmV?d00001 diff --git a/romfs/startup.te b/romfs/startup.te index 00e46ec..328f232 100644 --- a/romfs/startup.te +++ b/romfs/startup.te @@ -1,4 +1,5 @@ #REQUIRE KEYS +# NCA Database EXFAT INDEX is=["8000000000000120","8000000000000047","8000000000000000"] p=println pr=print @@ -13,13 +14,6 @@ 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!") -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()} @@ -42,6 +36,4 @@ delfile("sd:/Switch/Haku33/Haku33.nro") hwfly() p("\n\nDone!") -p("\n\nPress Any button to full power off!") -pause() power(3) \ No newline at end of file diff --git a/source/lang.hpp b/source/lang.hpp index 7d55a0f..6214d17 100644 --- a/source/lang.hpp +++ b/source/lang.hpp @@ -34,6 +34,7 @@ typedef struct { const char* text0; const char* text11; const char* text12; + const char* text13; /* const char* text; const char* text; const char* text; @@ -74,6 +75,7 @@ language LG; 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"; + LG.text13 = "\x1b[33;1m*\x1b[0m ESTAS SEGURO??\n"; break; default: //all LG.text1 = "\n\x1b[30;1m YOUR CONSOLE WILL BE COMPLETELY CLEANED: SAVES, GAMES, ETC \x1b[0m\n"; @@ -87,7 +89,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"; + LG.text13 = "\x1b[33;1m*\x1b[0m ARE YOU SURE??\n"; break; } setsysExit(); diff --git a/source/main.cpp b/source/main.cpp index 06ac1b9..16a63b3 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -33,6 +33,8 @@ static u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE]; char Logs[2024]; bool isXSOS; +int verM = 0; + extern "C" { #include "reboot.h" @@ -93,6 +95,7 @@ using namespace std; Result Init_Services(void) { Result ret = 0; + if (R_FAILED(ret = setsysInitialize())) {return 1;} if (R_FAILED(ret = splInitialize())) {return 1;} if (R_FAILED(ret = hiddbgInitialize())) {return 1;} if (R_FAILED(ret = psmInitialize())) {return 1;} @@ -156,7 +159,7 @@ void SetupClean (){ led_on(1); spsmInitialize(); - spsmShutdown(true); + spsmShutdown(false); }else{ //Erista boot led_on(2); @@ -167,6 +170,29 @@ void SetupClean (){ bpcExit(); } } +void NewClean(){ + //if () + u64 uidsave = 0x8000000000000000; + AccountUid uid; + FsFileSystem dataW; + + if(R_SUCCEEDED(fsOpen_SystemSaveData (&dataW,FsSaveDataSpaceId_System,uidsave,uid))) { + fsdevMountDevice("bro", dataW); + copy_me("romfs:/imkvdb.arc", "bro:/imkvdb.arc"); + fsdevCommitDevice("bro"); + fsdevUnmountDevice("bro"); + cout << "Data Cleared... " << uidsave <= 17){ + NewClean(); + } else { + SetupClean(); + } + } + sure = true; + //break; }