Skip to content

Commit

Permalink
fix the compile
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Jun 2, 2024
1 parent 108812c commit 759d8e4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/generator/X64Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ std::vector<uint8_t> X64HandlerGenerator::handlerBytes(uint64_t address) {
restoreReturnRegisters(a, returnPreservedSize);

// done!
a.add(RSP, 0x10)
a.add(RSP, 0x10);
a.pop(RBP);
a.ret();

Expand Down Expand Up @@ -249,8 +249,7 @@ Result<> X64HandlerGenerator::relocateRIPInstruction(cs_insn* insn, uint8_t* buf
case X86_REG_R13: reg = R13; break;
case X86_REG_R14: reg = R14; break;
case X86_REG_R15: reg = R15; break;
case X86_REG_RIP: reg = RIP; break;
default: goto fail;
default: break;
};
};

Expand Down Expand Up @@ -323,7 +322,7 @@ Result<> X64HandlerGenerator::relocateRIPInstruction(cs_insn* insn, uint8_t* buf

a.label("absolute-pointer");
// it's bad but umm better than the alternative of double indirection
a.write64(*static_cast<uint64_t*>(absolute));
a.write64(*reinterpret_cast<uint64_t*>(absolute));

a.updateLabels();

Expand All @@ -346,7 +345,7 @@ Result<> X64HandlerGenerator::relocateRIPInstruction(cs_insn* insn, uint8_t* buf

a.label("absolute-pointer");
// it's bad but umm better than the alternative of double indirection
a.write64(*static_cast<uint64_t*>(absolute));
a.write64(*reinterpret_cast<uint64_t*>(absolute));

a.label("skip-pointer");

Expand Down

0 comments on commit 759d8e4

Please sign in to comment.