hookSystem: fix anchoring in seekNewPageAddr()
otherwise we might miss the chance to get an anchor
This commit is contained in:
parent
dc72259a54
commit
c3747fab56
2 changed files with 9 additions and 7 deletions
|
|
@ -71,6 +71,8 @@ void Debug::log(eLogLevel level, std::string str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// log it to the stdout too.
|
// log it to the stdout too.
|
||||||
if (!m_disableStdout)
|
if (!m_disableStdout) {
|
||||||
std::println("{}", ((m_coloredLogs && !**m_coloredLogs) ? str : coloredStr));
|
std::println("{}", ((m_coloredLogs && !**m_coloredLogs) ? str : coloredStr));
|
||||||
|
std::fflush(stdout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,7 @@ bool CFunctionHook::unhook() {
|
||||||
m_hookLen = 0;
|
m_hookLen = 0;
|
||||||
m_trampoLen = 0;
|
m_trampoLen = 0;
|
||||||
m_trampolineAddr = nullptr; // no unmapping, it's managed by the HookSystem
|
m_trampolineAddr = nullptr; // no unmapping, it's managed by the HookSystem
|
||||||
|
m_original = nullptr;
|
||||||
m_originalBytes.clear();
|
m_originalBytes.clear();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -305,12 +306,6 @@ static uintptr_t seekNewPageAddr() {
|
||||||
lastStart = start;
|
lastStart = start;
|
||||||
lastEnd = end;
|
lastEnd = end;
|
||||||
continue;
|
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);
|
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;
|
return lastEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!anchoredToHyprland && line.contains("Hyprland")) {
|
||||||
|
Debug::log(LOG, "seekNewPageAddr: Anchored to hyprland at 0x{:x}", start);
|
||||||
|
anchoredToHyprland = true;
|
||||||
|
}
|
||||||
|
|
||||||
lastStart = start;
|
lastStart = start;
|
||||||
lastEnd = end;
|
lastEnd = end;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue