diff --git a/src/inline_hook.cpp b/src/inline_hook.cpp index dea6a81..784f0cb 100644 --- a/src/inline_hook.cpp +++ b/src/inline_hook.cpp @@ -262,7 +262,7 @@ std::expected 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(ix.raw.imm[0].value.s); }