summaryrefslogtreecommitdiff
path: root/src/plugins/HookSystem.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-10-07 01:44:03 +0100
committerVaxry <vaxry@vaxry.net>2025-10-07 01:44:03 +0100
commitc3747fab5615ede222559a00501160773b82a2c2 (patch)
tree3d4df67847b34411b9592c39191763c84d28e209 /src/plugins/HookSystem.cpp
parentdc72259a5443116e892c49e37552ca5f82525ca6 (diff)
hookSystem: fix anchoring in seekNewPageAddr()
otherwise we might miss the chance to get an anchor
Diffstat (limited to 'src/plugins/HookSystem.cpp')
-rw-r--r--src/plugins/HookSystem.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp
index dccb4cd0..242b8d30 100644
--- a/src/plugins/HookSystem.cpp
+++ b/src/plugins/HookSystem.cpp
@@ -245,6 +245,7 @@ bool CFunctionHook::unhook() {
m_hookLen = 0;
m_trampoLen = 0;
m_trampolineAddr = nullptr; // no unmapping, it's managed by the HookSystem
+ m_original = nullptr;
m_originalBytes.clear();
return true;
@@ -305,12 +306,6 @@ static uintptr_t seekNewPageAddr() {
lastStart = start;
lastEnd = end;
continue;
- } else if (!anchoredToHyprland) {
- Debug::log(LOG, "seekNewPageAddr: Anchored to hyprland at 0x{:x}", start);
- anchoredToHyprland = true;
- lastStart = start;
- lastEnd = end;
- continue;
}
Debug::log(LOG, "seekNewPageAddr: found gap: 0x{:x}-0x{:x} ({} bytes)", lastEnd, start, start - lastEnd);
@@ -318,6 +313,11 @@ static uintptr_t seekNewPageAddr() {
return lastEnd;
}
+ if (!anchoredToHyprland && line.contains("Hyprland")) {
+ Debug::log(LOG, "seekNewPageAddr: Anchored to hyprland at 0x{:x}", start);
+ anchoredToHyprland = true;
+ }
+
lastStart = start;
lastEnd = end;
}