-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Detour successful, but hook modification not applied #93
Comments
You are immediately destructing the hook object which unhooks the target. move the PLH::x64Detour object to global scope |
Like this?
|
PolyHook_2_0/polyhook2/Detour/ADetour.hpp Line 75 in e4601b1
|
I got this:
Code doesnt even reach "if hooked" state. |
You are not using C++ correctly. uptrTest->hook() is how you invoke a virtual method of a base class, the uptrTest->Detour is nonsense |
How then this function should be done? |
Dude seriously go learn how object oriented programming and C++ in general works. I already showed you how it works.
|
But if it's in global scope, fnAddress is 0. Later in some place im filling it using GetProcAddress. It's first time when I have to use unique_ptr, new and virtual functions / methods so those kind of solutions are just new for me.
|
You need to delay initialization of the object then. You can do that like this:
|
Should I create new issue? When it reach the end of OpenglInit function, targeted program just crashing. When changing fnAddress to other (from ptr to *ptr, which will not hit my targeted function) it doesnt crash. Maybe "protection" or sth like that (no anticheat). Or maybe function arguments is wrong here, fnCallback which is (char*)&hwglSwapBuffers. |
No, please debug it and find the root cause. If you can create a simple reproduction and an explanation of the root cause then I can fix any potential bugs. I don't have the time or will to walk you through this libraries usage |
Hey, I tried to Hook wglSwapBuffers (changing from MinHook to PolyHook, so nothing can get wrong huh), but ye - got hooked and literally nothing changed In process asm and it just doesnt work.
Used
vcpkg.exe install polyhook2:x64-windows-static
to install this.Then added
VcpkgTriplet
in .vcxproj file.. Changed to Multi-threaded..The text was updated successfully, but these errors were encountered: