Yet another continuation of a thread I started for VLR. I've got some Lua files from the game. I'm interested in trying to decompile them back into source code. I know that decompiling is often a tricky thing but there do exist decompilers for Lua such as unluac. The problem is that these programs error out for some reason (I don't know why).
Here are two sample Lua files
How difficult is the process of bringing a Lua script back to source code? Are there any resources available to help guide me?
Thanks
Decompile Lua Files?
-
- Posts: 1193
- Joined: Sun Aug 17, 2014 7:27 pm
Re: Decompile Lua Files?
Please, help
Somebody can compile tool http://luajit.org/download.html?
Somebody can compile tool http://luajit.org/download.html?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: Decompile Lua Files?
Attached.
-
- Posts: 250
- Joined: Sat Dec 27, 2014 8:49 pm
Re: Decompile Lua Files?
Cuber456 wrote:Yet another continuation of a thread I started for VLR. I've got some Lua files from the game. I'm interested in trying to decompile them back into source code. I know that decompiling is often a tricky thing but there do exist decompilers for Lua such as unluac. The problem is that these programs error out for some reason (I don't know why).
Here are two sample Lua files
How difficult is the process of bringing a Lua script back to source code? Are there any resources available to help guide me?
Thanks
LuaDec exists for this purpose however it is kind of limited to what it can/can't restore. If the version of Lua that the application is using does not match the version that LuaDec was compiled with, it wont work. Also, if the Lua library the target uses has custom libraries, alterations or any new byte code added, LuaDec will fail due to it missing the custom things.
These two files do not work with the standard Lua library and LuaDec so it appears they have custom edits in their stuff.
The file header tells you what version of Lua is being used though to help limit things down:
The beginning 1B 4C 75 61 is the typical Lua compiled file header. Afterward the 51 is the version.
This states that Lua 5.1 was used to compile the Lua chunk.
-
- Posts: 1193
- Joined: Sun Aug 17, 2014 7:27 pm
-
- Posts: 9
- Joined: Fri Dec 26, 2014 4:46 am
Re: Decompile Lua Files?
atom0s wrote:LuaDec exists for this purpose however it is kind of limited to what it can/can't restore. If the version of Lua that the application is using does not match the version that LuaDec was compiled with, it wont work. Also, if the Lua library the target uses has custom libraries, alterations or any new byte code added, LuaDec will fail due to it missing the custom things.
These two files do not work with the standard Lua library and LuaDec so it appears they have custom edits in their stuff.
The file header tells you what version of Lua is being used though to help limit things down:
The beginning 1B 4C 75 61 is the typical Lua compiled file header. Afterward the 51 is the version.
This states that Lua 5.1 was used to compile the Lua chunk.
Makes perfect sense. I guess I'm not surprised that they can't be decompiled with the standard library. I also guess it is safe to say that we don't know what libraries or custom things were used at compile time either. Looks like manual RE would have to be used to figure out what these files really do which is something not yet within grasp.
Also, really interesting to know that these two files were compiled with Lua 5.1. I did not know the LUA header contained that information.
Thank You.
-
- Posts: 45
- Joined: Sun Oct 09, 2016 6:27 pm
Re: Decompile Lua Files?
Lua decompilation is now available online at http://decompiler.com/
-
- Posts: 1
- Joined: Sun Jan 30, 2022 12:19 pm
Re: Decompile Lua Files?
i need more help
i cant find main in code
thx
i cant find main in code
thx