Page 1 of 2 12 LastLast
Results 1 to 20 of 32

Thread: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

  1. #1
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    This was a quick win, based again on previous work by other modders.

    It you just want to look, get attached zip.

    If you want to decode more .luac files, here's what you do:

    • You need C compiler, clue about programming etc. This is not for everyone.

    First we need lua:

    • Get lua 5.1 sources
    • In src/luaconf.h change lines
      • #define LUA_NUMBER_DOUBLE
        #define LUA_NUMBER double
        to


      • #define LUA_NUMBER_FLOAT
        #define LUA_NUMBER float
    • compile lua with command appropriate for your platform like:
      • make macosx - I only tested this one, on 32 bit OS
      • make linux
      • make mingw
      • make generic - this should work too I think

    Now luadec:

    • Get luadec51_2.0 sources
    • In print.c line 15 change line in getupval command (line 45 here) from:
      • if (F->f->upvalues) {
    • to
      • if (F->f->upvalues && r < F->f->sizeupvalues) {
    • Compile it pointing to directory where original lua is located (tweak for your platform):
      • gcc -g -I ../../lua-5.1.4/src/ *.c -c
      • gcc ../../lua-5.1.4/src/liblua.a *.o -o luadec

    Now back up this luadec executable somewhere so you don't have to go through this nonsense again.

    Use pack manager to extract .luac files, then decompile each one of them with ./luadec -d xxx.luac >xxx.lua

    Before that print.c patch, of 438 .luac files I found in patch.pack, 171 crashed on decompilation - including nearly all interesting ones - successes were mostly trivial files. Now only 16 crash, so almost all can be viewed.

    You can always decompile all files to lua assembly with ./luadec -dis xxx.luac but this is a lot more difficult to read.

    Now I did not fix the underlying problem!!! The only thing I did was making luadec not crash on first confusing setupval opcode.

    Decompiled lua code might very well still be wrong (it's really lua 5.0 decompiler only halfway upgraded to lua 5.1 that ETW uses). At least you will get a warning (thanks to -d option) in places where luadec is confused, and this seems to be per-function confusion, so other decompiled functions in the same file will be fine.

    I'm attaching zip with .patch for luadec and decoded .lua files from patch.pack. 0 size means luadec still crashes, just so you don't have to guess.

  2. #2
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    I contacted author of luadec with what I think are all relevant details.
    Hopefully he'll have more clue on what needs to be done to move it from mostly-fixed to fully-fixed.

  3. #3
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    A single command script to fetch, patch, and build luadec for ETW .luac files now available in etwng repository.
    It would be neat if someone took a few minutes to make it work on systems other than OSX,
    This is trivial matter, lua compiles on Windows out of the box, but I don't have Windows-based
    development environment to even try that.

  4. #4
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    As many people have problems with luadec, I prepared a 7z archive with decompilation results of all .luac files in ETW and NTW.

    PM with your email address to get it.

  5. #5
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    luadec now builds on both OSX and Linux.

    People who had troubles finding an OSX machine to try it might want to give it another go -
    Linux machines (and livecds) are a lot easier to find.

  6. #6
    wangrin's Avatar Unguibus et Rostro
    Patrician Artifex

    Join Date
    Feb 2005
    Location
    France
    Posts
    4,397

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    I'm trying to compile luadec on windows 7, but I get errors :

    The first step was to download LUA 5.1 sources from lua.org
    The second step was to download luadec installer from luaforge.org
    The third step was to download and install MinGW from sourceforge

    To install MinGW, I use basic setups and add 3 packages :

    • mingw32-base
    • mingw32-gcc-g++
    • msys-base


    According to this tutorial : Installing Lua on a Windows system

    Then, I've tried to compile luadec for windows system, but I get errors during the process :

    Code:
    D:\LUADEC\lua-5.1>make clean
    cd src && make clean
    make[1]: Entering directory `/d/LUADEC/lua-5.1/src'
    rm -f liblua.a lua luac lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex
    .o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundu
    mp.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o lta
    blib.o lstrlib.o loadlib.o linit.o lua.o luac.o print.o
    make[1]: Leaving directory `/d/LUADEC/lua-5.1/src'
    
    D:\LUADEC\lua-5.1>make mingw
    cd src && make mingw
    make[1]: Entering directory `/d/LUADEC/lua-5.1/src'
    make "LUA_A=lua51.dll" "LUA_T=lua.exe" \
            "AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
            "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
    make[2]: Entering directory `/d/LUADEC/lua-5.1/src'
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lua.o lua.c
    make[2]: gcc: Command not found
    make[2]: *** [lua.o] Error 127
    make[2]: Leaving directory `/d/LUADEC/lua-5.1/src'
    make[1]: *** [mingw] Error 2
    make[1]: Leaving directory `/d/LUADEC/lua-5.1/src'
    make: *** [mingw] Error 2
    As gcc command is not found, do I need some other package or is it a filepath issue ?

    All file needed are in the LUADEC folder, itself divided in subfolders :

    • lua-5.1
    • MinGW



    luadec.exe is in LUADEC folder.
    MinGW files are in LUADEC\MinGW subfolder.


    « Le courage, c’est de ne pas subir la loi du mensonge triomphant qui passe, et de ne pas faire écho de notre âme, de notre bouche et de nos mains aux applaudissements imbéciles et aux huées fanatiques.. » Jean JAURES

  7. #7
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Well, gcc not found sounds like filepath issue. I never tried it on mingw, just OSX and Linux, but in principle it should work on Windows as well.

  8. #8
    wangrin's Avatar Unguibus et Rostro
    Patrician Artifex

    Join Date
    Feb 2005
    Location
    France
    Posts
    4,397

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    In "Environment variables", I had two entries for PATH, one for JRuby and the other for MinGW, both entry are separate by ";" :
    Code:
    C:\Program Files\jruby-1.5.6\bin;D:\LUADEC\MinGW\bin
    I temporarily add MSYS to my system path using command :
    Code:
    SET PATH=%PATH%;D:\LUADEC\MinGW\msys\1.0\bin
    Then, I have a strange behaviour in the cmd prompt.
    When I add the command :
    Code:
    CD D:\LUADEC\lua-5.1
    to change folder, it doesn't work first.

    I have to add the command :
    [code]d:[code]
    to get the right folder.

    But it doesn't matter as the two first steps work now that I launch cmd as administrator :
    • make clean
    • make mingw


    Now, it's with the last step I have a problem :
    Code:
    D:\LUADEC\lua-5.1>make install INSTALL_TOP=D:/LUADEC/LUA/5.1 TO_BIN="lua.exe luac.exe lua51.dll"
    cd src && mkdir -p D:/LUADEC/LUA/5.1/bin D:/LUADEC/LUA/5.1/include D:/LUADEC/LUA/5.1/lib D:/LUADEC/LUA/5.1/man/man1 D:/LUADEC/LUA/5.1/share/lua/5.1 D:/LUADEC/LUA/5.1/lib/lua/5.1
    cd src && cp lua.exe luac.exe lua51.dll D:/LUADEC/LUA/5.1/bin
    cp: cannot stat `luac.exe': No such file or directory
    make: *** [install] Error 1
    When I should obtain something like this
    Code:
    c:\temp\lua-5.1.5>make install INSTALL_TOP=c:/temp/lua/5.1 TO_BIN="lua.exe luac.exe lua51.dll"
    cd src && mkdir -p c:/temp/lua/5.1/bin c:/temp/lua/5.1/include c:/temp/lua/5.1/lib c:/temp/lua/5.1/man/man1 c:/temp/lua/5.1/share/lua/5.1 c:/temp/lua/5.1/lib/lua/5.1
    cd src && install -p -m 0755 lua.exe luac.exe lua51.dll c:/temp/lua/5.1/bin
    cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp c:/temp/lua/5.1/include
    cd src && install -p -m 0644 liblua.a c:/temp/lua/5.1/lib
    cd doc && install -p -m 0644 lua.1 luac.1 c:/temp/lua/5.1/man/man1
    What I want is to store the new file in a LUA folder (D:\LUADEC\LUA).
    Folder is created as well as several other sub-folders and files.
    Last edited by wangrin; April 04, 2015 at 01:59 PM.


    « Le courage, c’est de ne pas subir la loi du mensonge triomphant qui passe, et de ne pas faire écho de notre âme, de notre bouche et de nos mains aux applaudissements imbéciles et aux huées fanatiques.. » Jean JAURES

  9. #9
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Well, it sounds like it built
    Code:
    lua.exe
    but not
    Code:
    luac.exe
    . Was there anything about it during
    Code:
    make mingw
    ?

  10. #10
    wangrin's Avatar Unguibus et Rostro
    Patrician Artifex

    Join Date
    Feb 2005
    Location
    France
    Posts
    4,397

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    It worked fine :

    Code:
    D:\LUADEC\lua-5.1>make mingw
    cd src && make mingw
    make[1]: Entering directory `/d/LUADEC/lua-5.1/src'
    make "LUA_A=lua51.dll" "LUA_T=lua.exe" \
            "AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
            "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
    make[2]: Entering directory `/d/LUADEC/lua-5.1/src'
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lua.o lua.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lapi.o lapi.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lcode.o lcode.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ldebug.o ldebug.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ldo.o ldo.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ldump.o ldump.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lfunc.o lfunc.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lgc.o lgc.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o llex.o llex.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lmem.o lmem.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lobject.o lobject.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lopcodes.o lopcodes.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lparser.o lparser.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lstate.o lstate.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lstring.o lstring.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ltable.o ltable.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ltm.o ltm.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lundump.o lundump.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lvm.o lvm.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lzio.o lzio.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lauxlib.o lauxlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lbaselib.o lbaselib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ldblib.o ldblib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o liolib.o liolib.c
    liolib.c: In function 'read_number':
    liolib.c:259:3: warning: format '%lf' expects argument of type 'double *', but argument 3 has type 'lua_Number *' [-Wformat=]
       if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
       ^
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lmathlib.o lmathlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o loslib.o loslib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o ltablib.o ltablib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o lstrlib.o lstrlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o loadlib.o loadlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL   -c -o linit.o linit.c
    gcc -shared -o lua51.dll lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
    strip --strip-unneeded lua51.dll
    gcc -o lua.exe -s lua.o lua51.dll -lm
    make[2]: Leaving directory `/d/LUADEC/lua-5.1/src'
    make[1]: Leaving directory `/d/LUADEC/lua-5.1/src'
    When I should get something like this
    Code:
    c:\temp\lua-5.1.5>make mingw
    cd src && make mingw
    make[1]: Entering directory `/c/temp/lua-5.1.5/src'
    make "LUA_A=lua51.dll" "LUA_T=lua.exe" \
     "AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
     "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
    make[2]: Entering directory `/c/temp/lua-5.1.5/src'
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lua.o lua.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lapi.o lapi.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lcode.o lcode.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ldebug.o ldebug.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ldo.o ldo.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ldump.o ldump.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lfunc.o lfunc.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lgc.o lgc.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o llex.o llex.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lmem.o lmem.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lobject.o lobject.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lopcodes.o lopcodes.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lparser.o lparser.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lstate.o lstate.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lstring.o lstring.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ltable.o ltable.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ltm.o ltm.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lundump.o lundump.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lvm.o lvm.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lzio.o lzio.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lauxlib.o lauxlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lbaselib.o lbaselib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ldblib.o ldblib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o liolib.o liolib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lmathlib.o lmathlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o loslib.o loslib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o ltablib.o ltablib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o lstrlib.o lstrlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o loadlib.o loadlib.c
    gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o linit.o linit.c
    gcc -shared -o lua51.dll lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o # DLL needs all object files
    strip --strip-unneeded lua51.dll
    gcc -o lua.exe -s lua.o lua51.dll -lm
    make[2]: Leaving directory `/c/temp/lua-5.1.5/src'
    make "LUAC_T=luac.exe" luac.exe
    make[2]: Entering directory `/c/temp/lua-5.1.5/src'
    gcc -O2 -Wall -c -o luac.o luac.c
    gcc -O2 -Wall -c -o print.o print.c
    ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o # DLL needs all object files
    ranlib liblua.a
    gcc -o luac.exe luac.o print.o liblua.a -lm
    make[2]: Leaving directory `/c/temp/lua-5.1.5/src'
    make[1]: Leaving directory `/c/temp/lua-5.1.5/src'
    So, it gets trouble with "gcc -O2 -Wall -DLUA_BUILD_AS_DLL -c -o liolib.o liolib.c"
    And it doesn't run "make "LUAC_T=luac.exe" luac.exe"... so, it's possible it doesn't create luac.exe
    Last edited by wangrin; April 04, 2015 at 02:21 PM.


    « Le courage, c’est de ne pas subir la loi du mensonge triomphant qui passe, et de ne pas faire écho de notre âme, de notre bouche et de nos mains aux applaudissements imbéciles et aux huées fanatiques.. » Jean JAURES

  11. #11
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Output looks reasonable, so no idea why it can't find luac.exe later.

  12. #12
    wangrin's Avatar Unguibus et Rostro
    Patrician Artifex

    Join Date
    Feb 2005
    Location
    France
    Posts
    4,397

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    As the program doesn't execute "make "LUAC_T=luac.exe" luac.exe" command, maybe it doesn't create luac.exe

    I've tried to manually run the command :
    Code:
    D:\LUADEC\lua-5.1>cd src
    
    D:\LUADEC\lua-5.1\src>make "LUAC_T=luac.exe" luac.exe
    gcc -O2 -Wall    -c -o luac.o luac.c
    gcc -O2 -Wall    -c -o print.o print.c
    ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o
    ranlib liblua.a
    gcc -o luac.exe  luac.o print.o liblua.a -lm.
    And then re-run the command
    Code:
    D:\LUADEC\lua-5.1>make install INSTALL_TOP=D:/LUADEC/LUA/5.1 TO_BIN="lua.exe lua
    c.exe lua51.dll"
    cd src && mkdir -p D:/LUADEC/LUA/5.1/bin D:/LUADEC/LUA/5.1/include D:/LUADEC/LUA/5.1/lib D:/LUADEC/LUA/5.1/man/man1 D:/LUADEC/LUA/5.1/share/lua/5.1 D:/LUADEC/LUA/5.1/lib/lua/5.1
    cd src && cp lua.exe luac.exe lua51.dll D:/LUADEC/LUA/5.1/bin
    cd src && cp lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp D:/LUADEC/LUA/5.1/include
    cd src && cp liblua.a D:/LUADEC/LUA/5.1/lib
    cd doc && cp lua.1 luac.1 D:/LUADEC/LUA/5.1/man/man1
    Now, I have all three files : lua.exe, luac.exe and lua51.dll
    Last edited by wangrin; April 04, 2015 at 02:28 PM.


    « Le courage, c’est de ne pas subir la loi du mensonge triomphant qui passe, et de ne pas faire écho de notre âme, de notre bouche et de nos mains aux applaudissements imbéciles et aux huées fanatiques.. » Jean JAURES

  13. #13

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Any new advancements ?

  14. #14
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quote Originally Posted by Liberalis Bellatricus View Post
    Any new advancements ?
    It does what it can, unless someone wrote actual lua 5.1 decompiler that's more or less as good as it's going to get.

  15. #15

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Do you have the zip file still or a complete version of the decompiler? Cause the attachment is gone, I think...
    "You can ask me for anything you like, except time."
    Napoleon Bonaparte
    "If you want a thing done well, do it yourself."
    Napoleon Bonaparte
    "You don't reason with intellectuals. You shoot them."
    Napoleon Bonaparte

  16. #16
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Order of Shadows: Could you try one in https://github.com/taw/etwng/tree/master/luac ? I haven't used it in ages, hopefully it will still work out of the box.

    (if not, I can take a look at it later)

  17. #17

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    So, I downloaded LuaDec, copied the text of build_luadec and created with it a .bat file, then I created another bat file with this code: ./luadec -d xxx.luac >xxx.lua == luadec == (I overwrite the file paths)
    I ran build_luadec and then the second .bat file, but I get only an empty lua file.
    So I'm not sure about what to download, and I found not a way to download some of the files in the etwng repository, so I made them by myself, but I am actually not sure about what file format to choose.
    So it would be really nice if you could explain me some steps to use this
    "You can ask me for anything you like, except time."
    Napoleon Bonaparte
    "If you want a thing done well, do it yourself."
    Napoleon Bonaparte
    "You don't reason with intellectuals. You shoot them."
    Napoleon Bonaparte

  18. #18
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quote Originally Posted by Order of Shadows View Post
    So, I downloaded LuaDec, copied the text of build_luadec and created with it a .bat file, then I created another bat file with this code: ./luadec -d xxx.luac >xxx.lua == luadec == (I overwrite the file paths)
    I ran build_luadec and then the second .bat file, but I get only an empty lua file.
    So I'm not sure about what to download, and I found not a way to download some of the files in the etwng repository, so I made them by myself, but I am actually not sure about what file format to choose.
    So it would be really nice if you could explain me some steps to use this
    I only ever made it work on OSX and Linux. It seems to still be working on OSX file at least.

    Do you have access to any kind of OSX/Linux box or VM to test it first? It could presumably be made to work on Windows+cygwin without too much hassle otherwise.

  19. #19

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    Quote Originally Posted by taw View Post
    I only ever made it work on OSX and Linux. It seems to still be working on OSX file at least.

    Do you have access to any kind of OSX/Linux box or VM to test it first? It could presumably be made to work on Windows+cygwin without too much hassle otherwise.
    Sorry, I'm only Windows User and I have no experience with VM so I would prefer cygwin.
    "You can ask me for anything you like, except time."
    Napoleon Bonaparte
    "If you want a thing done well, do it yourself."
    Napoleon Bonaparte
    "You don't reason with intellectuals. You shoot them."
    Napoleon Bonaparte

  20. #20
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,332

    Default Re: Lua decompiler (mostly) FIXED - .luac files ready for your viewing pleasure!

    OK, jruby build_luadec will compile some kind of luadec on cygwin now, but I didn't have any time to check if it's the right flags (it needs to be 32 bit to match Total War engine).

    You need to have all the prerequisites (gcc, patch, wget etc.) preinstalled of course.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •