-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add an option to let midhook call original first instead of calling hook code first #37
Comments
What you're trying to propose isn't intuitive in on itself, it would cause so much issues for no reason and the feature is entirely useless as you have already shown, you can just hook after the instruction was executed lol original_fn:
mov rcx, [rax+330h]
jmp hook_proxy
; continue_code_flow
hook_proxy:
jmp hooked_fn
; the instructions after this is what is executed after you call original in your hook
mov edx, 8003h ; original instructions that the library replaced
jmp continue_code_flow (also this isn't limited to mid function hooks XD) |
You are right about that. I saw the hooking library that Dalamud is using, found that the library has an option to let you choose the behavior and thought that was useful in some cases, hence I made this issue. |
For now, you could probably just hook in a different place or write your own stub with Xbyak to give yourself more control and access to more registers and such. |
Example:
Let's say I want to get the rcx register address, with the current implementation, I need to hook
mov edx, 8003h
to get rcx address, which is not that intuitive to me. If there is an option to make it call original first, then I just hookmov rcx, [rax+330h]
and grab the addressThe text was updated successfully, but these errors were encountered: