From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Lua bytecode" |
|---|
| claim | "The Lua 5.3 chunk header is 33 bytes with the default 64-bit lua_Integer and double lua_Number: signature, 0x53, format 0, LUAC_DATA 19 93 0D 0A 1A 0A, sizeof(int), sizeof(size_t), sizeof(Instruction), sizeof(lua_Integer), sizeof(lua_Number), LUAC_INT 0x5678 and LUAC_NUM 370.5 (byte order from the test integer). One byte with the main function's upvalue count follows." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Lua bytecode" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "lua53_header" |
|---|
| size | 33 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "char[4]" |
|---|
| name | "signature" |
|---|
|
| offset | 4 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "version" |
|---|
| notes | "0x53" |
|---|
|
| offset | 5 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "format" |
|---|
|
| offset | 6 |
|---|
| size | 6 |
|---|
| type | "char[6]" |
|---|
| name | "luac_data" |
|---|
| notes | "19 93 0D 0A 1A 0A" |
|---|
|
| offset | 12 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "sizeof_int" |
|---|
|
| offset | 13 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "sizeof_size_t" |
|---|
|
| offset | 14 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "sizeof_Instruction" |
|---|
|
| offset | 15 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "sizeof_lua_Integer" |
|---|
|
| offset | 16 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "sizeof_lua_Number" |
|---|
|
| offset | 17 |
|---|
| size | 8 |
|---|
| type | "int64_t" |
|---|
| name | "luac_int" |
|---|
| notes | "0x5678" |
|---|
|
| offset | 25 |
|---|
| size | 8 |
|---|
| type | "double" |
|---|
| name | "luac_num" |
|---|
| notes | "370.5" |
|---|
|
|
|---|
| endianness | "native" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "DumpHeader (tag v5.3.6); LUAC_DATA, LUAC_INT 0x5678, LUAC_NUM 370.5 in lundump.h lines 16-19; luaU_dump writes DumpByte(f->sizeupvalues) after the header" |
|---|
| repo | "https://github.com/lua/lua" |
|---|
| commit | "75ea9ccbea7c4886f30da147fb67b693b2624c26" |
|---|
| path | "ldump.c" |
|---|
| lines | "184-196" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "MSVC x64 builds of 5.3.0-5.3.6 write 1B 4C 75 61 53 00 19 93 0D 0A 1A 0A 04 08 04 08 08 78 56 00.. 00 28 77 40, then 01." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Header (Lua 5.3)" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T07:00:30.791Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T17:28:43.122Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read DumpHeader and luaU_dump in ldump.c at the cited commit: signature, version, format, LUAC_DATA, five size bytes (int, size_t, Instruction, lua_Integer, lua_Number), DumpInteger(LUAC_INT), DumpNumber(LUAC_NUM) = 33 bytes with default sizes; DumpByte(sizeupvalues) follows." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T17:08:37.599Z" |
|---|
| summary | "Add data.endianness native: ldump.c writes LUAC_INT and LUAC_NUM in host order (header comment at line 33 about endianness) and the loader rejects a chunk whose LUAC_INT/LUAC_NUM do not read back as…" |
|---|
| changed | |
|---|
|
|
|---|