benilla-re systems structs docs

LoadHeader

function · lua · boundary

Address
0x6ff210 · 334 bytes, up to 0x6ff35d
Meaning
Checks a precompiled chunk's signature, version, byte order, sizes and test number
Confidence
verified, proof one
Finding
lua/chunks#loading-a-precompiled-chunk

Finding: Loading a precompiled chunk in lua: precompiled chunks

luaU_undump names the chunk from its stream name less a leading @ or =, or binary string when it begins with the escape byte, and loads it. The header must hold the signature 1b 4c 75 61, version 0x50, a byte-order byte that sets the swap flag when it differs from 1, the sizes 4, 4, 4, 6, 8, 9, 9 and 8, and a number whose integer part is 31415926. Each function then gives its source, line, four bytes, lines, locals, upvalue names, constants and code, and must pass the code checker. The constants take the current execution-context word.

functionnamedecided by
0x6fec50LoadChunkLoadHeader (0x6fec53), tail jmp to LoadFunction with no parent source (0x6fec5a, 0x6fec5d)
0x6ff210LoadHeaderLoadSignature (0x6ff214), version 0x50 (0x6ff223, 0x6ff25b), luaU_endianness (0x6ff29d), eight TestSize (0x6ff2b8..0x6ff32f), __ftol of the number (0x6ff33b, 0x6ff340)
0x6ff360LoadSignaturesignature bytes (0x6ff360, 0x6ff36b), compare (0x6ff374..0x6ff37c), bad signature in %s (0x6ff396)
0x6ff3b0TestSizeone byte (0x6ff3b9), compare (0x6ff3c1), virtual machine mismatch (0x6ff3d1)
0x6ff3f0luaU_endiannessmov eax,1; ret (0x6ff3f0)
0x6fec70LoadFunctionluaF_newproto (0x6fec79), source or the parent's (0x6fec82..0x6fec8e), four bytes (0x6fec9d..0x6fecbb), the five vectors (0x6fecc7..0x6feceb), luaG_checkcode (0x6fecf2), bad code in %s (0x6fed01)
0x6fefe0LoadLinescount (0x6fefe7), luaM_irealloc line 136 (0x6fefee, 0x6ff006), LoadVector (0x6ff018)
0x6fef60LoadLocalscount (0x6fef6b), line 123 (0x6fef74, 0x6fef89), name, first and last instruction (0x6fefa2..0x6fefc5)
0x6ff030LoadUpvaluescount 0 or the upvalue count (0x6ff045..0x6ff05f), line 148 (0x6ff069, 0x6ff07f), names (0x6ff092)
0x6ff0b0LoadConstantscount (0x6ff0bd), line 159 (0x6ff0c4, 0x6ff0d8), type byte (0x6ff0ff), nil, number and string with the word (0x6ff12e..0x6ff16f), prototypes line 182 (0x6ff18f, 0x6ff1a9), LoadFunction (0x6ff1c5)
0x6feea0LoadCodecount (0x6feea7), line 114 (0x6feeae, 0x6feec3), LoadVector (0x6feed5)

The derivation is in the doc.

Callers 1

Callees 7

Calls and jumps by a bare address, from tables/calls.tsv.