Skip to content

Commit

Permalink
fixed linux module injection on i686
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Apr 17, 2024
1 parent 26167b4 commit e34b29d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/linux/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e34b29d

Please sign in to comment.