fixed fileattributes tag reading

This commit is contained in:
Jindra Pet��k
2013-07-08 15:28:18 +02:00
parent d575cb2fbc
commit 7f7c6e0e8f
3 changed files with 8 additions and 2 deletions
@@ -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<Integer, String> exportNames = new HashMap<>();
for (Tag t : tags) {
@@ -1729,6 +1733,7 @@ public class SWF {
HashMap<String, Integer> typeCounts = new HashMap<>();
public int deobfuscateIdentifiers(RenameType renameType) {
findFileAttributes();
if (fileAttributes == null) {
int cnt = 0;
cnt += deobfuscateAS2Identifiers(renameType);
@@ -1228,6 +1228,7 @@ public class SWFInputStream extends InputStream {
if (fileAttributes.actionScript3) {
isAS3 = true;
}
doParse = true;
break;
case DoActionTag.ID:
case DoInitActionTag.ID:
@@ -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";
}
}