From 6c8d014550c85421f9d0414d5c9a69e4773bf081 Mon Sep 17 00:00:00 2001 From: Andrew Strelsky Date: Sat, 21 Oct 2023 14:11:24 -0400 Subject: [PATCH] fixed relocation mistake --- libhijacker/source/elf/elf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libhijacker/source/elf/elf.cpp b/libhijacker/source/elf/elf.cpp index 06f7b6d..a2a83cc 100644 --- a/libhijacker/source/elf/elf.cpp +++ b/libhijacker/source/elf/elf.cpp @@ -787,7 +787,7 @@ bool Elf::processRelocations() noexcept { if (libsym == 0) [[unlikely]] { return false; } - *faddr(rel->r_offset) = libsym + toFileOffset(rel->r_addend); + *faddr(rel->r_offset) = libsym + rel->r_addend; break; } case R_X86_64_GLOB_DAT: { @@ -804,7 +804,7 @@ bool Elf::processRelocations() noexcept { } case R_X86_64_RELATIVE: { // imagebase + addend - *faddr(rel->r_offset) = imagebase + toFileOffset(rel->r_addend); + *faddr(rel->r_offset) = toVirtualAddress(rel->r_addend); break; } case R_X86_64_JMP_SLOT: {