Alias
restorefuncrestoreclosure
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Khôi phục hoặc thay thế function bằng cách gọi function hook operation bên trong và không trả về values. First argument phải là function. Với một function argument, function tìm the saved original function; nếu không có entry thì tạo “Function is not hooked”. Sau đó gọi function hook operation với hooked closure và stored original closure, xóa Lua stack, và xóa restored closure khỏi hook records khi stored original đã được dùng. Nếu second argument cũng là function, function thay vào đó coi firstFunction là original function cần cài đặt và secondFunction là closure cần patch. O dang nay, khong thuc hien missing-original check voi gia tri hook records da luu; gia tri da luu chi duoc so sanh trong final remove check. Non-function second arguments bị branch condition bỏ qua. restorefunc và restoreclosure là aliases cho cùng function.
restorefunction(firstFunction: function, secondFunction?: function)
restorefuncrestoreclosurelocal function target()
return "original"
end
hookfunction(target, function()
return "hooked"
end)
print(target())
restorefunction(target)
print(target())