I've been experimenting with decompiling Lua bytecode and found useful tools like unluac, and LuaAssemblyTools. Unluac seems to do the trick with lua scripts compiled with luac giving me almost the exact source code, however when I convert lua script to bytecode using the code:
I get a different output than with luac, however they are very much the same being only a byte extra at (a lot of) different places. Now this new file will give me an
IllegalState exception from unluac and when I try to run the bytecode file (created by the code line above) in luac with the -l option I get:
C:\MyDir>luac -l stringdumped.txt luac: stringdumped.txt: bad integer in precompiled chunk
So there is clearly a difference between
string.dump and luac, even though it is suggested here: http://lua-users.org/wiki/LuaCompilerInLua to use
string.dump as an emulator for luac.
Could anyone explain the difference to me, and suggest how I would go about reversing a
string.dump "compiled" script?