It is currently 16 Apr 2024, 03:59
   
Text Size

Lua Decompiler

Moderator: CCGHQ Admins

Lua Decompiler

Postby Xander9009 » 11 Feb 2015, 16:19

This is pretty freaking useless at the moment, but you can drop a compiled lua file onto the exe and you'll get back a decompiled version. Will probably only work for DotP and not general Lua scripts (although general lua scripts already have tools, so that doesn't matter). Should we ever manage to mod 2015 (which seems unlikely at this point :( ), then it'll make decompiling the lol files ~1% easier.

I was curious today what it took to decompile them, and it turned out the method involved manually editing the file in a hex editor and the using the command prompt to run the file through the proper lua decompiler. This will do both of those things for you, saving a little unnecessary effort (with the added benefit of using a temporary file rather than actually altering the original, not that that's likely to matter).

The tool I wrote doesn't care about the extension, but I don't know if unluac does.
Attachments
Lua Decopmiler.zip
(630.48 KiB) Downloaded 810 times
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Lua Decompiler

Postby Tejahn » 20 Feb 2015, 14:07

Thanks! I'll get a look at this later.
Tejahn
 
Posts: 430
Joined: 14 May 2013, 01:35
Has thanked: 25 times
Been thanked: 25 times

Re: Lua Decompiler

Postby thefiremind » 29 Sep 2016, 13:45

Since this will become more useful now that Magic Duels uses LOL files for card pools and cards, I downloaded the source files for luadec 2.2, modified them so that the different format flag is already taken care of, and recompiled with Visual Studio. The result is attached to this post.

I also included 2 batch files that simplify things a little bit. Put the LOL file you want to decompile in the same folder as luadec, then drag and drop it on loldec.bat. You'll obtain a TXT file with the decompiled contents. With LOL files that can't be correctly decompiled you can try with loldis.bat (which disassembles them), but the result will be very hard to understand.

Some Visual C++ runtime libraries may be required.
Attachments
luadec51_mod.zip
Compiled from luadec 2.2, batch files have UTF-8 argument
(73.1 KiB) Downloaded 525 times
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times


Return to Utilities

Who is online

Users browsing this forum: No registered users and 13 guests


Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 13 guests

Login Form