Skip to main content

Luramas

Luramas is a decompiler framework. It takes something hard to read, raw machine code or VM bytecode, and turns it back into readable, high-level source. The design is built around one idea: lift the target into an architecture-independent form once, then simplify that form over and over with small, provable optimizations until it looks like the code a person would have written.

That idea is what lets one pipeline use unrelated targets. x86-64, Lua, etc all lift into the same IL, and from there nothing downstream knows or cares which target it came from. Add a new front-end and the entire optimizer and every emitter come for free.

Pipeline

A decompile runs through four stages, front to back:

  1. Lifting Assembly - a per-target disassembler decodes bytes into structured instructions, and a lifter turns each instruction into IL with no meaning attached to the original opcode names. See Disassemblers and Writing a Lifter.
  2. Intermediate Language (IL) - the shared, architecture-independent instruction set. Every target uses it; see the IL Overview and the Instruction Set Architecture. The IL buffer is then bridged to a closure tree.
  3. Intermediate Representation (IR) - the closure is lifted into the ir_stat model, control flow is rebuilt, SSA is constructed, and a fixed schedule of passes simplifies everything. See Overview.
  4. Code Generation - the optimized IR is emitted into a real high-level language through a per-language emitter. See Emitters.

Where to start