Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fixed relocation mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Strelsky committed Oct 21, 2023
1 parent 0c2a223 commit 6c8d014
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libhijacker/source/elf/elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ bool Elf::processRelocations() noexcept {
if (libsym == 0) [[unlikely]] {
return false;
}
*faddr<uintptr_t*>(rel->r_offset) = libsym + toFileOffset(rel->r_addend);
*faddr<uintptr_t*>(rel->r_offset) = libsym + rel->r_addend;
break;
}
case R_X86_64_GLOB_DAT: {
Expand All @@ -804,7 +804,7 @@ bool Elf::processRelocations() noexcept {
}
case R_X86_64_RELATIVE: {
// imagebase + addend
*faddr<uintptr_t*>(rel->r_offset) = imagebase + toFileOffset(rel->r_addend);
*faddr<uintptr_t*>(rel->r_offset) = toVirtualAddress(rel->r_addend);
break;
}
case R_X86_64_JMP_SLOT: {
Expand Down

0 comments on commit 6c8d014

Please sign in to comment.