mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-22 04:39:17 +01:00
Actually read the target process from the plugin while function patching
This commit is contained in:
parent
ce73ac48e0
commit
c76edf09c4
@ -23,11 +23,12 @@
|
|||||||
class FunctionData {
|
class FunctionData {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FunctionData(void *paddress, void *vaddress, const std::string &name, function_replacement_library_type_t library, void *replaceAddr, void *replaceCall) {
|
FunctionData(void *paddress, void *vaddress, const std::string &name, function_replacement_library_type_t library, void *replaceAddr, void *replaceCall, FunctionPatcherTargetProcess targetProcess) {
|
||||||
this->paddress = paddress;
|
this->paddress = paddress;
|
||||||
this->vaddress = vaddress;
|
this->vaddress = vaddress;
|
||||||
this->name = name;
|
this->name = name;
|
||||||
this->library = library;
|
this->library = library;
|
||||||
|
this->targetProcess = targetProcess;
|
||||||
this->replaceAddr = replaceAddr;
|
this->replaceAddr = replaceAddr;
|
||||||
this->replaceCall = replaceCall;
|
this->replaceCall = replaceCall;
|
||||||
}
|
}
|
||||||
@ -60,11 +61,16 @@ public:
|
|||||||
return replaceCall;
|
return replaceCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FunctionPatcherTargetProcess getTargetProcess() const {
|
||||||
|
return targetProcess;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void *paddress = NULL;
|
void *paddress = NULL;
|
||||||
void *vaddress = NULL;
|
void *vaddress = NULL;
|
||||||
std::string name;
|
std::string name;
|
||||||
function_replacement_library_type_t library;
|
function_replacement_library_type_t library;
|
||||||
|
FunctionPatcherTargetProcess targetProcess;
|
||||||
void *replaceAddr = NULL;
|
void *replaceAddr = NULL;
|
||||||
void *replaceCall = NULL;
|
void *replaceCall = NULL;
|
||||||
};
|
};
|
||||||
|
@ -113,7 +113,7 @@ bool PluginContainerPersistence::savePlugin(plugin_information_t *pluginInformat
|
|||||||
function_data->replaceCall = (uint32_t) curFunction.getReplaceCall();
|
function_data->replaceCall = (uint32_t) curFunction.getReplaceCall();
|
||||||
function_data->physicalAddr = (uint32_t) curFunction.getPhysicalAddress();
|
function_data->physicalAddr = (uint32_t) curFunction.getPhysicalAddress();
|
||||||
function_data->virtualAddr = (uint32_t) curFunction.getVirtualAddress();
|
function_data->virtualAddr = (uint32_t) curFunction.getVirtualAddress();
|
||||||
function_data->targetProcess = FP_TARGET_PROCESS_GAME_AND_MENU;
|
function_data->targetProcess = curFunction.getTargetProcess();
|
||||||
|
|
||||||
plugin_data->info.number_used_functions++;
|
plugin_data->info.number_used_functions++;
|
||||||
i++;
|
i++;
|
||||||
@ -250,7 +250,7 @@ std::vector<PluginContainer> PluginContainerPersistence::loadPlugins(plugin_info
|
|||||||
|
|
||||||
for (uint32_t j = 0; j < functionReplaceCount; j++) {
|
for (uint32_t j = 0; j < functionReplaceCount; j++) {
|
||||||
function_replacement_data_t *entry = &(plugin_data->info.functions[j]);
|
function_replacement_data_t *entry = &(plugin_data->info.functions[j]);
|
||||||
FunctionData func((void *) entry->physicalAddr, (void *) entry->virtualAddr, entry->function_name, (function_replacement_library_type_t) entry->library, (void *) entry->replaceAddr, (void *) entry->replaceCall);
|
FunctionData func((void *) entry->physicalAddr, (void *) entry->virtualAddr, entry->function_name, (function_replacement_library_type_t) entry->library, (void *) entry->replaceAddr, (void *) entry->replaceCall, entry->targetProcess);
|
||||||
pluginInformation.addFunctionData(func);
|
pluginInformation.addFunctionData(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ std::optional<PluginInformation> PluginInformationFactory::load(const PluginData
|
|||||||
DEBUG_FUNCTION_LINE("Saving function \"%s\" of plugin . PA:%08X VA:%08X Library: %08X, target: %08X, call_addr: %08X", cur_function->_function.name/*,pluginData.getPluginInformation()->getName().c_str()*/,
|
DEBUG_FUNCTION_LINE("Saving function \"%s\" of plugin . PA:%08X VA:%08X Library: %08X, target: %08X, call_addr: %08X", cur_function->_function.name/*,pluginData.getPluginInformation()->getName().c_str()*/,
|
||||||
cur_function->_function.physical_address, cur_function->_function.virtual_address, cur_function->_function.library, cur_function->_function.target, (void *) cur_function->_function.call_addr);
|
cur_function->_function.physical_address, cur_function->_function.virtual_address, cur_function->_function.library, cur_function->_function.target, (void *) cur_function->_function.call_addr);
|
||||||
FunctionData function_data((void *) cur_function->_function.physical_address, (void *) cur_function->_function.virtual_address, cur_function->_function.name, (function_replacement_library_type_t) cur_function->_function.library,
|
FunctionData function_data((void *) cur_function->_function.physical_address, (void *) cur_function->_function.virtual_address, cur_function->_function.name, (function_replacement_library_type_t) cur_function->_function.library,
|
||||||
(void *) cur_function->_function.target, (void *) cur_function->_function.call_addr);
|
(void *) cur_function->_function.target, (void *) cur_function->_function.call_addr, (FunctionPatcherTargetProcess) cur_function->_function.targetProcess);
|
||||||
pluginInfo.addFunctionData(function_data);
|
pluginInfo.addFunctionData(function_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user