summaryrefslogtreecommitdiffstats
path: root/src/core/patcher.h
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-03-27 21:20:28 +0100
committerFilip Gawin <filip.gawin@zoho.com>2020-03-27 21:25:39 +0100
commit184a80cc3b7ecd054f09ec5519fded5fb4efa162 (patch)
treea2bff32a40052ee9740c82f88e403f003c3d03ad /src/core/patcher.h
parentremoved windows.h for most .cpps (diff)
downloadre3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.tar
re3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.tar.gz
re3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.tar.bz2
re3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.tar.lz
re3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.tar.xz
re3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.tar.zst
re3-184a80cc3b7ecd054f09ec5519fded5fb4efa162.zip
Diffstat (limited to '')
-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)