ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sun Sep 24, 2017 6:50 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Decompile Lua Files?
PostPosted: Wed Mar 18, 2015 10:18 pm 

Joined: Fri Dec 26, 2014 4:46 am
Posts: 9
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


Top
   
 Post subject: Re: Decompile Lua Files?
PostPosted: Mon Jun 15, 2015 2:42 pm 
User avatar

Joined: Sun Aug 17, 2014 7:27 pm
Posts: 676
Please, help
Somebody can compile tool http://luajit.org/download.html?


Top
   
 Post subject: Re: Decompile Lua Files?
PostPosted: Tue Jun 16, 2015 9:16 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6694
Attached.


Attachments:
File comment: LuaJIT-2.0.4
luajit.zip [221.77 KiB]
Downloaded 639 times
Top
   
 Post subject: Re: Decompile Lua Files?
PostPosted: Tue Jun 23, 2015 8:14 pm 
User avatar

Joined: Sat Dec 27, 2014 8:49 pm
Posts: 92
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:
Image

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.

_________________
My personal site: http://atom0s.com
Donations can be made via Paypal: Click Here


Top
   
 Post subject: Re: Decompile Lua Files?
PostPosted: Thu Jun 25, 2015 7:20 pm 
User avatar

Joined: Sun Aug 17, 2014 7:27 pm
Posts: 676
aluigi wrote:
Attached.

Thanks aluigi

Library jit/*.dll?
Image


Top
   
 Post subject: Re: Decompile Lua Files?
PostPosted: Mon Feb 29, 2016 10:57 pm 

Joined: Fri Dec 26, 2014 4:46 am
Posts: 9
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:
Image

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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited