Can you advise any WINAPI Hook lib?

Started by bitcoin, September 04, 2020, 02:03:37 AM

Previous topic - Next topic

bitcoin

Can you advise any Winapi hooking library?

I try Microsoft Detours, MinHook - but all this need C++ or C in Visual Studio..

How library can use with Pelles C?


bitcoin

Hello,
I can't compile this code with Pelles , have error.
With VC++ it works good.

John Z

Hi,

Are you saying you can't compile the library or DLL sources or just the usage examples?
The DLL and Library sources are in straight C and even compile under MinGW so they do not need C++.

Quote from: bitcoin on September 04, 2020, 09:31:35 PM
I can't compile this code with Pelles , have error.

Doesn't really give any information to be able to help you....

John Z

bitcoin

I compile DLL with VC++, because there are project (.sln) for Studio.
Then I try to build my DLL with .lib file , and have such error https://forum.pellesc.de/index.php?topic=9804.msg32897#msg32897

Can you give me a project (Pelles C), that works?

My code you can see in attach, it compile good, but not build!


algernon_77

Hello there!

I compiled MinHook from sources using VS2019 Community, but changed a few thigs in projects properties (no function level linking, no linktime code generation, compile as C, and possibly more :-) )
Then I opened your project, copied MinHook dll and import library and it works now. You have both projects attached below. The initial linker error may have had something to do with COMDAT section from the default MinHook lib build, but I'm not sure, to be honest. Hope it helps!


bitcoin

algernon_77, thank you! This works good!