summaryrefslogtreecommitdiff
path: root/src/plugins/HookSystem.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-11-16 12:01:48 +0000
committerGitHub <noreply@github.com>2025-11-16 12:01:48 +0000
commit9b006b2c8533bae1e528bd123be209453787b9b7 (patch)
tree4814be71407fe676feac5fd1e8debb8987c0add5 /src/plugins/HookSystem.hpp
parentb35f78431f5a8cec1df1ff8595b239fcb0ba3e4c (diff)
plugin/hook: disallow multiple hooks per function (#12320)
this was never safe. After recent changes, it's become even less so. Just disallow it. ref #11992
Diffstat (limited to 'src/plugins/HookSystem.hpp')
-rw-r--r--src/plugins/HookSystem.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/HookSystem.hpp b/src/plugins/HookSystem.hpp
index cf098dd1..3431e8c8 100644
--- a/src/plugins/HookSystem.hpp
+++ b/src/plugins/HookSystem.hpp
@@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include <cstddef>
+#include <unordered_set>
#include "../helpers/memory/Memory.hpp"
#define HANDLE void*
@@ -70,7 +71,8 @@ class CHookSystem {
uint64_t used = 0;
};
- std::vector<SAllocatedPage> m_pages;
+ std::vector<SAllocatedPage> m_pages;
+ std::unordered_set<uint64_t> m_activeHooks;
friend class CFunctionHook;
};