Java, Lua, and PE files

glaurung luac

Recognize Lua and LuaJIT bytecode and print header information.

does not write by default 2 worked examples

use it for

The parser recognizes Lua 5.1 through 5.4 and LuaJIT bytecode. It reports metadata and available source-name information.

Run glaurung luac --help on your installed version before putting the command in a script. Glaurung is still pre-1.0.

input
A Lua 5.1–5.4 or LuaJIT bytecode chunk.
output
Bytecode family, format byte, endianness, and any stored source name.
mode
read only. The examples leave the input unchanged.

command shape

syntax

short form
$ glaurung luac PATH [--json]

The installed parser is authoritative: glaurung luac --help

run it

examples

Identify a Lua 5.3 chunk

The source path is metadata embedded by the compiler; it need not exist on your machine.

run

from the engine checkout
$ glaurung luac samples/binaries/platforms/linux/amd64/lua/hello-lua5.4.luac --json

output

captured result captured 2026-08-31
{"kind":"Lua 5.3","format":0,"source":"@/workspace/source/lua/hello.lua","little_endian":true}

captured 2026-08-31.

Read the result: luac recognizes the header. It does not decompile the chunk into Lua source.

Reject a non-Lua file

Use a known native binary as a negative control for format detection.

run

from the engine checkout
$ glaurung luac /bin/ls

output

captured result captured on Ubuntu, 2026-08-31
Error: not Lua bytecode: /bin/ls

captured on Ubuntu, 2026-08-31.

Read the result: The command stops at the header check. It does not try to interpret arbitrary native bytes as Lua instructions.

used above

important options

--json
Emit the compact header record as JSON.
--format plain|rich|json|jsonl
Choose the output format.
--quiet
Suppress non-result messages.

These are the flags used by the examples. Run glaurung luac --help for the complete parser help.

keep working

related commands

← all 40 commands