Yuari
Documentation
Docs/Oth/oth.hook

oth.hook

Installs a low-level function hook.

Syntax

oth.hook(target: any, hook: function) -> nil

Parameters

ParameterTypeDescription
targetanyThe function or object being targeted.
hookfunctionThe replacement callback that receives the original arguments.

Returns

TypeDescription
nilThis function does not return a value.

Description

oth.hook is part of the Oth library. Oth works at the raw hook layer. It installs function hooks, exposes their handles and provides trampoline calls.

The hook affects future calls. Keep the returned original or handle if you need to delegate calls or undo the change later.

Example

local handle = oth.hook(print, function(...) return end)
print(handle)

Notes

  • Raw hooks bypass closure-level safety; always keep the returned handle so you can unhook.