summaryrefslogtreecommitdiff
path: root/src/plugins/HookSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/HookSystem.cpp')
-rw-r--r--src/plugins/HookSystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp
index 8d47470b..59654816 100644
--- a/src/plugins/HookSystem.cpp
+++ b/src/plugins/HookSystem.cpp
@@ -356,7 +356,7 @@ uint64_t CHookSystem::getAddressForTrampo() {
const uint64_t PAGESIZE_VAR = sysconf(_SC_PAGE_SIZE);
const auto BASEPAGEADDR = seekNewPageAddr();
for (int attempt = 0; attempt < 2; ++attempt) {
- for (int i = 2; i >= 0; --i) {
+ for (int i = 0; i <= 2; ++i) {
const auto PAGEADDR = BASEPAGEADDR + i * PAGESIZE_VAR;
page->addr = (uint64_t)mmap((void*)PAGEADDR, PAGESIZE_VAR, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);