Rename gRPLData to gLoadedRPLData

This commit is contained in:
Maschell 2022-10-05 15:43:12 +02:00
parent 74d1c74b94
commit 769262a66c
4 changed files with 17 additions and 17 deletions

View File

@ -5,10 +5,10 @@
#include <malloc.h>
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");

View File

@ -64,14 +64,14 @@ DECL_FUNCTION(LOADED_RPL *, LiFindRPLByName, char *name) {
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];
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;
}

View File

@ -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;
LOADED_RPL *gLoadedRPLData __attribute__((section(".data"))) = nullptr;

View File

@ -3,4 +3,4 @@
extern module_information_t *gModuleData;
extern int32_t gSDMountRefCount;
extern LOADED_RPL *gRPLData;
extern LOADED_RPL *gLoadedRPLData;