Menu

decompiled is not the same lua version

myhrmans
2025-11-22
2025-11-22
  • myhrmans

    myhrmans - 2025-11-22

    Hi there.

    When I decompile a file that is lua 5.1 it ends up with goto functions which came in 5.2 - How can I tell the version the decompiled code should have?

     
  • tehtmi

    tehtmi - 2025-11-22

    Currently, you can --disassemble and the first line should be .version 5.1. Probably at some point I will add comments to the decompilation with certain metadata.

    Gotos from decompiling versions before 5.2 happen as a fallback when working with debug-stripped code. As unluac doesn't properly support these yet, its poor understanding of which registers are temporary can lead to situations where decompiling without gotos is impossible -- gotos are used as an alternative to failure (since it might still be useful to read even if it can't be re-compiled as is).

     

Log in to post a comment.