RbxStu V3 Docs
  • Welcome
  • Information
    • Engine Information
      • Luau API Security
  • Stunc
    • Overview
    • Connections
    • Filesystem
      • readfile
      • writefile
      • appendfile
      • isfile
      • isfolder
      • listfiles
      • makefolder
      • delfile
      • delfolder
      • loadfile
      • dofile
  • Memory
    • getgc
    • reference_object
    • unreference_object
    • get_gc_threshold
  • Closures
    • isunhookable
    • makeunhookable
    • ishooked
    • restorefunction
    • hookfunction
    • hookmetamethod
    • isourclosure
    • iscclosure
    • islclosure
    • clonefunction
    • newcclosure
    • newlclosure
    • loadstring
Powered by GitBook
On this page
  1. Closures

isourclosure

Overview of the isourclosure function.

Function Characteristics

This function is pure; it does not modify any data when called.

Function definition
function isourclosure(closure: (...any) -> (...any)): boolean

High-Level Overview

Validates that the provided closure is originating from the executor.

Low-Level Overview

The Luau compiler or the luau_load function are overridden to replace the line defined of every proto to -1. This allows us to validate if the Luau closure is originating from the executor.

For C closures, their c.f is checked; if it is within the .text section of ROBLOX, then it is not our function; if it isn't, however, then it is ours, as there is no way we have another DLL messing us up.

This makes checking the C closure's simple pointer mathematics and is much cheaper than keeping an entire function hashset or vector.

PrevioushookmetamethodNextiscclosure

Last updated 4 months ago