Skip to content

Commit

Permalink
InlineHook: Fix target check
Browse files Browse the repository at this point in the history
  • Loading branch information
cursey committed Jan 1, 2025
1 parent de83823 commit 9bdcb47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inline_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ std::expected<void, InlineHook::Error> InlineHook::e9_hook(const std::shared_ptr
auto new_disp = target_address - (tramp_ip + 6);

// Handle the case where the target is now in the trampoline.
if (target_address < m_target + m_original_bytes.size()) {
if (target_address >= m_target && target_address < m_target + m_original_bytes.size()) {
new_disp = static_cast<ptrdiff_t>(ix.raw.imm[0].value.s);
}

Expand Down

0 comments on commit 9bdcb47

Please sign in to comment.