diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java
index 908d67b9d..267381587 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2Graph;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphSource;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
+import com.jpexs.decompiler.flash.abc.avm2.instructions.DeobfuscatePopIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Lf32Ins;
@@ -796,7 +797,7 @@ public class AVM2Code implements Serializable {
if (ins.definition instanceof IfTypeIns) {
t = "";
for (int i = 0; i < -ins.definition.getStackDelta(ins, null/*IfTypeIns do not require ABCs*/); i++) {
- t += new PopIns().instructionName + "\n";
+ t += new DeobfuscatePopIns().instructionName + "\n";
}
if (fixBranch == 0) { //jump
t += new JumpIns().instructionName + " ofs" + Helper.formatAddress(ofs + ins.getBytes().length + ins.operands[0]);
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java
index d516e065b..aafb1e509 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java
@@ -336,4 +336,9 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
public int getFixBranch() {
return fixedBranch;
}
+
+ @Override
+ public boolean isDeobfuscatePop() {
+ return definition instanceof DeobfuscatePopIns;
+ }
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java
new file mode 100644
index 000000000..c84cad895
--- /dev/null
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2013 JPEXS
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.jpexs.decompiler.flash.abc.avm2.instructions;
+
+import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns;
+
+/**
+ *
+ * @author JPEXS
+ */
+public class DeobfuscatePopIns extends PopIns {
+
+ public DeobfuscatePopIns() {
+ instructionName = "ffdec_deobfuscatepop";
+ }
+}
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java
index cb1744894..8a94e9037 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/AddAVM2Item.java
@@ -52,7 +52,7 @@ public class AddAVM2Item extends BinaryOpItem {
@Override
public Object getResult() {
if (EcmaScript.type(leftSide.getResult()) == EcmaType.STRING || EcmaScript.type(rightSide.getResult()) == EcmaType.STRING) {
- return leftSide.getResult().toString() + rightSide.getResult().toString();
+ return "" + leftSide.getResult() + rightSide.getResult();
}
return EcmaScript.toNumber(leftSide.getResult()) + EcmaScript.toNumber(rightSide.getResult());
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java
index 6c4a9ea86..8ba718a13 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/parser/ASM3Parser.java
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.avm2.parser;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
+import com.jpexs.decompiler.flash.abc.avm2.instructions.DeobfuscatePopIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.types.ABCException;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
@@ -287,6 +288,12 @@ public class ASM3Parser {
break;
}
}
+ if (symb.value.toString().toLowerCase().equals("ffdec_deobfuscatepop")) {
+ lastIns = new AVM2Instruction(offset, new DeobfuscatePopIns(), new int[0], new byte[0]);
+ code.code.add(lastIns);
+ offset += lastIns.getBytes().length;
+ insFound = true;
+ }
if (!insFound) {
throw new ParseException("Invalid instruction name:" + (String) symb.value, lexer.yyline());
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java
index 45bcdd748..657d31a75 100644
--- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java
+++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java
@@ -36,7 +36,7 @@ import java.util.logging.Logger;
public class MethodBody implements Cloneable, Serializable {
- boolean debugMode = false;
+ boolean debugMode = true;
public int method_info;
public int max_stack;
public int max_regs;
diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java
index cef533c2b..a823ec23b 100644
--- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java
+++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java
@@ -1261,4 +1261,9 @@ public class Action implements GraphSourceItem {
}
return ret;
}
+
+ @Override
+ public boolean isDeobfuscatePop() {
+ return false;
+ }
}
diff --git a/trunk/src/com/jpexs/decompiler/flash/action/special/ActionDeobfuscatePop.java b/trunk/src/com/jpexs/decompiler/flash/action/special/ActionDeobfuscatePop.java
index cdeab633c..9f5341d08 100644
--- a/trunk/src/com/jpexs/decompiler/flash/action/special/ActionDeobfuscatePop.java
+++ b/trunk/src/com/jpexs/decompiler/flash/action/special/ActionDeobfuscatePop.java
@@ -42,4 +42,9 @@ public class ActionDeobfuscatePop extends ActionPop {
}
GraphTargetItem val = stack.pop();
}
+
+ @Override
+ public boolean isDeobfuscatePop() {
+ return true;
+ }
}
diff --git a/trunk/src/com/jpexs/decompiler/graph/Graph.java b/trunk/src/com/jpexs/decompiler/graph/Graph.java
index 883d16d3f..b4529acde 100644
--- a/trunk/src/com/jpexs/decompiler/graph/Graph.java
+++ b/trunk/src/com/jpexs/decompiler/graph/Graph.java
@@ -16,6 +16,7 @@
*/
package com.jpexs.decompiler.graph;
+import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.helpers.Highlighting;
@@ -546,10 +547,33 @@ public class Graph {
return null;
}
- public GraphPart getNextNoJump(GraphPart part) {
+ public GraphPart getNextNoJump(GraphPart part, List