Sign in to follow this  
DeadlyFoez

Easy LUA Decompiler

Recommended Posts

DeadlyFoez    16

Easy LUA Decompiler

The Easy LUA Decompiler is a batch file that aids in the decompiling of compiled LUA files. The original batch file was written by [MENTION=6393]Aoredon[/MENTION] and was posted HERE. I have taken [MENTION=6393]Aoredon[/MENTION]'s batch file greatly extended it's capabilities and usefulness.

Features
  • [*]Single file drag and drop support [*]Prompts before overwriting a file

Requirements

  • [*]
Easy LUA Decompiler [*]unluac

NOTE: Both Easy LUA Decompiler and unluac must be in the same directory. The program will halt and inform you if unluac.jar is not in the same folder.

Source Code

@Echo offset ProgDir=%~dp0if not exist %ProgDir%unluac.jar goto NoUnluacif "%1"=="" goto START:NEXTSHIFTif not %ProgDir% == %~dp1 copy %1 %ProgDir%%~nx1 > NULset targetFile=%~nx1goto CHECKDEC:SHIFTINGSHIFTgoto NEXTSHIFT:STARTSet targetFile=CLSEcho Easy LUA Decompiler V0.3Echo.Echo Instructions:Echo Enter the filename of the LUA file you want to decompile.Echo Leave blank and press [Enter] to exit.Echo.set /p targetFile="Enter target file name: "if %targetFile% == NULL goto ENDclsif exist %targetFile%.lua goto ADDEXTif exist %targetFile% goto CHECKDECgoto NOTFOUND:ADDEXTset targetFile=%targetFile%.luagoto CHECKDEC:CHECKDECif exist %~dp1dec_%targetFile% goto OVERWRITEgoto DECOMPILE:OVERWRITEEcho WARNING: %~dp1dec_%targetFile% already exists.choice /c:YN /m "Would you like to overwrite the file"if errorlevel 2 goto ARGUSTART:DECOMPILEJava -jar %ProgDir%unluac.jar %targetFile% > dec_%targetFile%if not %ProgDir% == %~dp1 goto CLEANINGif not "%1"=="" goto endclsEcho File decompiled succesfully. Echo Input File: %~dp1%targetfile% Echo Output File: %~dp1dec_%targetfile%Echo.pausegoto START:NOTFOUNDEcho The specified file was not found.Echo.pausegoto START:ARGUSTARTif not "%1"=="" goto endgoto START:CLEANINGmove dec_%targetFile% %~dp1dec_%targetFile% > NULdel %ProgDir%%targetFile%if not "%2"=="" goto SHIFTING:ENDif not "%2"=="" goto SHIFTINGexit:NOUNLUACecho ERROR: unluac.jar not found.echo Program must exit.goto END


Version History
V0.1 - Initial Release
V0.2 - Added single file drag and drop support
V0.3 - Added multiple file drag and drop support
You can now drag and drop files from other directories
Program will halt if unluac.jar is not in the same folder as Easy LUA Decompiler

Known Issues
Drag and drop does not work if any of the parent folders has a space in it's name. That will be fixed in the next version. Edited by DeadlyFoez

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this