We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
safetyhook/src/inline_hook.cpp
Lines 260 to 284 in de83823
I'm creating a MidHook at the address 00000001004751AC, which has the following instructions:
MidHook
00000001004751AC
00000001004751AC 72 AE jb short 10047515C 00000001004751AE 48 8D BD E0F8FFFF lea rdi, [rbp-720h]
this ends up emitting the trampoline:
00000000FFFF0327 0F82 AEFFFFFF jb FFFF02DB 00000000FFFF032D 48 8D BD E0F8FFFF lea rdi, [rbp-720h] 00000000FFFF0334 E9 7C4E4800 jmp 1004751B5
The jb here did not get resolved properly (it should be a relative jmp to 000000010047515C).
jb
000000010047515C
target_address < m_target + m_original_bytes.size()
ends up being
000000010047515C < 00000001004751B5
So I'm guessing that check should actually be:
target_address >= m_target && target_address < m_target + m_original_bytes.size()
The text was updated successfully, but these errors were encountered:
Sounds like a reasonable fix to me.
Sorry, something went wrong.
@gibbed can you try #87 and let me know if it actually fixes the issue you've described?
Yeah, it does. Though you've missed the check for unconditional jumps.
https://github.com/cursey/safetyhook/pull/87/files#diff-b109456f39b67560bebff92603a5d7152ce3a5188182bc84c231e6c3e7019f7cL278
Successfully merging a pull request may close this issue.
safetyhook/src/inline_hook.cpp
Lines 260 to 284 in de83823
I'm creating a
MidHook
at the address00000001004751AC
, which has the following instructions:this ends up emitting the trampoline:
The
jb
here did not get resolved properly (it should be a relative jmp to000000010047515C
).target_address < m_target + m_original_bytes.size()
ends up being
000000010047515C < 00000001004751B5
So I'm guessing that check should actually be:
target_address >= m_target && target_address < m_target + m_original_bytes.size()
The text was updated successfully, but these errors were encountered: