metaworm / luac-parser-rs

lua bytecode parser written in Rust using nom, part of metaworm's lua decompiler, support lua51/lua52/lua53/lua54/luajit/luau https://luadec.metaworm.site/
https://luadec.metaworm.site/
203 stars 28 forks source link

Decompiled LUA File isn't working - 5.3.4 #39

Open enaske opened 7 months ago

enaske commented 7 months ago

Hey,

I attached a Log.lua File from a Game I play. Used your Decompiler to modify it + download. However the Game errors out, when I run the decompiled File:

I also attached the Encrypter used ( I think thats the one used) Encryption64.zip log.zip

I also tried to enable Disassembly, but it don't do anything.

Utility/log.lua"]:81: no visible label 'label_22' for <goto> at line 75 stack traceback: [C]: in function 'require' ?: in main chunk [C]: in function 'require' ?: in main chunk [C]: in function 'require' ?: in function 'System.system_manager_cpp.Initialize' [2024.03.17-16.22.39:286][246]LogUnLua: Error: Lua error message: file loading from file system error stack traceback: [C]: in ? [C]: in function 'require' ?: in main chunk [C]: in function 'require' ?: in main chunk [C]: in function 'require'

enaske commented 7 months ago

Update, seems to be 5.4

Decompile with unluac (Java Version) works fine, when running now. Recompile as well.

Would be great if you could check the File out. Maybe you can add support for it.

As special if I could have a reference to the Bytecode, because modify Bytecode is super annoying :)

metaworm commented 5 months ago

In the decompiled results, labels are used to indicate jump relationships, but they do not necessarily guarantee that the code can still be compiled by Lua. In some cases, restoration failures may lead to this issue. For such situations, you should carefully review the logic and manually restore the Lua code.