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.

#1060 Wrong and / or when compiled as push false / push true
Author:
Brandon

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

im using 6.0.2 nightly build 950. i chekced all previous 6.0. problem exists in each
build
> What steps will reproduce the problem?
open attached file and check for any conditions (if, while) that has multiple operands
for example look into match.base.MatchLevel.as
public function updateAlternativeMatchGroup() : void
{
var _loc4_:* = null as MatchGroup;
var _loc1_:MatchGroup = null;
var _loc2_:int = 0;
var _loc3_:Array = _matchGroups;
while(_loc2_ < _loc3_.length)
{
_loc4_ = _loc3_[_loc2_];
_loc2_++;
if(_loc1_ == null && _loc1_.id <= _loc4_.id || _loc4_.totalRatio > 0)
{
...
It is clear that
if(_loc1_ == null && _loc1_.id <= _loc4_.id || _loc4_.totalRatio > 0)
should look like
if(_loc1_ == null || _loc1_.id <= _loc4_.id && _loc4_.totalRatio > 0)
Next is match.amy.AmyLevel.as (line 238)
else if(_loc15_.type != "objectgroup" || _loc15_.name == "decor1")
should look like
else if(_loc15_.type == "objectgroup" && _loc15_.name == "decor1")
Next is match.amy.AmyLevel.as (line 286)
if(_loc24_.gid < 181 || _loc24_.gid <= 195)
should look like
if(_loc24_.gid >= 181 && _loc24_.gid <= 195)
Next is match.amy.AmyLevel.as (line 521)
if(_loc35_ == null || _loc35_.getTile() != null)
should look like
if(_loc35_ != null && _loc35_.getTile() != null)
> What is the expected output? What do you see instead?
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
> Please provide any additional information below. If the problem is related to a SWF
file, attach it here, otherwise we can't help you.

So. Is this bug ?
Or some kind of tricky obfuscation ?
I think this is a bug
Also i noticed, that there are no definition for static variables.
public class SomeClass
{
public static var a:Array = new Array();
...
}
will be decompiled as
public class SomeClass
{
public static var a:Array;
...
}
for example see match.amy.MatchRule2
or is it'll be better to make separate ticket ?
match.amy.MatchRule2 (line 15)
public static var directions:Array;
should be something like public static var directions:Array = new Array([0,1],[1,0]....)
I think until they are in the same swf, and each problem is an incorrect decompilation,
you can write all of them here, but JPEXS will correct me if he has another opinion.
Is there something i could do to help?
ifs and whiles are not so bad, because the could be reverted to its original form.
but static variables are big data losses. no way to recover it :(
Anyway i want to Thank You for such product.
None of existing decompilers could ever achive such amazingly close results!
FFDec is opensource, you can try to fix the problem, and send a pull request with the
fix:)
Wooh it would be the longest fix history of development ever seen.
Since i have to lear java first :)
It is not really about Java, it is about an algorithm... It is almost the same in every
language:)
Please create separate issue for those static variables. These are initialized in script
initializer and we need to handle script initializer correctly.
I will solve the && + || problem here.
Thanks.
Title: Incorrect decompilation →Wrong and / or conditions
Since nither i dont know decompilation algorithms nor java.
Hope my donation will help you some how :-)
JPEXS, issue about static variables is created.
Thank's in advance.
Hi, thanks for the donation, but I don't like the idea that the donation will speed up our
work on it.
It needs to be fixed no matter of any donations. If you donated only because of this
incomplete issue, then please rather take it back, because it makes me sad this way.
The decompiler is free and always will be free, we do not accept any money to do
something.
I will surely take a look what's wrong there and fix it, but it will take some time and
our time is limited. We have our regular jobs. Receiving money for it don't give us more
time to do it....
JPEXS didnt want to speed you up.
just wanted to help. and this is the only way i could do it.
okay, thanks :-)
no problem :-)
Should be fixed in nightly 958 or later
State: new→upgraded
Title: Wrong and / or conditions→Wrong and / or when compiled as push false / push true
Title: Wrong and / or conditions→Wrong and / or when compiled as push false / push true
In 962, I fixed it once more, this time for real I guess :-)
Seems like it is ok.
Thank you, JPEXS!
I say about people, when i see what they do.
You have an excellent hobby, a sharp mind and amazing tallent.
State: upgraded→closed