mirror of
https://github.com/wiiu-env/WUMSLoader.git
synced 2025-01-12 08:19:07 +01:00
relocator: UseOSDynLoad_IsModuleLoaded instead of OSDynLoad_Acquire
This commit is contained in:
parent
7df0cf32f2
commit
42d73fa539
@ -12,8 +12,7 @@
|
||||
#undef IMPORT_END
|
||||
|
||||
#define IMPORT(name) do{if(OSDynLoad_FindExport(handle, 0, #name, &addr_##name) < 0)OSFatal("Function " # name " is NULL");} while(0)
|
||||
#define IMPORT_BEGIN(lib) OSDynLoad_Acquire(#lib ".rpl", &handle)
|
||||
/* #define IMPORT_END() OSDynLoad_Release(handle) */
|
||||
#define IMPORT_BEGIN(lib) do{if(OSDynLoad_IsModuleLoaded(#lib ".rpl", &handle) != OS_DYNLOAD_OK) OSFatal(#lib ".rpl is not loaded");} while(0)
|
||||
#define IMPORT_END()
|
||||
|
||||
#define EXPORT_VAR(type, var) type var __attribute__((section(".data")));
|
||||
@ -24,13 +23,15 @@ EXPORT_VAR(uint32_t *, pMEMFreeToDefaultHeap);
|
||||
|
||||
void InitFunctionPointers(void) {
|
||||
OSDynLoad_Module handle;
|
||||
addr_OSDynLoad_Acquire = (void *) 0x0102A3B4;
|
||||
addr_OSDynLoad_FindExport = (void *) 0x0102B828;
|
||||
addr_OSDynLoad_Acquire = (void *) 0x0102A3B4; // 0x0200dfb4 - 0xFE3C00
|
||||
addr_OSDynLoad_FindExport = (void *) 0x0102B828; // 0200f428 - 0xFE3C00
|
||||
addr_OSDynLoad_IsModuleLoaded = (void *) 0x0102A59C; // 0200e19c - 0xFE3C00
|
||||
|
||||
OSDynLoad_Acquire("coreinit.rpl", &handle);
|
||||
IMPORT_BEGIN(coreinit);
|
||||
OSDynLoad_FindExport(handle, 1, "MEMAllocFromDefaultHeapEx", (void **) &pMEMAllocFromDefaultHeapEx);
|
||||
OSDynLoad_FindExport(handle, 1, "MEMAllocFromDefaultHeap", (void **) &pMEMAllocFromDefaultHeap);
|
||||
OSDynLoad_FindExport(handle, 1, "MEMFreeToDefaultHeap", (void **) &pMEMFreeToDefaultHeap);
|
||||
IMPORT_END()
|
||||
|
||||
#include "imports.h"
|
||||
|
||||
|
@ -3,6 +3,7 @@ IMPORT_BEGIN(coreinit);
|
||||
|
||||
IMPORT(OSDynLoad_Acquire);
|
||||
IMPORT(OSDynLoad_FindExport);
|
||||
IMPORT(OSDynLoad_IsModuleLoaded);
|
||||
IMPORT(DCFlushRange);
|
||||
IMPORT(ICInvalidateRange);
|
||||
IMPORT(OSGetSystemInfo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user