From 7526c7274a3c5290c17275be506e2ba0ea3510a3 Mon Sep 17 00:00:00 2001 From: Decaf Code Date: Tue, 13 Nov 2018 19:29:19 -0500 Subject: [PATCH] hook/table.c: Populate links from first match The loaded module list is kept in the order the modules are first loaded. Using the first loaded module (i.e. the EXE) will help ensure that multiple hook DLLs stack correctly. Previously the link was taken from the most-recently loaded module. --- hook/table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hook/table.c b/hook/table.c index 04afadb..a6a20d6 100644 --- a/hook/table.c +++ b/hook/table.c @@ -93,7 +93,7 @@ static void hook_table_apply_to_iid( sym = &syms[j]; if (hook_table_match_proc(&iate, sym)) { - if (sym->link != NULL) { + if (sym->link != NULL && *sym->link == NULL) { *sym->link = *iate.ppointer; }