Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:LuaJIT

From ReverseEngineering.wiki
Library
Developer Mike Pall
Versions 2.0.x (2009-2017), 2.1 (rolling, branch v2.1 since 2.1.0-beta1)
License MIT
Website https://luajit.org/
On this wiki Facts · Code · Notes · Topics

Mike Pall's tracing JIT compiler and interpreter for Lua 5.1 (MIT): a compact C and assembler VM with its own bytecode (Format:LuaJIT bytecode), a built-in FFI and bit library, embedded in OpenResty, games, mods and tools; usually shipped as lua51.dll or luajit-5.1.so, or linked statically.

Overview

LuaJIT implements the Lua 5.1 language with some 5.2 extensions. The interpreter core is hand-written assembler per architecture (generated with DynASM), so a LuaJIT binary does not contain PUC-Rio's luaV_execute, and the constant tables listed on Library:Lua (luaP_opmodes, luai_ctype_) do not identify it. Many programs rename the DLL to lua51.dll; the exports tell the difference.

Identification

  • Version string: LUAJIT_VERSION is "LuaJIT 2.1.ROLLING" in the rolling source (src/luajit_rolling.h lines 33-37); release builds substitute the real number, for example LuaJIT 2.1.1727870382, and the text Copyright (C) 2005-2026 Mike Pall and https://luajit.org/. These strings are in the binary (jit.version, jit.version_num).
  • Exports (DLL/so builds): the standard lua_*/luaL_* API plus luaJIT_setmode, luaJIT_profile_start, luaJIT_profile_stop, luaJIT_profile_dumpstack, luaopen_jit, luaopen_ffi, luaopen_bit and the version symbol luaJIT_version_2_1_ROLLING (renamed per release, e.g. luaJIT_version_2_1_0_beta3), which exists so that a program linked against a header and a different library fails to load.
  • Bytecode: embedded chunks start 1B 4C 4A (Format:LuaJIT bytecode).
  • Source names: the library files lib_base.c, lib_jit.c, lib_ffi.c; Lua-side modules jit.vmdef, jit.bc, jit.dump (when not stripped).
  • A game that carries a LuaJIT runtime but loads PUC-Rio-style 1B 4C 75 61 chunks does not exist (the loader rejects them); use the third byte of the chunk to choose the tool.

Code & repositories

See the linked repository below.

  • https://github.com/LuaJIT/LuaJIT @ 2a8e017ef1ece6a95b983ffca073d30609dce7c4 · license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
    The LuaJIT source (MIT): src/lj_bcdump.h documents the dump format, lj_bc.h the instruction set, lj_bcwrite.c and lj_bcread.c the writer and loader; the v2.1 branch is the rolling release.
    Tested on: source read, not run: source read at the pinned commit; nothing built or run · checked 2026-10-18; last activity 2026-10-14

Evidence & references

  • LuaJIT/LuaJIT commit 2a8e017ef1ece6a95b983ffca073d30609dce7c4, src/luajit_rolling.h, src/lj_bcdump.h. Read only.