General

For Borland Delphi users

For Microsoft VC users

For Borland C++ users

Contact and feedback

License and redistribute

For newbies



General

What's CodeHook?    Top

CodeHook 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?    Top

Just 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?    Top

No. 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?    Top

Yes. 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?    Top

http://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?    Top

MPL 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'"?    Top

You 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".