From 203abdd561d2adca80b1defe3941db15584db209 Mon Sep 17 00:00:00 2001 From: Honfika Date: Sun, 12 Jan 2014 23:43:30 +0100 Subject: [PATCH] LocalData object instead of object lists --- .../jpexs/decompiler/flash/BaseLocalData.java | 25 +++++ .../flash/FinalProcessLocalData.java | 32 ++++++ trunk/src/com/jpexs/decompiler/flash/SWF.java | 5 +- .../flash/SourceGeneratorLocalData.java | 38 +++++++ .../decompiler/flash/abc/AVM2LocalData.java | 80 ++++++++++++++ .../decompiler/flash/abc/avm2/AVM2Code.java | 95 +++++++++-------- .../flash/abc/avm2/graph/AVM2Graph.java | 100 ++++++++---------- .../flash/abc/avm2/graph/AVM2GraphSource.java | 8 +- .../avm2/instructions/AVM2Instruction.java | 22 ++-- .../jpexs/decompiler/flash/action/Action.java | 12 +-- .../decompiler/flash/action/ActionGraph.java | 16 +-- .../flash/action/ActionGraphSource.java | 3 +- .../flash/action/ActionListReader.java | 81 ++++++-------- .../flash/action/ActionLocalData.java | 50 +++++++++ .../flash/action/model/ActionItem.java | 5 +- .../action/model/AsciiToCharActionItem.java | 3 +- .../flash/action/model/CallActionItem.java | 3 +- .../action/model/CallFunctionActionItem.java | 3 +- .../action/model/CallMethodActionItem.java | 3 +- .../flash/action/model/CastOpActionItem.java | 3 +- .../action/model/CharToAsciiActionItem.java | 3 +- .../action/model/CloneSpriteActionItem.java | 3 +- .../action/model/DecrementActionItem.java | 3 +- .../action/model/DefineLocalActionItem.java | 3 +- .../flash/action/model/DeleteActionItem.java | 3 +- .../action/model/DirectValueActionItem.java | 3 +- .../flash/action/model/EvalActionItem.java | 3 +- .../action/model/FSCommand2ActionItem.java | 3 +- .../action/model/FSCommandActionItem.java | 3 +- .../action/model/FunctionActionItem.java | 5 +- .../action/model/GetMemberActionItem.java | 3 +- .../action/model/GetPropertyActionItem.java | 3 +- .../flash/action/model/GetTimeActionItem.java | 3 +- .../flash/action/model/GetURL2ActionItem.java | 3 +- .../flash/action/model/GetURLActionItem.java | 3 +- .../action/model/GetVariableActionItem.java | 3 +- .../action/model/GetVersionActionItem.java | 3 +- .../action/model/GotoFrame2ActionItem.java | 3 +- .../action/model/GotoFrameActionItem.java | 3 +- .../action/model/GotoLabelActionItem.java | 3 +- .../action/model/IncrementActionItem.java | 3 +- .../action/model/InitArrayActionItem.java | 3 +- .../action/model/InitObjectActionItem.java | 3 +- .../action/model/LoadMovieActionItem.java | 3 +- .../action/model/LoadMovieNumActionItem.java | 3 +- .../action/model/LoadVariablesActionItem.java | 3 +- .../model/LoadVariablesNumActionItem.java | 3 +- .../action/model/MBAsciiToCharActionItem.java | 3 +- .../action/model/MBCharToAsciiActionItem.java | 3 +- .../model/MBStringExtractActionItem.java | 3 +- .../model/MBStringLengthActionItem.java | 3 +- .../action/model/NewMethodActionItem.java | 3 +- .../action/model/NewObjectActionItem.java | 3 +- .../action/model/NextFrameActionItem.java | 3 +- .../flash/action/model/PlayActionItem.java | 3 +- .../flash/action/model/PopActionItem.java | 3 +- .../action/model/PostDecrementActionItem.java | 5 +- .../action/model/PostIncrementActionItem.java | 5 +- .../action/model/PrevFrameActionItem.java | 3 +- .../flash/action/model/PrintActionItem.java | 3 +- .../action/model/PrintAsBitmapActionItem.java | 3 +- .../model/PrintAsBitmapNumActionItem.java | 3 +- .../action/model/PrintNumActionItem.java | 3 +- .../action/model/RandomNumberActionItem.java | 3 +- .../action/model/RemoveSpriteActionItem.java | 3 +- .../flash/action/model/ReturnActionItem.java | 3 +- .../action/model/SetMemberActionItem.java | 5 +- .../action/model/SetPropertyActionItem.java | 5 +- .../action/model/SetTarget2ActionItem.java | 3 +- .../action/model/SetTargetActionItem.java | 3 +- .../action/model/SetVariableActionItem.java | 5 +- .../action/model/StartDragActionItem.java | 3 +- .../flash/action/model/StopActionItem.java | 3 +- .../action/model/StopAllSoundsActionItem.java | 3 +- .../action/model/StopDragActionItem.java | 3 +- .../action/model/StoreRegisterActionItem.java | 3 +- .../action/model/StringExtractActionItem.java | 3 +- .../action/model/StringLengthActionItem.java | 3 +- .../action/model/TargetPathActionItem.java | 3 +- .../flash/action/model/ThrowActionItem.java | 3 +- .../action/model/ToIntegerActionItem.java | 3 +- .../action/model/ToNumberActionItem.java | 3 +- .../action/model/ToStringActionItem.java | 3 +- .../model/ToggleHighQualityActionItem.java | 3 +- .../flash/action/model/TraceActionItem.java | 3 +- .../flash/action/model/TypeOfActionItem.java | 3 +- .../action/model/UnLoadMovieActionItem.java | 3 +- .../model/UnLoadMovieNumActionItem.java | 3 +- .../action/model/clauses/ClassActionItem.java | 5 +- .../action/model/clauses/ForInActionItem.java | 3 +- .../clauses/IfFrameLoadedActionItem.java | 3 +- .../model/clauses/InterfaceActionItem.java | 3 +- .../model/clauses/TellTargetActionItem.java | 3 +- .../action/model/clauses/TryActionItem.java | 3 +- .../action/model/clauses/WithActionItem.java | 3 +- .../model/operations/AddActionItem.java | 3 +- .../model/operations/AndActionItem.java | 3 +- .../model/operations/BitAndActionItem.java | 3 +- .../model/operations/BitOrActionItem.java | 3 +- .../model/operations/BitXorActionItem.java | 3 +- .../model/operations/DivideActionItem.java | 3 +- .../action/model/operations/EqActionItem.java | 3 +- .../action/model/operations/GeActionItem.java | 3 +- .../action/model/operations/GtActionItem.java | 3 +- .../operations/InstanceOfActionItem.java | 3 +- .../model/operations/LShiftActionItem.java | 3 +- .../action/model/operations/LeActionItem.java | 3 +- .../action/model/operations/LtActionItem.java | 3 +- .../model/operations/ModuloActionItem.java | 3 +- .../model/operations/MultiplyActionItem.java | 3 +- .../model/operations/NeqActionItem.java | 3 +- .../action/model/operations/OrActionItem.java | 3 +- .../operations/PreDecrementActionItem.java | 3 +- .../operations/PreIncrementActionItem.java | 3 +- .../model/operations/RShiftActionItem.java | 3 +- .../model/operations/StrictEqActionItem.java | 3 +- .../model/operations/StrictNeqActionItem.java | 3 +- .../model/operations/StringAddActionItem.java | 3 +- .../model/operations/StringEqActionItem.java | 3 +- .../model/operations/StringLtActionItem.java | 3 +- .../model/operations/SubtractActionItem.java | 3 +- .../model/operations/URShiftActionItem.java | 3 +- .../parser/script/ActionScriptParser.java | 10 +- .../parser/script/ActionSourceGenerator.java | 72 ++++++------- .../action/special/ActionDeobfuscatePop.java | 3 +- .../decompiler/flash/gui/GraphFrame.java | 3 +- .../flash/gui/abc/UsageListModel.java | 3 - .../src/com/jpexs/decompiler/graph/Graph.java | 52 ++++----- .../com/jpexs/decompiler/graph/GraphPart.java | 5 +- .../jpexs/decompiler/graph/GraphSource.java | 3 +- .../decompiler/graph/GraphSourceItem.java | 3 +- .../decompiler/graph/GraphTargetItem.java | 7 +- .../decompiler/graph/SourceGenerator.java | 29 ++--- .../jpexs/decompiler/graph/model/AndItem.java | 3 +- .../decompiler/graph/model/BlockItem.java | 3 +- .../decompiler/graph/model/BreakItem.java | 3 +- .../graph/model/CommaExpressionItem.java | 3 +- .../decompiler/graph/model/ContinueItem.java | 3 +- .../decompiler/graph/model/DoWhileItem.java | 3 +- .../decompiler/graph/model/DuplicateItem.java | 3 +- .../jpexs/decompiler/graph/model/ForItem.java | 3 +- .../jpexs/decompiler/graph/model/IfItem.java | 3 +- .../jpexs/decompiler/graph/model/NotItem.java | 3 +- .../jpexs/decompiler/graph/model/OrItem.java | 3 +- .../graph/model/ParenthesisItem.java | 3 +- .../decompiler/graph/model/SwitchItem.java | 3 +- .../decompiler/graph/model/TernarOpItem.java | 3 +- .../decompiler/graph/model/WhileItem.java | 3 +- 148 files changed, 725 insertions(+), 417 deletions(-) create mode 100644 trunk/src/com/jpexs/decompiler/flash/BaseLocalData.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java create mode 100644 trunk/src/com/jpexs/decompiler/flash/action/ActionLocalData.java diff --git a/trunk/src/com/jpexs/decompiler/flash/BaseLocalData.java b/trunk/src/com/jpexs/decompiler/flash/BaseLocalData.java new file mode 100644 index 000000000..455f3b4f8 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/BaseLocalData.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2010-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; + +/** + * + * @author JPEXS + */ +public abstract class BaseLocalData { + +} diff --git a/trunk/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java b/trunk/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java new file mode 100644 index 000000000..97b5a0110 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/FinalProcessLocalData.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2010-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; + +import java.util.HashSet; + +/** + * + * @author JPEXS + */ +public class FinalProcessLocalData { + + public final HashSet temporaryRegisters; + + public FinalProcessLocalData() { + temporaryRegisters = new HashSet<>(); + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index c2af251d0..03272dd0b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionDeobfuscation; import com.jpexs.decompiler.flash.action.ActionGraphSource; +import com.jpexs.decompiler.flash.action.ActionLocalData; import com.jpexs.decompiler.flash.action.model.ConstantPool; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; @@ -1552,7 +1553,7 @@ public final class SWF implements TreeItem { private HashMap usageTypes = new HashMap<>(); private ActionDeobfuscation deobfuscation = new ActionDeobfuscation(); - private static void getVariables(ConstantPool constantPool, List localData, Stack stack, List output, ActionGraphSource code, int ip, List> variables, List functions, HashMap strings, List visited, HashMap usageTypes, String path) throws InterruptedException { + private static void getVariables(ConstantPool constantPool, BaseLocalData localData, Stack stack, List output, ActionGraphSource code, int ip, List> variables, List functions, HashMap strings, List visited, HashMap usageTypes, String path) throws InterruptedException { boolean debugMode = false; while ((ip > -1) && ip < code.size()) { if (visited.contains(ip)) { @@ -1717,7 +1718,7 @@ public final class SWF implements TreeItem { } private static void getVariables(List> variables, List functions, HashMap strings, HashMap usageType, ActionGraphSource code, int addr, String path) throws InterruptedException { - List localData = Helper.toList(new HashMap(), new HashMap(), new HashMap()); + ActionLocalData localData = new ActionLocalData(); getVariables(null, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList(), usageType, path); } diff --git a/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java b/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java new file mode 100644 index 000000000..1f4425971 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010-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; + +import java.util.HashMap; + +/** + * + * @author JPEXS + */ +public class SourceGeneratorLocalData { + + public HashMap registerVars; + public Boolean inFunction; + public Boolean inMethod; + public Integer forInLevel; + + public SourceGeneratorLocalData(HashMap registerVars, Boolean inFunction, Boolean inMethod, Integer forInLevel) { + this.registerVars = registerVars; + this.inFunction = inFunction; + this.inMethod = inMethod; + this.forInLevel = forInLevel; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java b/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java new file mode 100644 index 000000000..75c031105 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2010-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; + +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.abc.types.ABCException; +import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.GraphTargetItem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Stack; + +/** + * + * @author JPEXS + */ +public class AVM2LocalData extends BaseLocalData { + + public Boolean isStatic; + public Integer classIndex; + public HashMap localRegs; + public Stack scopeStack; + public ConstantPool constants; + public MethodInfo[] methodInfo; + public MethodBody methodBody; + public ABC abc; + public HashMap localRegNames; + public List fullyQualifiedNames; + public ArrayList parsedExceptions; + public ArrayList finallyJumps; + public ArrayList ignoredSwitches; + public Integer scriptIndex; + public HashMap localRegAssignmentIps; + public Integer ip; + public HashMap> refs; + public AVM2Code code; + + public AVM2LocalData() { + + } + + public AVM2LocalData(AVM2LocalData localData) { + isStatic = localData.isStatic; + classIndex = localData.classIndex; + localRegs = localData.localRegs; + scopeStack = localData.scopeStack; + constants = localData.constants; + methodInfo = localData.methodInfo; + methodBody = localData.methodBody; + abc = localData.abc; + localRegNames = localData.localRegNames; + fullyQualifiedNames = localData.fullyQualifiedNames; + parsedExceptions = localData.parsedExceptions; + finallyJumps = localData.finallyJumps; + ignoredSwitches = localData.ignoredSwitches; + scriptIndex = localData.scriptIndex; + localRegAssignmentIps = localData.localRegAssignmentIps; + ip = localData.ip; + refs = localData.refs; + code = localData.code; + } +} 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 32017a0fb..52d42e2fe 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ABCInputStream; +import com.jpexs.decompiler.flash.abc.AVM2LocalData; 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; @@ -1647,51 +1648,51 @@ public class AVM2Code implements Serializable { } @SuppressWarnings("unchecked") - private static List prepareBranchLocalData(List localData) { - List ret = new ArrayList<>(); - ret.add(localData.get(0)); //isStatic - ret.add(localData.get(1)); //classIndex - ret.add(new HashMap<>((HashMap) localData.get(2))); - ret.add((Stack) ((Stack) localData.get(3)).clone()); - ret.add(localData.get(4)); //constants - ret.add(localData.get(5)); //method_info - ret.add(localData.get(6)); //body - ret.add(localData.get(7)); //abc - ret.add(localData.get(8)); //localgetNames - ret.add(localData.get(9)); - ret.add(localData.get(10)); - ret.add(localData.get(11)); - ret.add(localData.get(12)); - ret.add(localData.get(13)); - ret.add(localData.get(14)); - ret.add(localData.get(15)); - ret.add(localData.get(16)); - ret.add(localData.get(17)); + private static AVM2LocalData prepareBranchLocalData(AVM2LocalData localData) { + AVM2LocalData ret = new AVM2LocalData(); + ret.isStatic = localData.isStatic; + ret.classIndex = localData.classIndex; + ret.localRegs = new HashMap<>(localData.localRegs); + ret.scopeStack = (Stack) (localData.scopeStack).clone(); + ret.constants = localData.constants; + ret.methodInfo = localData.methodInfo; + ret.methodBody = localData.methodBody; + ret.abc = localData.abc; + ret.localRegNames = localData.localRegNames; + ret.fullyQualifiedNames = localData.fullyQualifiedNames; + ret.parsedExceptions = localData.parsedExceptions; + ret.finallyJumps = localData.finallyJumps; + ret.ignoredSwitches = localData.ignoredSwitches; + ret.scriptIndex = localData.scriptIndex; + ret.localRegAssignmentIps = localData.localRegAssignmentIps; + ret.ip = localData.ip; + ret.refs = localData.refs; + ret.code = localData.code; return ret; } public int removeTraps(ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, ABC abc, int scriptIndex, int classIndex, boolean isStatic, String path) throws InterruptedException { removeDeadCode(constants, trait, info, body); - List localData = new ArrayList<>(); - localData.add((Boolean) isStatic); //isStatic - localData.add((Integer) (classIndex)); //classIndex - localData.add(new HashMap()); - localData.add(new Stack()); - localData.add(abc.constants); - localData.add(abc.method_info); - localData.add(body); - localData.add(abc); - localData.add(body.getLocalRegNames(abc)); //localRegNames - localData.add(new ArrayList()); //fullyQualifiedNames - localData.add(new ArrayList()); - localData.add(new ArrayList()); - localData.add(new ArrayList()); - localData.add((Integer) (scriptIndex)); - localData.add(new HashMap()); //localRegAssignmentIps - localData.add(Integer.valueOf(0)); + AVM2LocalData localData = new AVM2LocalData(); + localData.isStatic = isStatic; + localData.classIndex = classIndex; + localData.localRegs = new HashMap<>(); + localData.scopeStack = new Stack<>(); + localData.constants = abc.constants; + localData.methodInfo = abc.method_info; + localData.methodBody = body; + localData.abc = abc; + localData.localRegNames = body.getLocalRegNames(abc); + localData.fullyQualifiedNames = new ArrayList<>(); + localData.parsedExceptions = new ArrayList<>(); + localData.finallyJumps = new ArrayList<>(); + localData.ignoredSwitches = new ArrayList<>(); + localData.scriptIndex = scriptIndex; + localData.localRegAssignmentIps = new HashMap<>(); + localData.ip = 0; HashMap> refs = visitCode(body); - localData.add(refs); - localData.add(this); + localData.refs = refs; + localData.code = this; int ret = 0; ret += removeTraps(constants, trait, info, body, localData, new AVM2GraphSource(this, false, -1, -1, new HashMap(), new Stack(), abc, body, new HashMap(), new ArrayList(), new HashMap(), refs), 0, path, refs); removeIgnored(constants, trait, info, body); @@ -2379,7 +2380,7 @@ public class AVM2Code implements Serializable { } @SuppressWarnings("unchecked") - private static int removeTraps(HashMap> refs, boolean secondPass, boolean indeterminate, List localData, Stack stack, List output, AVM2GraphSource code, int ip, HashMap visited, HashMap> visitedStates, HashMap decisions, String path, int recursionLevel) throws InterruptedException { + private static int removeTraps(HashMap> refs, boolean secondPass, boolean indeterminate, AVM2LocalData localData, Stack stack, List output, AVM2GraphSource code, int ip, HashMap visited, HashMap> visitedStates, HashMap decisions, String path, int recursionLevel) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -2401,7 +2402,7 @@ public class AVM2Code implements Serializable { visited.put(ip, visited.get(ip) + 1); } } else { - HashMap currentState = (HashMap) localData.get(2); + HashMap currentState = localData.localRegs; if (visitedStates.containsKey(ip)) { HashMap lastState = visitedStates.get(ip); @@ -2451,7 +2452,7 @@ public class AVM2Code implements Serializable { if (debugMode) { System.out.println((indeterminate ? "useV " : "") + (secondPass ? "secondPass " : "") + "Visit " + ip + ": " + ins + " stack:" + stack.toString()); - HashMap registers = (HashMap) localData.get(2); + HashMap registers = localData.localRegs; System.out.print("Registers:"); for (int reg : registers.keySet()) { try { @@ -2485,7 +2486,7 @@ public class AVM2Code implements Serializable { if (((AVM2Instruction) ins).definition instanceof NewFunctionIns) { stack.push(new BooleanAVM2Item(null, true)); } else { - localData.set(15, ip); + localData.ip = ip; ins.translate(localData, stack, output, Graph.SOP_USE_STATIC, path); } @@ -2494,7 +2495,7 @@ public class AVM2Code implements Serializable { SetLocalTypeIns slt = (SetLocalTypeIns) ins.definition; int regId = slt.getRegisterId(ins); if (indeterminate) { - HashMap registers = (HashMap) localData.get(2); + HashMap registers = localData.localRegs; GraphTargetItem regVal = registers.get(regId); if (regVal.isCompileTime()) { registers.put(regId, new NotCompileTimeItem(null, regVal)); @@ -2577,7 +2578,7 @@ public class AVM2Code implements Serializable { } else { decisions.put(ins, dec); } - HashMap registers = (HashMap) localData.get(2); + HashMap registers = localData.localRegs; boolean regChanged = false; if (!dec.registers.isEmpty()) { if (dec.registers.size() != registers.size()) { @@ -2636,7 +2637,7 @@ public class AVM2Code implements Serializable { return ret; } - public static int removeTraps(ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, List localData, AVM2GraphSource code, int addr, String path, HashMap> refs) throws InterruptedException { + public static int removeTraps(ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, AVM2LocalData localData, AVM2GraphSource code, int addr, String path, HashMap> refs) throws InterruptedException { HashMap decisions = new HashMap<>(); removeTraps(refs, false, false, localData, new Stack(), new ArrayList(), code, code.adr2pos(addr), new HashMap(), new HashMap>(), decisions, path, 0); int cnt = 0; @@ -2667,7 +2668,7 @@ public class AVM2Code implements Serializable { code.getCode().removeIgnored(constants, trait, info, body); return cnt; } - /*public static int removeTraps(List localData, AVM2GraphSource code, int addr) { + /*public static int removeTraps(AVM2LocalData localData, AVM2GraphSource code, int addr) { AVM2Graph.translateViaGraph(localData, "", code, new ArrayList(), Graph.SOP_REMOVE_STATIC); return 1; }*/ diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 0a2407fd1..4f7fe8782 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -16,7 +16,10 @@ */ package com.jpexs.decompiler.flash.abc.avm2.graph; +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.flash.FinalProcessLocalData; import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.AVM2LocalData; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictEqIns; @@ -99,42 +102,29 @@ public class AVM2Graph extends Graph { }*/ } - public static final int DATA_ISSTATIC = 0; - public static final int DATA_CLASSINDEX = 1; - public static final int DATA_LOCALREGS = 2; - public static final int DATA_SCOPESTACK = 3; - public static final int DATA_CONSTANTS = 4; - public static final int DATA_METHOD_INFO = 5; - public static final int DATA_BODY = 6; - public static final int DATA_ABC = 7; - public static final int DATA_LOCALREGNAMES = 8; - public static final int DATA_FQN = 9; - public static final int DATA_PARSEDEXCEPTIONS = 10; - public static final int DATA_FINALLYJUMPS = 11; - public static final int DATA_IGNOREDSWITCHES = 12; public static List translateViaGraph(String path, AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, Stack scopeStack, HashMap localRegNames, List fullyQualifiedNames, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { AVM2Graph g = new AVM2Graph(code, abc, body, isStatic, scriptIndex, classIndex, localRegs, scopeStack, localRegNames, fullyQualifiedNames, localRegAssigmentIps, refs); - List localData = new ArrayList<>(); - localData.add((Boolean) isStatic); - localData.add((Integer) classIndex); - localData.add(localRegs); - localData.add(scopeStack); - localData.add(abc.constants); - localData.add(abc.method_info); - localData.add(body); - localData.add(abc); - localData.add(localRegNames); - localData.add(fullyQualifiedNames); - localData.add(new ArrayList()); - localData.add(new ArrayList()); //finallyJumps - localData.add(new ArrayList()); - localData.add((Integer) scriptIndex); - localData.add(new HashMap()); //localRegAssignmentIps - localData.add(Integer.valueOf(0)); - localData.add(refs); - localData.add(code); + AVM2LocalData localData = new AVM2LocalData(); + localData.isStatic = isStatic; + localData.classIndex = classIndex; + localData.localRegs = localRegs; + localData.scopeStack = scopeStack; + localData.constants = abc.constants; + localData.methodInfo = abc.method_info; + localData.methodBody = body; + localData.abc = abc; + localData.localRegNames = localRegNames; + localData.fullyQualifiedNames = fullyQualifiedNames; + localData.parsedExceptions = new ArrayList<>(); + localData.finallyJumps = new ArrayList<>(); + localData.ignoredSwitches = new ArrayList<>(); + localData.scriptIndex = scriptIndex; + localData.localRegAssignmentIps = new HashMap<>(); + localData.ip = 0; + localData.refs = refs; + localData.code = code; g.init(localData); List allParts = new ArrayList<>(); for (GraphPart head : g.heads) { @@ -186,15 +176,13 @@ public class AVM2Graph extends Graph { } @Override - protected List check(GraphSource code, List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + protected List check(GraphSource code, BaseLocalData localData, List allParts, Stack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { List ret = null; - @SuppressWarnings("unchecked") - List parsedExceptions = (List) localData.get(DATA_PARSEDEXCEPTIONS); - @SuppressWarnings("unchecked") - List finallyJumps = (List) localData.get(DATA_FINALLYJUMPS); - @SuppressWarnings("unchecked") - List ignoredSwitches = (List) localData.get(DATA_IGNOREDSWITCHES); + AVM2LocalData aLocalData = (AVM2LocalData) localData; + List parsedExceptions = aLocalData.parsedExceptions; + List finallyJumps = aLocalData.finallyJumps; + List ignoredSwitches = aLocalData.ignoredSwitches; int ip = part.start; int addr = this.avm2code.fixAddrAfterDebugLine(this.avm2code.pos2adr(part.start)); int maxend = -1; @@ -331,9 +319,8 @@ public class AVM2Graph extends Graph { } } stack.add(new ExceptionAVM2Item(catchedExceptions.get(e))); - List localData2 = new ArrayList<>(); - localData2.addAll(localData); - localData2.set(DATA_SCOPESTACK, new Stack()); + AVM2LocalData localData2 = new AVM2LocalData(aLocalData); + localData2.scopeStack = new Stack<>(); List stopPart2 = new ArrayList<>(stopPart); stopPart2.add(nepart); if (retPart != null) { @@ -619,11 +606,10 @@ public class AVM2Graph extends Graph { } @Override - protected GraphPart checkPart(Stack stack, List localData, GraphPart next, List allParts) { - @SuppressWarnings("unchecked") - List finallyJumps = (List) localData.get(DATA_FINALLYJUMPS); - @SuppressWarnings("unchecked") - List ignoredSwitches = (List) localData.get(DATA_IGNOREDSWITCHES); + protected GraphPart checkPart(Stack stack, BaseLocalData localData, GraphPart next, List allParts) { + AVM2LocalData aLocalData = (AVM2LocalData) localData; + List finallyJumps = aLocalData.finallyJumps; + List ignoredSwitches = aLocalData.ignoredSwitches; GraphPart ret = next; for (int f = 0; f < finallyJumps.size(); f++) { int fip = finallyJumps.get(f); @@ -678,7 +664,8 @@ public class AVM2Graph extends Graph { } @Override - protected GraphTargetItem checkLoop(LoopItem loopItem, List localData, List loops) { + protected GraphTargetItem checkLoop(LoopItem loopItem, BaseLocalData localData, List loops) { + AVM2LocalData aLocalData = (AVM2LocalData) localData; if (loopItem instanceof WhileItem) { WhileItem w = (WhileItem) loopItem; @@ -703,8 +690,7 @@ public class AVM2Graph extends Graph { if (spt.object instanceof LocalRegAVM2Item) { int regIndex = ((LocalRegAVM2Item) spt.object).regIndex; HasNextAVM2Item iti = (HasNextAVM2Item) w.expression.get(w.expression.size() - 1); - @SuppressWarnings("unchecked") - HashMap localRegs = (HashMap) localData.get(DATA_LOCALREGS); + HashMap localRegs = aLocalData.localRegs; localRegs.put(regIndex, new FilterAVM2Item(null, iti.collection.getThroughRegister(), ift.expression)); return null; } @@ -731,7 +717,7 @@ public class AVM2Graph extends Graph { } @Override - protected void finalProcess(List list, int level, List localData) { + protected void finalProcess(List list, int level, FinalProcessLocalData localData) { if (level == 0) { if (!list.isEmpty()) { if (list.get(list.size() - 1) instanceof ReturnVoidAVM2Item) { @@ -822,14 +808,12 @@ public class AVM2Graph extends Graph { } @Override - public List prepareBranchLocalData(List localData) { - List ret = new ArrayList<>(); - ret.addAll(localData); - @SuppressWarnings("unchecked") - Stack scopeStack = (Stack) ret.get(DATA_SCOPESTACK); + public AVM2LocalData prepareBranchLocalData(BaseLocalData localData) { + AVM2LocalData aLocalData = (AVM2LocalData) localData; + AVM2LocalData ret = new AVM2LocalData(aLocalData); Stack copyScopeStack = new Stack<>(); - copyScopeStack.addAll(scopeStack); - ret.set(DATA_SCOPESTACK, copyScopeStack); + copyScopeStack.addAll(ret.scopeStack); + ret.scopeStack = copyScopeStack; return ret; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java index b0ce4403c..c1e2de79b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java @@ -16,7 +16,9 @@ */ package com.jpexs.decompiler.flash.abc.avm2.graph; +import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.AVM2LocalData; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConvertOutput; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -83,11 +85,9 @@ public class AVM2GraphSource extends GraphSource { } @Override - @SuppressWarnings("unchecked") - public List translatePart(GraphPart part, List localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException { + public List translatePart(GraphPart part, BaseLocalData localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException { List ret = new ArrayList<>(); - Object o = localData.get(AVM2Graph.DATA_SCOPESTACK); - Stack newstack = (Stack) o; + Stack newstack = ((AVM2LocalData) localData).scopeStack; ConvertOutput co = code.toSourceOutput(path, part, false, isStatic, scriptIndex, classIndex, localRegs, stack, newstack, abc, abc.constants, abc.method_info, body, start, end, localRegNames, fullyQualifiedNames, new boolean[size()], localRegAssigmentIps, refs); ret.addAll(co.output); return ret; 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 723c1ec47..ecf94864f 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 @@ -16,8 +16,9 @@ */ package com.jpexs.decompiler.flash.abc.avm2.instructions; -import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.abc.ABCOutputStream; +import com.jpexs.decompiler.flash.abc.AVM2LocalData; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns; @@ -25,8 +26,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.LookupSwitchIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnValueIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns; -import com.jpexs.decompiler.flash.abc.types.MethodBody; -import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -37,7 +36,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Stack; @@ -279,15 +277,15 @@ public class AVM2Instruction implements Serializable, GraphSourceItem { public List replaceWith; @Override - @SuppressWarnings("unchecked") - public void translate(List localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException { - definition.translate((Boolean) localData.get(0), - (Integer) localData.get(13), - (Integer) localData.get(1), - (HashMap) localData.get(2), + public void translate(BaseLocalData localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException { + AVM2LocalData aLocalData = (AVM2LocalData) localData; + definition.translate(aLocalData.isStatic, + aLocalData.scriptIndex, + aLocalData.classIndex, + aLocalData.localRegs, stack, - (Stack) localData.get(3), - (ConstantPool) localData.get(4), this, (MethodInfo[]) localData.get(5), output, (MethodBody) localData.get(6), (ABC) localData.get(7), (HashMap) localData.get(8), (List) localData.get(9), null, (HashMap) localData.get(14), (int) (Integer) localData.get(15), (HashMap>) localData.get(16), (AVM2Code) localData.get(17)); + aLocalData.scopeStack, + aLocalData.constants, this, aLocalData.methodInfo, output, aLocalData.methodBody, aLocalData.abc, aLocalData.localRegNames, aLocalData.fullyQualifiedNames, null, aLocalData.localRegAssignmentIps, aLocalData.ip, aLocalData.refs, aLocalData.code); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 8c79c4980..6b58d527a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action; import com.jpexs.decompiler.flash.AppStrings; +import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; @@ -757,9 +758,9 @@ public class Action implements GraphSourceItem { } @Override - @SuppressWarnings("unchecked") - public void translate(List localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException { - translate(stack, output, (HashMap) localData.get(0), (HashMap) localData.get(1), (HashMap) localData.get(2), staticOperation, path); + public void translate(BaseLocalData localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException { + ActionLocalData aLocalData = (ActionLocalData) localData; + translate(stack, output, aLocalData.regNames, aLocalData.variables, aLocalData.functions, staticOperation, path); } @Override @@ -823,10 +824,7 @@ public class Action implements GraphSourceItem { if (start < actions.size() && (end > 0) && (start > 0)) { log("Entering " + start + "-" + end + (actions.size() > 0 ? (" (" + actions.get(start).toString() + " - " + actions.get(end == actions.size() ? end - 1 : end) + ")") : "")); } - List localData = new ArrayList<>(); - localData.add(registerNames); - localData.add(variables); - localData.add(functions); + ActionLocalData localData = new ActionLocalData(registerNames, variables, functions); List output = new ArrayList<>(); int ip = start; boolean isWhile = false; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java index 0e4b9c72d..beaf54898 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -16,6 +16,8 @@ */ package com.jpexs.decompiler.flash.action; +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.flash.FinalProcessLocalData; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.EnumerateActionItem; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; @@ -48,9 +50,7 @@ import com.jpexs.decompiler.graph.model.SwitchItem; import com.jpexs.decompiler.graph.model.WhileItem; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.Set; import java.util.Stack; /** @@ -72,8 +72,7 @@ public class ActionGraph extends Graph { public static List translateViaGraph(HashMap registerNames, HashMap variables, HashMap functions, List code, int version, int staticOperation, String path) throws InterruptedException { ActionGraph g = new ActionGraph(code, registerNames, variables, functions, version); - List localData = new ArrayList<>(); - localData.add(registerNames); + ActionLocalData localData = new ActionLocalData(registerNames); g.init(localData); return g.translate(localData, staticOperation, path); } @@ -94,13 +93,8 @@ public class ActionGraph extends Graph { } @Override - protected void finalProcess(List list, int level, List localData) { + protected void finalProcess(List list, int level, FinalProcessLocalData localData) { - if (localData.isEmpty()) { - localData.add(new HashSet()); //List of temporaryRegisters - } - @SuppressWarnings("unchecked") - Set temporaryRegisters = (HashSet) localData.get(0); List ret = Action.checkClass(list); if (ret != list) { list.clear(); @@ -253,7 +247,7 @@ public class ActionGraph extends Graph { } @Override - protected List check(GraphSource code, List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + protected List check(GraphSource code, BaseLocalData localData, List allParts, Stack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { if (!output.isEmpty()) { if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { StoreRegisterActionItem str = (StoreRegisterActionItem) output.get(output.size() - 1); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java b/trunk/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java index f7082a2f2..ce0627438 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action; +import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.graph.GraphPart; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -72,7 +73,7 @@ public class ActionGraphSource extends GraphSource { } @Override - public List translatePart(GraphPart part, List localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException { + public List translatePart(GraphPart part, BaseLocalData localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException { return (Action.actionsPartToTree(registerNames, variables, functions, stack, actions, start, end, version, staticOperation, path)); } private List posCache = null; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java b/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java index a778c153d..a8942ff28 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/ActionListReader.java @@ -241,7 +241,7 @@ public class ActionListReader { Stack stack = new Stack<>(); - List localData = Helper.toList(new HashMap(), new HashMap(), new HashMap()); + ActionLocalData localData = new ActionLocalData(); int maxRecursionLevel = 0; for (int i = 0; i < actions.size(); i++) { @@ -256,7 +256,7 @@ public class ActionListReader { } } - deobfustaceActionListAtPosRecursive(listeners, new ArrayList(), new HashMap>(), containerSWFOffset, localData, stack, cpool, actionMap, ip, ip, retdups, ip, endIp, path, new HashMap(), false, new HashMap>(), version, 0, maxRecursionLevel); + deobfustaceActionListAtPosRecursive(listeners, new ArrayList(), new HashMap>(), containerSWFOffset, localData, stack, cpool, actionMap, ip, retdups, ip, endIp, path, new HashMap(), false, new HashMap>(), version, 0, maxRecursionLevel); if (!retdups.isEmpty()) { for (int i = 0; i < ip; i++) { @@ -585,7 +585,6 @@ public class ActionListReader { return true; } - @SuppressWarnings("unchecked") private static Action readActionListAtPos(List listeners, long containerSWFOffset, ConstantPool cpool, SWFInputStream sis, List actions, List nextOffsets, long ip, long startIp, long endIp, int version, String path, boolean indeterminate, List visitedContainers) throws IOException { @@ -701,8 +700,7 @@ public class ActionListReader { } } - @SuppressWarnings("unchecked") - private static void deobfustaceActionListAtPosRecursive(List listeners, List output, HashMap> containers, long containerSWFOffset, List localData, Stack stack, ConstantPool cpool, List actions, int pos, int ip, List ret, int startIp, int endip, String path, Map visited, boolean indeterminate, Map> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException { + private static void deobfustaceActionListAtPosRecursive(List listeners, List output, HashMap> containers, long containerSWFOffset, ActionLocalData localData, Stack stack, ConstantPool cpool, List actions, int ip, List ret, int startIp, int endip, String path, Map visited, boolean indeterminate, Map> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException { boolean debugMode = false; boolean decideBranch = false; @@ -710,17 +708,15 @@ public class ActionListReader { throw new TranslateException("deobfustaceActionListAtPosRecursive max recursion level reached."); } - pos = ip; Action a; Scanner sc = new Scanner(System.in); loopip: - while (((endip == -1) || (endip > ip)) && (a = actions.get(pos)) != null) { + while (((endip == -1) || (endip > ip)) && (a = actions.get(ip)) != null) { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } int actionLen = getTotalActionLength(a); - pos += actionLen; if (!visited.containsKey(ip)) { visited.put(ip, 0); } @@ -728,10 +724,7 @@ public class ActionListReader { curVisited++; visited.put(ip, curVisited); for (int i = 0; i < listeners.size(); i++) { - listeners.get(i).progress("Deobfuscating", pos, actions.size()); - } - if ((ip < ret.size()) && (!(ret.get(ip) instanceof ActionNop))) { - a = ret.get(ip); + listeners.get(i).progress("Deobfuscating", ip, actions.size()); } int info = a.actionLength + 1 + ((a.actionCode >= 0x80) ? 2 : 0); @@ -747,10 +740,8 @@ public class ActionListReader { atos = a.toString(); } System.err.println("readActionListAtPos ip: " + (ip - startIp) + " (0x" + Helper.formatAddress(ip - startIp) + ") " + " action(len " + a.actionLength + "): " + atos + (a.isIgnored() ? " (ignored)" : "") + " stack:" + Helper.stackToString(stack, LocalData.create(cpool)) + " " + Helper.byteArrToString(a.getBytes(version))); - @SuppressWarnings("unchecked") - HashMap vars = (HashMap) localData.get(1); System.err.print("variables: "); - for (Map.Entry v : vars.entrySet()) { + for (Map.Entry v : localData.variables.entrySet()) { System.err.print("'" + v + "' = " + v.getValue().toString(LocalData.create(cpool)) + ", "); } System.err.println(); @@ -786,7 +777,7 @@ public class ActionListReader { aif = (ActionIf) a; GraphTargetItem top = stack.pop(); - int nip = pos + aif.getJumpOffset(); + int nip = ip + actionLen + aif.getJumpOffset(); if (decideBranch) { System.out.print("newip " + nip + ", "); @@ -794,8 +785,7 @@ public class ActionListReader { String next = sc.next(); switch (next) { case "j": - newip = pos + aif.getJumpOffset(); - pos = newip; + newip = nip; break; case "i": break; @@ -808,7 +798,7 @@ public class ActionListReader { System.err.print("is compiletime -> "); } if (EcmaScript.toBoolean(top.getResult())) { - newip = pos + aif.getJumpOffset(); + newip = nip; aif.jumpUsed = true; if (debugMode) { System.err.println("jump"); @@ -826,7 +816,7 @@ public class ActionListReader { goaif = true; } } else if (a instanceof ActionJump) { - newip = pos + ((ActionJump) a).getJumpOffset(); + newip = ip + actionLen + ((ActionJump) a).getJumpOffset(); } else if (!(a instanceof GraphSourceItemContainer)) { //return in for..in, TODO:Handle this better way if (((a instanceof ActionEquals) || (a instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) { @@ -842,7 +832,7 @@ public class ActionListReader { break; } - HashMap vars = (HashMap) localData.get(1); + HashMap vars = localData.variables; if (varname != null) { GraphTargetItem varval = vars.get(varname); if (varval != null && varval.isCompileTime() && indeterminate) { @@ -876,20 +866,19 @@ public class ActionListReader { output2s.add(new ArrayList()); continue; } - List localData2; + ActionLocalData localData2; List output2 = new ArrayList<>(); if ((cnt instanceof ActionDefineFunction) || (cnt instanceof ActionDefineFunction2)) { - localData2 = Helper.toList(new HashMap(), new HashMap(), new HashMap()); + localData2 = new ActionLocalData(); } else { localData2 = localData; } - deobfustaceActionListAtPosRecursive(listeners, output2, containers, containerSWFOffset, localData2, new Stack(), cpool, actions, pos, (int) endAddr, ret, startIp, (int) (endAddr + size), path + (cntName == null ? "" : "/" + cntName), visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); + deobfustaceActionListAtPosRecursive(listeners, output2, containers, containerSWFOffset, localData2, new Stack(), cpool, actions, (int) endAddr, ret, startIp, (int) (endAddr + size), path + (cntName == null ? "" : "/" + cntName), visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); output2s.add(output2); endAddr += size; } - cnt.translateContainer(output2s, stack, output, (HashMap) localData.get(0), (HashMap) localData.get(1), (HashMap) localData.get(2)); + cnt.translateContainer(output2s, stack, output, localData.regNames, localData.variables, localData.functions); ip = (int) endAddr; - pos = ip; continue; } } @@ -897,18 +886,12 @@ public class ActionListReader { if (a instanceof ActionEnd) { break; } - if (newip > -1) { - ip = newip; - } else { - ip += info; - } - pos = ip; if (goaif) { aif.ignoreUsed = true; aif.jumpUsed = true; indeterminate = true; - HashMap vars = (HashMap) localData.get(1); + HashMap vars = localData.variables; boolean stateChanged = false; if (decisionStates.containsKey(ip)) { HashMap oldstate = decisionStates.get(ip); @@ -933,8 +916,8 @@ public class ActionListReader { if ((!stateChanged) && curVisited > 1) { List branches = new ArrayList<>(); - branches.add(pos + aif.getJumpOffset()); - branches.add(pos); + branches.add(ip + actionLen + aif.getJumpOffset()); + branches.add(ip + actionLen); for (int br : branches) { int visc = 0; if (visited.containsKey(br)) { @@ -942,7 +925,6 @@ public class ActionListReader { } if (visc == 0) {// substack = (Stack) stack.clone(); - deobfustaceActionListAtPosRecursive(listeners, output, containers, containerSWFOffset, prepareLocalBranch(localData), substack, cpool, actions, pos, pos + aif.getJumpOffset(), ret, startIp, endip, path, visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); + deobfustaceActionListAtPosRecursive(listeners, output, containers, containerSWFOffset, prepareLocalBranch(localData), substack, cpool, actions, ip + actionLen + aif.getJumpOffset(), ret, startIp, endip, path, visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel); } + + if (newip > -1) { + ip = newip; + } else { + ip += info; + } + if (a.isExit()) { break; } } for (DisassemblyListener listener : listeners) { - listener.progress("Deobfuscating", pos, actions.size()); + listener.progress("Deobfuscating", ip, actions.size()); } } - private static List prepareLocalBranch(List localData) { - @SuppressWarnings("unchecked") - HashMap regNames = (HashMap) localData.get(0); - @SuppressWarnings("unchecked") - HashMap variables = (HashMap) localData.get(1); - @SuppressWarnings("unchecked") - HashMap functions = (HashMap) localData.get(2); - List ret = new ArrayList<>(); - ret.add(new HashMap<>(regNames)); - ret.add(new HashMap<>(variables)); - ret.add(new HashMap<>(functions)); - return ret; + private static ActionLocalData prepareLocalBranch(ActionLocalData localData) { + + return new ActionLocalData(new HashMap<>(localData.regNames), + new HashMap<>(localData.variables), new HashMap<>(localData.functions)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/ActionLocalData.java b/trunk/src/com/jpexs/decompiler/flash/action/ActionLocalData.java new file mode 100644 index 000000000..257dfc9fb --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/action/ActionLocalData.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2010-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.action; + +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.graph.GraphTargetItem; +import java.util.HashMap; + +/** + * + * @author JPEXS + */ +public class ActionLocalData extends BaseLocalData { + + public final HashMap regNames; + public final HashMap variables; + public final HashMap functions; + + public ActionLocalData() { + regNames = new HashMap<>(); + variables = new HashMap<>(); + functions = new HashMap<>(); + } + + public ActionLocalData(HashMap regNames) { + this.regNames = regNames; + variables = new HashMap<>(); + functions = new HashMap<>(); + } + + public ActionLocalData(HashMap regNames, HashMap variables, HashMap functions) { + this.regNames = regNames; + this.variables = variables; + this.functions = functions; + } +} diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java index 847fd3537..a52adc610 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionPop; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -62,7 +63,7 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable } } - protected List toSourceCall(List localData, SourceGenerator gen, List list) { + protected List toSourceCall(SourceGeneratorLocalData localData, SourceGenerator gen, List list) { List ret = new ArrayList<>(); for (int i = 0; i < list.size(); i++) { ret.addAll(0, list.get(i).toSource(localData, gen)); @@ -72,7 +73,7 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable } @Override - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = toSource(localData, generator); if (hasReturnValue()) { ret.add(new ActionPop()); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java index faebfbf3b..2eb2d43a3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionAsciiToChar; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class AsciiToCharActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionAsciiToChar()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java index 2eebaea71..85e85dcb8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionCall; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class CallActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionCall()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java index 55280faae..31d747c25 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionCallFunction; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -114,7 +115,7 @@ public class CallFunctionActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), functionName, new ActionCallFunction()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java index 332488e97..e85dd805d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionCallMethod; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -98,7 +99,7 @@ public class CallMethodActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), scriptObject, methodName, new ActionCallMethod()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java index 2d4b24588..657da94cb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf7.ActionCastOp; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -62,7 +63,7 @@ public class CastOpActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, constructor, object, new ActionCastOp()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java index b6008deee..d6b092871 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionCharToAscii; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -73,7 +74,7 @@ public class CharToAsciiActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionCharToAscii()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java index b34a1dd12..9ce7c5feb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionCloneSprite; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -69,7 +70,7 @@ public class CloneSpriteActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, source, target, depth, new ActionCloneSprite()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java index a3a082fc7..6e8b914d7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionDecrement; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -72,7 +73,7 @@ public class DecrementActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object, new ActionDecrement()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java index 67d5af127..e5b8a6d21 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal; import com.jpexs.decompiler.flash.action.swf5.ActionDefineLocal2; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -94,7 +95,7 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { if (value == null) { return toSourceMerge(localData, generator, name, new ActionDefineLocal2()); } else { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java index 789d6e126..f330cca79 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionDelete; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -65,7 +66,7 @@ public class DeleteActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object, propertyName, new ActionDelete()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index ced861356..3c0041db5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.ConstantIndex; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; @@ -233,7 +234,7 @@ public class DirectValueActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionPush(value)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java index bc43703f7..5d89cae4b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -43,7 +44,7 @@ public class EvalActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionGetVariable()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java index 982e612e5..a9e3cf5cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.flashlite.ActionFSCommand2; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -69,7 +70,7 @@ public class FSCommand2ActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); for (GraphTargetItem a : arguments) { ret.addAll(a.toSource(localData, generator)); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java index 9edafc361..6b2a4e367 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionGetURL; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -45,7 +46,7 @@ public class FSCommandActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionGetURL("FSCommand:" + command, "")); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java index 18bd7e6cf..dea4c8c80 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/FunctionActionItem.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionPush; @@ -150,12 +151,12 @@ public class FunctionActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; List paramRegs = new ArrayList<>(); @SuppressWarnings("unchecked") - List localDataCopy = (List) Helper.deepCopy(localData); + SourceGeneratorLocalData localDataCopy = (SourceGeneratorLocalData) Helper.deepCopy(localData); HashMap registerVars = asGenerator.getRegisterVars(localDataCopy); registerVars.put("_parent", REGISTER_PARENT); registerVars.put("_root", REGISTER_ROOT); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java index 634c9266a..8f17d7f5f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionGetMember; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -93,7 +94,7 @@ public class GetMemberActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object, memberName, new ActionGetMember()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java index 8c2947ed1..ec9e30ee5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.swf4.ActionGetProperty; import com.jpexs.decompiler.flash.action.swf4.ActionPush; @@ -63,7 +64,7 @@ public class GetPropertyActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), new ActionGetProperty()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java index c765d4525..4ca1ac6b1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetTimeActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetTime; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -48,7 +49,7 @@ public class GetTimeActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionGetTime()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java index b5a64f8aa..e8a22a588 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -73,7 +74,7 @@ public class GetURL2ActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, urlString, targetString, new ActionGetURL2(sendVarsMethod, false, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java index 6c78d3617..77cd02c3a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionGetURL; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -43,7 +44,7 @@ public class GetURLActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionGetURL(urlString, targetString)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java index 841a04539..a2d1feefd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -130,7 +131,7 @@ public class GetVariableActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, name, new ActionGetVariable()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java index 974863a34..4b7c00902 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GetVersionActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetVariable; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -40,7 +41,7 @@ public class GetVersionActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionPush("/:$version"), new ActionGetVariable()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java index d699f7c12..405a0572d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGotoFrame2; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -68,7 +69,7 @@ public class GotoFrame2ActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, frame, new ActionGotoFrame2(playFlag, sceneBiasFlag, sceneBias)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java index f3c7ffe7f..a35c4c48b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoFrameActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionGotoFrame; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -40,7 +41,7 @@ public class GotoFrameActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionGotoFrame(frame)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java index 3d256797a..4576ba68e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/GotoLabelActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionGoToLabel; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -41,7 +42,7 @@ public class GotoLabelActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionGoToLabel(label)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java index 20b6a50f0..613ed4764 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionIncrement; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -72,7 +73,7 @@ public class IncrementActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object, new ActionIncrement()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java index d9b608b63..19108025d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionInitArray; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -64,7 +65,7 @@ public class InitArrayActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, toSourceCall(localData, generator, values), new ActionInitArray()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java index ebd145ba1..57b9fcf83 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -79,7 +80,7 @@ public class InitObjectActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); for (int i = values.size() - 1; i >= 0; i--) { ret.addAll(names.get(i).toSource(localData, generator)); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java index 60be0b4a4..3aac4b06b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -67,7 +68,7 @@ public class LoadMovieActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, urlString, targetString, new ActionGetURL2(method, true, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java index e8b0c4f56..c500b4ed1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -69,7 +70,7 @@ public class LoadMovieNumActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, urlString, new AddActionItem(src, asGenerator.pushConstTargetItem("_level"), num, true), new ActionGetURL2(method, false, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java index a1eef67b2..65303621c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -67,7 +68,7 @@ public class LoadVariablesActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, urlString, targetString, new ActionGetURL2(method, false, true)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java index ca73cd8e6..a2431ec5f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -69,7 +70,7 @@ public class LoadVariablesNumActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, urlString, new AddActionItem(src, asGenerator.pushConstTargetItem("_level"), num, true), new ActionGetURL2(method, false, true)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java index a75b18853..adfd53b29 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionMBAsciiToChar; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class MBAsciiToCharActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionMBAsciiToChar()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java index 54fac62cc..0987c6bfe 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionMBCharToAscii; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class MBCharToAsciiActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionMBCharToAscii()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java index 5ea93166a..0b53bb8fd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionMBStringExtract; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -69,7 +70,7 @@ public class MBStringExtractActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, index, count, new ActionMBStringExtract()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java index 6acc67822..9c7441a2a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionMBStringLength; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -54,7 +55,7 @@ public class MBStringLengthActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionMBStringLength()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java index 20b1f857f..a9c21c790 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionNewMethod; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -99,7 +100,7 @@ public class NewMethodActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), scriptObject, methodName, new ActionNewMethod()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java index e8b2fd956..1f8473f4a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionNewObject; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -70,7 +71,7 @@ public class NewObjectActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), objectName, new ActionNewObject()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java index c48bf77a3..5cce59615 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/NextFrameActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionNextFrame; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -35,7 +36,7 @@ public class NextFrameActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionNextFrame()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java index 39bec59fa..6e8446992 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PlayActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionPlay; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -35,7 +36,7 @@ public class PlayActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionPlay()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java index 6602ca14f..bebafcd46 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PopActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionPop; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -49,7 +50,7 @@ public class PopActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionPop()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java index e0a2968d7..d28c15a74 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.SubtractActionItem; import com.jpexs.decompiler.flash.action.swf4.ActionPop; import com.jpexs.decompiler.flash.action.swf4.ActionPush; @@ -87,7 +88,7 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction } @Override - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); if (object instanceof GetVariableActionItem) { @@ -122,7 +123,7 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object.toSource(localData, generator), toSourceIgnoreReturnValue(localData, generator)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java index c4c1025e2..31e9891ff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.swf4.ActionPop; import com.jpexs.decompiler.flash.action.swf4.ActionPush; @@ -87,7 +88,7 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction } @Override - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); if (object instanceof GetVariableActionItem) { @@ -122,7 +123,7 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object.toSource(localData, generator), toSourceIgnoreReturnValue(localData, generator)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java index 7796842da..c4693d5da 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrevFrameActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionPrevFrame; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -35,7 +36,7 @@ public class PrevFrameActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionPrevFrame()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java index 3e03f83ea..13c60909e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -60,7 +61,7 @@ public class PrintActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, new AddActionItem(src, asGenerator.pushConstTargetItem("print:#"), boundingBox, true), target, new ActionGetURL2(0, false, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java index 7ede81ea2..67d0a9a1c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -60,7 +61,7 @@ public class PrintAsBitmapActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, new AddActionItem(src, asGenerator.pushConstTargetItem("printasbitmap:#"), boundingBox, true), target, new ActionGetURL2(0, false, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java index 5efa9a4f6..6165ec77e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -60,7 +61,7 @@ public class PrintAsBitmapNumActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, new AddActionItem(src, asGenerator.pushConstTargetItem("printasbitmap:#"), boundingBox, true), new AddActionItem(src, asGenerator.pushConstTargetItem("_level"), num, true), new ActionGetURL2(0, false, false)); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java index 008d60425..b596a65da 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -60,7 +61,7 @@ public class PrintNumActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, new AddActionItem(src, asGenerator.pushConstTargetItem("print:#"), boundingBox, true), new AddActionItem(src, asGenerator.pushConstTargetItem("_level"), num, true), new ActionGetURL2(0, false, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java index e550471d3..1e98ef043 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionRandomNumber; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class RandomNumberActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionRandomNumber()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java index b8e68f371..c4392ec1f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionRemoveSprite; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class RemoveSpriteActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionRemoveSprite()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java index ff5fbd68d..881cdf183 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionIf; @@ -64,7 +65,7 @@ public class ReturnActionItem extends ActionItem implements ExitItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; List ret = new ArrayList<>(); int forinlevel = asGenerator.getForInLevel(localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java index f7d08920d..d2dc7f935 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; @@ -116,14 +117,14 @@ public class SetMemberActionItem extends ActionItem implements SetTypeActionItem } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; int tmpReg = asGenerator.getTempRegister(localData); return toSourceMerge(localData, generator, object, objectName, value, new ActionStoreRegister(tmpReg), new ActionSetMember(), new ActionPush(new RegisterNumber(tmpReg))); } @Override - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, object, objectName, value, new ActionSetMember()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index fadb8d85f..6419d0b89 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionPush; @@ -100,14 +101,14 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; int tmpReg = asGenerator.getTempRegister(localData); return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), value, new ActionStoreRegister(tmpReg), new ActionSetProperty(), new ActionPush(new RegisterNumber(tmpReg))); } @Override - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), value, new ActionSetProperty()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java index 1a71bb13c..82d283683 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphSourceItemPos; @@ -48,7 +49,7 @@ public class SetTarget2ActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { throw new UnsupportedOperationException(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java index 021972461..6e640dc95 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -40,7 +41,7 @@ public class SetTargetActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { throw new UnsupportedOperationException(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java index 42edf1212..d110439a8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.action.swf4.ActionSetVariable; @@ -111,14 +112,14 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; int tmpReg = asGenerator.getTempRegister(localData); return toSourceMerge(localData, generator, name, value, new ActionStoreRegister(tmpReg), new ActionSetVariable(), new ActionPush(new RegisterNumber(tmpReg))); } @Override - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, name, value, new ActionSetVariable()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java index b86811b07..0aa23c91c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionStartDrag; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -85,7 +86,7 @@ public class StartDragActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { boolean hasConstrains = true; if (constrain instanceof DirectValueActionItem) { if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java index 7bb1eff6f..c6693225e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionStop; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -35,7 +36,7 @@ public class StopActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionStop()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java index 7d4cd3198..1c813c91e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopAllSoundsActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionStopSounds; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -35,7 +36,7 @@ public class StopAllSoundsActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionStopSounds()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java index bb8b2893d..1fee3535e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StopDragActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionEndDrag; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -35,7 +36,7 @@ public class StopDragActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionEndDrag()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java index f1bcf5388..8a0978cac 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; import com.jpexs.decompiler.flash.action.swf5.ActionStoreRegister; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -95,7 +96,7 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionStoreRegister(register.number)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java index e8ecbfde0..ac762efaf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionStringExtract; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -58,7 +59,7 @@ public class StringExtractActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, index, count, new ActionStringExtract()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java index 6a7c283ba..f478e048e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionStringLength; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -46,7 +47,7 @@ public class StringLengthActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionStringLength()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java index ec6e88eff..354d787da 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionTargetPath; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class TargetPathActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionTargetPath()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java index 4d838f116..b93b92929 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf7.ActionThrow; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -46,7 +47,7 @@ public class ThrowActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionThrow()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java index 9190c918a..dfecd3f40 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionToInteger; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class ToIntegerActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionToInteger()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java index f624ce5fa..73115934c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionToNumber; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class ToNumberActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionToNumber()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java index 32c0a65aa..9612f9d12 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionToString; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class ToStringActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionToString()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java index a119a23df..fa203847f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/ToggleHighQualityActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf3.ActionToggleQuality; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -40,7 +41,7 @@ public class ToggleHighQualityActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionToggleQuality()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java index 2fc8ece08..e239193c6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionTrace; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class TraceActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionTrace()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java index 51a8bd768..42918fdbe 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionTypeOf; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.ecma.EcmaType; @@ -81,7 +82,7 @@ public class TypeOfActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, value, new ActionTypeOf()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java index a34fd47e6..d5b74aad9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; import com.jpexs.decompiler.flash.action.swf4.ActionPush; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -54,7 +55,7 @@ public class UnLoadMovieActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, new ActionPush(""), targetString, new ActionGetURL2(0, true, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java index 255240bd0..a39d7ecb0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.AddActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; import com.jpexs.decompiler.flash.action.swf4.ActionGetURL2; @@ -56,7 +57,7 @@ public class UnLoadMovieNumActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; return toSourceMerge(localData, generator, new ActionPush(""), new AddActionItem(src, asGenerator.pushConstTargetItem("_level"), num, true), new ActionGetURL2(0, true, false)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java index 65bf18d90..e48b6e61e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ClassActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.clauses; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; @@ -226,11 +227,11 @@ public class ClassActionItem extends ActionItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; @SuppressWarnings("unchecked") - List localData2 = (List) Helper.deepCopy(localData); + SourceGeneratorLocalData localData2 = (SourceGeneratorLocalData) Helper.deepCopy(localData); asGenerator.setInMethod(localData2, true); ret.addAll(asGenerator.generateTraits(localData2, false, className, extendsOp, implementsOp, constructor, functions, vars, staticFunctions, staticVars)); return ret; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java index ceece2755..d602e2937 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/ForInActionItem.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; @@ -115,7 +116,7 @@ public class ForInActionItem extends LoopActionItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; HashMap registerVars = asGenerator.getRegisterVars(localData); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java index 1a0de82c6..77abe226d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/IfFrameLoadedActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.clauses; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.swf4.ActionWaitForFrame2; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -74,7 +75,7 @@ public class IfFrameLoadedActionItem extends ActionItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List body = generator.generate(localData, actions); return toSourceMerge(localData, generator, frame, new ActionWaitForFrame2(body.size()), body); } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java index ca05416d5..bae337810 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/InterfaceActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.clauses; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.parser.script.ActionSourceGenerator; @@ -68,7 +69,7 @@ public class InterfaceActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; ret.addAll(asGenerator.generateTraits(localData, true, name, null, superInterfaces, null, null, null, null, null)); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java index 4b687efb7..7fb011b36 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TellTargetActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.clauses; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.swf3.ActionSetTarget; import com.jpexs.decompiler.flash.action.swf4.ActionSetTarget2; @@ -61,7 +62,7 @@ public class TellTargetActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); ret.addAll(target.toSource(localData, generator)); ret.add(new ActionSetTarget2()); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java index 2a122e230..74d0d9f34 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/TryActionItem.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.model.ConstantPool; @@ -141,7 +142,7 @@ public class TryActionItem extends ActionItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List ret = new ArrayList<>(); ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; List tryCommandsA = asGenerator.toActionList(asGenerator.generate(localData, tryCommands)); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java index e2e5ef64a..41e61b875 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/clauses/WithActionItem.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action.model.clauses; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.ActionItem; import com.jpexs.decompiler.flash.action.swf5.ActionWith; @@ -60,7 +61,7 @@ public class WithActionItem extends ActionItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { List data = generator.generate(localData, items); List dataA = new ArrayList<>(); for (GraphSourceItem s : data) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java index 2e9b814d0..fa38ee330 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AddActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.swf5.ActionAdd2; import com.jpexs.decompiler.flash.ecma.EcmaScript; @@ -72,7 +73,7 @@ public class AddActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionAdd2()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AndActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AndActionItem.java index 489df3b68..a0bbf0320 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AndActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/AndActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionAnd; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class AndActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionAnd()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitAndActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitAndActionItem.java index a7384073b..ba046d157 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitAndActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitAndActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionBitAnd; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class BitAndActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitAnd()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitOrActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitOrActionItem.java index 92cde8c61..e0a3720c1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitOrActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitOrActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionBitOr; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class BitOrActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitOr()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitXorActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitXorActionItem.java index 48ec20e6c..85f835431 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitXorActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/BitXorActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionBitXor; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class BitXorActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitXor()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/DivideActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/DivideActionItem.java index ddc415ba4..3e38ab021 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/DivideActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/DivideActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionDivide; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -39,7 +40,7 @@ public class DivideActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionDivide()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java index 007816307..986a91222 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/EqActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; import com.jpexs.decompiler.flash.ecma.EcmaScript; @@ -51,7 +52,7 @@ public class EqActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionEquals2()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java index 64ce76bae..f0eafd689 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GeActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.swf4.ActionNot; import com.jpexs.decompiler.flash.action.swf5.ActionLess2; @@ -59,7 +60,7 @@ public class GeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionLess2(), new ActionNot()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java index a93c3b653..8847997cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/GtActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf6.ActionGreater; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -42,7 +43,7 @@ public class GtActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionGreater()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/InstanceOfActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/InstanceOfActionItem.java index d978865bb..7ab1795ba 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/InstanceOfActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/InstanceOfActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf6.ActionInstanceOf; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -36,7 +37,7 @@ public class InstanceOfActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionInstanceOf()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LShiftActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LShiftActionItem.java index f52b8fdb5..23dc120a9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LShiftActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LShiftActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class LShiftActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitLShift()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java index 2298ad77b..574a58350 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LeActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionNot; import com.jpexs.decompiler.flash.action.swf6.ActionGreater; import com.jpexs.decompiler.flash.ecma.EcmaScript; @@ -50,7 +51,7 @@ public class LeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionGreater(), new ActionNot()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java index 0e7d8aa94..ca72b7c8b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/LtActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.swf5.ActionLess2; import com.jpexs.decompiler.flash.ecma.EcmaScript; @@ -51,7 +52,7 @@ public class LtActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionLess2()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/ModuloActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/ModuloActionItem.java index cad165ac3..da61cf02b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/ModuloActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/ModuloActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionModulo; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -39,7 +40,7 @@ public class ModuloActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionModulo()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/MultiplyActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/MultiplyActionItem.java index 44d11b8ee..56a457b4a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/MultiplyActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/MultiplyActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionMultiply; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class MultiplyActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionMultiply()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java index 4a5c274bc..7aae5741a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/NeqActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.swf4.ActionNot; import com.jpexs.decompiler.flash.action.swf5.ActionEquals2; @@ -52,7 +53,7 @@ public class NeqActionItem extends BinaryOpItem implements LogicalOpItem, Invert } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionEquals2(), new ActionNot()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/OrActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/OrActionItem.java index 39e53c188..6959b3aa0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/OrActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/OrActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionOr; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class OrActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionOr()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreDecrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreDecrementActionItem.java index 5b2bd2461..b4aff7415 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreDecrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreDecrementActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; import com.jpexs.decompiler.flash.action.model.GetPropertyActionItem; @@ -48,7 +49,7 @@ public class PreDecrementActionItem extends UnaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; List ret = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreIncrementActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreIncrementActionItem.java index ccc39aa79..e36c94837 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreIncrementActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/PreIncrementActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.GetMemberActionItem; import com.jpexs.decompiler.flash.action.model.GetPropertyActionItem; @@ -48,7 +49,7 @@ public class PreIncrementActionItem extends UnaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator; List ret = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/RShiftActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/RShiftActionItem.java index 50fe8f61a..c5f4eb912 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/RShiftActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/RShiftActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class RShiftActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitRShift()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java index d3ffbda0b..ddd0c7174 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictEqActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -45,7 +46,7 @@ public class StrictEqActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionStrictEquals()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java index b7d19d158..f98939e8f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StrictNeqActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionNot; import com.jpexs.decompiler.flash.action.swf6.ActionStrictEquals; import com.jpexs.decompiler.flash.ecma.EcmaScript; @@ -46,7 +47,7 @@ public class StrictNeqActionItem extends BinaryOpItem implements LogicalOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionStrictEquals(), new ActionNot()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringAddActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringAddActionItem.java index f8c080b0e..7a847d3d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringAddActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringAddActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionStringAdd; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -36,7 +37,7 @@ public class StringAddActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionStringAdd()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java index c13976ce7..b615d0c48 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringEqActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionStringEquals; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -36,7 +37,7 @@ public class StringEqActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionStringEquals()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java index b2f721cb8..d5c729627 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/StringLtActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionStringLess; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -36,7 +37,7 @@ public class StringLtActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionStringLess()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java index 7282111bc..f15a32b80 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/SubtractActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionSubtract; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -61,7 +62,7 @@ public class SubtractActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionSubtract()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/URShiftActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/URShiftActionItem.java index 21c9613d5..630b6eda3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/operations/URShiftActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/operations/URShiftActionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.model.operations; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.swf5.ActionBitURShift; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -36,7 +37,7 @@ public class URShiftActionItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitURShift()); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java index 5d377ae21..79826180a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionScriptParser.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.parser.script; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.AsciiToCharActionItem; import com.jpexs.decompiler.flash.action.model.CallActionItem; @@ -1829,12 +1830,9 @@ public class ActionScriptParser { public List actionsFromTree(List tree, List constantPool) { ActionSourceGenerator gen = new ActionSourceGenerator(constantPool); List ret = new ArrayList<>(); - List localDate = new ArrayList<>(); - localDate.add(new HashMap()); //registerVars - localDate.add(Boolean.FALSE); //inFunction - localDate.add(Boolean.FALSE); //inMethod - localDate.add((Integer) 0); //forInLevel - List srcList = gen.generate(localDate, tree); + SourceGeneratorLocalData localData = new SourceGeneratorLocalData( + new HashMap(), Boolean.FALSE, Boolean.FALSE, 0); + List srcList = gen.generate(localData, tree); for (GraphSourceItem s : srcList) { if (s instanceof Action) { ret.add((Action) s); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index fb9b2d53c..0eab7171c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.action.parser.script; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.model.DirectValueActionItem; import com.jpexs.decompiler.flash.action.model.FunctionActionItem; @@ -72,7 +73,7 @@ import java.util.List; public class ActionSourceGenerator implements SourceGenerator { @Override - public List generate(List localData, AndItem item) { + public List generate(SourceGeneratorLocalData localData, AndItem item) { List ret = new ArrayList<>(); ret.addAll(generateToActionList(localData, item.leftSide)); ret.add(new ActionPushDuplicate()); @@ -87,7 +88,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, OrItem item) { + public List generate(SourceGeneratorLocalData localData, OrItem item) { List ret = new ArrayList<>(); ret.addAll(generateToActionList(localData, item.leftSide)); ret.add(new ActionPushDuplicate()); @@ -116,7 +117,7 @@ public class ActionSourceGenerator implements SourceGenerator { return list; } - private List generateIf(List localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) { + private List generateIf(SourceGeneratorLocalData localData, GraphTargetItem expression, List onTrueCmds, List onFalseCmds, boolean ternar) { List ret = new ArrayList<>(); if (expression instanceof Inverted) { ret.addAll(((Inverted) expression).invert().toSource(localData, this)); @@ -168,7 +169,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, IfItem item) { + public List generate(SourceGeneratorLocalData localData, IfItem item) { return generateIf(localData, item.expression, item.onTrue, item.onFalse, false); } @@ -195,7 +196,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, TernarOpItem item) { + public List generate(SourceGeneratorLocalData localData, TernarOpItem item) { List onTrue = new ArrayList<>(); onTrue.add(item.onTrue); List onFalse = new ArrayList<>(); @@ -204,7 +205,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, WhileItem item) { + public List generate(SourceGeneratorLocalData localData, WhileItem item) { List ret = new ArrayList<>(); List whileExpr = new ArrayList<>(); @@ -233,7 +234,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, DoWhileItem item) { + public List generate(SourceGeneratorLocalData localData, DoWhileItem item) { List ret = new ArrayList<>(); List doExpr = generateToActionList(localData, item.expression); List doBody = generateToActionList(localData, item.commands); @@ -251,7 +252,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, ForItem item) { + public List generate(SourceGeneratorLocalData localData, ForItem item) { List ret = new ArrayList<>(); List forExpr = generateToActionList(localData, item.expression); List forBody = generateToActionList(localData, item.commands); @@ -283,7 +284,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, SwitchItem item) { + public List generate(SourceGeneratorLocalData localData, SwitchItem item) { List ret = new ArrayList<>(); HashMap registerVars = getRegisterVars(localData); int exprReg = 0; @@ -394,7 +395,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, NotItem item) { + public List generate(SourceGeneratorLocalData localData, NotItem item) { if (item.getOriginal() instanceof Inverted) { GraphTargetItem norig = ((Inverted) item).invert(); return norig.toSource(localData, this); @@ -406,14 +407,14 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, DuplicateItem item) { + public List generate(SourceGeneratorLocalData localData, DuplicateItem item) { List ret = new ArrayList<>(); ret.add(new ActionPushDuplicate()); return ret; } @Override - public List generate(List localData, BreakItem item) { + public List generate(SourceGeneratorLocalData localData, BreakItem item) { List ret = new ArrayList<>(); ActionJump abreak = new ActionJump(0); abreak.isBreak = true; @@ -422,7 +423,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, ContinueItem item) { + public List generate(SourceGeneratorLocalData localData, ContinueItem item) { List ret = new ArrayList<>(); ActionJump acontinue = new ActionJump(0); acontinue.isContinue = true; @@ -430,16 +431,16 @@ public class ActionSourceGenerator implements SourceGenerator { return ret; } - private List generateToActionList(List localData, List commands) { + private List generateToActionList(SourceGeneratorLocalData localData, List commands) { return toActionList(generate(localData, commands)); } - private List generateToActionList(List localData, GraphTargetItem command) { + private List generateToActionList(SourceGeneratorLocalData localData, GraphTargetItem command) { return toActionList(command.toSource(localData, this)); } @Override - public List generate(List localData, List commands) { + public List generate(SourceGeneratorLocalData localData, List commands) { List ret = new ArrayList<>(); for (GraphTargetItem item : commands) { ret.addAll(item.toSourceIgnoreReturnValue(localData, this)); @@ -447,40 +448,39 @@ public class ActionSourceGenerator implements SourceGenerator { return ret; } - @SuppressWarnings("unchecked") - public HashMap getRegisterVars(List localData) { - return (HashMap) localData.get(0); + public HashMap getRegisterVars(SourceGeneratorLocalData localData) { + return localData.registerVars; } - public void setRegisterVars(List localData, HashMap value) { - localData.set(0, value); + public void setRegisterVars(SourceGeneratorLocalData localData, HashMap value) { + localData.registerVars = value; } - public void setInFunction(List localData, boolean value) { - localData.set(1, value); + public void setInFunction(SourceGeneratorLocalData localData, boolean value) { + localData.inFunction = value; } - public boolean isInFunction(List localData) { - return (Boolean) localData.get(1); + public boolean isInFunction(SourceGeneratorLocalData localData) { + return localData.inFunction; } - public boolean isInMethod(List localData) { - return (Boolean) localData.get(2); + public boolean isInMethod(SourceGeneratorLocalData localData) { + return localData.inMethod; } - public void setInMethod(List localData, boolean value) { - localData.set(2, value); + public void setInMethod(SourceGeneratorLocalData localData, boolean value) { + localData.inMethod = value; } - public int getForInLevel(List localData) { - return (Integer) localData.get(3); + public int getForInLevel(SourceGeneratorLocalData localData) { + return localData.forInLevel; } - public void setForInLevel(List localData, int value) { - localData.set(3, value); + public void setForInLevel(SourceGeneratorLocalData localData, int value) { + localData.forInLevel = value; } - public int getTempRegister(List localData) { + public int getTempRegister(SourceGeneratorLocalData localData) { HashMap registerVars = getRegisterVars(localData); int tmpReg = 0; for (int i = 0; i < 256; i++) { @@ -619,7 +619,7 @@ public class ActionSourceGenerator implements SourceGenerator { return new ActionPush(new ConstantIndex(index)); } - public List generateTraits(List localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) { + public List generateTraits(SourceGeneratorLocalData localData, boolean isInterface, GraphTargetItem name, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List functions, List> vars, List staticFunctions, List> staticVars) { List extendsStr = getVarParts(extendsVal); List ret = new ArrayList<>(); List nameStr = getVarParts(name); @@ -750,7 +750,7 @@ public class ActionSourceGenerator implements SourceGenerator { } @Override - public List generate(List localData, CommaExpressionItem item) { + public List generate(SourceGeneratorLocalData localData, CommaExpressionItem item) { if (item.commands.isEmpty()) { return new ArrayList<>(); } 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 6e8fa89d3..51314575a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/special/ActionDeobfuscatePop.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/special/ActionDeobfuscatePop.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.action.special; +import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.action.swf4.ActionPop; import com.jpexs.decompiler.graph.GraphTargetItem; import java.util.List; @@ -36,7 +37,7 @@ public class ActionDeobfuscatePop extends ActionPop { } @Override - public void translate(List localData, Stack stack, List output, int staticOperation, String path) { + public void translate(BaseLocalData localData, Stack stack, List output, int staticOperation, String path) { if (stack.isEmpty()) { return; } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/GraphFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/GraphFrame.java index 88226886c..68f35a190 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/GraphFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/GraphFrame.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.graph.GraphPart; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Line2D; -import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -48,7 +47,7 @@ public class GraphFrame extends AppFrame { private GraphPart head; public GraphPanel(Graph graph) throws InterruptedException { - graph.init(new ArrayList<>()); + graph.init(null); size = getPartPositions(head = graph.heads.get(0), SPACE_VERTICAL + SPACE_VERTICAL + BLOCK_HEIGHT / 2, getPartWidth(graph.heads.get(0), new HashSet()) * (BLOCK_WIDTH + SPACE_HORIZONTAL) / 2 - SPACE_HORIZONTAL, partPos, true); backLinksLeft = 1; backLinksRight = 1; diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java index cc4039807..ec36e874a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/UsageListModel.java @@ -39,7 +39,6 @@ public class UsageListModel extends DefaultListModel { } @Override - @SuppressWarnings("unchecked") public Object get(int index) { try { return ((MultinameUsage) super.get(index)).toString(abcTags, abc); @@ -50,7 +49,6 @@ public class UsageListModel extends DefaultListModel { } @Override - @SuppressWarnings("unchecked") public Object getElementAt(int index) { try { return ((MultinameUsage) super.getElementAt(index)).toString(abcTags, abc); @@ -60,7 +58,6 @@ public class UsageListModel extends DefaultListModel { return null; } - @SuppressWarnings("unchecked") public MultinameUsage getUsage(int index) { return ((MultinameUsage) super.getElementAt(index)); } diff --git a/trunk/src/com/jpexs/decompiler/graph/Graph.java b/trunk/src/com/jpexs/decompiler/graph/Graph.java index 63ddd12df..2dbdcf6f8 100644 --- a/trunk/src/com/jpexs/decompiler/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/graph/Graph.java @@ -16,6 +16,8 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.BaseLocalData; +import com.jpexs.decompiler.flash.FinalProcessLocalData; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; @@ -64,7 +66,7 @@ public class Graph { } - public void init(List localData) throws InterruptedException { + public void init(BaseLocalData localData) throws InterruptedException { if (heads != null) { return; } @@ -89,7 +91,7 @@ public class Graph { } } - private void fixGraph(List localData, GraphPart part) throws InterruptedException { + private void fixGraph(BaseLocalData localData, GraphPart part) throws InterruptedException { //if(true) return; try { while (fixGraphOnce(localData, part, new ArrayList(), false)) { @@ -102,7 +104,7 @@ public class Graph { } } - private boolean fixGraphOnce(List localData, GraphPart part, List visited, boolean doChildren) throws InterruptedException { + private boolean fixGraphOnce(BaseLocalData localData, GraphPart part, List visited, boolean doChildren) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -378,11 +380,11 @@ public class Graph { /* public GraphPart getNextCommonPart(GraphPart part, List loops) { return getNextCommonPart(part, new ArrayList(),loops); }*/ - public GraphPart getNextCommonPart(List localData, GraphPart part, List loops) throws InterruptedException { + public GraphPart getNextCommonPart(BaseLocalData localData, GraphPart part, List loops) throws InterruptedException { return getCommonPart(localData, part.nextParts, loops); } - public GraphPart getCommonPart(List localData, List parts, List loops) throws InterruptedException { + public GraphPart getCommonPart(BaseLocalData localData, List parts, List loops) throws InterruptedException { if (parts.isEmpty()) { return null; } @@ -442,7 +444,7 @@ public class Graph { return null; } - public GraphPart getMostCommonPart(List localData, List parts, List loops) throws InterruptedException { + public GraphPart getMostCommonPart(BaseLocalData localData, List parts, List loops) throws InterruptedException { if (parts.isEmpty()) { return null; } @@ -553,7 +555,7 @@ public class Graph { return null; } - public GraphPart getNextNoJump(GraphPart part, List localData) { + public GraphPart getNextNoJump(GraphPart part, BaseLocalData localData) { while (code.get(part.start).isJump()) { part = part.getSubParts().get(0).nextParts.get(0); } @@ -583,13 +585,13 @@ public class Graph { return part; } - public static List translateViaGraph(List localData, String path, GraphSource code, List alternateEntries, int staticOperation) throws InterruptedException { + public static List translateViaGraph(BaseLocalData localData, String path, GraphSource code, List alternateEntries, int staticOperation) throws InterruptedException { Graph g = new Graph(code, alternateEntries); g.init(localData); return g.translate(localData, staticOperation, path); } - public List translate(List localData, int staticOperation, String path) throws InterruptedException { + public List translate(BaseLocalData localData, int staticOperation, String path) throws InterruptedException { List allParts = new ArrayList<>(); for (GraphPart head : heads) { populateParts(head, allParts); @@ -612,7 +614,7 @@ public class Graph { List ret = printGraph(localData, stack, allParts, null, heads.get(0), null, loops, staticOperation, path); processIfs(ret); finalProcessStack(stack, ret); - finalProcessAll(ret, 0, new ArrayList<>()); + finalProcessAll(ret, 0, new FinalProcessLocalData()); return ret; @@ -621,7 +623,7 @@ public class Graph { public void finalProcessStack(Stack stack, List output) { } - private void finalProcessAll(List list, int level, List localData) { + private void finalProcessAll(List list, int level, FinalProcessLocalData localData) { finalProcess(list, level, localData); for (GraphTargetItem item : list) { if (item instanceof Block) { @@ -633,7 +635,7 @@ public class Graph { } } - protected void finalProcess(List list, int level, List localData) { + protected void finalProcess(List list, int level, FinalProcessLocalData localData) { } private void processIfs(List list) { @@ -785,22 +787,22 @@ public class Graph { return false; } - protected List check(GraphSource code, List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + protected List check(GraphSource code, BaseLocalData localData, List allParts, Stack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { return null; } - protected GraphPart checkPart(Stack stack, List localData, GraphPart part, List allParts) { + protected GraphPart checkPart(Stack stack, BaseLocalData localData, GraphPart part, List allParts) { return part; } @SuppressWarnings("unchecked") - protected GraphTargetItem translatePartGetStack(List localData, GraphPart part, Stack stack, int staticOperation) throws InterruptedException { + protected GraphTargetItem translatePartGetStack(BaseLocalData localData, GraphPart part, Stack stack, int staticOperation) throws InterruptedException { stack = (Stack) stack.clone(); translatePart(localData, part, stack, staticOperation, null); return stack.pop(); } - protected List translatePart(List localData, GraphPart part, Stack stack, int staticOperation, String path) throws InterruptedException { + protected List translatePart(BaseLocalData localData, GraphPart part, Stack stack, int staticOperation, String path) throws InterruptedException { List sub = part.getSubParts(); List ret = new ArrayList<>(); int end; @@ -861,16 +863,16 @@ public class Graph { list.remove(list.size() - 1); } - protected List printGraph(List localData, Stack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, int staticOperation, String path) throws InterruptedException { + protected List printGraph(BaseLocalData localData, Stack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, int staticOperation, String path) throws InterruptedException { List visited = new ArrayList<>(); return printGraph(visited, localData, stack, allParts, parent, part, stopPart, loops, null, staticOperation, path, 0); } - protected GraphTargetItem checkLoop(LoopItem loopItem, List localData, List loops) { + protected GraphTargetItem checkLoop(LoopItem loopItem, BaseLocalData localData, List loops) { return loopItem; } - private void getPrecontinues(List localData, GraphPart parent, GraphPart part, List allParts, List loops, List stopPart) throws InterruptedException { + private void getPrecontinues(BaseLocalData localData, GraphPart parent, GraphPart part, List allParts, List loops, List stopPart) throws InterruptedException { markLevels(localData, part, allParts, loops); //Note: this also marks part as precontinue when there is if /* @@ -922,13 +924,13 @@ public class Graph { clearLoops(loops);*/ } - private void markLevels(List localData, GraphPart part, List allParts, List loops) throws InterruptedException { + private void markLevels(BaseLocalData localData, GraphPart part, List allParts, List loops) throws InterruptedException { clearLoops(loops); markLevels(localData, part, allParts, loops, new ArrayList(), 1, new ArrayList(), 0); clearLoops(loops); } - private void markLevels(List localData, GraphPart part, List allParts, List loops, List stopPart, int level, List visited, int recursionLevel) throws InterruptedException { + private void markLevels(BaseLocalData localData, GraphPart part, List allParts, List loops, List stopPart, int level, List visited, int recursionLevel) throws InterruptedException { boolean debugMode = false; if (stopPart == null) { stopPart = new ArrayList<>(); @@ -1074,13 +1076,13 @@ public class Graph { } } - private void getLoops(List localData, GraphPart part, List loops, List stopPart) throws InterruptedException { + private void getLoops(BaseLocalData localData, GraphPart part, List loops, List stopPart) throws InterruptedException { clearLoops(loops); getLoops(localData, part, loops, stopPart, true, 1, new ArrayList()); clearLoops(loops); } - private void getLoops(List localData, GraphPart part, List loops, List stopPart, boolean first, int level, List visited) throws InterruptedException { + private void getLoops(BaseLocalData localData, GraphPart part, List loops, List stopPart, boolean first, int level, List visited) throws InterruptedException { boolean debugMode = false; if (stopPart == null) { @@ -1361,7 +1363,7 @@ public class Graph { } } - protected List printGraph(List visited, List localData, Stack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, List ret, int staticOperation, String path, int recursionLevel) throws InterruptedException { + protected List printGraph(List visited, BaseLocalData localData, Stack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, List ret, int staticOperation, String path, int recursionLevel) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -2187,7 +2189,7 @@ public class Graph { return writer; } - public List prepareBranchLocalData(List localData) { + public BaseLocalData prepareBranchLocalData(BaseLocalData localData) { return localData; } diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphPart.java b/trunk/src/com/jpexs/decompiler/graph/GraphPart.java index a21275278..9de4319f0 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphPart.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphPart.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.BaseLocalData; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -60,7 +61,7 @@ public class GraphPart implements Serializable { return time; } - private boolean leadsTo(List localData, Graph gr, GraphSource code, GraphPart part, List visited, List loops) throws InterruptedException { + private boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, List visited, List loops) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -125,7 +126,7 @@ public class GraphPart implements Serializable { return false; } - public boolean leadsTo(List localData, Graph gr, GraphSource code, GraphPart part, List loops) throws InterruptedException { + public boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, List loops) throws InterruptedException { for (Loop l : loops) { l.leadsToMark = 0; } diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphSource.java b/trunk/src/com/jpexs/decompiler/graph/GraphSource.java index 9e553355a..be470ec03 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphSource.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphSource.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.BaseLocalData; import com.jpexs.decompiler.flash.action.Action; import java.io.Serializable; import java.util.ArrayList; @@ -35,7 +36,7 @@ public abstract class GraphSource implements Serializable { public abstract boolean isEmpty(); - public abstract List translatePart(GraphPart part, List localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException; + public abstract List translatePart(GraphPart part, BaseLocalData localData, Stack stack, int start, int end, int staticOperation, String path) throws InterruptedException; private void visitCode(int ip, int lastIp, HashMap> refs, int endIp) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphSourceItem.java b/trunk/src/com/jpexs/decompiler/graph/GraphSourceItem.java index 86ad0ba90..f05f92d9d 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphSourceItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphSourceItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.BaseLocalData; import java.io.Serializable; import java.util.List; import java.util.Stack; @@ -26,7 +27,7 @@ import java.util.Stack; */ public interface GraphSourceItem extends Serializable { - public void translate(List localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException; + public void translate(BaseLocalData localData, Stack stack, List output, int staticOperation, String path) throws InterruptedException; public boolean isJump(); diff --git a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java index fb8f2e559..b1c21366a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.graph.model.BinaryOp; @@ -206,11 +207,11 @@ public abstract class GraphTargetItem implements Serializable { return equals(target); } - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return new ArrayList<>(); } - public List toSourceIgnoreReturnValue(List localData, SourceGenerator generator) { + public List toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) { return toSource(localData, generator); } @@ -220,7 +221,7 @@ public abstract class GraphTargetItem implements Serializable { return ret; } - protected List toSourceMerge(List localData, SourceGenerator gen, Object... tar) { + protected List toSourceMerge(SourceGeneratorLocalData localData, SourceGenerator gen, Object... tar) { List ret = new ArrayList<>(); for (Object o : tar) { if (o instanceof GraphTargetItem) { diff --git a/trunk/src/com/jpexs/decompiler/graph/SourceGenerator.java b/trunk/src/com/jpexs/decompiler/graph/SourceGenerator.java index ea49b191d..c61b6ad91 100644 --- a/trunk/src/com/jpexs/decompiler/graph/SourceGenerator.java +++ b/trunk/src/com/jpexs/decompiler/graph/SourceGenerator.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.graph.model.AndItem; import com.jpexs.decompiler.graph.model.BreakItem; import com.jpexs.decompiler.graph.model.CommaExpressionItem; @@ -37,31 +38,31 @@ import java.util.List; */ public interface SourceGenerator { - public List generate(List localData, AndItem item); + public List generate(SourceGeneratorLocalData localData, AndItem item); - public List generate(List localData, OrItem item); + public List generate(SourceGeneratorLocalData localData, OrItem item); - public List generate(List localData, IfItem item); + public List generate(SourceGeneratorLocalData localData, IfItem item); - public List generate(List localData, TernarOpItem item); + public List generate(SourceGeneratorLocalData localData, TernarOpItem item); - public List generate(List localData, WhileItem item); + public List generate(SourceGeneratorLocalData localData, WhileItem item); - public List generate(List localData, DoWhileItem item); + public List generate(SourceGeneratorLocalData localData, DoWhileItem item); - public List generate(List localData, ForItem item); + public List generate(SourceGeneratorLocalData localData, ForItem item); - public List generate(List localData, SwitchItem item); + public List generate(SourceGeneratorLocalData localData, SwitchItem item); - public List generate(List localData, NotItem item); + public List generate(SourceGeneratorLocalData localData, NotItem item); - public List generate(List localData, DuplicateItem item); + public List generate(SourceGeneratorLocalData localData, DuplicateItem item); - public List generate(List localData, BreakItem item); + public List generate(SourceGeneratorLocalData localData, BreakItem item); - public List generate(List localData, ContinueItem item); + public List generate(SourceGeneratorLocalData localData, ContinueItem item); - public List generate(List localData, List commands); + public List generate(SourceGeneratorLocalData localData, List commands); - public List generate(List localData, CommaExpressionItem item); + public List generate(SourceGeneratorLocalData localData, CommaExpressionItem item); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/AndItem.java b/trunk/src/com/jpexs/decompiler/graph/model/AndItem.java index 590b410fd..8b17066c6 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/AndItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/AndItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -44,7 +45,7 @@ public class AndItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java index 83af4449e..a85614522 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BlockItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -47,7 +48,7 @@ public class BlockItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, commands); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java index ef953b3f9..0ee81b62f 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BreakItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -54,7 +55,7 @@ public class BreakItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java index 18475475f..c06f2ee09 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/CommaExpressionItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -49,7 +50,7 @@ public class CommaExpressionItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java index 1006fadbc..24801e379 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ContinueItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -54,7 +55,7 @@ public class ContinueItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java index 44924dfcd..29cc7209a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DoWhileItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.LoopWithType; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -104,7 +105,7 @@ public class DoWhileItem extends LoopItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java index 5bdcd6b37..ba25d3c3d 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/DuplicateItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -74,7 +75,7 @@ public class DuplicateItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java index 6cc017ae0..e7cf6dec2 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ForItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.LoopWithType; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -126,7 +127,7 @@ public class ForItem extends LoopItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java index f73df67b7..c17d1e325 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/IfItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.Block; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -131,7 +132,7 @@ public class IfItem extends GraphTargetItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/NotItem.java b/trunk/src/com/jpexs/decompiler/graph/model/NotItem.java index ff8ae8271..6cd649df4 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/NotItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/NotItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.action.model.operations.Inverted; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -65,7 +66,7 @@ public class NotItem extends UnaryOpItem implements LogicalOpItem, Inverted { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/OrItem.java b/trunk/src/com/jpexs/decompiler/graph/model/OrItem.java index 1fa4500bd..7ad473f78 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/OrItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/OrItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -39,7 +40,7 @@ public class OrItem extends BinaryOpItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java index 238c89cc9..81c47611a 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -41,7 +42,7 @@ public class ParenthesisItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return value.toSource(localData, generator); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java index 4e7dd3f3c..3554fd6ae 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/SwitchItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.LoopWithType; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -137,7 +138,7 @@ public class SwitchItem extends LoopItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java index bfa19e136..30926e51f 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/TernarOpItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -46,7 +47,7 @@ public class TernarOpItem extends GraphTargetItem { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java index 324115466..ccd62f627 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/WhileItem.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.graph.model; +import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.LoopWithType; import com.jpexs.decompiler.flash.helpers.NulWriter; @@ -101,7 +102,7 @@ public class WhileItem extends LoopItem implements Block { } @Override - public List toSource(List localData, SourceGenerator generator) { + public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) { return generator.generate(localData, this); }