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

Fix detour issue on x64 #97

Merged
merged 11 commits into from
Apr 28, 2021
Merged

Conversation

randydu
Copy link
Contributor

@randydu randydu commented Apr 25, 2021

  • fix indirect-CALL (0xFF15) trampoline code patching issue;
    It only needs a dest-holder to specify its destination, no extra JMP needed.
  • adds a new detour scheme (in-place) for quick hooking speed and stability;
    the code-cave scheme is a bit slow when hooking many apis, also the code-cave, according to my tests on low memory machine (Win7/x64, 1GB ram), can be modified (or even unmapped from process memory) after hooking, the cave-searching algorithm needs improvement to make sure the code-cave lives in a non-volatile safe place.

polyhook2/Detour/ADetour.hpp Outdated Show resolved Hide resolved
sources/CapstoneDisassembler.cpp Show resolved Hide resolved
@stevemk14ebr
Copy link
Owner

If you are able to resolve the two comments I have I will merge your PR quickly. I appreciate your contribution and your drive to find the root cause issue on your own bug! I wish more people did this, model contributor right here!

- fix a code-cave-pattern (NOP2_RET) too small issue that can corrupt code;
  (ref: memset.asm)
@stevemk14ebr stevemk14ebr merged commit 9713567 into stevemk14ebr:master Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants