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/
204 stars 28 forks source link

decompile: parse luac: Error( Stack #40

Closed jjc6676 closed 5 months ago

jjc6676 commented 6 months ago

Getting an error message when trying to load file. These were working before. Just wondering what I can do to get it working? Any help would be greatly appreciated.

Screenshot 2024-05-08 162631

toxamin commented 6 months ago

perhaps you should send the file so the issue can be debugged? :D

jjc6676 commented 5 months ago

card.zip

Thank you for the suggestion @toxamin

toxamin commented 5 months ago

this seems to be a modified non-official bytecode format, i've checked the file to discover the format id has been changed to 1 and an extra luanum has been added to the header (9221). i have attached the decompiled file output.zip

toxamin commented 5 months ago

note, should you wish to decompile the file yourself all you need to do is simply remove the extra 8 bytes, which are shown in the screenshot: image

jjc6676 commented 5 months ago

This is most excellent, and I appreciate your hard work. Can you tell me which program I can use to remove the extra bytes? VS Studio? Pulsar? or something else? I apologize as I am still learning. @toxamin

Thank you in advance!

jjc6676 commented 5 months ago

I learned that I need to use a hex editor @toxamin The part above highlighted in the second part with the $ symbol... Do I need to delete that as well?

jjc6676 commented 5 months ago

I figured it all out - sorry for the questions. Thank you so much!