Using Easyhook static lib directly from an EXE

Apr 23, 2014 at 4:08 PM
Edited Apr 23, 2014 at 4:09 PM
Hi everyone,

I very new to Easyhook 2.6 and trying to use it in an unmanaged C++ EXE application using VStudio.

I compile EasyHookDLL and the UnmanagedHook sample. Everything works fine.

Since I can't distribute a DLL with my application, I need to convert EasyHookDLL to a static lib.

I followed this article:
http://www.codeproject.com/Tips/481976/Statically-linking-to-EasyHook

Unfortunately, it doesn't say how to use it directly from the EXE, but instead from another DLL.

When I try to use the static lib without the initialization in DLLMain, the EXE crash at:
// register in global HLS list
RtlAcquireLock(&GlobalHookLock);
Does anybody know if it is possible to compile EasyHook into a static lib and then use it directly from the UnmanagedHook sample?

Any help is welcome!

Thanks

htome
Jun 27, 2014 at 12:51 PM
Hi, htome :). Seems you should call EasyHookDllmain from your WinMain() or _main() function once. All internals of EaseHook are initialized... and it's should work.