JSPM

node-luajit-decompiler-v2

1.0.7
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 122
  • Score
    100M100P100Q87215F
  • License MIT

_LuaJIT Decompiler v2_ is a replacement tool for the old and now mostly defunct python decompiler. The project fixes all of the bugs and quirks the python decompiler had while also offering full support for gotos and stripped bytecode including locals and upvalues.

Package Exports

  • node-luajit-decompiler-v2
  • node-luajit-decompiler-v2/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-luajit-decompiler-v2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

LuaJIT Decompiler v2. Node support

LuaJIT Decompiler v2 is a replacement tool for the old and now mostly defunct python decompiler.
The project fixes all of the bugs and quirks the python decompiler had while also offering
full support for gotos and stripped bytecode including locals and upvalues.

Usage

It is recommended to run in a separate node thread

import { type DecompileOptions, decompile } from "node-luajit-decompiler-v2";

const options: DecompileOptions = {
  ignoreDebugInfo: false,
  minimizeDiffs: true,
  unrestrictedAscii: true,
};

try {
  const tmpInFile = "file.luac";
  const buffer = fs.readFileSync(tmpInFile);
  const result = decompile(buffer, options);
  fs.writeFileSync(tmpOutFile, result, "binary");
} catch (error) {
  console.error(error);
}

TODO

  • bytecode big endian support
  • improved decompilation logic for conditional assignments

Original project https://github.com/marsinator358/luajit-decompiler-v2