- 1, What's CodeHook?
- 2, How to integrate Win32 CodeHook to my project?
- 3, How to know if a target function has been hooked?
For Borland Delphi users
For Microsoft VC users
- 1, Can I static link the code to my program?
- 2, When I hook a class member function, why I always get crash?
For Borland C++ users
Contact and feedback
- 1, Where is the official CodeHook website?
- 2, Who is the original author of CodeHook?
- 3, How to contact the original author?
License and redistribute
- 1, What's the license of Win32 CodeHook?
- 2, I've improved the code, can I redistribute the modified code to others?
For newbies
General
What's CodeHook? TopCodeHook is a code library to hook APIs.
How to integrate Win32 CodeHook to my project? Top
You can read the tutorial for more information.
How to know if a target function has been hooked? Top
Call ICodeHook.FindHookHandleFromTarget. If the return value is INVALID_CODEHOOK_HANDLE, the target function has not been hooked.
However, if you use IDirectCodeHook directly instead of ICodeHook or ICodeHookHelper, it is your responsibility to maintain the information of which target functions have been hooked.
For Borland Delphi users
Can I static link the code to my program? TopJust put CodeHook in the "uses" section and call GetCodeHookIntf in CodeHook.pas.
For Microsoft VC users
Can I static link the code to my program? TopNo. VC only supports COFF format object files and library files. The format generated by Delphi is OMF, and I can't convert the .obj and .lib files to COFF format.
When I hook a class member function, why I always get crash? Top
Please keep in mind, the default calling convention of VC class member function is "thiscall" (pass "this" pointer in ECX) which isn't supported by Win32 CodeHook, so if you can modify to source code to be hooked, change the calling convention to stdcall or cdecl, otherwise, you need to use the raw mode hook.
For Borland C++ users
Can I static link the code to my program? TopYes. You only need to link to CodeHook_bc.lib.
For BCB users, I even guess you can use the .dcu files directly in your C++ code but I haven't tested it.
Contact and feedback
Where is the official CodeHook website? Tophttp://www.kbasm.com/
Who is the original author of CodeHook? Top
Wang Qi (family name: Wang), from China, Beijing.
How to contact the original author? Top
Send mail to "kbasm.com AT gmail D.O.T com".
Or go to the forum http://www.kbasm.com/forum/
Bug report, feature request, or any discussion on CodeHook, are welcome.
License and redistribute
What's the license of Win32 CodeHook? TopMPL 1.1.
You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html
I've improved the code, can I redistribute the modified code to others? Top
Yes, according to the license. But you are highly recommended and encouraged to send the modified code to the original author. The reason is simple. The original author may decide to include the improvement in the "official" release to improve CodeHook's quality.
For newbies
After adding "CodeHookIntf" to the "uses" clause, why Delphi reports error that "File not found: 'CodeHookIntf.dcu'"? TopYou need to add the path where CodeHook source sits in to your project search path.
In Delphi IDE, click menu Projects then Options, in the pop up dialog, switch to the "Directories and Conditionals" tab, then add the path of CodeHook\Source to the "Search path".