Developer knowledge network ยท moderated exchange

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Knowledge indexLive
4Categories
919Threads
2.8KPosts
Analysis

Roblox Luau Proto bytecode structure & constant table layout

luau_hacker
Luau Expert
MEMBER
Rep: 159
Join Date: Aug 2020
Posts: 17
Thanks: 26
1 months ago ยท 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
Join Date: Jul 2019
Posts: 10
Thanks: 45
1 months ago ยท 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
Join Date: Mar 2018
Posts: 86
Thanks: 61
1 months ago ยท Jul 2, 2026 10:29 PM
#3

Very clean struct definition. Matches Luau open source repository.