• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

Global function hook...

My question is how to globally hook some function from any other dll (kernel32, user32, winsock). I watched madCodeHook but it allows me only to hook a function in one process only. And it would be fine if it worked on W2k/XP too ;-))

I offer +500 points for a complete solution...
Lukasz Lach
Lukasz Lach
  • 2
  • 2
1 Solution
So you want to hook into the Windows API globally?  Sounds like a RootKit.  ;-)  Check out http://rootkit.com/ for some examples, with source code.  Not in Delphi, but the API's are the same.
Lukasz LachAuthor Commented:
Madshi i know you can ;-)
You can use the latest beta version of madCodeHook which supports system wide dll injection in both 9x and NT families. This way you can quite easily realize system wide API hooking. Here's the download:


Here are some demos which demonstrate how you can use madCodeHook to do system wide API hooking:


Regards, Madshi.
Lukasz LachAuthor Commented:
It is realy cool, but I have one problem while compiling the dll:

  DllProc := @HandleEvents;
  DllProc(DLL_PROCESS_ATTACH); // -> Missing operator or semicolon

I'm using D5, in my case
var DllProc: Pointer
 in SysUtils
Oh, interesting, thanks for the hint. Then please change it to:


I'll change it in my sources, too.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now