unluau: Unknown capture type 1 when decoding specific Alan Wake 2 *.binlua files (1.0.8 alpha)

When decoding .binlua files (quite literally luau renamed to binlua, thanks Remedy) simple scripts will work and output something right, but on a good chunk the decompiler will produce this error;

[20:01:12 FTL] Decompilation error Unluau.DecompilerException: Unknown capture type 1 at Unluau.Lifter.LiftBlock(Function function, Registers registers, Int32 pcStart, Int32 pcStop) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Lifter.cs:line 528 at Unluau.Lifter.LiftProgram() in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Lifter.cs:line 36 at Unluau.Decompiler.Decompile() in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Decompiler.cs:line 48 at Unluau.CLI.Program.RunOptions(Options options) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau.CLI\Program.cs:line 119

Is this an issue regarding support of for loops?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Just wanted to check in quickly. I have been rewriting Unluau for the past weeks and am adding an IL to facilitate control flow analysis. Hopefully this set up will resolve most issues the alpha version faces.

Just pushed a new change that should fix a few scripts. Not all.

I also get another different error on different files; [21:40:25 FTL] Unexpected error; please report here: https://github.com/atrexus/unluau/issues System.NullReferenceException: Object reference not set to an instance of an object. at Unluau.IfElse.Write(Output output) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Statements\IfElse.cs:line 28 at Unluau.Statement.WriteSequence(Output output, IList 1 statements) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Statements\Statement.cs:line 20 at Unluau.Block.Write(Output output) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Statements\Block.cs:line 33 at Unluau.Closure.Write(Output output) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Expressions\Closure.cs:line 47 at Unluau.Assignment.Write(Output output) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Statements\Assignment.cs:line 30 at Unluau.Statement.WriteSequence(Output output, IList 1 statements) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Statements\Statement.cs:line 20 at Unluau.OuterBlock.Write(Output output) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Lifter\Statements\OuterBlock.cs:line 24 at Unluau.Decompiler.Decompile() in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau\Decompiler.cs:line 53 at Unluau.CLI.Program.RunOptions(Options options) in C:\Users\infur\Documents\unluau-1.0.8-alpha\src\Unluau.CLI\Program.cs:line 119 playable_character_selector.zip

Now that the capture issue has been fixed, while it has opened up my scope on the scripts I can actually decompile, I’m getting more variations on this specific error. They don’t always produce the same traceback either, which makes me think it’s gonna be horrible to actually look into on a consistent basis. On some occasions, it’ll actually produce output in the specified file, but it always cuts off at strange locations, like in the middle of a function. I’ve attached a zip file containing a few files that don’t work. objectnotset.zip

Take at look at the most recent version, I added a few more things.

@riverence Thank you for all of the bugs, I will get to them as soon as possible.