エイリアス
restorefuncrestoreclosure
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
内部で function hook operation を呼び出して function を復元または置き換え、values は返しません。first argument は function である必要があります。function argument が 1 つの場合、function は the saved original function を検索します。entry が存在しない場合は “Function is not hooked” を発生させます。その後、hooked closure と stored original closure で function hook operation を呼び出し、Lua stack をクリアし、stored original が使われた場合は restored closure を hook records から削除します。second argument も function の場合、function は firstFunction をインストールする original function、secondFunction を patch する closure として扱います。この形式では、保存された hook records 値に対する missing-original check は行われません。保存された値は final remove check でのみ比較されます。 にのみ使われます。non-function second arguments は branch condition によって無視されます。restorefunc と restoreclosure は同じ function の aliases です。
restorefunction(firstFunction: function, secondFunction?: function)
restorefuncrestoreclosurelocal function target()
return "original"
end
hookfunction(target, function()
return "hooked"
end)
print(target())
restorefunction(target)
print(target())