-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Description
First, thank you for creating such an excellent hooking library. I've spent some time learning how to use DynoHook, which works well in most scenarios. However, I was wondering if there's a way to use it without specifying an ICallingConvention with parameter qualification.
In certain cases where we don't need to specify function parameters (e.g., when hooking mid-execution flow at a specific code location rather than at function entry), DynoHook doesn't appear to support this use case optimally.
Proposed Use Case: Mid-Function Hooking
- Use Zydis + user-defined signatures(scan code) to identify hook locations (typically before
callorjmpinstructions) - Hook exactly once at the target location without affecting all call points
- Pass a lambda callback that can:
- Access pre-interrupt context (registers/stack pointers)
- Flexibly modify original function behavior
Reference Implementation
This technique (known as mid-function hooking) is implemented in the SafetyHook project, which was designed with this capability in mind. An excellent article detailing this approach can be found here: SafetyHook: Mid-Function Hooking - Aixxe's Blog
SafetyHook repository: https://github.com/cursey/safetyhook
Feature Request
Could mid-function hooking support be added to DynoHook? I'd appreciate your insights on:
- Implementation feasibility
- Potential design approaches
- Roadmap considerations
Once again, thank you for maintaining DynoHook — it's a fantastic project, and I really appreciate your work!