Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kronos2308 committed Jul 27, 2021
1 parent 365817d commit db4e1b7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 146 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 := 3.9
APP_VERSION := 4.0
ROMFS := romfs

#---------------------------------------------------------------------------------
Expand Down
45 changes: 0 additions & 45 deletions source/ams_bpc.c

This file was deleted.

31 changes: 0 additions & 31 deletions source/ams_bpc.h

This file was deleted.

4 changes: 2 additions & 2 deletions source/lang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ language LG;
LG.text2 = "\n\x1b[30;1m SE REALIZARA UN HARD RESET LUEGO SE APAGARA LA CONSOLA \x1b[0m\n";
LG.text3 = "\n\x1b[30;1m SI NO SABES LO QUE HACES, PRESIONA B PARA ABORTAR \x1b[0m\n";
LG.text4 = "\n\n\x1b[30;1m-------- LO DEVORARE TODO --------\x1b[0m\n\n";
LG.text5 = "\n\nPULSA \x1b[3%u;1m ZL\x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR \x1b[0m JUNTOS PARA LIMPIAR\n\n";
LG.text5 = "\n\nPULSA A PARA LIMPIAR\n\n";
LG.text6 = "\x1b[33;1m*\x1b[0m Recuerda Desinstalar Incognito Desde Incognito-RCM\n\n";
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";
Expand All @@ -79,7 +79,7 @@ language LG;
LG.text2 = "\n\x1b[30;1m A HARD RESET WILL BE PERFORMED AFTER THE CONSOLE WILL BE OFF \x1b[0m\n";
LG.text3 = "\n\x1b[30;1m IF YOU DON'T KNOW WHAT YOU DO, PRESS B FOR ABORT \x1b[0m\n";
LG.text4 = "\n\n\x1b[30;1m-------- I WILL CONSUME EVERYTHING --------\x1b[0m\n\n";
LG.text5 = "\n\nPRESS \x1b[3%u;1m ZL\x1b[3%u;1m -\x1b[3%u;1m +\x1b[3%u;1m ZR \x1b[0m TOGETHER TO CLEAN\n\n";
LG.text5 = "\n\nPRESS A TO CLEAN\n\n";
LG.text6 = "\x1b[33;1m*\x1b[0m Remember Uninstall Incognito from Incognito-RCM\n\n";
LG.text7 = "\x1b[33;1m*\x1b[0m After the Reboot go to Hekate -> More configs -> Haku33\n\n";
LG.text8 = " Reboot to payload cannot be used on a Mariko system\n";
Expand Down
73 changes: 6 additions & 67 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ char Logs[2024];
bool isXSOS;

extern "C" {
#include "ams_bpc.h"
#include "reboot.h"
}

Expand Down Expand Up @@ -66,27 +65,6 @@ void copy_me(string origen, string destino) {
dest.close();
}

bool txIsAvailable() {
auto srv_name = smEncodeName("tx");
Handle tmph = 0;
auto rc = smRegisterService(&tmph, srv_name, false, 1);
if(R_FAILED(rc)) {
return true;
}
smUnregisterService(srv_name);
return false;
}

static void reboot_to_payload_AMS(void) {
Result rc = amsBpcSetRebootPayload(g_reboot_payload, IRAM_PAYLOAD_MAX_SIZE);
if (R_FAILED(rc)) {
sprintf(Logs," Failed to set reboot payload: 0x%x\n", rc);
}
else {
spsmShutdown(true);
}
}

bool is_patched = false;
void CheckHardware()
{
Expand All @@ -97,7 +75,6 @@ void CheckHardware()
}
}

bool can_reboot_AMS = true;
void SetupClean (){
if (is_patched){
led_on(1);
Expand All @@ -115,11 +92,9 @@ void SetupClean (){
copy_me("romfs:/startup.te", "/startup.te");
copy_me("romfs:/poweroff.bin", "/poweroff.bin");
copy_me("romfs:/TegraExplorer.bin", "/Haku33.bin");
if (isXSOS){
bpcInitialize();
if(init_slp()){reboot_to_payload();}
bpcExit();
}else if (can_reboot_AMS) { reboot_to_payload_AMS();}
bpcInitialize();
if(init_slp()){reboot_to_payload();}
bpcExit();
}
}

Expand All @@ -135,43 +110,7 @@ int main(int argc, char **argv)
padInitializeDefault(&pad);

Result rc = 0;
bool isXSOS = txIsAvailable();
if (!isXSOS){
if (R_FAILED(rc = setsysInitialize())) {
sprintf(Logs," Failed to initialize set:sys: 0x%x\n", rc);
can_reboot_AMS = false;
}
else {
if (is_patched) {
sprintf(Logs,LG.text8 );
can_reboot_AMS = false;
}
}

if (can_reboot_AMS && R_FAILED(rc = spsmInitialize())) {
sprintf(Logs," Failed to initialize spsm: 0x%x\n", rc);
can_reboot_AMS = false;
}

if (can_reboot_AMS) {
smExit(); //Required to connect to ams:bpc
if R_FAILED(rc = amsBpcInitialize()) {
sprintf(Logs," Failed to initialize ams:bpc: 0x%x\n", rc);
can_reboot_AMS = false;
}
}

if (can_reboot_AMS) {
FILE *f = fopen("romfs:/TegraExplorer.bin", "rb");
if (f == NULL) {
sprintf(Logs," Failed to open atmosphere/romfs:/TegraExplorer.bin!\n");
can_reboot_AMS = false;
} else {
fread(g_reboot_payload, 1, sizeof(g_reboot_payload), f);
fclose(f);
}
}
}
//keys
while (appletMainLoop())
{
Expand Down Expand Up @@ -214,20 +153,20 @@ int main(int argc, char **argv)
printf("\n\n %s",LG.text7);
}
printf("\n\x1b[31;1m%s \x1b[0m ",Logs);
printf(LG.text5,LT,minus,more,RT);
printf(LG.text5);


consoleUpdate(NULL);

//call clean after combo
if (kHeld & KEY_ZL && kHeld & KEY_ZR && kHeld & KEY_MINUS && kHeld & KEY_PLUS)
if (kHeld & KEY_A)
{
SetupClean();
//break;
}

//exit
if (kDown & KEY_A || kDown & KEY_B || kDown & KEY_Y || kDown & KEY_X)
if (kDown & KEY_B || kDown & KEY_Y || kDown & KEY_X)
{
break;
}
Expand Down

0 comments on commit db4e1b7

Please sign in to comment.