-
Notifications
You must be signed in to change notification settings - Fork 893
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
detours vs minhook #88
Comments
Hello Luca, Whether you switch to MinHook or stick with Detours, there is a more flexible approach to hooking into the game than the one you are using. What you could do instead is use "DLL Injection". The idea of it is that you force the game to call LoadLibrary to load in your own custom DLL. From there, you can resume hooking game functions. I don't know much about Detours, but MinHook does have some functionality when it comes to finding memory space for the hook. We use MinHook constantly for virtualizing file systems, and it hasn't let us down. There is another alternative I can think of in your case: patching the game binary. It's a bit more annoying for the end-user, but gives you a lot of flexibility. You can patch in your own LoadLibrary, or just directly patch the game functions to add force feedback. If you want these changes to be resistant to updates, I recommend you use a disassembler library and create an auto-patcher. I unfortunately have no experience with that. Good luck! |
Hi Sam, Many thanks for your response !! I I have undestand for DLL injection you mean a thing simular this:
This code is present in my project that work fine and is missing in the project that not work. In short I need to proceed in this way:
and functions adress. I'am in the right way ?? |
Hi,
I have created a c++ complete project to hook GOG game and work perfectly (this add a unofficial Force Feedback support).
To to it I have found on github a custom version of d3d9.dll with with DllMain inside.
I have put in my code with detours with succefull hook the game without any problems.
Now I have used the some project to another GOG game but this time becouse there is no d3d9.dll inside I have used another github dll libogg.dll.
libogg don't have DllMain I have added it myself and my log confirm that both DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH was called correcly.
Unfortunatenly I have many ussue to to hook, many times the app crash in "DetourAttach" and when work (random) the hook don't seem work correcly.
I have do the some with zlib with the some result.
At the moment I don't have a prcise idea about why this happen.
Do you think it is a good idea switch to minhook ? Or my attemp is wrong ?
The text was updated successfully, but these errors were encountered: