mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-23 16:21:50 +01:00
Remove assembly from patcher.h
This commit is contained in:
parent
e7c18fc17f
commit
184a80cc3b
@ -117,16 +117,10 @@ Nop(AT address, unsigned int nCount)
|
|||||||
Unprotect_internal();
|
Unprotect_internal();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename AT, typename HT> inline void
|
template <typename T> inline void
|
||||||
InjectHook(AT address, HT hook, unsigned int nType=PATCH_NOTHING)
|
InjectHook(uintptr_t address, T hook, unsigned int nType = PATCH_NOTHING)
|
||||||
{
|
{
|
||||||
uint32 uiHook;
|
InjectHook_internal(address, reinterpret_cast<uintptr_t>((void *&)hook), nType);
|
||||||
_asm
|
|
||||||
{
|
|
||||||
mov eax, hook
|
|
||||||
mov uiHook, eax
|
|
||||||
}
|
|
||||||
InjectHook_internal((uint32)address, uiHook, nType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ExtractCall(void *dst, uint32_t a)
|
inline void ExtractCall(void *dst, uint32_t a)
|
||||||
|
@ -71,7 +71,7 @@ InjectHook_internal(uint32 address, uint32 hook, int type)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(ptrdiff_t*)(address + 1) = hook - address - 5;
|
*(ptrdiff_t*)(address + 1) = (uintptr_t)hook - (uintptr_t)address - 5;
|
||||||
if(type == PATCH_NOTHING)
|
if(type == PATCH_NOTHING)
|
||||||
VirtualProtect((void*)(address + 1), 4, protect[0], &protect[1]);
|
VirtualProtect((void*)(address + 1), 4, protect[0], &protect[1]);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user