From 5a208621264cff4d4fe6f1d5f018b28ca43e88bd Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 7 Oct 2025 12:37:21 +0100 Subject: hookSystem: use a full trampo setup for hooks instead of planting a longjmp at the fn head, make a shortjmp to a launch trampo this helps with shortjmps that can be in the fn and will break when relocated. They are very unlikely to occur within the first 5 bytes (jmp rel32) but can happen in the first 10 or so (longjmp) fixes csgo-vk-fix on latest main with release building on gcc / clang --- src/plugins/HookSystem.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/plugins/HookSystem.hpp') diff --git a/src/plugins/HookSystem.hpp b/src/plugins/HookSystem.hpp index 95b4c972..cf098dd1 100644 --- a/src/plugins/HookSystem.hpp +++ b/src/plugins/HookSystem.hpp @@ -6,7 +6,7 @@ #include "../helpers/memory/Memory.hpp" #define HANDLE void* -#define HOOK_TRAMPOLINE_MAX_SIZE 64 +#define HOOK_TRAMPOLINE_MAX_SIZE 32 class CFunctionHook { public: @@ -24,13 +24,13 @@ class CFunctionHook { void* m_original = nullptr; private: - void* m_source = nullptr; - void* m_trampolineAddr = nullptr; - void* m_destination = nullptr; - size_t m_hookLen = 0; - size_t m_trampoLen = 0; - HANDLE m_owner = nullptr; - bool m_active = false; + void* m_source = nullptr; + void* m_launchTrampolineAddr = nullptr; + void* m_landTrampolineAddr = nullptr; + void* m_destination = nullptr; + size_t m_hookLen = 0; + HANDLE m_owner = nullptr; + bool m_active = false; std::vector m_originalBytes; -- cgit v1.2.3