summaryrefslogtreecommitdiffstats
path: root/src/core/patcher.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-03-28 21:42:11 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-03-28 21:42:11 +0100
commit92edf92570a7d9b092370d8dc499a67997fa8137 (patch)
tree1409ab9d00d398430755e2b874cdacfba0490c52 /src/core/patcher.h
parentfixes (diff)
parentMerge pull request #364 from erorcun/erorcun (diff)
downloadre3-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.h12
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)