Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Utilities
Lua Decompiler
Moderator: CCGHQ Admins
Lua Decompiler
by 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.
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 812 times
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
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
by 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.
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 528 times
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests