diff --git a/src/dynamic_libs/os_functions.c b/src/dynamic_libs/os_functions.c index abf9ad9..af038f0 100644 --- a/src/dynamic_libs/os_functions.c +++ b/src/dynamic_libs/os_functions.c @@ -37,6 +37,7 @@ EXPORT_DECL(int, OSDynLoad_FindExport, u32 handle, int isdata, const char *symbo //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- EXPORT_DECL(int, OSGetSecurityLevel, void); EXPORT_DECL(int, OSForceFullRelaunch, void); +EXPORT_DECL(void, OSShutdown, void); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Thread functions @@ -139,6 +140,7 @@ void InitOSFunctionPointers(void) //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- OS_FIND_EXPORT(coreinit_handle, OSGetSecurityLevel); OS_FIND_EXPORT(coreinit_handle, OSForceFullRelaunch); + OS_FIND_EXPORT(coreinit_handle, OSShutdown); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! System functions //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/src/dynamic_libs/os_functions.h b/src/dynamic_libs/os_functions.h index 97a0826..d3cf9b6 100644 --- a/src/dynamic_libs/os_functions.h +++ b/src/dynamic_libs/os_functions.h @@ -85,6 +85,7 @@ extern int (* OSDynLoad_FindExport)(u32 handle, int isdata, const char *symbol, //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- extern int (* OSGetSecurityLevel)(void); extern int (* OSForceFullRelaunch)(void); +extern void (* OSShutdown)(void); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Thread functions diff --git a/src/dynamic_libs/os_types.h b/src/dynamic_libs/os_types.h index aaa18fe..4883c3c 100644 --- a/src/dynamic_libs/os_types.h +++ b/src/dynamic_libs/os_types.h @@ -7,6 +7,8 @@ extern "C" { #include +typedef u32 BOOL; + typedef struct _OSCalendarTime { int sec; int min; diff --git a/src/main.c b/src/main.c index 0354ea5..9695f38 100644 --- a/src/main.c +++ b/src/main.c @@ -55,10 +55,10 @@ int Menu_Main(int argc, char ** argv){ cfw_config_t config; default_config(&config); - //int launch = 1; - ShowMenu(&config); - - ExecuteIOSExploit(&config); + int launch = ShowMenu(&config); + if (launch) { + ExecuteIOSExploit(&config); + } if ( OSGetTitleID() == 0x000500101004A200L || // mii maker eur @@ -66,15 +66,23 @@ int Menu_Main(int argc, char ** argv){ OSGetTitleID() == 0x000500101004A000L) { // mii maker jpn // restart mii maker. - OSForceFullRelaunch(); - SYSLaunchMenu(); - return ( (int (*)(int, char **))(*(unsigned int*)0x1005E040) )(argc, argv); + if (launch) { + OSForceFullRelaunch(); + SYSLaunchMenu(); + } else { + OSShutdown(); + } + return ( (int (*)(int, char **))(*(unsigned int*)0x1005E040) )(argc, argv); } ProcUIInit(OSSavesDone_ReadyToRelease); - OSForceFullRelaunch(); - SYSLaunchMenu(); + if (launch) { + OSForceFullRelaunch(); + SYSLaunchMenu(); + } else { + OSShutdown(); + } while (CheckRunning()) { log_printf_("check"); diff --git a/src/menu.c b/src/menu.c index d237253..063f720 100644 --- a/src/menu.c +++ b/src/menu.c @@ -239,7 +239,7 @@ int ShowMenu(cfw_config_t * currentConfig) console_print_pos(x_offset, 1, " -- NAND Dumper --"); console_print_pos(x_offset, 3, "Select your options and press A to launch."); - console_print_pos(x_offset, 4, "Press HOME to exit back to HBL."); + console_print_pos(x_offset, 4, "Press HOME to shutdown the console."); //console_print_pos(x_offset, 5, "Hold B on start to force enter this menu"); int y_offset = 6; @@ -254,7 +254,7 @@ int ShowMenu(cfw_config_t * currentConfig) TEXT_SEL(configPtr[idx], " ", "<"), selection_options[idx].disabled, TEXT_SEL(configPtr[idx], " ", ">")); } - console_print_pos(x_offset, 15, "Based on mocha CFW by Dimok."); + console_print_pos(x_offset, 15, "Original NAND Dumper by koolkdev. Based on mocha CFW by Dimok."); console_print_pos(x_offset, 16, "Credits go to everyone who contributed to Wii U scene publicly."); console_print_pos(x_offset, 17, "Special thanks to smealum, plutoo, yellows8, naehrwert and derrek.");