TsudaKageyu / minhook

The Minimalistic x86/x64 API Hooking Library for Windows
http://www.codeproject.com/KB/winsdk/LibMinHook.aspx
Other
4.43k stars 898 forks source link

MinHook seems to be failing to read the instructions properly #108

Closed ThePixelGamer closed 1 year ago

ThePixelGamer commented 1 year ago

Hi I'm trying to hook this one function that looks like this image but for some reason MinHook is failing to understand that the instruction at C4 is 2 bytes long which results in this image Something to note I'm currently using the latest GitHub release and haven't tried using a build of master yet, if this is a duplicate feel free to close.

m417z commented 1 year ago

There's nothing wrong in this picture. MinHook is supposed to jump back to C6 when the original function is called through the pointer it returns. The byte at C5 (54 - push rsp) will just never be used. MinHook could patch it with a nop, but that's just extra work that can be avoided.

ThePixelGamer commented 1 year ago

Ah I see, I guess I should've examined the trampoline before posting this. Thanks for the clarification!