From 57c19c17e9e239e1b54fd3d1e811e7e5c6edcf38 Mon Sep 17 00:00:00 2001 From: Dmitriy Goncharov Date: Thu, 12 Dec 2024 12:41:01 +0700 Subject: [PATCH] Fixed the search for the region closest to the function --- src/os_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os_unix.c b/src/os_unix.c index 65150d2..02b7099 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -416,7 +416,7 @@ void *funchook_resolve_func(funchook_t *funchook, void *func) if ((void*)lm->l_addr <= func) { if (lmap == NULL) { lmap = lm; - } else if (lmap->l_addr > lm->l_addr) { + } else if (lmap->l_addr < lm->l_addr) { lmap = lm; } }