LM_HookCode
Places a hook/detour onto the addressfrom, redirecting it to the address to. Optionally generates a trampoline to call the original function.
Signature
Parameters
The address where the hook will be placed.
The address where the hook will jump to.
Optional pointer to an
lm_address_t variable that will receive a trampoline/gateway to call the original function. Pass LM_NULLPTR if you don’t need a trampoline.Returns
The amount of bytes occupied by the hook (aligned to the nearest instruction). Returns0 on failure.
Example
LM_HookCodeEx
Places a hook/detour onto the addressfrom in a remote process, redirecting it to the address to. Optionally generates a trampoline to call the original function in the remote process.
Signature
Parameters
The remote process to place the hook in.
The address where the hook will be placed in the remote process.
The address where the hook will jump to in the remote process.
Optional pointer to an
lm_address_t variable that will receive a trampoline/gateway to call the original function in the remote process. Pass LM_NULLPTR if you don’t need a trampoline.Returns
The amount of bytes occupied by the hook (aligned to the nearest instruction) in the remote process. Returns0 on failure.