From 769262a66c92c256d41ad067c20413ceee5e4b90 Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 5 Oct 2022 15:43:12 +0200 Subject: [PATCH] Rename gRPLData to gLoadedRPLData --- source/dynload/dynload.cpp | 8 +++---- .../dynload/dynload_function_replacements.cpp | 22 +++++++++---------- source/globals.cpp | 2 +- source/globals.h | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/dynload/dynload.cpp b/source/dynload/dynload.cpp index bb4877e..e6484c5 100644 --- a/source/dynload/dynload.cpp +++ b/source/dynload/dynload.cpp @@ -5,10 +5,10 @@ #include void initDynload() { - gRPLData = (LOADED_RPL *) malloc(sizeof(LOADED_RPL) * gModuleData->number_modules); - if (!gRPLData) { - DEBUG_FUNCTION_LINE_ERR("Failed to allocate gRPLData"); - OSFatal("AromaBaseModule: Failed to allocate gRPLData"); + gLoadedRPLData = (LOADED_RPL *) malloc(sizeof(LOADED_RPL) * gModuleData->number_modules); + if (!gLoadedRPLData) { + DEBUG_FUNCTION_LINE_ERR("Failed to allocate gLoadedRPLData"); + OSFatal("AromaBaseModule: Failed to allocate gLoadedRPLData"); } DEBUG_FUNCTION_LINE("Patch functions for dynload patches"); diff --git a/source/dynload/dynload_function_replacements.cpp b/source/dynload/dynload_function_replacements.cpp index 86e16f6..d1b3cb5 100644 --- a/source/dynload/dynload_function_replacements.cpp +++ b/source/dynload/dynload_function_replacements.cpp @@ -63,15 +63,15 @@ DECL_FUNCTION(LOADED_RPL *, LiFindRPLByName, char *name) { for (uint32_t i = 0; i < gModuleData->number_modules; i++) { auto *curModule = &gModuleData->modules[i]; if (strcmp(name, curModule->module_export_name) == 0) { - fileInfoBuffer.tlsModuleIndex = 0; - gRPLData[i].fileInfoBuffer = &fileInfoBuffer; // will be copied to the LiImportTracking array - gRPLData[i].loadStateFlags = 0x0; - gRPLData[i].entrypoint = 0x1; //needs to be != 0; - gRPLData[i].funcExports = (Export *) (FUNCTION_EXPORT_MAGIC + i); - gRPLData[i].numFuncExports = 1; - gRPLData[i].dataExports = (Export *) (DATA_EXPORT_MAGIC + i); - gRPLData[i].numDataExports = 1; - return &gRPLData[i]; + fileInfoBuffer.tlsModuleIndex = 0; + gLoadedRPLData[i].fileInfoBuffer = &fileInfoBuffer; // will be copied to the LiImportTracking array + gLoadedRPLData[i].loadStateFlags = 0x0; + gLoadedRPLData[i].entrypoint = 0x1; //needs to be != 0; + gLoadedRPLData[i].funcExports = (Export *) (FUNCTION_EXPORT_MAGIC + i); + gLoadedRPLData[i].numFuncExports = 1; + gLoadedRPLData[i].dataExports = (Export *) (DATA_EXPORT_MAGIC + i); + gLoadedRPLData[i].numDataExports = 1; + return &gLoadedRPLData[i]; } } return real_LiFindRPLByName(name); @@ -118,7 +118,7 @@ DECL_FUNCTION(Export *, LiBinSearchExport, Export *exports, int numExports, char DECL_FUNCTION(int32_t, LiFixupRelocOneRPL, LOADED_RPL *rpl, void *imports, uint32_t unknown) { auto rplAddress = (uint32_t) rpl; - if (rplAddress >= (uint32_t) &gRPLData[0] && rplAddress < (uint32_t) &gRPLData[gModuleData->number_modules]) { + if (rplAddress >= (uint32_t) &gLoadedRPLData[0] && rplAddress < (uint32_t) &gLoadedRPLData[gModuleData->number_modules]) { // Skip if this is our fake RPL return 0; } @@ -127,7 +127,7 @@ DECL_FUNCTION(int32_t, LiFixupRelocOneRPL, LOADED_RPL *rpl, void *imports, uint3 DECL_FUNCTION(int32_t, sCheckOne, LOADED_RPL *rpl) { auto rplAddress = (uint32_t) rpl; - if (rplAddress >= (uint32_t) &gRPLData[0] && rplAddress < (uint32_t) &gRPLData[gModuleData->number_modules]) { + if (rplAddress >= (uint32_t) &gLoadedRPLData[0] && rplAddress < (uint32_t) &gLoadedRPLData[gModuleData->number_modules]) { // Skip if this is our fake RPL return 0; } diff --git a/source/globals.cpp b/source/globals.cpp index 95daff6..59aef61 100644 --- a/source/globals.cpp +++ b/source/globals.cpp @@ -2,4 +2,4 @@ module_information_t *gModuleData __attribute__((section(".data"))) = NULL; int32_t gSDMountRefCount __attribute__((section(".data"))) = 0; -LOADED_RPL *gRPLData __attribute__((section(".data"))) = nullptr; \ No newline at end of file +LOADED_RPL *gLoadedRPLData __attribute__((section(".data"))) = nullptr; \ No newline at end of file diff --git a/source/globals.h b/source/globals.h index 2e577a4..fd68b33 100644 --- a/source/globals.h +++ b/source/globals.h @@ -3,4 +3,4 @@ extern module_information_t *gModuleData; extern int32_t gSDMountRefCount; -extern LOADED_RPL *gRPLData; \ No newline at end of file +extern LOADED_RPL *gLoadedRPLData; \ No newline at end of file