diff --git a/source/main.cpp b/source/main.cpp index c8e9624..2d13f9e 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -9,13 +9,13 @@ #include "plugin/PluginContainerPersistence.h" #include "PluginManagement.h" #include "utils/logger.h" +#include "hooks.h" WUMS_MODULE_EXPORT_NAME("homebrew_wupsbackend"); std::vector loadPlugins(const std::vector &pluginList, MEMHeapHandle heapHandle); WUMS_INITIALIZE(args) { - __init_wut(); WHBLogUdpInit(); gModuleData = args.module_information; @@ -26,11 +26,15 @@ WUMS_INITIALIZE(args) { OSFatal("WUPS-Backend: The module information struct version does not match."); } WHBLogPrintf("Init successful"); - __fini_wut(); +} + +WUMS_APPLICATION_ENDS() { + DEBUG_FUNCTION_LINE("Call hooks"); + CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_END); + CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB); } WUMS_APPLICATION_STARTS() { - __init_wut(); WHBLogUdpInit(); uint32_t upid = OSGetUPID(); if (upid != 2 && upid != 15) { diff --git a/source/patcher/hooks_patcher_static.cpp b/source/patcher/hooks_patcher_static.cpp index eae3611..32c7336 100644 --- a/source/patcher/hooks_patcher_static.cpp +++ b/source/patcher/hooks_patcher_static.cpp @@ -255,12 +255,7 @@ DECL_FUNCTION(uint32_t, OSReceiveMessage, OSMessageQueue *queue, OSMessage *mess if (message->args[0] == 0xFACEF000) { CallHook(gPluginInformation, WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND); } else if (message->args[0] == 0xD1E0D1E0) { - CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_END); - CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB); - __fini_wut(); - //gInBackground = false; - //DCFlushRange(&gInBackground,4); - //unmount_sd_fat("sd"); + // Implemented via WUMS Hook } } lastData0 = message->args[0];