Menu

Exception in thread "main" java.lang.IllegalStateException Lua 5.0

2024-10-31
2024-10-31
  • Able Robert Kuayun

    Hello i encounter an error when decompiling lua scrip 5.0 using unluac.jar

    Exception in thread "main" java.lang.IllegalStateException
    at unluac.parse.BHeader.<init>(BHeader.java:28)
    at unluac.Main.file_to_function(Main.java:55)
    at unluac.Main.main(Main.java:34)</init>

    here are the lua script;
    
     
  • tehtmi

    tehtmi - 2024-10-31

    It was compiled with MAXSTACK 300 which for Lua 5.0 changes the way that certain bytecode instructions referencing constants are encoded. (It sounds like you're maybe using an old unluac version as well, but that's neither here nor there.)

    It's easy to adapt unluac for this change:

    diff -r d01ab6b389a8 src/unluac/Version.java
    --- a/src/unluac/Version.java    Mon Jun 10 11:58:34 2024 -0700
    +++ b/src/unluac/Version.java    Tue Oct 29 09:46:43 2024 -0700
    @@ -181,7 +181,7 @@
               environmenttable = new Setting<>(null);
               useifbreakrewrite = new Setting<>(false);
               usegoto = new Setting<>(false);
    -          rkoffset = new Setting<>(250);
    +          rkoffset = new Setting<>(300);
               allownegativeint = new Setting<Boolean>(false);
               constantslengthmode = new Setting<>(ListLengthMode.STRICT);
               functionslengthmode = new Setting<>(ListLengthMode.STRICT);
    
     
  • Able Robert Kuayun

    alright thanks bro.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.