NO

Author Topic: Can you advise any WINAPI Hook lib?  (Read 4828 times)

Offline bitcoin

  • Member
  • *
  • Posts: 179
Can you advise any WINAPI Hook lib?
« on: September 04, 2020, 02:03:37 AM »
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?

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Can you advise any WINAPI Hook lib?
« Reply #1 on: September 04, 2020, 04:01:47 PM »

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: Can you advise any WINAPI Hook lib?
« Reply #2 on: September 04, 2020, 09:31:35 PM »
Hello,
I can't compile this code with Pelles , have error.
With VC++ it works good.

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Can you advise any WINAPI Hook lib?
« Reply #3 on: September 05, 2020, 02:30:02 PM »
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++.

I can't compile this code with Pelles , have error.

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

John Z

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: Can you advise any WINAPI Hook lib?
« Reply #4 on: September 05, 2020, 03:22:16 PM »
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!


Offline algernon_77

  • Member
  • *
  • Posts: 33
Re: Can you advise any WINAPI Hook lib?
« Reply #5 on: September 05, 2020, 11:47:23 PM »
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!

 

Offline bitcoin

  • Member
  • *
  • Posts: 179
Re: Can you advise any WINAPI Hook lib?
« Reply #6 on: September 06, 2020, 09:28:27 PM »
algernon_77, thank you! This works good!