Skip to content

jzyra/HookWinAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HookWinAPI

This library allows the implementation of interception functions to intercept calls to Windows system functions.
It enables developers to alter the behavior of system functions by injecting custom code.
This library allows you to produce DLL files that can be injected into Windows processes using tools such as: https://github.com/jzyra/inject-dll

Build

To compile this library, you must have MinGW installed and have the gcc.exe and ar.exe binaries in the PATH environment variable.
You must then run the following command:

make.bat

Functions

hook_init

Description : Allows initializing the hook on the Windows system function without activating it.

Prototype

struct hook_t * hook_init(const char * moduleName, const char * funcname, PVOID funcHook);

Arguments

  • moduleName (const char *): The name of the module (dll file) associated with the Windows system function that will be hooked.
  • funcname (const char *): The name of the Windows system function that will be hooked.
  • funcHook (PVOID): The pointer to the function that will be called instead of the Windows system function.

Return value

  • struct hook_t *: A pointer that represents the hook and that will allow the hook to be activated or deactivated.

hook_enable

Description : Enables the hook to be activated and the funcHook function (specified in hook_init) to be called instead of the funcname function (specified in hook_init).

Prototype

void hook_enable(struct hook_t *hook);

Arguments

  • hook (struct hook_t *): The structure returned during the initialization of the hook (hook_init).

hook_disable

Description : Disable the hook and call the funcname function (specified in hook_init) instead of the funcHook function (specified in hook_init).

Prototype

void hook_disable(struct hook_t *hook);

Arguments

  • hook (struct hook_t *): The structure returned during the initialization of the hook (hook_init).

hook_free

Description : Frees the memory allocated for the structure returned by the hook_init function.

Prototype

void hook_free(struct hook_t *hook);

Arguments

  • hook (struct hook_t *): The structure returned during the initialization of the hook (hook_init).

About

This library allows the implementation of interception functions to intercept calls to Windows system functions. It enables developers to alter the behavior of system functions by injecting custom code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors