|
-
April 24th, 2005, 06:15 PM
#1
API Hooking question
I want to hook some APIs. I has some questions when reading the article on codeguru website
http://www.codeguru.com/Cpp/W-P/dll...ticle.php/c127/
The sample in that article is to hook DirectDrawCreate function in DDRAW.dll, and change it with his own function in his own dll. I am just wondering why he set a global WH_CBT hook but with a callback function doing nothing (just do CallNextHookEx).
When I made some mouse hook or keyborad hook, I always did my work in the callback function, so I am confused that why we changed when do API hooking.
Thanks in advance!
-
April 24th, 2005, 08:34 PM
#2
Re: API Hooking question
That link didn't take me anywhere so I'm guessing.
He probably create a WH_CBT hook to create an instance of his dll in every process. This would be nessisary if you were trying to hook every call to an api
The Strawdog's out in the street
-
April 25th, 2005, 08:12 AM
#3
Re: API Hooking question
Sorry about the link. it is:
HTML Code:
<a href=http://www.codeguru.com/Cpp/W-P/dll/hooking/article.php/c127/>api hooking </a>
I think you are right. So to use WH_CBT hook is just make a chance to create the dll instance for very processes. the hook itself is not essential, and I might use some other types of global hook such as WH_GETMESSAGE hook to do the same job. Am I right? Thank you!
Last edited by olin; April 25th, 2005 at 08:16 AM.
-
April 25th, 2005, 01:47 PM
#4
Re: API Hooking question
From the link
This code is intended to be included in a DLL inserted through a global Windows Hook (CBT hook for example).
looks like I guessed right
The Strawdog's out in the street
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|