hookSystem: fix anchor point for mmap
This commit is contained in:
parent
bbb83317c0
commit
ee5d05f0fc
1 changed files with 6 additions and 8 deletions
|
|
@ -172,7 +172,7 @@ bool CFunctionHook::hook() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (rc<int64_t>(m_source) - rc<int64_t>(m_destination) > 2000000000 /* 2 GB */) {
|
||||
if (std::abs(rc<int64_t>(m_source) - rc<int64_t>(m_destination)) > 2000000000 /* 2 GB */) {
|
||||
Debug::log(ERR, "[functionhook] failed, source and dest are over 2GB apart");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -312,8 +312,11 @@ static uintptr_t seekNewPageAddr() {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (start - lastEnd > PAGESIZE_VAR * 2) {
|
||||
if (!line.contains("Hyprland") && !anchoredToHyprland) {
|
||||
if (!anchoredToHyprland && line.contains("Hyprland")) {
|
||||
Debug::log(LOG, "seekNewPageAddr: Anchored to hyprland at 0x{:x}", start);
|
||||
anchoredToHyprland = true;
|
||||
} else if (start - lastEnd > PAGESIZE_VAR * 2) {
|
||||
if (!anchoredToHyprland) {
|
||||
Debug::log(LOG, "seekNewPageAddr: skipping gap 0x{:x}-0x{:x}, not anchored to Hyprland code pages yet.", lastEnd, start);
|
||||
lastStart = start;
|
||||
lastEnd = end;
|
||||
|
|
@ -325,11 +328,6 @@ 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue