It is currently 17 Jan 2017, 10:56
   
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 120 times
User avatar
Xander9009
Programmer
 
Posts: 2414
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 78 times
Been thanked: 307 times

Re: Lua Decompiler

Postby Tejahn » 20 Feb 2015, 14:07

Thanks! I'll get a look at this later.
Tejahn
 
Posts: 426
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, too, 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
Now compiled from luadec 2.2
(73.09 KiB) Downloaded 17 times
< Former DotP 2012/2013/2014 modder >
Currently active in the Magic Duels section.
User avatar
thefiremind
Programmer
 
Posts: 3485
Joined: 07 Nov 2011, 10:55
Has thanked: 114 times
Been thanked: 707 times


Return to Utilities

Who is online

Users browsing this forum: No registered users and 3 guests


Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 3 guests

Login Form