mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-18 00:58:06 +00:00
LocalData object instead of object lists
This commit is contained in:
25
trunk/src/com/jpexs/decompiler/flash/BaseLocalData.java
Normal file
25
trunk/src/com/jpexs/decompiler/flash/BaseLocalData.java
Normal file
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public abstract class BaseLocalData {
|
||||
|
||||
}
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class FinalProcessLocalData {
|
||||
|
||||
public final HashSet<Integer> temporaryRegisters;
|
||||
|
||||
public FinalProcessLocalData() {
|
||||
temporaryRegisters = new HashSet<>();
|
||||
}
|
||||
}
|
||||
@@ -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<DirectValueActionItem, String> usageTypes = new HashMap<>();
|
||||
private ActionDeobfuscation deobfuscation = new ActionDeobfuscation();
|
||||
|
||||
private static void getVariables(ConstantPool constantPool, List<Object> localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, ActionGraphSource code, int ip, List<MyEntry<DirectValueActionItem, ConstantPool>> variables, List<GraphSourceItem> functions, HashMap<DirectValueActionItem, ConstantPool> strings, List<Integer> visited, HashMap<DirectValueActionItem, String> usageTypes, String path) throws InterruptedException {
|
||||
private static void getVariables(ConstantPool constantPool, BaseLocalData localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, ActionGraphSource code, int ip, List<MyEntry<DirectValueActionItem, ConstantPool>> variables, List<GraphSourceItem> functions, HashMap<DirectValueActionItem, ConstantPool> strings, List<Integer> visited, HashMap<DirectValueActionItem, String> 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<MyEntry<DirectValueActionItem, ConstantPool>> variables, List<GraphSourceItem> functions, HashMap<DirectValueActionItem, ConstantPool> strings, HashMap<DirectValueActionItem, String> usageType, ActionGraphSource code, int addr, String path) throws InterruptedException {
|
||||
List<Object> localData = Helper.toList(new HashMap<Integer, String>(), new HashMap<String, GraphTargetItem>(), new HashMap<String, GraphTargetItem>());
|
||||
ActionLocalData localData = new ActionLocalData();
|
||||
getVariables(null, localData, new Stack<GraphTargetItem>(), new ArrayList<GraphTargetItem>(), code, code.adr2pos(addr), variables, functions, strings, new ArrayList<Integer>(), usageType, path);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SourceGeneratorLocalData {
|
||||
|
||||
public HashMap<String, Integer> registerVars;
|
||||
public Boolean inFunction;
|
||||
public Boolean inMethod;
|
||||
public Integer forInLevel;
|
||||
|
||||
public SourceGeneratorLocalData(HashMap<String, Integer> registerVars, Boolean inFunction, Boolean inMethod, Integer forInLevel) {
|
||||
this.registerVars = registerVars;
|
||||
this.inFunction = inFunction;
|
||||
this.inMethod = inMethod;
|
||||
this.forInLevel = forInLevel;
|
||||
}
|
||||
}
|
||||
80
trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java
Normal file
80
trunk/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java
Normal file
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Integer, GraphTargetItem> localRegs;
|
||||
public Stack<GraphTargetItem> scopeStack;
|
||||
public ConstantPool constants;
|
||||
public MethodInfo[] methodInfo;
|
||||
public MethodBody methodBody;
|
||||
public ABC abc;
|
||||
public HashMap<Integer, String> localRegNames;
|
||||
public List<String> fullyQualifiedNames;
|
||||
public ArrayList<ABCException> parsedExceptions;
|
||||
public ArrayList<Integer> finallyJumps;
|
||||
public ArrayList<Integer> ignoredSwitches;
|
||||
public Integer scriptIndex;
|
||||
public HashMap<Integer, Integer> localRegAssignmentIps;
|
||||
public Integer ip;
|
||||
public HashMap<Integer, List<Integer>> 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;
|
||||
}
|
||||
}
|
||||
@@ -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<Object> prepareBranchLocalData(List<Object> localData) {
|
||||
List<Object> ret = new ArrayList<>();
|
||||
ret.add(localData.get(0)); //isStatic
|
||||
ret.add(localData.get(1)); //classIndex
|
||||
ret.add(new HashMap<>((HashMap<Integer, GraphTargetItem>) localData.get(2)));
|
||||
ret.add((Stack<GraphTargetItem>) ((Stack<GraphTargetItem>) 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<GraphTargetItem>) (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<Object> localData = new ArrayList<>();
|
||||
localData.add((Boolean) isStatic); //isStatic
|
||||
localData.add((Integer) (classIndex)); //classIndex
|
||||
localData.add(new HashMap<Integer, GraphTargetItem>());
|
||||
localData.add(new Stack<GraphTargetItem>());
|
||||
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<String>()); //fullyQualifiedNames
|
||||
localData.add(new ArrayList<ABCException>());
|
||||
localData.add(new ArrayList<Integer>());
|
||||
localData.add(new ArrayList<Integer>());
|
||||
localData.add((Integer) (scriptIndex));
|
||||
localData.add(new HashMap<Integer, Integer>()); //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<Integer, List<Integer>> 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<Integer, GraphTargetItem>(), new Stack<GraphTargetItem>(), abc, body, new HashMap<Integer, String>(), new ArrayList<String>(), new HashMap<Integer, Integer>(), 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<Integer, List<Integer>> refs, boolean secondPass, boolean indeterminate, List<Object> localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, AVM2GraphSource code, int ip, HashMap<Integer, Integer> visited, HashMap<Integer, HashMap<Integer, GraphTargetItem>> visitedStates, HashMap<AVM2Instruction, Decision> decisions, String path, int recursionLevel) throws InterruptedException {
|
||||
private static int removeTraps(HashMap<Integer, List<Integer>> refs, boolean secondPass, boolean indeterminate, AVM2LocalData localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, AVM2GraphSource code, int ip, HashMap<Integer, Integer> visited, HashMap<Integer, HashMap<Integer, GraphTargetItem>> visitedStates, HashMap<AVM2Instruction, Decision> 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<Integer, GraphTargetItem> currentState = (HashMap<Integer, GraphTargetItem>) localData.get(2);
|
||||
HashMap<Integer, GraphTargetItem> currentState = localData.localRegs;
|
||||
|
||||
if (visitedStates.containsKey(ip)) {
|
||||
HashMap<Integer, GraphTargetItem> 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<Integer, GraphTargetItem> registers = (HashMap<Integer, GraphTargetItem>) localData.get(2);
|
||||
HashMap<Integer, GraphTargetItem> 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<Integer, GraphTargetItem> registers = (HashMap<Integer, GraphTargetItem>) localData.get(2);
|
||||
HashMap<Integer, GraphTargetItem> 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<Integer, GraphTargetItem> registers = (HashMap<Integer, GraphTargetItem>) localData.get(2);
|
||||
HashMap<Integer, GraphTargetItem> 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<Object> localData, AVM2GraphSource code, int addr, String path, HashMap<Integer, List<Integer>> refs) throws InterruptedException {
|
||||
public static int removeTraps(ConstantPool constants, Trait trait, MethodInfo info, MethodBody body, AVM2LocalData localData, AVM2GraphSource code, int addr, String path, HashMap<Integer, List<Integer>> refs) throws InterruptedException {
|
||||
HashMap<AVM2Instruction, AVM2Code.Decision> decisions = new HashMap<>();
|
||||
removeTraps(refs, false, false, localData, new Stack<GraphTargetItem>(), new ArrayList<GraphTargetItem>(), code, code.adr2pos(addr), new HashMap<Integer, Integer>(), new HashMap<Integer, HashMap<Integer, GraphTargetItem>>(), 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<Object> localData, AVM2GraphSource code, int addr) {
|
||||
/*public static int removeTraps(AVM2LocalData localData, AVM2GraphSource code, int addr) {
|
||||
AVM2Graph.translateViaGraph(localData, "", code, new ArrayList<Integer>(), Graph.SOP_REMOVE_STATIC);
|
||||
return 1;
|
||||
}*/
|
||||
|
||||
@@ -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<GraphTargetItem> translateViaGraph(String path, AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> scopeStack, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, int staticOperation, HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) throws InterruptedException {
|
||||
AVM2Graph g = new AVM2Graph(code, abc, body, isStatic, scriptIndex, classIndex, localRegs, scopeStack, localRegNames, fullyQualifiedNames, localRegAssigmentIps, refs);
|
||||
|
||||
List<Object> 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<ABCException>());
|
||||
localData.add(new ArrayList<Integer>()); //finallyJumps
|
||||
localData.add(new ArrayList<Integer>());
|
||||
localData.add((Integer) scriptIndex);
|
||||
localData.add(new HashMap<Integer, Integer>()); //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<GraphPart> allParts = new ArrayList<>();
|
||||
for (GraphPart head : g.heads) {
|
||||
@@ -186,15 +176,13 @@ public class AVM2Graph extends Graph {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<GraphTargetItem> check(GraphSource code, List<Object> localData, List<GraphPart> allParts, Stack<GraphTargetItem> stack, GraphPart parent, GraphPart part, List<GraphPart> stopPart, List<Loop> loops, List<GraphTargetItem> output, Loop currentLoop, int staticOperation, String path) throws InterruptedException {
|
||||
protected List<GraphTargetItem> check(GraphSource code, BaseLocalData localData, List<GraphPart> allParts, Stack<GraphTargetItem> stack, GraphPart parent, GraphPart part, List<GraphPart> stopPart, List<Loop> loops, List<GraphTargetItem> output, Loop currentLoop, int staticOperation, String path) throws InterruptedException {
|
||||
List<GraphTargetItem> ret = null;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ABCException> parsedExceptions = (List<ABCException>) localData.get(DATA_PARSEDEXCEPTIONS);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> finallyJumps = (List<Integer>) localData.get(DATA_FINALLYJUMPS);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> ignoredSwitches = (List<Integer>) localData.get(DATA_IGNOREDSWITCHES);
|
||||
AVM2LocalData aLocalData = (AVM2LocalData) localData;
|
||||
List<ABCException> parsedExceptions = aLocalData.parsedExceptions;
|
||||
List<Integer> finallyJumps = aLocalData.finallyJumps;
|
||||
List<Integer> 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<Object> localData2 = new ArrayList<>();
|
||||
localData2.addAll(localData);
|
||||
localData2.set(DATA_SCOPESTACK, new Stack<GraphTargetItem>());
|
||||
AVM2LocalData localData2 = new AVM2LocalData(aLocalData);
|
||||
localData2.scopeStack = new Stack<>();
|
||||
List<GraphPart> stopPart2 = new ArrayList<>(stopPart);
|
||||
stopPart2.add(nepart);
|
||||
if (retPart != null) {
|
||||
@@ -619,11 +606,10 @@ public class AVM2Graph extends Graph {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GraphPart checkPart(Stack<GraphTargetItem> stack, List<Object> localData, GraphPart next, List<GraphPart> allParts) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> finallyJumps = (List<Integer>) localData.get(DATA_FINALLYJUMPS);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Integer> ignoredSwitches = (List<Integer>) localData.get(DATA_IGNOREDSWITCHES);
|
||||
protected GraphPart checkPart(Stack<GraphTargetItem> stack, BaseLocalData localData, GraphPart next, List<GraphPart> allParts) {
|
||||
AVM2LocalData aLocalData = (AVM2LocalData) localData;
|
||||
List<Integer> finallyJumps = aLocalData.finallyJumps;
|
||||
List<Integer> 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<Object> localData, List<Loop> loops) {
|
||||
protected GraphTargetItem checkLoop(LoopItem loopItem, BaseLocalData localData, List<Loop> 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<Integer, GraphTargetItem> localRegs = (HashMap<Integer, GraphTargetItem>) localData.get(DATA_LOCALREGS);
|
||||
HashMap<Integer, GraphTargetItem> 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<GraphTargetItem> list, int level, List<Object> localData) {
|
||||
protected void finalProcess(List<GraphTargetItem> 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<Object> prepareBranchLocalData(List<Object> localData) {
|
||||
List<Object> ret = new ArrayList<>();
|
||||
ret.addAll(localData);
|
||||
@SuppressWarnings("unchecked")
|
||||
Stack<GraphTargetItem> scopeStack = (Stack<GraphTargetItem>) ret.get(DATA_SCOPESTACK);
|
||||
public AVM2LocalData prepareBranchLocalData(BaseLocalData localData) {
|
||||
AVM2LocalData aLocalData = (AVM2LocalData) localData;
|
||||
AVM2LocalData ret = new AVM2LocalData(aLocalData);
|
||||
Stack<GraphTargetItem> copyScopeStack = new Stack<>();
|
||||
copyScopeStack.addAll(scopeStack);
|
||||
ret.set(DATA_SCOPESTACK, copyScopeStack);
|
||||
copyScopeStack.addAll(ret.scopeStack);
|
||||
ret.scopeStack = copyScopeStack;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GraphTargetItem> translatePart(GraphPart part, List<Object> localData, Stack<GraphTargetItem> stack, int start, int end, int staticOperation, String path) throws InterruptedException {
|
||||
public List<GraphTargetItem> translatePart(GraphPart part, BaseLocalData localData, Stack<GraphTargetItem> stack, int start, int end, int staticOperation, String path) throws InterruptedException {
|
||||
List<GraphTargetItem> ret = new ArrayList<>();
|
||||
Object o = localData.get(AVM2Graph.DATA_SCOPESTACK);
|
||||
Stack<GraphTargetItem> newstack = (Stack<GraphTargetItem>) o;
|
||||
Stack<GraphTargetItem> 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;
|
||||
|
||||
@@ -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<Object> replaceWith;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void translate(List<Object> localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, int staticOperation, String path) throws InterruptedException {
|
||||
definition.translate((Boolean) localData.get(0),
|
||||
(Integer) localData.get(13),
|
||||
(Integer) localData.get(1),
|
||||
(HashMap<Integer, GraphTargetItem>) localData.get(2),
|
||||
public void translate(BaseLocalData localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, int staticOperation, String path) throws InterruptedException {
|
||||
AVM2LocalData aLocalData = (AVM2LocalData) localData;
|
||||
definition.translate(aLocalData.isStatic,
|
||||
aLocalData.scriptIndex,
|
||||
aLocalData.classIndex,
|
||||
aLocalData.localRegs,
|
||||
stack,
|
||||
(Stack<GraphTargetItem>) localData.get(3),
|
||||
(ConstantPool) localData.get(4), this, (MethodInfo[]) localData.get(5), output, (MethodBody) localData.get(6), (ABC) localData.get(7), (HashMap<Integer, String>) localData.get(8), (List<String>) localData.get(9), null, (HashMap<Integer, Integer>) localData.get(14), (int) (Integer) localData.get(15), (HashMap<Integer, List<Integer>>) 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
|
||||
|
||||
@@ -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<Object> localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output, int staticOperation, String path) throws InterruptedException {
|
||||
translate(stack, output, (HashMap<Integer, String>) localData.get(0), (HashMap<String, GraphTargetItem>) localData.get(1), (HashMap<String, GraphTargetItem>) localData.get(2), staticOperation, path);
|
||||
public void translate(BaseLocalData localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> 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<Object> localData = new ArrayList<>();
|
||||
localData.add(registerNames);
|
||||
localData.add(variables);
|
||||
localData.add(functions);
|
||||
ActionLocalData localData = new ActionLocalData(registerNames, variables, functions);
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
int ip = start;
|
||||
boolean isWhile = false;
|
||||
|
||||
@@ -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<GraphTargetItem> translateViaGraph(HashMap<Integer, String> registerNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions, List<Action> code, int version, int staticOperation, String path) throws InterruptedException {
|
||||
|
||||
ActionGraph g = new ActionGraph(code, registerNames, variables, functions, version);
|
||||
List<Object> 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<GraphTargetItem> list, int level, List<Object> localData) {
|
||||
protected void finalProcess(List<GraphTargetItem> list, int level, FinalProcessLocalData localData) {
|
||||
|
||||
if (localData.isEmpty()) {
|
||||
localData.add(new HashSet<Integer>()); //List of temporaryRegisters
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
Set<Integer> temporaryRegisters = (HashSet<Integer>) localData.get(0);
|
||||
List<GraphTargetItem> ret = Action.checkClass(list);
|
||||
if (ret != list) {
|
||||
list.clear();
|
||||
@@ -253,7 +247,7 @@ public class ActionGraph extends Graph {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<GraphTargetItem> check(GraphSource code, List<Object> localData, List<GraphPart> allParts, Stack<GraphTargetItem> stack, GraphPart parent, GraphPart part, List<GraphPart> stopPart, List<Loop> loops, List<GraphTargetItem> output, Loop currentLoop, int staticOperation, String path) throws InterruptedException {
|
||||
protected List<GraphTargetItem> check(GraphSource code, BaseLocalData localData, List<GraphPart> allParts, Stack<GraphTargetItem> stack, GraphPart parent, GraphPart part, List<GraphPart> stopPart, List<Loop> loops, List<GraphTargetItem> 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);
|
||||
|
||||
@@ -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<GraphTargetItem> translatePart(GraphPart part, List<Object> localData, Stack<GraphTargetItem> stack, int start, int end, int staticOperation, String path) throws InterruptedException {
|
||||
public List<GraphTargetItem> translatePart(GraphPart part, BaseLocalData localData, Stack<GraphTargetItem> 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<Long> posCache = null;
|
||||
|
||||
@@ -241,7 +241,7 @@ public class ActionListReader {
|
||||
|
||||
Stack<GraphTargetItem> stack = new Stack<>();
|
||||
|
||||
List<Object> localData = Helper.toList(new HashMap<Integer, String>(), new HashMap<String, GraphTargetItem>(), new HashMap<String, GraphTargetItem>());
|
||||
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<GraphTargetItem>(), new HashMap<Long, List<GraphSourceItemContainer>>(), containerSWFOffset, localData, stack, cpool, actionMap, ip, ip, retdups, ip, endIp, path, new HashMap<Integer, Integer>(), false, new HashMap<Integer, HashMap<String, GraphTargetItem>>(), version, 0, maxRecursionLevel);
|
||||
deobfustaceActionListAtPosRecursive(listeners, new ArrayList<GraphTargetItem>(), new HashMap<Long, List<GraphSourceItemContainer>>(), containerSWFOffset, localData, stack, cpool, actionMap, ip, retdups, ip, endIp, path, new HashMap<Integer, Integer>(), false, new HashMap<Integer, HashMap<String, GraphTargetItem>>(), 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<DisassemblyListener> listeners, long containerSWFOffset, ConstantPool cpool,
|
||||
SWFInputStream sis, List<Action> actions, List<Long> nextOffsets,
|
||||
long ip, long startIp, long endIp, int version, String path, boolean indeterminate, List<Long> visitedContainers) throws IOException {
|
||||
@@ -701,8 +700,7 @@ public class ActionListReader {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static void deobfustaceActionListAtPosRecursive(List<DisassemblyListener> listeners, List<GraphTargetItem> output, HashMap<Long, List<GraphSourceItemContainer>> containers, long containerSWFOffset, List<Object> localData, Stack<GraphTargetItem> stack, ConstantPool cpool, List<Action> actions, int pos, int ip, List<Action> ret, int startIp, int endip, String path, Map<Integer, Integer> visited, boolean indeterminate, Map<Integer, HashMap<String, GraphTargetItem>> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException {
|
||||
private static void deobfustaceActionListAtPosRecursive(List<DisassemblyListener> listeners, List<GraphTargetItem> output, HashMap<Long, List<GraphSourceItemContainer>> containers, long containerSWFOffset, ActionLocalData localData, Stack<GraphTargetItem> stack, ConstantPool cpool, List<Action> actions, int ip, List<Action> ret, int startIp, int endip, String path, Map<Integer, Integer> visited, boolean indeterminate, Map<Integer, HashMap<String, GraphTargetItem>> 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<String, GraphTargetItem> vars = (HashMap<String, GraphTargetItem>) localData.get(1);
|
||||
System.err.print("variables: ");
|
||||
for (Map.Entry<String, GraphTargetItem> v : vars.entrySet()) {
|
||||
for (Map.Entry<String, GraphTargetItem> 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<String, GraphTargetItem> vars = (HashMap<String, GraphTargetItem>) localData.get(1);
|
||||
HashMap<String, GraphTargetItem> 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<GraphTargetItem>());
|
||||
continue;
|
||||
}
|
||||
List<Object> localData2;
|
||||
ActionLocalData localData2;
|
||||
List<GraphTargetItem> output2 = new ArrayList<>();
|
||||
if ((cnt instanceof ActionDefineFunction) || (cnt instanceof ActionDefineFunction2)) {
|
||||
localData2 = Helper.toList(new HashMap<Integer, String>(), new HashMap<String, GraphTargetItem>(), new HashMap<String, GraphTargetItem>());
|
||||
localData2 = new ActionLocalData();
|
||||
} else {
|
||||
localData2 = localData;
|
||||
}
|
||||
deobfustaceActionListAtPosRecursive(listeners, output2, containers, containerSWFOffset, localData2, new Stack<GraphTargetItem>(), 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<GraphTargetItem>(), 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<Integer, String>) localData.get(0), (HashMap<String, GraphTargetItem>) localData.get(1), (HashMap<String, GraphTargetItem>) 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<String, GraphTargetItem> vars = (HashMap<String, GraphTargetItem>) localData.get(1);
|
||||
HashMap<String, GraphTargetItem> vars = localData.variables;
|
||||
boolean stateChanged = false;
|
||||
if (decisionStates.containsKey(ip)) {
|
||||
HashMap<String, GraphTargetItem> oldstate = decisionStates.get(ip);
|
||||
@@ -933,8 +916,8 @@ public class ActionListReader {
|
||||
|
||||
if ((!stateChanged) && curVisited > 1) {
|
||||
List<Integer> 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) {//<curVisited){
|
||||
ip = br;
|
||||
pos = br;
|
||||
continue loopip;
|
||||
}
|
||||
}
|
||||
@@ -951,28 +933,27 @@ public class ActionListReader {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Stack<GraphTargetItem> substack = (Stack<GraphTargetItem>) 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<Object> prepareLocalBranch(List<Object> localData) {
|
||||
@SuppressWarnings("unchecked")
|
||||
HashMap<Integer, String> regNames = (HashMap<Integer, String>) localData.get(0);
|
||||
@SuppressWarnings("unchecked")
|
||||
HashMap<String, GraphTargetItem> variables = (HashMap<String, GraphTargetItem>) localData.get(1);
|
||||
@SuppressWarnings("unchecked")
|
||||
HashMap<String, GraphTargetItem> functions = (HashMap<String, GraphTargetItem>) localData.get(2);
|
||||
List<Object> 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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
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<Integer, String> regNames;
|
||||
public final HashMap<String, GraphTargetItem> variables;
|
||||
public final HashMap<String, GraphTargetItem> functions;
|
||||
|
||||
public ActionLocalData() {
|
||||
regNames = new HashMap<>();
|
||||
variables = new HashMap<>();
|
||||
functions = new HashMap<>();
|
||||
}
|
||||
|
||||
public ActionLocalData(HashMap<Integer, String> regNames) {
|
||||
this.regNames = regNames;
|
||||
variables = new HashMap<>();
|
||||
functions = new HashMap<>();
|
||||
}
|
||||
|
||||
public ActionLocalData(HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions) {
|
||||
this.regNames = regNames;
|
||||
this.variables = variables;
|
||||
this.functions = functions;
|
||||
}
|
||||
}
|
||||
@@ -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<GraphSourceItem> toSourceCall(List<Object> localData, SourceGenerator gen, List<GraphTargetItem> list) {
|
||||
protected List<GraphSourceItem> toSourceCall(SourceGeneratorLocalData localData, SourceGenerator gen, List<GraphTargetItem> list) {
|
||||
List<GraphSourceItem> 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<GraphSourceItem> toSourceIgnoreReturnValue(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = toSource(localData, generator);
|
||||
if (hasReturnValue()) {
|
||||
ret.add(new ActionPop());
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionAsciiToChar());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionCall());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), functionName, new ActionCallFunction());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), scriptObject, methodName, new ActionCallMethod());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, constructor, object, new ActionCastOp());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionCharToAscii());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, source, target, depth, new ActionCloneSprite());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object, new ActionDecrement());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
if (value == null) {
|
||||
return toSourceMerge(localData, generator, name, new ActionDefineLocal2());
|
||||
} else {
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object, propertyName, new ActionDelete());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionPush(value));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionGetVariable());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
for (GraphTargetItem a : arguments) {
|
||||
ret.addAll(a.toSource(localData, generator));
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionGetURL("FSCommand:" + command, ""));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
List<Integer> paramRegs = new ArrayList<>();
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> localDataCopy = (List<Object>) Helper.deepCopy(localData);
|
||||
SourceGeneratorLocalData localDataCopy = (SourceGeneratorLocalData) Helper.deepCopy(localData);
|
||||
HashMap<String, Integer> registerVars = asGenerator.getRegisterVars(localDataCopy);
|
||||
registerVars.put("_parent", REGISTER_PARENT);
|
||||
registerVars.put("_root", REGISTER_ROOT);
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object, memberName, new ActionGetMember());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), new ActionGetProperty());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionGetTime());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, urlString, targetString, new ActionGetURL2(sendVarsMethod, false, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionGetURL(urlString, targetString));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, name, new ActionGetVariable());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionPush("/:$version"), new ActionGetVariable());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, frame, new ActionGotoFrame2(playFlag, sceneBiasFlag, sceneBias));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionGotoFrame(frame));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionGoToLabel(label));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object, new ActionIncrement());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, toSourceCall(localData, generator, values), new ActionInitArray());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
for (int i = values.size() - 1; i >= 0; i--) {
|
||||
ret.addAll(names.get(i).toSource(localData, generator));
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, urlString, targetString, new ActionGetURL2(method, true, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, urlString, targetString, new ActionGetURL2(method, false, true));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionMBAsciiToChar());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionMBCharToAscii());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, index, count, new ActionMBStringExtract());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionMBStringLength());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), scriptObject, methodName, new ActionNewMethod());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), objectName, new ActionNewObject());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionNextFrame());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionPlay());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionPop());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSourceIgnoreReturnValue(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
|
||||
if (object instanceof GetVariableActionItem) {
|
||||
@@ -122,7 +123,7 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object.toSource(localData, generator), toSourceIgnoreReturnValue(localData, generator));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSourceIgnoreReturnValue(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
|
||||
if (object instanceof GetVariableActionItem) {
|
||||
@@ -122,7 +123,7 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object.toSource(localData, generator), toSourceIgnoreReturnValue(localData, generator));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionPrevFrame());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionRandomNumber());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionRemoveSprite());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
int forinlevel = asGenerator.getForInLevel(localData);
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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<GraphSourceItem> toSourceIgnoreReturnValue(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, object, objectName, value, new ActionSetMember());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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<GraphSourceItem> toSourceIgnoreReturnValue(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, target, new ActionPush((Long) (long) propertyIndex), value, new ActionSetProperty());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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<GraphSourceItem> toSourceIgnoreReturnValue(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSourceIgnoreReturnValue(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, name, value, new ActionSetVariable());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
boolean hasConstrains = true;
|
||||
if (constrain instanceof DirectValueActionItem) {
|
||||
if (Double.compare(EcmaScript.toNumber(constrain.getResult()), 0) == 0) {
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionStop());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionStopSounds());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionEndDrag());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionStoreRegister(register.number));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, index, count, new ActionStringExtract());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionStringLength());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionTargetPath());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionThrow());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionToInteger());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionToNumber());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionToString());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionToggleQuality());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionTrace());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, value, new ActionTypeOf());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, new ActionPush(""), targetString, new ActionGetURL2(0, true, false));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> 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));
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> localData2 = (List<Object>) 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;
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
HashMap<String, Integer> registerVars = asGenerator.getRegisterVars(localData);
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> body = generator.generate(localData, actions);
|
||||
return toSourceMerge(localData, generator, frame, new ActionWaitForFrame2(body.size()), body);
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
ret.addAll(asGenerator.generateTraits(localData, true, name, null, superInterfaces, null, null, null, null, null));
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ret.addAll(target.toSource(localData, generator));
|
||||
ret.add(new ActionSetTarget2());
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> ret = new ArrayList<>();
|
||||
ActionSourceGenerator asGenerator = (ActionSourceGenerator) generator;
|
||||
List<Action> tryCommandsA = asGenerator.toActionList(asGenerator.generate(localData, tryCommands));
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
List<GraphSourceItem> data = generator.generate(localData, items);
|
||||
List<Action> dataA = new ArrayList<>();
|
||||
for (GraphSourceItem s : data) {
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, leftSide, rightSide, new ActionAdd2());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, leftSide, rightSide, new ActionAnd());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitAnd());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitOr());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<GraphSourceItem> toSource(List<Object> localData, SourceGenerator generator) {
|
||||
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) {
|
||||
return toSourceMerge(localData, generator, leftSide, rightSide, new ActionBitXor());
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user