mirror of
https://github.com/wiiu-env/FunctionPatcherModule.git
synced 2024-11-17 15:29:23 +01:00
Reset the cached function handle if RPL has been unloaded
This commit is contained in:
parent
e51e6a9509
commit
ac0c341eb4
@ -67,3 +67,12 @@ function_replacement_library_type_t FunctionAddressProvider::getTypeForHandle(OS
|
||||
return LIBRARY_OTHER;
|
||||
}
|
||||
|
||||
bool FunctionAddressProvider::resetHandle(OSDynLoad_Module handle) {
|
||||
for (auto &rplHandle : rpl_handles) {
|
||||
if (rplHandle.handle == handle) {
|
||||
rplHandle.handle = nullptr;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ public:
|
||||
|
||||
function_replacement_library_type_t getTypeForHandle(OSDynLoad_Module toReset);
|
||||
|
||||
bool resetHandle(OSDynLoad_Module handle);
|
||||
|
||||
std::list<rpl_handling> rpl_handles = {
|
||||
{LIBRARY_AVM, "avm.rpl", nullptr},
|
||||
{LIBRARY_CAMERA, "camera.rpl", nullptr},
|
||||
|
@ -106,6 +106,7 @@ void notify_callback(OSDynLoad_Module module,
|
||||
}
|
||||
}
|
||||
}
|
||||
gFunctionAddressProvider->resetHandle(module);
|
||||
CheckIfPatchedFunctionsAreStillInMemory();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user