From e34b29d3224e6d8182bd77b654b8c82e4ac9651e Mon Sep 17 00:00:00 2001 From: rdbo Date: Wed, 17 Apr 2024 08:42:40 -0300 Subject: [PATCH] fixed linux module injection on i686 --- src/linux/module.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/linux/module.c b/src/linux/module.c index b7004489..92fa77ce 100644 --- a/src/linux/module.c +++ b/src/linux/module.c @@ -215,11 +215,11 @@ LM_LoadModuleEx(const lm_process_t *process, ptlib.args[0] = path_addr; ptlib.args[1] = RTLD_LAZY; if (process->bits == 64) { - *(int32_t *)&ptlib.stack[0] = (int32_t)RTLD_LAZY; - *(uint64_t *)&ptlib.stack[4] = (uint64_t)path_addr; + *(uint64_t *)&ptlib.stack[0] = (uint64_t)path_addr; + *(int32_t *)&ptlib.stack[4] = (int32_t)RTLD_LAZY; } else { - *(int32_t *)&ptlib.stack[0] = (int32_t)RTLD_LAZY; - *(uint32_t *)&ptlib.stack[4] = (uint64_t)path_addr; + *(uint32_t *)&ptlib.stack[0] = (uint64_t)path_addr; + *(int32_t *)&ptlib.stack[4] = (int32_t)RTLD_LAZY; } if (ptrace_attach(process->pid))