Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between standard Lua bytecode and LuaJIT bytecode

I've been trying to decompile a LuaJIT bytecode file. I have managed to disassemble it (but can't find any way to reassemble it). So I am considering writing some software to convert from LuaJIT bytecode to standard Lua bytecode that would then run through LuaDec fine.

But what are the differences between LuaJIT bytecode and standard Lua bytecode?

like image 377
R4000 Avatar asked Dec 24 '11 06:12

R4000


1 Answers

The differences are pretty substantial. LuaJIT uses a lot more opcodes than standard Lua, because it specializes on some operations, like returning from a function vs. returning with 1 return value, etc.

The best you could do is compare the definitions of Lua opcodes and LuaJIT opcodes and see if you could translate between them, but this not going to be trivial...

like image 62
Michal Kottman Avatar answered Sep 20 '22 12:09

Michal Kottman