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

Commit

Permalink
Merge pull request #10 from LightningMods/patch-1
Browse files Browse the repository at this point in the history
move imagebase printf
  • Loading branch information
Andrew Strelsky authored Sep 20, 2023
2 parents 7cc14bd + f17839f commit 49624a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libhijacker/source/elf/elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ static void correctRsp(dbg::Registers &regs) noexcept {
}

bool Elf::start(uintptr_t args) noexcept {
printf("imagebase: 0x%08llx\n", imagebase);
if (hijacker->getPid() == getpid()) {
auto fun = reinterpret_cast<int(*)(uintptr_t)>(imagebase + e_entry); // NOLINT(*)
bool res = fun(args) == 0;
Expand All @@ -700,7 +701,6 @@ bool Elf::start(uintptr_t args) noexcept {
(void) args;
dbg::Registers regs = tracer.getRegisters();
correctRsp(regs);
printf("imagebase: 0x%08llx\n", imagebase);
regs.rdi(args);
regs.rip(imagebase + e_entry);
tracer.setRegisters(regs);
Expand Down

0 comments on commit 49624a3

Please sign in to comment.