How to decompile a Lua file?

S.Stevens picture S.Stevens · Nov 21, 2020 · Viewed 11.3k times · Source

I have a lua file, which, when opened in Notepad++ shows a mixture of English (uncorrupted), understandable text, as well as a mixture of "NULS" "ETX's" and other strange symbols, before I delve into attempting to decompile this, I want to work out if it is even possible?

Any help appreciated, thanks.

Answer

Spar picture Spar · Nov 21, 2020

First bytes of the compiled Lua file tell the version where the script was compiled in.

Try LuaDec. (5.1 - 5.3) https://github.com/viruscamp/luadec

Alternative project: Chunkspy. (It's only for 5.1 and 5.0.2.) http://chunkspy.luaforge.net/

For 5.1 and 5.0: https://sourceforge.net/projects/unluac