Closed chyyran closed 2 years ago
This is most likely not an issue with detour-rs as I'm doing the same thing here with no issues. I'm using windows-rs but maybe you can find something useful there and compare approaches. 🙂
I got the hook working with windows-rs
but not with winapi
. Might be a winapi
issue then.
@chyyran can you share the working example with Present
hooked?
Do you mind if I take your Present hook code above and add it under examples
to this library (e.g. detour-rs)?
Well the present hook above doesn't work. I can share my working code but it's been abstracted under a couple layers of macros and not license compatible with this detour-rs (MPL2).
@chyyran I adapted the code above to work by using windows-rs
as suggested. Can you give a permission to add it to examples?
Yes, you can use the code snippet linked in https://github.com/darfink/detour-rs/issues/29#issue-1126667018 under the terms of the MIT License
Trying the following trivial-ish example to test out hooking Direct3D11
Present
but the hooked application just hangs on call. "present" is never printed to stdout but the hooked application will hang indefinitely until manually closed. SEV just gives meAppHangB1
with no useful output. Function pointers seem to be fetched properly and target process and hook DLL is x64.I'm using dll-syringe to do my injection, which seemed to work for the MessageBox example. However unlike the MessageBox I get the function pointer to hook from the COM vtable as one would do in traditional hooking of COM interface methods.