I'm trying to execute (and maybe later decompile) Lua bytecode to which I do not have the source code, the compiler or the parser. (I'm guessing it uses some VM to execute?)
It is a (slightly) altered version of Lua, with a custom header. After manually editing the header to make it possible to load and execute the bytecode with an official Lua executable, it gives me an error message: "Bad code in precompiled chunk".
Now the problem is that it doesn't list a file offset, I do not know what exactly the problem is.
I'm guessing it's one or more of these:
- Header still not right
- Other opcodes
- A second header
- Some encryption
How do I know which one of these it is? How do I know where it starts being wrong? (where does the first error occur)
The file format is not documented publicly.
I've not worked with Lua bytecode before.
Edit: ChunkSpy IS able to decompile the bytecode.