Skip to content

Commit

Permalink
fixed condition for x64 rel jump
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Jun 8, 2024
1 parent 5de4352 commit b1f2eb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/arch/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ generate_hook_payload(lm_address_t from, lm_address_t to, lm_size_t bits, lm_byt

relative_addr = to - from - sizeof(jump32);

if (bits == 64 && ((int64_t)relative_addr < (int64_t)0xFFFFFFFF00000000) || (int64_t)relative_addr > (int64_t)0x7FFFFFFF) {
if (bits == 64 && ((int64_t)relative_addr < (int64_t)0xFFFFFFFF80000000) || (int64_t)relative_addr > (int64_t)0x7FFFFFFF) {
size = sizeof(jump64);
payload = (lm_byte_t *)jump64;
*(uint64_t *)(&jump64[6]) = (uint64_t)to;
Expand Down

0 comments on commit b1f2eb0

Please sign in to comment.