Features

Discover the main features and typical use cases of the plugin, including real-world scenarios where it shines.

PolyHook is a versatile and powerful C++ plugin designed to provide developers with an easy way to create dynamic function hooks for any call convention with pre and post callbacks. Built using the AsmJit machine code generation library and the Capstone Disassembler library, PolyHook enables dynamic function hooking for x86/ARM architecture with support for 32/64-bit modes on Windows and Linux platforms. It is designed for use with C++20 or later and is based on stevemk14ebr's PolyHook_2_0 library.

Key Features

1. Dynamic Function Hooking

  • Hook any function at runtime, regardless of its call convention.
  • Supports x86 and x64 architectures on Windows and Linux.

2. Pre and Post Callbacks

  • Easily add pre-call and post-call hooks to monitor or modify function behavior.
  • Execute custom logic before or after the original function is called.

3. Cross-Platform Compatibility

  • Works seamlessly on Windows and Linux.
  • Supports both 32-bit and 64-bit applications.

4. Built on AsmJit and Capstone

  • Utilizes the AsmJit library for dynamic machine code generation.
  • Leverages the Capstone Disassembler for precise instruction analysis.

5. Easy Integration

  • Designed for use with C++20 or later.
  • Simple and intuitive API for quick integration into your projects.

6. Customizable Hooks

  • Create hooks for specific functions or entire classes.
  • Modify function arguments or return values dynamically.

7. Lightweight and Efficient

  • Minimal overhead for high-performance applications.
  • Optimized for both speed and memory usage.

Use Cases

1. Game Modding

  • Hook game functions to add new features or modify existing behavior.
  • Create custom overlays, cheats, or debugging tools.

2. Software Debugging

  • Monitor function calls to diagnose issues or analyze performance.
  • Log function arguments and return values for debugging purposes.

3. Security Applications

  • Intercept and analyze function calls for security auditing.
  • Prevent unauthorized function execution or data access.

4. Plugin Development

  • Extend the functionality of existing applications by hooking into their APIs.
  • Create plugins for software that doesn't natively support extensibility.