AS1/2 and AS3 now share common decompiling method

This commit is contained in:
Jindra Pet��k
2013-02-24 22:46:42 +01:00
parent 6d644179ca
commit 8baa5691e9
423 changed files with 5610 additions and 4709 deletions
@@ -29,6 +29,10 @@ import com.jpexs.decompiler.flash.action.swf7.ActionTry;
import com.jpexs.decompiler.flash.action.treemodel.*;
import com.jpexs.decompiler.flash.action.treemodel.clauses.*;
import com.jpexs.decompiler.flash.action.treemodel.operations.NotTreeItem;
import com.jpexs.decompiler.flash.graph.GraphSource;
import com.jpexs.decompiler.flash.graph.GraphSourceItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.graph.IfItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import com.jpexs.decompiler.flash.helpers.Highlighting;
import java.io.ByteArrayOutputStream;
@@ -40,7 +44,7 @@ import java.util.logging.Logger;
/**
* Represents one ACTIONRECORD, also has some static method to work with Actions
*/
public class Action {
public class Action implements GraphSourceItem {
public Action beforeInsert;
public boolean ignored = false;
@@ -406,7 +410,7 @@ public class Action {
* @param output Output
* @param regNames Register names
*/
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<com.jpexs.decompiler.flash.graph.GraphTargetItem> stack, List<com.jpexs.decompiler.flash.graph.GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
}
/**
@@ -415,8 +419,8 @@ public class Action {
* @param stack Stack
* @return long value
*/
protected long popLong(Stack<TreeItem> stack) {
TreeItem item = stack.pop();
protected long popLong(Stack<GraphTargetItem> stack) {
GraphTargetItem item = stack.pop();
if (item instanceof DirectValueTreeItem) {
if (((DirectValueTreeItem) item).value instanceof Long) {
return (long) (Long) ((DirectValueTreeItem) item).value;
@@ -475,10 +479,11 @@ public class Action {
* @param tree List of TreeItem
* @return String
*/
public static String treeToString(List<TreeItem> tree) {
public static String treeToString(List<GraphTargetItem> tree) {
String ret = "";
for (TreeItem ti : tree) {
ret += ti.toString() + "\r\n";
List localData = new ArrayList();
for (GraphTargetItem ti : tree) {
ret += ti.toStringSemicoloned(localData) + "\r\n";
}
String parts[] = ret.split("\r\n");
ret = "";
@@ -584,7 +589,7 @@ public class Action {
public static String actionsToSource(List<Action> actions, int version) {
try {
//List<TreeItem> tree = actionsToTree(new HashMap<Integer, String>(), actions, version);
List<TreeItem> tree = actionsToTree(new HashMap<Integer, String>(), actions, version);
List<GraphTargetItem> tree = actionsToTree(new HashMap<Integer, String>(), actions, version);
return treeToString(tree);
@@ -602,12 +607,42 @@ public class Action {
* @param version SWF version
* @return List of treeItems
*/
public static List<TreeItem> actionsToTree(HashMap<Integer, String> regNames, List<Action> actions, int version) {
public static List<GraphTargetItem> actionsToTree(HashMap<Integer, String> regNames, List<Action> actions, int version) {
//Stack<TreeItem> stack = new Stack<TreeItem>();
return ActionGraph.translateViaGraph(regNames, actions, version);
//return actionsToTree(regNames, stack, actions, 0, actions.size() - 1, version);
}
@Override
public void translate(List localData, Stack<GraphTargetItem> stack, List<GraphTargetItem> output) {
translate(stack, output, (HashMap<Integer, String>) localData.get(0));
}
@Override
public boolean isJump() {
return false;
}
@Override
public boolean isBranch() {
return false;
}
@Override
public boolean isExit() {
return false;
}
@Override
public long getOffset() {
return getAddress();
}
@Override
public List<Integer> getBranches(GraphSource code) {
return new ArrayList<Integer>();
}
private static class Loop {
public long loopContinue;
@@ -630,15 +665,17 @@ public class Action {
logger.fine(s);
}
public static List<TreeItem> actionsPartToTree(HashMap<Integer, String> registerNames, Stack<TreeItem> stack, List<Action> actions, int start, int end, int version) {
public static List<GraphTargetItem> actionsPartToTree(HashMap<Integer, String> registerNames, Stack<GraphTargetItem> stack, List<Action> actions, int start, int end, int version) {
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<TreeItem> output = new ArrayList<TreeItem>();
List localData = new ArrayList();
localData.add(registerNames);
List<GraphTargetItem> output = new ArrayList<GraphTargetItem>();
int ip = start;
boolean isWhile = false;
boolean isForIn = false;
TreeItem inItem = null;
GraphTargetItem inItem = null;
int loopStart = 0;
loopip:
while (ip <= end + 1) {
@@ -678,34 +715,37 @@ public class Action {
if (ip > end) {
break;
}
if (ip >= actions.size()) {
break;
}
Action action = actions.get(ip);
/*ActionJump && ActionIf removed*/
if ((action instanceof ActionEnumerate2) || (action instanceof ActionEnumerate)) {
loopStart = ip + 1;
isForIn = true;
ip += 4;
action.translate(stack, output, registerNames);
action.translate(localData, stack, output);
EnumerateTreeItem en = (EnumerateTreeItem) stack.peek();
inItem = en.object;
continue;
} else if (action instanceof ActionTry) {
ActionTry atry = (ActionTry) action;
List<TreeItem> tryCommands = ActionGraph.translateViaGraph(registerNames, atry.tryBody, version);
List<GraphTargetItem> tryCommands = ActionGraph.translateViaGraph(registerNames, atry.tryBody, version);
TreeItem catchName;
if (atry.catchInRegisterFlag) {
catchName = new DirectValueTreeItem(atry, -1, new RegisterNumber(atry.catchRegister), new ArrayList<String>());
} else {
catchName = new DirectValueTreeItem(atry, -1, atry.catchName, new ArrayList<String>());
}
List<TreeItem> catchExceptions = new ArrayList<TreeItem>();
List<GraphTargetItem> catchExceptions = new ArrayList<GraphTargetItem>();
catchExceptions.add(catchName);
List<List<TreeItem>> catchCommands = new ArrayList<List<TreeItem>>();
List<List<GraphTargetItem>> catchCommands = new ArrayList<List<GraphTargetItem>>();
catchCommands.add(ActionGraph.translateViaGraph(registerNames, atry.catchBody, version));
List<TreeItem> finallyCommands = ActionGraph.translateViaGraph(registerNames, atry.finallyBody, version);
List<GraphTargetItem> finallyCommands = ActionGraph.translateViaGraph(registerNames, atry.finallyBody, version);
output.add(new TryTreeItem(tryCommands, catchExceptions, catchCommands, finallyCommands));
} else if (action instanceof ActionWith) {
ActionWith awith = (ActionWith) action;
List<TreeItem> withCommands = ActionGraph.translateViaGraph(registerNames, awith.actions, version);
List<GraphTargetItem> withCommands = ActionGraph.translateViaGraph(registerNames, awith.actions, version);
output.add(new WithTreeItem(action, stack.pop(), withCommands));
} else if (action instanceof ActionDefineFunction) {
FunctionTreeItem fti = new FunctionTreeItem(action, ((ActionDefineFunction) action).functionName, ((ActionDefineFunction) action).paramNames, ActionGraph.translateViaGraph(registerNames, ((ActionDefineFunction) action).code, version), ((ActionDefineFunction) action).constantPool, 1);
@@ -770,11 +810,11 @@ public class Action {
continue;
}*/ else if (action instanceof ActionStoreRegister) {
if ((ip + 1 <= end) && (actions.get(ip + 1) instanceof ActionPop)) {
action.translate(stack, output, registerNames);
action.translate(localData, stack, output);
stack.pop();
ip++;
} else {
action.translate(stack, output, registerNames);
action.translate(localData, stack, output);
}
} /*else if (action instanceof ActionStrictEquals) {
if ((ip + 1 < actions.size()) && (actions.get(ip + 1) instanceof ActionIf)) {
@@ -820,7 +860,7 @@ public class Action {
}
} */ else {
try {
action.translate(stack, output, registerNames);
action.translate(localData, stack, output);
} catch (EmptyStackException ese) {
System.err.println("EMPTYSTACK===========================");
Logger.getLogger(Action.class.getName()).log(Level.SEVERE, null, ese);
@@ -844,8 +884,8 @@ public class Action {
return output;
}
public static TreeItem getWithoutGlobal(TreeItem ti) {
TreeItem t = ti;
public static GraphTargetItem getWithoutGlobal(GraphTargetItem ti) {
GraphTargetItem t = ti;
if (!(t instanceof GetMemberTreeItem)) {
return ti;
}
@@ -872,19 +912,19 @@ public class Action {
return ti;
}
public static List<TreeItem> checkClass(List<TreeItem> output) {
List<TreeItem> ret = new ArrayList<TreeItem>();
public static List<GraphTargetItem> checkClass(List<GraphTargetItem> output) {
List<GraphTargetItem> ret = new ArrayList<GraphTargetItem>();
List<FunctionTreeItem> functions = new ArrayList<FunctionTreeItem>();
List<FunctionTreeItem> staticFunctions = new ArrayList<FunctionTreeItem>();
HashMap<TreeItem, TreeItem> vars = new HashMap<TreeItem, TreeItem>();
HashMap<TreeItem, TreeItem> staticVars = new HashMap<TreeItem, TreeItem>();
TreeItem className;
TreeItem extendsOp = null;
List<TreeItem> implementsOp = new ArrayList<TreeItem>();
HashMap<GraphTargetItem, GraphTargetItem> vars = new HashMap<GraphTargetItem, GraphTargetItem>();
HashMap<GraphTargetItem, GraphTargetItem> staticVars = new HashMap<GraphTargetItem, GraphTargetItem>();
GraphTargetItem className;
GraphTargetItem extendsOp = null;
List<GraphTargetItem> implementsOp = new ArrayList<GraphTargetItem>();
boolean ok = true;
for (TreeItem t : output) {
if (t instanceof IfTreeItem) {
IfTreeItem it = (IfTreeItem) t;
for (GraphTargetItem t : output) {
if (t instanceof IfItem) {
IfItem it = (IfItem) t;
if (it.expression instanceof NotTreeItem) {
NotTreeItem nti = (NotTreeItem) it.expression;
if (nti.value instanceof GetMemberTreeItem) {
@@ -892,14 +932,14 @@ public class Action {
if ((it.onTrue.size() == 1) && (it.onTrue.get(0) instanceof SetMemberTreeItem) && (((SetMemberTreeItem) it.onTrue.get(0)).value instanceof NewObjectTreeItem)) {
//ignore
} else {
List<TreeItem> parts = it.onTrue;
List<GraphTargetItem> parts = it.onTrue;
className = getWithoutGlobal((GetMemberTreeItem) nti.value);
if (parts.size() >= 1) {
if (parts.get(0) instanceof StoreRegisterTreeItem) {
int classReg = ((StoreRegisterTreeItem) parts.get(0)).register.number;
if ((parts.size() >= 2) && (parts.get(1) instanceof SetMemberTreeItem)) {
TreeItem ti1 = ((SetMemberTreeItem) parts.get(1)).value;
TreeItem ti2 = ((StoreRegisterTreeItem) parts.get(0)).value;
GraphTargetItem ti1 = ((SetMemberTreeItem) parts.get(1)).value;
GraphTargetItem ti2 = ((StoreRegisterTreeItem) parts.get(0)).value;
if (ti1 == ti2) {
if (((SetMemberTreeItem) parts.get(1)).value instanceof FunctionTreeItem) {
((FunctionTreeItem) ((SetMemberTreeItem) parts.get(1)).value).calculatedFunctionName = (className instanceof GetMemberTreeItem) ? ((GetMemberTreeItem) className).memberName : className;
@@ -919,7 +959,7 @@ public class Action {
if (parts.get(pos) instanceof StoreRegisterTreeItem) {
int instanceReg = -1;
if (((StoreRegisterTreeItem) parts.get(pos)).value instanceof GetMemberTreeItem) {
TreeItem obj = ((GetMemberTreeItem) ((StoreRegisterTreeItem) parts.get(pos)).value).object;
GraphTargetItem obj = ((GetMemberTreeItem) ((StoreRegisterTreeItem) parts.get(pos)).value).object;
if (obj instanceof DirectValueTreeItem) {
if (((DirectValueTreeItem) obj).value instanceof RegisterNumber) {
if (((RegisterNumber) ((DirectValueTreeItem) obj).value).number == classReg) {
@@ -1006,7 +1046,7 @@ public class Action {
pos++;
}
if (ok) {
List<TreeItem> output2 = new ArrayList<TreeItem>();
List<GraphTargetItem> output2 = new ArrayList<GraphTargetItem>();
output2.add(new ClassTreeItem(className, extendsOp, implementsOp, functions, vars, staticFunctions, staticVars));
return output2;
}
@@ -1037,7 +1077,7 @@ public class Action {
break;
}
}
List<TreeItem> output2 = new ArrayList<TreeItem>();
List<GraphTargetItem> output2 = new ArrayList<GraphTargetItem>();
output2.add(new InterfaceTreeItem(sm.objectName, implementsOp));
return output2;
} else {
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
package com.jpexs.decompiler.flash.action;
import com.jpexs.decompiler.flash.graph.GraphSource;
import com.jpexs.decompiler.flash.graph.GraphSourceItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.HashMap;
import java.util.List;
import java.util.Stack;
/**
*
* @author JPEXS
*/
public class ActionGraphSource extends GraphSource {
private List<Action> actions;
public int version;
private HashMap<Integer, String> registerNames;
public ActionGraphSource(List<Action> actions, int version, HashMap<Integer, String> registerNames) {
this.actions = actions;
this.version = version;
this.registerNames = registerNames;
}
@Override
public int size() {
return actions.size();
}
@Override
public GraphSourceItem get(int pos) {
return actions.get(pos);
}
@Override
public boolean isEmpty() {
return actions.isEmpty();
}
@Override
public List<GraphTargetItem> translatePart(List localData, Stack<GraphTargetItem> stack, int start, int end) {
return (Action.actionsPartToTree(registerNames, stack, actions, start, end, version));
}
@Override
public int adr2pos(long adr) {
return Action.adr2ip(actions, adr, version);
}
@Override
public long pos2adr(int pos) {
return Action.ip2adr(actions, pos, version);
}
}
@@ -1,32 +0,0 @@
/*
* 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;
/**
*
* @author JPEXS
*/
public class IgnoredPair {
public Action action;
public int pos;
public IgnoredPair(Action action, int pos) {
this.action = action;
this.pos = pos;
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.flashlite;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.FSCommand2TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -35,10 +35,10 @@ public class ActionFSCommand2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
long numArgs = popLong(stack);
TreeItem command = stack.pop();
List<TreeItem> args = new ArrayList<TreeItem>();
GraphTargetItem command = stack.pop();
List<GraphTargetItem> args = new ArrayList<GraphTargetItem>();
for (long l = 0; l < numArgs; l++) {
args.add(stack.pop());
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.StrictModeTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -60,7 +60,7 @@ public class ActionStrictMode extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new StrictModeTreeItem(this, mode));
}
}
@@ -34,6 +34,7 @@ import java.awt.event.ActionListener;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.swing.*;
import javax.swing.border.BevelBorder;
@@ -268,7 +269,7 @@ public class ActionPanel extends JPanel implements TreeSelectionListener, Action
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("GRAPH")) {
if (lastCode != null) {
GraphFrame gf = new GraphFrame(new ActionGraph(lastCode, SWF.DEFAULT_VERSION), "");
GraphFrame gf = new GraphFrame(new ActionGraph(lastCode, new HashMap<Integer, String>(), SWF.DEFAULT_VERSION), "");
gf.setVisible(true);
}
} else if (e.getActionCommand().equals("EDITACTION")) {
@@ -17,7 +17,6 @@
package com.jpexs.decompiler.flash.action.special;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import java.util.List;
import java.util.Stack;
@@ -33,7 +32,7 @@ public class ActionNop extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<com.jpexs.decompiler.flash.graph.GraphTargetItem> stack, List<com.jpexs.decompiler.flash.graph.GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
//output.add(new SimpleActionTreeItem(this, "nop();"));
}
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.GetURLTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -68,7 +68,7 @@ public class ActionGetURL extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new GetURLTreeItem(this, urlString, targetString));
}
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.GotoLabelTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -64,7 +64,7 @@ public class ActionGoToLabel extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new GotoLabelTreeItem(this, label));
}
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.GotoFrameTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -60,7 +60,7 @@ public class ActionGotoFrame extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new GotoFrameTreeItem(this, frame));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf3;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionNextFrame extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "nextFrame();"));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf3;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionPlay extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "Play();"));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf3;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionPrevFrame extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "prevFrame();"));
}
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.SetTargetTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -64,7 +64,7 @@ public class ActionSetTarget extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SetTargetTreeItem(this, targetName));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf3;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionStop extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "stop();"));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf3;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionStopSounds extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "stopAllSounds();"));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf3;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionToggleQuality extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "toggleHighQuality();"));
}
}
@@ -21,8 +21,8 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.WaitForFrameTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -64,7 +64,7 @@ public class ActionWaitForFrame extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new WaitForFrameTreeItem(this, frame, skipCount));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.AddTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionAdd extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new AddTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.AndTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionAnd extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new AndTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.AsciiToCharTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionAsciiToChar extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new AsciiToCharTreeItem(this, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.CallTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionCall extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new CallTreeItem(this, stack.pop()));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.CharToAsciiTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionCharToAscii extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new CharToAsciiTreeItem(this, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.CloneSpriteTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,10 +34,10 @@ public class ActionCloneSprite extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem depth = stack.pop();
TreeItem target = stack.pop();
TreeItem source = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem depth = stack.pop();
GraphTargetItem target = stack.pop();
GraphTargetItem source = stack.pop();
output.add(new CloneSpriteTreeItem(this, source, target, depth));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.DivideTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionDivide extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new DivideTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionEndDrag extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
output.add(new SimpleActionTreeItem(this, "stopDrag();"));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.EqTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionEquals extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new EqTreeItem(this, b, a));
}
}
@@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.GetPropertyTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -35,9 +35,9 @@ public class ActionGetProperty extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem index = stack.pop();
TreeItem target = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem index = stack.pop();
GraphTargetItem target = stack.pop();
int indexInt = 0;
if (index instanceof DirectValueTreeItem) {
if (((DirectValueTreeItem) index).value instanceof Long) {
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SimpleActionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,7 +34,7 @@ public class ActionGetTime extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
stack.push(new SimpleActionTreeItem(this, "getTimer()"));
}
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.GetURL2TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -72,9 +72,9 @@ public class ActionGetURL2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem targetString = stack.pop();
TreeItem urlString = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem targetString = stack.pop();
GraphTargetItem urlString = stack.pop();
output.add(new GetURL2TreeItem(this, urlString, targetString, sendVarsMethod, loadTargetFlag, loadTargetFlag));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.GetVariableTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionGetVariable extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
stack.push(new GetVariableTreeItem(this, value));
}
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.GotoFrame2TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -76,8 +76,8 @@ public class ActionGotoFrame2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem frame = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem frame = stack.pop();
output.add(new GotoFrame2TreeItem(this, frame, sceneBiasFlag, playFlag, sceneBias));
}
}
@@ -19,8 +19,10 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphSource;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.graph.GraphSource;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -81,4 +83,17 @@ public class ActionIf extends Action {
public String toString() {
return "ActionIf";
}
@Override
public boolean isBranch() {
return true;
}
@Override
public List<Integer> getBranches(GraphSource code) {
List<Integer> ret = super.getBranches(code);
ret.add(code.adr2pos(getAddress() + getBytes(((ActionGraphSource) code).version).length + offset));
ret.add(code.adr2pos(getAddress() + getBytes(((ActionGraphSource) code).version).length));
return ret;
}
}
@@ -19,8 +19,10 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionGraphSource;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.graph.GraphSource;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -86,4 +88,16 @@ public class ActionJump extends Action {
public String toString() {
return "Jump";
}
@Override
public boolean isJump() {
return true;
}
@Override
public List<Integer> getBranches(GraphSource code) {
List<Integer> ret = super.getBranches(code);
ret.add(code.adr2pos(getAddress() + getBytes(((ActionGraphSource) code).version).length + offset));
return ret;
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.LtTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionLess extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new LtTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.MBAsciiToCharTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionMBAsciiToChar extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new MBAsciiToCharTreeItem(this, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.MBCharToAsciiTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionMBCharToAscii extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new MBCharToAsciiTreeItem(this, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.MBStringExtractTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,10 +34,10 @@ public class ActionMBStringExtract extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem count = stack.pop();
TreeItem index = stack.pop();
TreeItem value = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem count = stack.pop();
GraphTargetItem index = stack.pop();
GraphTargetItem value = stack.pop();
stack.push(new MBStringExtractTreeItem(this, value, index, count));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.MBStringLengthTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionMBStringLength extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new MBStringLengthTreeItem(this, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.MultiplyTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionMultiply extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new MultiplyTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.NotTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionNot extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new NotTreeItem(this, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.OrTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionOr extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new OrTreeItem(this, b, a));
}
}
@@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.CallFunctionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.CallMethodTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -35,11 +35,11 @@ public class ActionPop extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
if (stack.isEmpty()) {
return;
}
TreeItem val = stack.pop();
GraphTargetItem val = stack.pop();
if ((val instanceof CallFunctionTreeItem) || (val instanceof CallMethodTreeItem)) {
output.add(val);
}
@@ -23,7 +23,7 @@ import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.parser.ParsedSymbol;
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -203,7 +203,7 @@ public class ActionPush extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
int pos = 0;
for (Object o : values) {
if (o instanceof ConstantIndex) {
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.RandomNumberTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionRandomNumber extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem maximum = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem maximum = stack.pop();
stack.push(new RandomNumberTreeItem(this, maximum));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.RemoveSpriteTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionRemoveSprite extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem target = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem target = stack.pop();
output.add(new RemoveSpriteTreeItem(this, target));
}
}
@@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.SetPropertyTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -35,10 +35,10 @@ public class ActionSetProperty extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
TreeItem index = stack.pop();
TreeItem target = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
GraphTargetItem index = stack.pop();
GraphTargetItem target = stack.pop();
int indexInt = 0;
if (index instanceof DirectValueTreeItem) {
if (((DirectValueTreeItem) index).value instanceof Long) {
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SetTarget2TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionSetTarget2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem target = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem target = stack.pop();
output.add(new SetTarget2TreeItem(this, target));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SetVariableTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionSetVariable extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
TreeItem name = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
GraphTargetItem name = stack.pop();
output.add(new SetVariableTreeItem(this, name, value));
}
}
@@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.StartDragTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -35,10 +35,10 @@ public class ActionStartDrag extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem target = stack.pop();
TreeItem lockCenter = stack.pop();
TreeItem constrain = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem target = stack.pop();
GraphTargetItem lockCenter = stack.pop();
GraphTargetItem constrain = stack.pop();
boolean hasConstrains = true;
if (constrain instanceof DirectValueTreeItem) {
@@ -53,10 +53,10 @@ public class ActionStartDrag extends Action {
}
}
}
TreeItem x1 = null;
TreeItem y1 = null;
TreeItem x2 = null;
TreeItem y2 = null;
GraphTargetItem x1 = null;
GraphTargetItem y1 = null;
GraphTargetItem x2 = null;
GraphTargetItem y2 = null;
if (hasConstrains) {
y2 = stack.pop();
x2 = stack.pop();
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.StringAddTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionStringAdd extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new StringAddTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.StringEqTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionStringEquals extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new StringEqTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.StringExtractTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,10 +34,10 @@ public class ActionStringExtract extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem count = stack.pop();
TreeItem index = stack.pop();
TreeItem value = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem count = stack.pop();
GraphTargetItem index = stack.pop();
GraphTargetItem value = stack.pop();
stack.push(new StringExtractTreeItem(this, value, index, count));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.StringLengthTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionStringLength extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new StringLengthTreeItem(this, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.StringLtTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionStringLess extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new StringLtTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.SubtractTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionSubtract extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new SubtractTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.ToIntegerTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionToInteger extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new ToIntegerTreeItem(this, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TraceTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionTrace extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
output.add(new TraceTreeItem(this, value));
}
}
@@ -21,8 +21,8 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.WaitForFrame2TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -60,8 +60,8 @@ public class ActionWaitForFrame2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem frame = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem frame = stack.pop();
output.add(new WaitForFrame2TreeItem(this, frame, skipCount));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.AddTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionAdd2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new AddTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.BitAndTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionBitAnd extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new BitAndTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.LShiftTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionBitLShift extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new LShiftTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.BitOrTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionBitOr extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new BitOrTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.RShiftTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionBitRShift extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new RShiftTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.URShiftTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionBitURShift extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new URShiftTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.BitXorTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionBitXor extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new BitXorTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.CallFunctionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -35,10 +35,10 @@ public class ActionCallFunction extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem functionName = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem functionName = stack.pop();
long numArgs = popLong(stack);
List<TreeItem> args = new ArrayList<TreeItem>();
List<GraphTargetItem> args = new ArrayList<GraphTargetItem>();
for (long l = 0; l < numArgs; l++) {
args.add(stack.pop());
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.CallMethodTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -35,11 +35,11 @@ public class ActionCallMethod extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem methodName = stack.pop();
TreeItem scriptObject = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem methodName = stack.pop();
GraphTargetItem scriptObject = stack.pop();
long numArgs = popLong(stack);
List<TreeItem> args = new ArrayList<TreeItem>();
List<GraphTargetItem> args = new ArrayList<GraphTargetItem>();
for (long l = 0; l < numArgs; l++) {
args.add(stack.pop());
}
@@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.parser.ParsedSymbol;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -85,6 +85,6 @@ public class ActionConstantPool extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DecrementTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionDecrement extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new DecrementTreeItem(this, a));
}
}
@@ -26,7 +26,7 @@ import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.swf4.ActionPush;
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
import com.jpexs.decompiler.flash.action.treemodel.FunctionTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import com.jpexs.decompiler.flash.helpers.Helper;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -153,7 +153,7 @@ public class ActionDefineFunction extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, HashMap<Integer, String> regNames) {
stack.push(new FunctionTreeItem(this, functionName, paramNames, Action.actionsToTree(regNames, code, version), constantPool, 1));
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DefineLocalTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionDefineLocal extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
TreeItem name = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
GraphTargetItem name = stack.pop();
output.add(new DefineLocalTreeItem(this, name, value));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DefineLocalTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionDefineLocal2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem name = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem name = stack.pop();
output.add(new DefineLocalTreeItem(this, name, null));
}
}
@@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DeleteTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -36,9 +36,9 @@ public class ActionDelete extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem propertyName = stack.pop();
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem propertyName = stack.pop();
GraphTargetItem object = stack.pop();
output.add(new DeleteTreeItem(this, object, propertyName));
stack.push(new DirectValueTreeItem(this, -1, Boolean.TRUE, new ArrayList<String>()));
@@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.DeleteTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.DirectValueTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -36,8 +36,8 @@ public class ActionDelete2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem propertyName = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem propertyName = stack.pop();
output.add(new DeleteTreeItem(this, null, propertyName));
stack.push(new DirectValueTreeItem(this, -1, Boolean.TRUE, new ArrayList<String>()));
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.EnumerateTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionEnumerate extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem object = stack.pop();
stack.push(new EnumerateTreeItem(this, object));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.EqTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionEquals2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new EqTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.GetMemberTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionGetMember extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem functionName = stack.pop();
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem functionName = stack.pop();
GraphTargetItem object = stack.pop();
stack.push(new GetMemberTreeItem(this, object, functionName));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.IncrementTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionIncrement extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
stack.push(new IncrementTreeItem(this, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.InitArrayTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -30,9 +30,9 @@ public class ActionInitArray extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
long numArgs = popLong(stack);
List<TreeItem> args = new ArrayList<TreeItem>();
List<GraphTargetItem> args = new ArrayList<GraphTargetItem>();
for (int l = 0; l < numArgs; l++) {
args.add(stack.pop());
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.InitObjectTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -35,10 +35,10 @@ public class ActionInitObject extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
long numArgs = popLong(stack);
List<TreeItem> values = new ArrayList<TreeItem>();
List<TreeItem> names = new ArrayList<TreeItem>();
List<GraphTargetItem> values = new ArrayList<GraphTargetItem>();
List<GraphTargetItem> names = new ArrayList<GraphTargetItem>();
for (long l = 0; l < numArgs; l++) {
values.add(stack.pop());
names.add(stack.pop());
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.LtTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionLess2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new LtTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.ModuloTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionModulo extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new ModuloTreeItem(this, b, a));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.NewMethodTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -35,11 +35,11 @@ public class ActionNewMethod extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem methodName = stack.pop();
TreeItem scriptObject = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem methodName = stack.pop();
GraphTargetItem scriptObject = stack.pop();
long numArgs = popLong(stack);
List<TreeItem> args = new ArrayList<TreeItem>();
List<GraphTargetItem> args = new ArrayList<GraphTargetItem>();
for (long l = 0; l < numArgs; l++) {
args.add(stack.pop());
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.NewObjectTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
@@ -35,10 +35,10 @@ public class ActionNewObject extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem objectName = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem objectName = stack.pop();
long numArgs = popLong(stack);
List<TreeItem> args = new ArrayList<TreeItem>();
List<GraphTargetItem> args = new ArrayList<GraphTargetItem>();
for (long l = 0; l < numArgs; l++) {
args.add(stack.pop());
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.IgnoredPair;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphSourceItemPos;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,10 +34,10 @@ public class ActionPushDuplicate extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
stack.push(value);
stack.push(value);
value.moreInstructions.add(new IgnoredPair(this, 0));
value.moreSrc.add(new GraphSourceItemPos(this, 0));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.ReturnTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,13 @@ public class ActionReturn extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
output.add(new ReturnTreeItem(this, value));
}
@Override
public boolean isExit() {
return true;
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.SetMemberTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,10 +34,10 @@ public class ActionSetMember extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem value = stack.pop();
TreeItem objectName = stack.pop();
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem value = stack.pop();
GraphTargetItem objectName = stack.pop();
GraphTargetItem object = stack.pop();
output.add(new SetMemberTreeItem(this, object, objectName, value));
}
}
@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -33,9 +33,9 @@ public class ActionStackSwap extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(a);
stack.push(b);
}
@@ -23,7 +23,7 @@ import com.jpexs.decompiler.flash.action.parser.FlasmLexer;
import com.jpexs.decompiler.flash.action.parser.ParseException;
import com.jpexs.decompiler.flash.action.swf4.RegisterNumber;
import com.jpexs.decompiler.flash.action.treemodel.StoreRegisterTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
@@ -61,8 +61,8 @@ public class ActionStoreRegister extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem item = stack.peek();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem item = stack.peek();
RegisterNumber rn = new RegisterNumber(registerNumber);
if (regNames.containsKey(registerNumber)) {
rn.name = regNames.get(registerNumber);
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TargetPathTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionTargetPath extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem object = stack.pop();
stack.push(new TargetPathTreeItem(this, object));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.ToNumberTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionToNumber extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem object = stack.pop();
stack.push(new ToNumberTreeItem(this, object));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.ToStringTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionToString extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem object = stack.pop();
stack.push(new ToStringTreeItem(this, object));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf5;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TypeOfTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionTypeOf extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem object = stack.pop();
stack.push(new TypeOfTreeItem(this, object));
}
}
@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.action.swf6;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.EnumerateTreeItem;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,8 +34,8 @@ public class ActionEnumerate2 extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem object = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem object = stack.pop();
stack.push(new EnumerateTreeItem(this, object));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf6;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.GtTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionGreater extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new GtTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf6;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.InstanceOfTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionInstanceOf extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new InstanceOfTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf6;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.StrictEqTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionStrictEquals extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new StrictEqTreeItem(this, b, a));
}
}
@@ -17,8 +17,8 @@
package com.jpexs.decompiler.flash.action.swf6;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.treemodel.TreeItem;
import com.jpexs.decompiler.flash.action.treemodel.operations.GtTreeItem;
import com.jpexs.decompiler.flash.graph.GraphTargetItem;
import java.util.List;
import java.util.Stack;
@@ -34,9 +34,9 @@ public class ActionStringGreater extends Action {
}
@Override
public void translate(Stack<TreeItem> stack, List<TreeItem> output, java.util.HashMap<Integer, String> regNames) {
TreeItem a = stack.pop();
TreeItem b = stack.pop();
public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames) {
GraphTargetItem a = stack.pop();
GraphTargetItem b = stack.pop();
stack.push(new GtTreeItem(this, b, a));
}
}

Some files were not shown because too many files have changed in this diff Show More