2022-08-25 12:58:35 +02:00
|
|
|
#include "applicationendshook/applicationendhook.h"
|
|
|
|
#include "dynload/dynload.h"
|
|
|
|
#include "globals.h"
|
|
|
|
#include "logger.h"
|
2022-09-07 01:08:35 +02:00
|
|
|
#include "patches/patches.h"
|
2022-08-25 12:58:35 +02:00
|
|
|
#include "sdrefcount/refcount.h"
|
|
|
|
#include "symbolnamepatcher/symbolname.h"
|
2022-09-19 13:06:52 +02:00
|
|
|
#include "version.h"
|
2023-01-06 20:35:40 +01:00
|
|
|
#include <function_patcher/function_patching.h>
|
2022-08-25 12:58:35 +02:00
|
|
|
#include <wums.h>
|
|
|
|
|
|
|
|
WUMS_MODULE_EXPORT_NAME("homebrew_basemodule");
|
|
|
|
WUMS_MODULE_SKIP_INIT_FINI();
|
2023-01-06 20:35:40 +01:00
|
|
|
WUMS_DEPENDS_ON(homebrew_functionpatcher);
|
2022-08-25 12:58:35 +02:00
|
|
|
|
2023-07-31 09:35:57 +02:00
|
|
|
#define VERSION "v0.2.4"
|
2022-09-19 13:06:52 +02:00
|
|
|
|
2022-08-25 12:58:35 +02:00
|
|
|
WUMS_INITIALIZE(args) {
|
|
|
|
initLogging();
|
|
|
|
gModuleData = args.module_information;
|
|
|
|
if (gModuleData == nullptr) {
|
|
|
|
OSFatal("AromaBaseModule: Failed to get gModuleData pointer.");
|
|
|
|
}
|
|
|
|
if (gModuleData->version != MODULE_INFORMATION_VERSION) {
|
|
|
|
OSFatal("AromaBaseModule: The module information struct version does not match.");
|
|
|
|
}
|
|
|
|
|
2023-01-06 20:35:40 +01:00
|
|
|
// First init Dynload to have proper OSDynLoad support!
|
|
|
|
initDynload();
|
|
|
|
|
|
|
|
// Now init the library so we can use it for the other patches.
|
|
|
|
if (FunctionPatcher_InitLibrary() != FUNCTION_PATCHER_RESULT_SUCCESS) {
|
|
|
|
OSFatal("homebrew_basemodule: FunctionPatcher_InitLibrary failed");
|
|
|
|
}
|
|
|
|
|
2022-08-25 12:58:35 +02:00
|
|
|
initApplicationEndsHook();
|
|
|
|
initSDRefCount();
|
|
|
|
initSymbolNamePatcher();
|
2023-01-06 20:35:40 +01:00
|
|
|
|
2022-09-07 01:08:35 +02:00
|
|
|
initCommonPatches();
|
2022-08-25 12:58:35 +02:00
|
|
|
|
|
|
|
deinitLogging();
|
|
|
|
}
|
2022-09-07 01:08:35 +02:00
|
|
|
|
|
|
|
WUMS_APPLICATION_STARTS() {
|
2022-09-19 13:06:52 +02:00
|
|
|
OSReport("Running AromaBaseModule " VERSION VERSION_EXTRA "\n");
|
|
|
|
|
2022-09-07 01:08:35 +02:00
|
|
|
commonPatchesStart();
|
|
|
|
}
|