summaryrefslogtreecommitdiff
path: root/src/plugins/HookSystem.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-06-19 11:58:07 +0200
committerVaxry <vaxry@vaxry.net>2025-06-19 11:58:12 +0200
commite999ad664da97d066e30e1d2749061eb57b0e19a (patch)
tree03af1e211727d173125982a8ef7803d7b8a327f2 /src/plugins/HookSystem.hpp
parent9fb6b5d96bfd242990b1bf08bd42d24bed8fb4bc (diff)
hookSystem: avoid using manual mem management, fix leak
fixes #10790
Diffstat (limited to 'src/plugins/HookSystem.hpp')
-rw-r--r--src/plugins/HookSystem.hpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/HookSystem.hpp b/src/plugins/HookSystem.hpp
index 801d950e..95b4c972 100644
--- a/src/plugins/HookSystem.hpp
+++ b/src/plugins/HookSystem.hpp
@@ -2,6 +2,7 @@
#include <string>
#include <vector>
+#include <cstddef>
#include "../helpers/memory/Memory.hpp"
#define HANDLE void*
@@ -23,15 +24,15 @@ 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_originalBytes = nullptr;
+ 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;
+
+ std::vector<unsigned char> m_originalBytes;
struct SInstructionProbe {
size_t len = 0;