Skip to content
New issue

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

Support for relocation of RIP-relative instructions in FunctionHook #35

Open
alexrp opened this issue Jul 21, 2022 · 2 comments
Open

Support for relocation of RIP-relative instructions in FunctionHook #35

alexrp opened this issue Jul 21, 2022 · 2 comments
Labels
area: hooking Issues related to the function hooking APIs. cpu: x86 64 Issues that are specific to x86 (64-bit). state: approved Feature requests and housekeeping tasks that have been approved. type: feature Issues that are classified as feature requests.
Milestone

Comments

@alexrp
Copy link
Sponsor Member

alexrp commented Jul 21, 2022

This is quite a difficult problem to solve, but it is possible. Instructions that use RIP-relative displacements have to be rewritten to equivalent sequences using absolute addresses. The tricky part is picking a volatile scratch register to use in the rewritten code that won't conflict with the original code.

@alexrp alexrp added state: approved Feature requests and housekeeping tasks that have been approved. type: feature Issues that are classified as feature requests. area: hooking Issues related to the function hooking APIs. labels Jul 21, 2022
@alexrp alexrp added this to the v2.0 milestone Jul 21, 2022
@alexrp alexrp self-assigned this Jul 21, 2022
@alexrp
Copy link
Sponsor Member Author

alexrp commented Jul 22, 2022

Until this problem is properly solved, we could factor the displacements used in prologue instructions into our code placement. That should be fairly simple to do.

@alexrp alexrp modified the milestones: v2.0, v3.0 Jul 23, 2022
@alexrp alexrp added the cpu: x86 64 Issues that are specific to x86 (64-bit). label Dec 14, 2023
@alexrp alexrp removed their assignment Jan 27, 2024
@alexrp alexrp modified the milestones: v4.0, Future Apr 30, 2024
@alexrp
Copy link
Sponsor Member Author

alexrp commented Apr 30, 2024

This feature is a major undertaking, to the point that it will probably be the main theme of a major release. And that's assuming I ever get around to it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: hooking Issues related to the function hooking APIs. cpu: x86 64 Issues that are specific to x86 (64-bit). state: approved Feature requests and housekeeping tasks that have been approved. type: feature Issues that are classified as feature requests.
Development

No branches or pull requests

1 participant