diff --git a/source/applicationendshook/applicationends_function_replacements.cpp b/source/applicationendshook/applicationends_function_replacements.cpp index 9104b0f..75e1dbc 100644 --- a/source/applicationendshook/applicationends_function_replacements.cpp +++ b/source/applicationendshook/applicationends_function_replacements.cpp @@ -24,13 +24,6 @@ void CallHook(wums_hook_type_t type) { } } -DECL_FUNCTION(void, _Exit, uint32_t status) { - CallHook(WUMS_HOOK_APPLICATION_ENDS); - CallHook(WUMS_HOOK_FINI_WUT_SOCKETS); - CallHook(WUMS_HOOK_FINI_WUT_DEVOPTAB); - real__Exit(status); -} - DECL_FUNCTION(uint32_t, OSReceiveMessage, OSMessageQueue *queue, OSMessage *message, uint32_t flags) { uint32_t res = real_OSReceiveMessage(queue, message, flags); if (queue == OSGetSystemMessageQueue()) { @@ -48,7 +41,6 @@ DECL_FUNCTION(uint32_t, OSReceiveMessage, OSMessageQueue *queue, OSMessage *mess function_replacement_data_t applicationendshook_function_replacements[] = { REPLACE_FUNCTION(OSReceiveMessage, LIBRARY_COREINIT, OSReceiveMessage), - REPLACE_FUNCTION(_Exit, LIBRARY_COREINIT, _Exit), }; uint32_t applicationendshook_function_replacements_size = sizeof(applicationendshook_function_replacements) / sizeof(function_replacement_data_t); \ No newline at end of file diff --git a/source/applicationendshook/applicationends_function_replacements.h b/source/applicationendshook/applicationends_function_replacements.h index 201fb93..94cda57 100644 --- a/source/applicationendshook/applicationends_function_replacements.h +++ b/source/applicationendshook/applicationends_function_replacements.h @@ -2,11 +2,14 @@ #include #include +#include #ifdef __cplusplus extern "C" { #endif +void CallHook(wums_hook_type_t type); + extern function_replacement_data_t applicationendshook_function_replacements[]; diff --git a/source/sdrefcount/sd_function_replacements.cpp b/source/sdrefcount/sd_function_replacements.cpp index 8099117..99bf8b1 100644 --- a/source/sdrefcount/sd_function_replacements.cpp +++ b/source/sdrefcount/sd_function_replacements.cpp @@ -1,10 +1,14 @@ #include "sd_function_replacements.h" +#include "applicationendshook/applicationends_function_replacements.h" #include "globals.h" #include "logger.h" #include #include DECL_FUNCTION(void, __PPCExit, uint32_t u1) { + CallHook(WUMS_HOOK_APPLICATION_ENDS); + CallHook(WUMS_HOOK_FINI_WUT_SOCKETS); + CallHook(WUMS_HOOK_FINI_WUT_DEVOPTAB); if (gSDMountRefCount > 0) { FSAInit(); auto client = FSAAddClient(nullptr);