mirror of
https://github.com/wiiu-env/FunctionPatcherModule.git
synced 2025-01-07 23:50:44 +01:00
Check function patcher data struct before patching a function
This commit is contained in:
parent
cb8e963f71
commit
6c18efef54
@ -35,10 +35,12 @@ void writeDataAndFlushIC(CThread *thread, void *arg) {
|
||||
ICInvalidateRange((void *) (effective_address), 4);
|
||||
}
|
||||
|
||||
|
||||
void FunctionPatcherPatchFunction(function_replacement_data_t *replacements, uint32_t size) {
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
function_replacement_data_t *function_data = &replacements[i];
|
||||
if (function_data->VERSION != FUNCTION_REPLACEMENT_DATA_STRUCT_VERSION) {
|
||||
OSFatal("Failed to patch function. struct version mismatch");
|
||||
}
|
||||
/* Patch branches to it. */
|
||||
volatile uint32_t *space = function_data->replace_data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user