Developer knowledge network · moderated exchange

Zajednica UnreliableCode

Zajednica za istraživanje, obrnuti inženjering i programiranje programera

Knowledge indexŽivjeti
4Categories
919Threads
2.8KPostovi
Analysis

Roblox Luau Proto bytecode structure & constant table layout

luau_hacker
Luau Expert
MEMBER
Rep: 159
Datum pridruživanja: Aug 2020
Postovi: 17
Hvala: 26
prije 1 mjeseci · Jul 2, 2026 9:59 AM
#1

Deep dive into Luau's Proto binary data structure:

CPP
struct LuauProto {
    uint8_t  maxstacksize;
    uint8_t  numparams;
    uint8_t  nups;
    uint8_t  is_vararg;
    int      sizecode;
    uint32_t* code;        // Array of 32-bit Luau instructions
    int      sizek;
    TValue*  k;           // Constant table (Strings, Numbers, Booleans)
    int      sizep;
    LuauProto** p;        // Sub-prototypes (nested functions/closures)
};

Traversing the Proto tree allows complete static disassembly of any loaded game script in memory!

luau_reverser
Bytecode Analyst
MEMBER
Rep: 115
Datum pridruživanja: Jul 2019
Postovi: 10
Hvala: 45
prije 1 mjeseci · Jul 2, 2026 4:04 PM
#2

Constant table TValue array contains all function names and string literals in plaintext. Essential for Luau decompilers.

vtable_slayer
Senior Reverser
MEMBER
Rep: 215
Datum pridruživanja: Mar 2018
Postovi: 86
Hvala: 61
prije 1 mjeseci · Jul 2, 2026 10:29 PM
#3

Very clean struct definition. Matches Luau open source repository.