Debug
The Debug library offers powerful tools for inspecting and modifying Luau functions at a bytecode level.
It allows you to access constants, upvalues, stack frames, and internal structures of functions that would otherwise be hidden - making it especially useful for reverse engineering and hooking.
What can you do?
With the Debug library, you can:
- Inspect constants with
debug.getconstants
,debug.getconstant
- Modify constants using
debug.setconstant
- Access upvalues using
debug.getupvalues
anddebug.getupvalue
- Replace upvalues with
debug.setupvalue
- Read or write values from a stack frame, using
debug.getstack
anddebug.setstack
- List or retrieve function prototypes, using
debug.getprotos
anddebug.getproto
What can't you do?
- You cannot access C closures with this library, such as
print