Skip to main content
Hook une target function avec une replacement function et renvoie une cloned copy de l’original target closure. Les deux arguments doivent être des functions. L’function flush d’abord les pending C function swaps, clone le target with function cloning, ajoute la replacement closure ou son mapped newcclosure target à hidden stack tracking, appelle FixCallstack pour target et cloned original, puis patch la target closure with le C closure, Luau closure ou newcclosure-specific path. Si target n’est pas déjà dans hook records, le cloned original y est stocké pour restorefunction. La returned function est la cloned original closure.

Syntaxe

Alias

  • hookfunc
  • replaceclosure
  • detourfunction
  • detour_function

Arguments

Retours

Exemple

Patch a function closure and keep a cloned original.