Skip to content

Commit

Permalink
fixed condition in relative jump
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo committed Jun 8, 2024
1 parent b1f2eb0 commit a61712a
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)0xFFFFFFFF80000000) || (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 a61712a

Please sign in to comment.