From 7f7c6e0e8f92acd8b90580183ed65684d77bb44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Mon, 8 Jul 2013 15:28:18 +0200 Subject: [PATCH] fixed fileattributes tag reading --- trunk/src/com/jpexs/decompiler/flash/SWF.java | 7 ++++++- trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java | 1 + trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index d51609034..3fbfc6846 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -328,6 +328,10 @@ public class SWF { tags = sis.readTagList(0, paralelRead, true); assignExportNamesToSymbols(); assignClassesToSymbols(); + findFileAttributes(); + } + + private void findFileAttributes(){ for (Tag t : tags) { if (t instanceof FileAttributesTag) { fileAttributes = (FileAttributesTag) t; @@ -335,7 +339,7 @@ public class SWF { } } } - + private void assignExportNamesToSymbols() { HashMap exportNames = new HashMap<>(); for (Tag t : tags) { @@ -1729,6 +1733,7 @@ public class SWF { HashMap typeCounts = new HashMap<>(); public int deobfuscateIdentifiers(RenameType renameType) { + findFileAttributes(); if (fileAttributes == null) { int cnt = 0; cnt += deobfuscateAS2Identifiers(renameType); diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 41ac951eb..b3de07e14 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -1228,6 +1228,7 @@ public class SWFInputStream extends InputStream { if (fileAttributes.actionScript3) { isAS3 = true; } + doParse = true; break; case DoActionTag.ID: case DoInitActionTag.ID: diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java index 40358af35..107ac0d1a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java @@ -51,7 +51,7 @@ public class SwitchItem extends LoopItem implements Block { ret += hilight("switch(") + switchedObject.toString(localData) + hilight(")") + "\r\n{\r\n"; for (int i = 0; i < caseCommands.size(); i++) { for (int k = 0; k < valuesMapping.size(); k++) { - if (valuesMapping.get(k) == i) { + if (valuesMapping.get(k) == i) { ret += "case " + caseValues.get(k).toString(localData) + ":\r\n"; } }