i try to recover lua code from the compiled op code. I hope you can help me with this.
195 [-] GETTABLE 7 0 177 ; "formcontainer"
196 [-] GETTABLE 7 7 178 ; "form"
197 [-] GETTABLE 8 7 179 ; "elements"
198 [-] GETTABLE 8 8 180 ; "appear"
199 [-] TEST 5 5 0
200 [-] JMP 0 3 ; to 204
201 [-] MOVE 9 6 0
202 [-] JMP 0 2 ; to 205
203 [-] LOADBOOL 9 0 1
204 [-] LOADBOOL 9 1 0
205 [-] SETTABLE 8 181 9 ; "hidden"
This is the code that it is all about. what i already recovered is this part:
form.elements["appear"].hidden =
Lines 195 to 198 just get the right table and temporary store it in register 8 (r8) in the lines 199 to 204 the value that should be stored ins determined and temporary set to r9, so it can be set to the member hidden of r8.
r5 is called bCouldBeXLive and r6 is bIsGalaxy i'm sure it's something like
form.elements["appear"].hidden = if bCouldBeXLive then bIsGalaxy else true end
But this is not valid lua 5.0.2 code.
Already tried
form.elements["appear"].hidden = bCouldBeXLive and bIsGalaxy or true
but this would end in two TEST operations.
195 [-] GETTABLE 7 0 177 ; "formcontainer"
196 [-] GETTABLE 7 7 178 ; "form"
197 [-] GETTABLE 8 7 179 ; "elements"
198 [-] GETTABLE 8 8 180 ; "appear"
199 [-] TEST 5 5 0
200 [-] JMP 0 2 ; to 203
201 [-] TEST 9 6 1
202 [-] JMP 0 1 ; to 204
203 [-] LOADBOOL 9 1 0
204 [-] SETTABLE 8 181 9 ; "hidden"
Specially the line 203 of the original op code surprise me, because it's never executed.
For me the op code looks like a ternary operator. Do you know a variant that fits the original op code?