Use latest version of libfunctionpatcher

This commit is contained in:
Maschell 2022-05-08 20:43:03 +02:00
parent 93fb8f7d84
commit 59300aad22
2 changed files with 11 additions and 3 deletions

View File

@ -87,7 +87,7 @@ function_replacement_data_t function_replacements[] __attribute__((section(".dat
REPLACE_FUNCTION_VIA_ADDRESS(KiIsEffectiveRangeValid, 0xffee0d6c, 0xffee0d6c), REPLACE_FUNCTION_VIA_ADDRESS(KiIsEffectiveRangeValid, 0xffee0d6c, 0xffee0d6c),
REPLACE_FUNCTION_VIA_ADDRESS(IPCKDriver_ValidatePhysicalAddress, 0xfff0cb5c, 0xfff0cb5c), REPLACE_FUNCTION_VIA_ADDRESS(IPCKDriver_ValidatePhysicalAddress, 0xfff0cb5c, 0xfff0cb5c),
REPLACE_FUNCTION_VIA_ADDRESS(KiGetOrPutUserData, 0xffee0794, 0xffee0794), REPLACE_FUNCTION_VIA_ADDRESS(KiGetOrPutUserData, 0xffee0794, 0xffee0794),
REPLACE_FUNCTION(MEMFindContainHeap, LIBRARY_COREINIT, MEMFindContainHeap), REPLACE_FUNCTION(MEMFindContainHeap, LIBRARY_COREINIT, MEMFindContainHeap),
}; };
// clang-format on // clang-format on

View File

@ -1,8 +1,11 @@
#include "function_replacements.h" #include "function_replacements.h"
#include "logger.h"
#include "memory_mapping.h" #include "memory_mapping.h"
#include <coreinit/debug.h>
#include <function_patcher/function_patching.h> #include <function_patcher/function_patching.h>
#include <wums.h> #include <wums.h>
#ifdef DEBUG
#include "logger.h"
#endif
WUMS_MODULE_EXPORT_NAME("homebrew_memorymapping"); WUMS_MODULE_EXPORT_NAME("homebrew_memorymapping");
WUMS_MODULE_SKIP_INIT_FINI(); WUMS_MODULE_SKIP_INIT_FINI();
@ -13,11 +16,16 @@ WUMS_INITIALIZE(args) {
if (!ucSetupRequired) { if (!ucSetupRequired) {
return; return;
} }
ucSetupRequired = 0; ucSetupRequired = 0;
MemoryMapping_setupMemoryMapping(); MemoryMapping_setupMemoryMapping();
MemoryMapping_CreateHeaps(); MemoryMapping_CreateHeaps();
FunctionPatcherPatchFunction(function_replacements, function_replacements_size); for (uint32_t i = 0; i < function_replacements_size; i++) {
if (!FunctionPatcherPatchFunction(&function_replacements[i], nullptr)) {
OSFatal("homebrew_memorymapping: Failed to patch function");
}
}
} }
#ifdef DEBUG #ifdef DEBUG