Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Decompile Lua Files?

Featured Replies

  • Author
  • Localization

Cuber456, posted Wed Mar 18, 2015 10:18 pm (3960)


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
  • Author
  • Localization

atom0s, posted Tue Jun 23, 2015 8:14 pm (5880)


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.
  • Author
  • Localization

makc_ar, posted Thu Jun 25, 2015 7:20 pm (5913)


aluigi wrote:
Attached.

Thanks aluigi

Library jit/*.dll?
Image
  • Author
  • Localization

Cuber456, posted Mon Feb 29, 2016 10:57 pm (11701)


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.
  • Author
  • Localization

k117, posted Sun Jan 30, 2022 12:22 pm (69473)


i need more help
i cant find main in code
thx
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.