Aliases
restorefuncrestoreclosure
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Restaura ou substitui uma function chamando function hook operation internamente e não retorna values. O first argument deve ser uma function. Com um function argument, a function procura the saved original function; se nenhum entry existir, gera “Function is not hooked”. Em seguida chama function hook operation com a hooked closure e a stored original closure, limpa o Lua stack e remove a restored closure de hook records quando a stored original foi usada. Se o second argument também for uma function, a function trata firstFunction como a original function a instalar e secondFunction como a closure a corrigir. Nessa forma, nenhum missing-original check e feito contra o valor armazenado em hook records; o valor armazenado e apenas comparado durante o final remove check. Non-function second arguments são ignorados pela branch condition. restorefunc e restoreclosure são aliases da mesma function.
restorefunction(firstFunction: function, secondFunction?: function)
restorefuncrestoreclosurelocal function target()
return "original"
end
hookfunction(target, function()
return "hooked"
end)
print(target())
restorefunction(target)
print(target())