Expand description
§ghook-macros
Procedural macros for the ghook modding framework.
This crate provides the compile-time code generation that powers ghook:
#[hookable]– marks game functions as interceptable#[prefix]– defines a hook that runs before the original#[postfix]– defines a hook that runs after the original#[replace]– defines a hook that replaces the original#[mod_info]– embeds mod metadata in the binary#[mod_init]– marks the mod’s entry pointuse_game_hooks!– auto-generates types from game binary
§Note
This crate is a proc-macro crate and cannot be used directly. Import these
macros through ghook-sdk instead:
ⓘ
use ghook_sdk::*; // Re-exports all macros§License
Licensed under the Mozilla Public License 2.0.
§Author
Semyon Tsarev
Macros§
- use_
game_ hooks - Reads a game binary and auto-generates hook argument/result types.
Attribute Macros§
- hookable
- Marks a function as hookable by mods.
- mod_
info - Embeds mod metadata into a dedicated binary section.
- mod_
init - Marks a function as the mod’s initialization entry point.
- postfix
- Defines a postfix hook that runs after the original function.
- prefix
- Defines a prefix hook that runs before the original function.
- replace
- Defines a replace hook that completely substitutes the original function.