diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 0b6f8d511..d4a831f40 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -1552,7 +1552,7 @@ public class SWF { if (ins instanceof ActionConstantPool) { constantPool = new ConstantPool(((ActionConstantPool) ins).constantPool); } - int staticOperation = (Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; try { ins.translate(localData, stack, output, staticOperation, path); @@ -1825,7 +1825,7 @@ public class SWF { classNameParts = new String[]{className}; } } - int staticOperation = (Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; List dec = Action.actionsToTree(dia.getActions(version), version, staticOperation, ""/*FIXME*/); GraphTargetItem name = null; for (GraphTargetItem it : dec) { diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 89dc1bca0..14e85e9c6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -624,7 +624,7 @@ public class SWFInputStream extends InputStream { stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); } try { - ins.translate(localData, stack, output, Graph.SOP_SKIP_STATIC, null); + ins.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, null); } catch (Exception ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, "Error during getting constantpool", ex); } @@ -1021,7 +1021,7 @@ public class SWFInputStream extends InputStream { if ((a instanceof ActionStoreRegister) && stack.isEmpty()) { stack.push(new DirectValueActionItem(null, 0, new Null(), new ArrayList())); } - a.translate(localData, stack, output, Graph.SOP_SKIP_STATIC, path); + a.translate(localData, stack, output, Graph.SOP_USE_STATIC/*Graph.SOP_SKIP_STATIC*/, path); } } } catch (RuntimeException ex) { 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 f4c445956..ac90b7915 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -795,7 +795,7 @@ public class AVM2Code implements Serializable { if (ins.definition instanceof IfTypeIns) { t = new PopIns().instructionName + "\n"; if (fixBranch == 0) { //jump - t = new JumpIns().instructionName + " ofs" + Helper.formatAddress(ofs + ins.getBytes().length + ins.operands[0]); + t += new JumpIns().instructionName + " ofs" + Helper.formatAddress(ofs + ins.getBytes().length + ins.operands[0]); } else { //nojump, ignore } @@ -1483,7 +1483,7 @@ public class AVM2Code implements Serializable { localData.add(new ArrayList()); localData.add((Integer) (scriptIndex)); int ret = 0; - ret += removeTraps(localData, new AVM2GraphSource(this, false, -1, -1, new HashMap(), new Stack(), abc, body, new HashMap(), new ArrayList()), 0, path); + ret += removeTraps(constants, body, localData, new AVM2GraphSource(this, false, -1, -1, new HashMap(), new Stack(), abc, body, new HashMap(), new ArrayList()), 0, path); removeIgnored(constants, body); removeDeadCode(constants, body); @@ -2203,13 +2203,15 @@ public class AVM2Code implements Serializable { return ret; } - public static int removeTraps(List localData, AVM2GraphSource code, int addr, String path) { + public static int removeTraps(ConstantPool constants, MethodBody body, List localData, AVM2GraphSource code, int addr, String path) { HashMap decisions = new HashMap<>(); HashMap> refs = new HashMap<>(); code.getCode().visitCode(0, code.size() - 1, refs); removeTraps(refs, false, false, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path); localData.set(2, new HashMap()); - return removeTraps(refs, true, false, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path); + int cnt = removeTraps(refs, true, false, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path); + code.getCode().removeIgnored(constants, body); + return cnt; } /*public static int removeTraps(List localData, AVM2GraphSource code, int addr) { AVM2Graph.translateViaGraph(localData, "", code, new ArrayList(), Graph.SOP_REMOVE_STATIC); 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 3769bb6c0..24cc38570 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 @@ -174,7 +174,11 @@ public class AVM2Instruction implements Serializable, GraphSourceItem { s.append(" m["); s.append(operands[i]); s.append("]\""); - s.append(Helper.escapeString(constants.constant_multiname[operands[i]].toString(constants, fullyQualifiedNames))); + if (constants.constant_multiname[operands[i]] == null) { + s.append(""); + } else { + s.append(Helper.escapeString(constants.constant_multiname[operands[i]].toString(constants, fullyQualifiedNames))); + } s.append("\""); break; case AVM2Code.DAT_STRING_INDEX: diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index f77814aae..e8b49ff98 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -690,7 +690,7 @@ public class Action implements GraphSourceItem { public static String actionsToSource(List actions, int version, String path) { try { //List tree = actionsToTree(new HashMap(), actions, version); - int staticOperation = (Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; + int staticOperation = Graph.SOP_USE_STATIC; //(Boolean) Configuration.getConfig("autoDeobfuscate", true) ? Graph.SOP_SKIP_STATIC : Graph.SOP_USE_STATIC; List tree = actionsToTree(new HashMap(), new HashMap(), new HashMap(), actions, version, staticOperation, path); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java index 1104b6f53..629b22e6f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java @@ -48,6 +48,7 @@ import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; +import java.util.Locale; import java.util.Properties; import java.util.logging.ConsoleHandler; import java.util.logging.FileHandler; @@ -464,6 +465,7 @@ public class Main { * @throws IOException */ public static void main(String[] args) throws IOException { + Locale.setDefault(Locale.GERMAN); loadProperties(); View.setLookAndFeel(); Configuration.loadFromFile(getConfigFile(), getReplacementsFile());