Skip to content
bobsayshilol edited this page Nov 2, 2013 · 7 revisions

Wiki thing

If you're reading this I assume you have downloaded the decompiler and are now lost as to how it works - scroll down to "How to use" if you just want to start using it, or read the next bit to see what is included in the download. (If you don't know how to download the decompiler there should be a link on the right of this page saying "Download ZIP")

What you just downloaded

The download includes:

  • a version (I think it's the latest) of LuaJIT, compiled on Windows - you can obviously download the source and build it yourself, but all you need from the compiled build is "lua51.dll","luajit.exe" and the folder "jit" (there isn't a binary download on the site, hence why I included a pre-built version)
  • an AutoIt script (this is the bit I done made)
  • a compiled version of the AutoIt script (for people who don't want to install AutoIt)
  • 2 batch files - one converts all .lua files into readable bytecode, and the other converts them into an object format

How to use the damn thing

###Windows###

  1. First you navigate to the file you want to decompile
  2. Now COPY that file into wherever you have downloaded and extracted this to
  3. Rename the copied file to "test.lua" - this is what the script looks for
  4. Run the script (either by loading up "decoder.au3" and running it, or just by running "decoder.exe")
  5. You should notice 3 new files appear called "test.asm", "out2.lua" and "out.lua" - "test.asm" is the readable bytecode version of the file (not easy to work out what's going on since it looks like assembly), and "out.lua" and "out2.lua" are the re-assembled versions (much easier to work out what's going on)
  6. Attempt to read "out.lua"
  7. Go put some music on and get a drink because it doesn't make any sense
  8. Realise you should be reading "out2.lua" instead
  9. For a tutorial of how to convert the "out2.lua" file to an actual lua file click here - note that this applied to the original decompiler, but in the most recent one "out2.lua" is a fix-up of "out.lua" and the tutorial should still be read to make sure that you can fix-up "out2.lua" even more
  10. You can use the asm batch file to convert all .lua files to readable bytecode so you can see how close your plaintext lua file is to the compiled one

###Linux### Same as above, except I think you need to use WINE to run "decoder.exe" (which will in turn run "luajit.exe") or you can try and write an equivalent python script (which you can post on here to help other people out), and I don't know how to write shell scripts that would do the same as the batches

Clone this wiki locally