summaryrefslogtreecommitdiffstats
path: root/src/core/patcher.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-03-28 20:01:18 +0100
committerGitHub <noreply@github.com>2020-03-28 20:01:18 +0100
commit8623bc97526a2b16ba48f3626722efed2892f539 (patch)
tree57bd1356ad4a104bc61045579bfc0b82ca101433 /src/core/patcher.h
parentMerge pull request #363 from erorcun/erorcun (diff)
parentCleanup patching system (diff)
downloadre3-8623bc97526a2b16ba48f3626722efed2892f539.tar
re3-8623bc97526a2b16ba48f3626722efed2892f539.tar.gz
re3-8623bc97526a2b16ba48f3626722efed2892f539.tar.bz2
re3-8623bc97526a2b16ba48f3626722efed2892f539.tar.lz
re3-8623bc97526a2b16ba48f3626722efed2892f539.tar.xz
re3-8623bc97526a2b16ba48f3626722efed2892f539.tar.zst
re3-8623bc97526a2b16ba48f3626722efed2892f539.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)