Skip to main content
Replaces the behavior of a target function with a replacement function and returns a callable copy of the original behavior. Both arguments must be functions.

Syntax

Aliases

  • hookfunc
  • replaceclosure
  • detourfunction
  • detour_function

Arguments

Returns

Example

Patch a function closure and keep a cloned original.