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

Not an issue but a huge THANK YOU :) #1

Open
adaber opened this issue May 18, 2021 · 0 comments
Open

Not an issue but a huge THANK YOU :) #1

adaber opened this issue May 18, 2021 · 0 comments

Comments

@adaber
Copy link

adaber commented May 18, 2021

Hey Kyle,

I just want to thank you for your "X64 Function Hooking by Example" article. It helped me a lot doing some 64-bit game hacking for fun. I've initially done it using Cheat Engine but wanted to create and inject my own DLL.

Got stuck on the fact that Visual C++ does not support inline assembly for x64 as well as some other differences between x32 and x64 in general (jumps...). Your article helped a lot with the "jump" problem. I really like the solution you presented (relative jump from the hooked function to the Relay function and absolute jump to the PayLoad function).

What I ended up doing differently, compared to your example, was that I included the instruction whose bytes got corrupted by the relative jump and its "nopED" bytes and the change (hack) in my pure asm Payload function that is a part of my C++ project. I also then made an absolute jump back from the Payload to the hooked function right after the included corrupted instruction. And it worked ! :) Haven't fully looked at your Trampoline code, that uses the Capstone library, since I wanted to get my modification(hack) to work first as proof of concept.

I hope you don't mind if I point out something in your code :)

In Full Code for Example 2 (click to expand), your

InstallHook (void* targetFunction, void* payloadFunction) function never uses the input arguments (targetFunction and payloadFunction). It's not a big deal since you just directly calculate a pointer to targetFunction and use NullPaint3DButtonHandler in the WriteAbsoluteJump64(relayFuncMemory, NullPaint3DButtonHandler) step but I thought you might've overlooked that since you already pass the void pointers to targetFunction and payloadFunction that you use in InstallHook....Hope this makes sense :)

Anyways, thanks again for such a great article and keep up the great work !

Ada

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

No branches or pull requests

1 participant