If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : We have got a new blog where we post some interesting SWF internals info.

#1070 Incorrect decompilation of switch statement
Author:
Brandon

Date created:
Type: bug
Visibility: Everybody
Assigned to:
State: closed 

> What steps will reproduce the problem?
/www.free-decompiler.com/flash/issues/1060-wrong-and-or-when-compiled-as-push-false-push-t
rue
Get swf from this ticket.
Open it. Go to match.Amy.AmyLevel (line 1215)
You will see
if(param1 >= 61 && param1 <= 66 || param1 >= 81 && param1 <= 82)
{
_loc23_ = new ToyTile(param1);
switch(param1)
{
case 0:
if(_collectGoalArr[0] > 0)
{
_loc23_.collectBehaviourId = 0;
}
break;
case 1:
...
> What is the expected output? What do you see instead?
expected something like:
if(param1 >= 61 && param1 <= 66 || param1 >= 81 && param1 <= 82)
{
_loc23_ = new ToyTile(param1);
switch(param1)
{
case 61:
if(_collectGoalArr[0] > 0)
{
_loc23_.collectBehaviourId = 0;
}
break;
case 62:
...
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
6.0.1.994 nightly
> Please provide any additional information below. If the problem is related to a SWF
file, attach it here, otherwise we can't help you.
/www.free-decompiler.com/flash/issues/1060-wrong-and-or-when-compiled-as-push-false-push-t
rue
Get swf from this ticket.
Also can be reproduced with our as3.swf file.
Current:
public function testSwitch() : *
{
switch(4)
{
case 0:
trace("fiftyseven multiply a");
break;
case 1:
trace("thirteen");
case 2:
trace("fourteen");
break;
case 3:
trace("eightynine");
break;
}
}
Expected:
public function testSwitch() : *
{
var a:* = 5;
switch(a)
{
case 57 * a:
trace("fiftyseven multiply a");
break;
case 13:
trace("thirteen");
case 14:
trace("fourteen");
break;
case 89:
trace("eightynine");
break;
}
}
Only with enabled deobfuscation.
However this can be ok, because "a" is constant so the deobfuscated code is equivalent
with the orginal:)
Deobfuscator should remove the deterministic lookupswitch instructions.
Fixed in the latest nightly build.
State: new→upgraded
I close this issue due to inactivity. Please create new issue if problem still exists.
State: upgraded→closed