Verschlüsse prüfen, erstellen, klonen und ersetzen.
Verfügbare Funktionen
checkcaller
Gibt zurück, ob der current Luau thread in Real caller context vorhanden ist. Die function nimmt keine arguments und pusht das boolean result von the current caller context. Die function untersucht weder den Lua call stack noch ein function object.
clonefunction
Creates and returns a separate function value for the function passed as the first argument. The argument must be a function.
comparefunctions
Vergleicht zwei function values über ihren function identity. Beide arguments müssen functions sein. Die function gibt das boolean result von function identity(L, 1) == function identity(L, 2) zurück. Sie vergleicht kein function bytecode, source, behavior, hashes, upvalues oder newcclosure mappings. comparefunction ist ein alias für dieselbe function.
getfunctionhash
Returns an uppercase SHA384 hex digest derived from a Luau function. The argument must be a function, and C closures raise “Lua function expected”. If no hashable function content is available, the function returns nil.
hookfunction
Hookt eine target function mit einer replacement function und gibt eine cloned copy der original target closure zurück. Beide arguments müssen functions sein. Die function flusht zuerst pending C function swaps, cloned den target über function cloning, fügt die replacement closure oder ihr mapped newcclosure target zu hidden stack tracking hinzu, ruft FixCallstack für target und cloned original auf und patcht dann die target closure über den C closure, Luau closure oder newcclosure-specific path. Wenn target noch nicht in hook records ist, wird das cloned original dort für restorefunction gespeichert. Die returned function ist die cloned original closure.
hookmetamethod
Sucht eine metamethod function auf einem value und hookt diese function über hookfunction. Das first argument kann jeder value sein, den raw metafield lookup akzeptiert. Das second argument muss ein string metamethod name sein, und das third argument muss eine function replacement sein. Wenn raw metafield lookup das named metafield nicht findet, löst die function “Metamethod doesn’t exist” für argument 2 aus. Wenn das metafield existiert, aber keine function ist, löst sie “Metamethod isn’t a function” für argument 2 aus. Wenn das metafield eine function ist, ruft hookmetamethod hookfunction mit der found metamethod function als target auf und gibt die cloned original closure von hookfunction zurück.
iscclosure
Returns whether the provided function is a C closure. The argument must be a function; passing any other type raises a type error. The function does not inspect executor ownership, source, bytecode, or upvalues.
isexecutorclosure
Returns whether the provided function is classified as executor-owned. The argument must be a function. The function does not inspect source text, debug names, bytecode hashes, or call stack ownership.
isfunctionhooked
Returns whether the provided function currently has a hook record. The argument must be a function.
ishiddenstack
Returns whether a function, or the function at a stack level, is marked as hidden. target must be a function or stack level number. Invalid stack levels raise “Level out of range”. isstackhidden is an alias.
islclosure
Returns whether the provided function is a Lua closure. The argument must be a function; passing a non-function raises a type error. isluaclosure is an alias.
isnewcclosure
Returns whether the provided function is a newcclosure-created C closure. The first argument must be a function; passing a non-function raises a type error. Documented usage is a single function argument; extra arguments are not part of the supported signature.
newcclosure
Returns a C closure for the provided function. If the function is already a C closure, the same function is returned. Passing a non-function raises a type error.
newlclosure
Returns a Luau closure that calls the provided function. The first argument must be a function.
restorefunction
Stellt eine function wieder her oder ersetzt sie, indem intern function hook operation aufgerufen wird, und gibt keine values zurück. Das first argument muss eine function sein. Mit einem function argument sucht die function nach the saved original function; wenn kein entry existiert, löst sie “Function is not hooked” aus. Dann ruft sie function hook operation mit der hooked closure und der stored original closure auf, leert den Lua stack und entfernt die restored closure aus hook records, wenn das stored original verwendet wurde. Wenn das second argument ebenfalls eine function ist, behandelt die function firstFunction stattdessen als die zu installierende original function und secondFunction als die zu patchende closure. In dieser Form wird kein missing-original check gegen den gespeicherten hook records-Wert durchgeführt; der gespeicherte Wert wird nur beim final remove check verglichen. verwendet. Non-function second arguments werden von der branch condition ignoriert. restorefunc und restoreclosure sind aliases für dieselbe function.
sethiddenstack
Marks or unmarks a function, or the function at a stack level, as hidden. target must be a function or stack level number. hidden defaults to true. Invalid stack levels raise “Level out of range”. setstackhidden is an alias.