API hook(with full source code).

i need API Hook Such as CreateProcess.
with full source code (not madshi).
plz! help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hello AFZDeveloper, you may want to give alot more information about what type of hook you want to use (or what you are trying to do). . . . if you want some full source code to be created. . . Here is an EE page with some code for a Keyboard hook

Slick, I guess AFZDev. is asking for some API (function) hijacking code!

AFZDeveloper, information on this topic are very rare. The guys who know how to do it often won't share their knowledge (of course).
I recommend to take a look at Jeffrey Richter's book and/or the Detour package at http://research.microsoft.com/ (both contain full VC++ source code).

I guess this is not a satisfing answer for you. But I really doubt you will ever get a full API hijacking Delphi example and as you can read in Jeffrey Richter's book there are many different circumstances you have to care about. It's not that easy as setting up a "WindowsHookEx()" ;-)

Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

I see AFZDeveloper in alot of questions here. . . who knows what he is asking for. . . . but he needs to give enough information to  get help for the problem
AFZDeveloperAuthor Commented:
such as madCodeHook but with source code.
There are many Hooks that can be installed on system, what kind of Hook do you need help?
AFZDeveloperAuthor Commented:
plz! more comment.

AFZDev., I would say you are the one who has to be more precise...
MadCodeHook is a collection of many different hook types + much low level stuff. You won't even find one collection written in any other language that contains all of this.
What are you aiming at? Is it a "just for fun" question or do you need a specific thing to be done?

> i need API Hook Such as CreateProcess.

Are you talking about CreateRemoteThread()???
> i need API Hook Such as CreateProcess.

CreateProcess API function is not a Hook function. If you mean to monitor any newly created process, then you may need to implement follow hook functions by using API call.

1. SetWindowsHookEx <--- Install a Hook function on system, all Hook functions must be implemented in a DLL.
2. Specify which system hook to install, Keyboard, Mouse, Message Filter, Journal playback...etc. Read Win32 API help in Delphi and look for "SetWindowsHookEx" API function.
3. UnHookWindowHookEx <------ Removes hook function from system and free its memory.

Im not going to tell you or write exact code here, coz Im a lazy guy. You have to learn it by yourself by read Win32 API Help file and hang your system for several times. (thats what i paid for my skills :-)
AFZDeveloperAuthor Commented:
yes, monitor any newly created process for example.
plz. send a source code for it.
>> MadCodeHook is a collection of many different hook types + much low level stuff. You won't even find one collection written in any other language that contains all of this.

Thanks, DaFox!   :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.