Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for other type of lua 5.1 #21

Open
ImanCol opened this issue Jan 28, 2022 · 4 comments
Open

Support for other type of lua 5.1 #21

ImanCol opened this issue Jan 28, 2022 · 4 comments

Comments

@ImanCol
Copy link

ImanCol commented Jan 28, 2022

I thought you might be interested in adding support for a special type of lua 5.1 files.

These are files from an emulator (NSO) and many of the decompiling tools don't exactly generate a working decompile and break the application. Some files do not even generate code on the decompile.com page, but your decompilicon tool on the web https://lua-decompiler.ferib.dev/ manages to generate data, but with some errors.

Can you bear them?
scripts.zip

@ferib
Copy link
Owner

ferib commented Jan 29, 2022

Hello, the API behind the lua-decompiler.ferib.dev was recently swapped with the luadec 2.2 decompiler as my 'decompiler' was made for educational purposes only. Only after recent increase in traffic I decided to simply ditch my WIP decompiler with an actual working on.

With that said, the luadec v2.2 seems to work perfectly fine on your scripts

@ImanCol
Copy link
Author

ImanCol commented Jan 29, 2022

Yes, but a large part of those .Lua generates errors. I would like to know if I am using the correct version (5.1) in Luadec or these files are another version.

-- DECOMPILER ERROR at PC
Screenshot_20220128-204425_Chrome

2.2 is the latest version of luadec? I can't find a version reference (which doesn't involve using -v in the console)

@ferib
Copy link
Owner

ferib commented Jan 29, 2022

I am not familier with luadec at all, but to check your Lua version, open the Lua file in a Hex editor and check for the magic header bytes. Those magic bytes will reveal the correct lua version.

Having a quick look at the files in notepad will reveal the string LuaQ at the start, the Q is 0x51 in hex, assuming this is indeed Lua version 5.1

@ImanCol
Copy link
Author

ImanCol commented Jan 30, 2022

Ok so your website uses luadec v2.2 (luadec 2.2 rev: 895d923 for Lua 5.1) which I compiled from viruscamp/luadec and got the same result

image
image
Maybe I should send the request to the original repository to verify why it does not read these .lua correctly

Sorry, I thought you knew more about Luadec, and could you help me to know how to get that missing information where the comments appear in the decompiled file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants