diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-03-28 21:42:11 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-03-28 21:42:11 +0100 |
commit | 92edf92570a7d9b092370d8dc499a67997fa8137 (patch) | |
tree | 1409ab9d00d398430755e2b874cdacfba0490c52 /src/core/patcher.h | |
parent | fixes (diff) | |
parent | Merge pull request #364 from erorcun/erorcun (diff) | |
download | re3-92edf92570a7d9b092370d8dc499a67997fa8137.tar re3-92edf92570a7d9b092370d8dc499a67997fa8137.tar.gz re3-92edf92570a7d9b092370d8dc499a67997fa8137.tar.bz2 re3-92edf92570a7d9b092370d8dc499a67997fa8137.tar.lz re3-92edf92570a7d9b092370d8dc499a67997fa8137.tar.xz re3-92edf92570a7d9b092370d8dc499a67997fa8137.tar.zst re3-92edf92570a7d9b092370d8dc499a67997fa8137.zip |
Diffstat (limited to 'src/core/patcher.h')
-rw-r--r-- | src/core/patcher.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/core/patcher.h b/src/core/patcher.h index 3dfbb05c..2722b6fd 100644 --- a/src/core/patcher.h +++ b/src/core/patcher.h @@ -117,16 +117,10 @@ Nop(AT address, unsigned int nCount) Unprotect_internal(); } -template<typename AT, typename HT> inline void -InjectHook(AT address, HT hook, unsigned int nType=PATCH_NOTHING) +template <typename T> inline void +InjectHook(uintptr_t address, T hook, unsigned int nType = PATCH_NOTHING) { - uint32 uiHook; - _asm - { - mov eax, hook - mov uiHook, eax - } - InjectHook_internal((uint32)address, uiHook, nType); + InjectHook_internal(address, reinterpret_cast<uintptr_t>((void *&)hook), nType); } inline void ExtractCall(void *dst, uint32_t a) |