Skip to main content
Hook một target function bằng replacement function và trả về cloned copy của original target closure. Cả hai arguments phải là functions. Function trước tiên flush pending C function swaps, cloning target qua function cloning, thêm replacement closure hoặc mapped newcclosure target của nó vào hidden stack tracking, gọi FixCallstack cho target và cloned original, rồi patch target closure qua C closure, Luau closure hoặc newcclosure-specific path. Nếu target chưa có trong hook records, cloned original được lưu ở đó cho restorefunction. Returned function là cloned original closure.

Cú pháp

Alias

  • hookfunc
  • replaceclosure
  • detourfunction
  • detour_function

Đối số

Giá trị trả về

Ví dụ

Patch a function closure and keep a cloned original.