Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Nov 12, 2023
1 parent cfd3104 commit 5532e54
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 15 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.7
APP_VERSION := 6.1
ROMFS := romfs

#---------------------------------------------------------------------------------
Expand Down
Binary file added romfs/imkvdb.arc
Binary file not shown.
10 changes: 1 addition & 9 deletions romfs/startup.te
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#REQUIRE KEYS
# NCA Database EXFAT INDEX
is=["8000000000000120","8000000000000047","8000000000000000"]
p=println
pr=print
Expand All @@ -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()}
Expand All @@ -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)
4 changes: 3 additions & 1 deletion source/lang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand All @@ -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();
Expand Down
57 changes: 53 additions & 4 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;}
Expand Down Expand Up @@ -156,7 +159,7 @@ void SetupClean (){

led_on(1);
spsmInitialize();
spsmShutdown(true);
spsmShutdown(false);
}else{
//Erista boot
led_on(2);
Expand All @@ -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 <<std::endl;
}else{
cout << "Data not Cleared... " <<std::endl;
SetupClean();
}
fsFsClose(&dataW);
led_on(1);
spsmInitialize();
spsmShutdown(false);

}


int main(int argc, char **argv)
{
Expand All @@ -179,7 +205,14 @@ int main(int argc, char **argv)
padConfigureInput(8, HidNpadStyleSet_NpadStandard);
padInitializeDefault(&pad);
bool keysok = IsExist("/switch/prod.keys");
bool sure = false;
Result rc = 0;
SetSysFirmwareVersion ver;
if (R_FAILED(rc = setsysGetFirmwareVersion(&ver))) {
printf("setsysGetFirmwareVersion() Failied: 0x%x.\n\n", rc);
} else {
verM = (int)ver.major;
}

//keys
while (appletMainLoop())
Expand Down Expand Up @@ -227,21 +260,37 @@ int main(int argc, char **argv)
printf(LG.text12);
}
printf(LG.text5);
if (sure){
printf(LG.text13);
}


consoleUpdate(NULL);

if (kDown & KEY_Y || kDown & KEY_X){
SetupClean();
}

//call clean after combo
if (kHeld & KEY_A)
if (kDown & KEY_A)
{
/*
if (is_patched){
if (keysok){
SetupClean();
}
} else SetupClean();
*/
SetupClean();
*/
if (sure){
if (verM >= 17){
NewClean();
} else {
SetupClean();
}
}
sure = true;

//break;
}

Expand Down

0 comments on commit 5532e54

Please sign in to comment.