mirror of
https://github.com/wiiu-env/FunctionPatcherModule.git
synced 2024-11-16 06:49:23 +01:00
Fix patching of functions that only consist of one branch instruction outside of nn::acp
This commit is contained in:
parent
9752595fa9
commit
0638573094
@ -36,16 +36,14 @@ uint32_t FunctionAddressProvider::getEffectiveAddressOfFunction(function_replace
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((library == LIBRARY_NN_ACP) && (uint32_t) (*(volatile uint32_t *) (real_addr) &0x48000002) == 0x48000000) {
|
uint32_t realAddrData = *((volatile uint32_t *) real_addr);
|
||||||
auto address_diff = (uint32_t) (*(volatile uint32_t *) (real_addr) &0x03FFFFFC);
|
|
||||||
if ((address_diff & 0x03000000) == 0x03000000) {
|
if ((realAddrData & 0xFC000003) == 0x48000000) {
|
||||||
address_diff |= 0xFC000000;
|
auto address_diff = (uint32_t) (realAddrData & 0x01FFFFFC);
|
||||||
|
if ((realAddrData & 0x02000000) == 0x02000000) {
|
||||||
|
address_diff = 0xFE000000 + address_diff;
|
||||||
}
|
}
|
||||||
real_addr += (int32_t) address_diff;
|
real_addr += (int32_t) address_diff;
|
||||||
if ((uint32_t) (*(volatile uint32_t *) (real_addr) &0x48000002) == 0x48000000) {
|
|
||||||
DEBUG_FUNCTION_LINE_ERR("Error");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return real_addr;
|
return real_addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user