summaryrefslogtreecommitdiffstats
path: root/src/core/patcher.h
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-03-29 17:39:47 +0200
committerGitHub <noreply@github.com>2020-03-29 17:39:47 +0200
commita0b077574e95e49ad845a6c9dc1af906b17277f9 (patch)
treede9f8dbd0e3c06ffbb95b13c0637dfc3db3873c1 /src/core/patcher.h
parentstyle & cosmetic fixes (diff)
parentMerge pull request #367 from Sergeanur/wrappers_cleanup (diff)
downloadre3-a0b077574e95e49ad845a6c9dc1af906b17277f9.tar
re3-a0b077574e95e49ad845a6c9dc1af906b17277f9.tar.gz
re3-a0b077574e95e49ad845a6c9dc1af906b17277f9.tar.bz2
re3-a0b077574e95e49ad845a6c9dc1af906b17277f9.tar.lz
re3-a0b077574e95e49ad845a6c9dc1af906b17277f9.tar.xz
re3-a0b077574e95e49ad845a6c9dc1af906b17277f9.tar.zst
re3-a0b077574e95e49ad845a6c9dc1af906b17277f9.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)