Use OSDynLoad_IsModuleLoaded instead of OSDynLoad_Acquire and add missing call

This commit is contained in:
Maschell 2023-01-03 23:13:18 +01:00
parent 49ca0b803f
commit 241b5ba661
2 changed files with 4 additions and 3 deletions

View File

@ -33,7 +33,7 @@ void InitFunctionPointers(void) {
addr_OSDynLoad_FindExport = (void *) 0x0102B828; // 0200f428 - 0xFE3C00
addr_OSDynLoad_IsModuleLoaded = (void *) 0x0102A59C; // 0200e19c - 0xFE3C00
OSDynLoad_Acquire("coreinit.rpl", &handle);
OSDynLoad_IsModuleLoaded("coreinit.rpl", &handle);
uint32_t **value = 0;
OSDynLoad_FindExport(handle, 1, "MEMAllocFromDefaultHeap", (void **) &value);
@ -43,6 +43,9 @@ void InitFunctionPointers(void) {
OSDynLoad_FindExport(handle, 1, "MEMFreeToDefaultHeap", (void **) &value);
MEMFreeToDefaultHeap = *value;
#include "imports.h"
OSDynLoad_IsModuleLoaded("coreinit.rpl", &handle);
// override failed __rplwrap_exit find export
OSDynLoad_FindExport(handle, 0, "exit", (void **) &addr___rplwrap_exit);
}

View File

@ -31,8 +31,6 @@ IMPORT(OSSetThreadSpecific);
IMPORT(OSInitCond);
IMPORT(OSWaitCond);
IMPORT(OSSignalCond);
IMPORT(MEMAllocFromDefaultHeapEx);
IMPORT(MEMFreeToDefaultHeap);
IMPORT(OSSwapAtomic);
IMPORT(OSDynLoad_GetAllocator);
IMPORT(OSDynLoad_SetAllocator);