-
Notifications
You must be signed in to change notification settings - Fork 639
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
Static version of EasyHook DLL #260
base: master
Are you sure you want to change the base?
Conversation
Additionally it should be added, that this makes remote injection impossible with current implementation, since it injects the .exe instead of the EasyHook32/64 dll and probably more complicated things I can't talk about |
@tmeckel i compiled your static branch successfully, however in my inject app by default it doesn't find the function Then when I set
|
Try to replace the #if with #ifdef And ensure that EASYHOOK_STATIC is defined when you compile your program. |
@tmeckel I was re-reading the article you linked in Codeproject, and the guy mentioned something about I added
Now it compiled, however, I did not understand how do you attach the dll to the target process when I call:
Returns: |
@pepeu93 I don't know your exact solution setup, but as I described in the initial Pull Request description you have to add the two following statements to you main method (C++ or C program obviously) EasyHookAttach();
<...>
EasyHookDetach(); After #ifndef _M_X64
#ifdef _DEBUG
#pragma comment(lib, "EasyHook32SD.lib")
#else
#pragma comment(lib, "EasyHook32S.lib")
#endif
#else
#ifdef _DEBUG
#pragma comment(lib, "EasyHook64SD.lib")
#else
#pragma comment(lib, "EasyHook64S.lib")
#endif
#endif The |
In a project I had the requirement to link EasyHook statically.
The pull request contains alll changes to build EsayHook as a static link library instead of a DLL.
I know using the static version of EasyHook with .NET this makes no sense, but using it a native project with C or C++ it's very valuable for not having to deliver the correct EasyHook.DLL with created program.
To use the static version calll the following methods in the main() function (normally this handled by the DllMain method, when the EasyHook DLL is loaded or unloaded into a process).
My work is based on the excellent article of Jerry Wang at Codeproject