From 9a0a54bebb2b4756ac30ab8a957ddca5ffe53892 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 12 Jul 2015 18:14:26 +0200 Subject: [PATCH 01/25] hashCode and equals --- .../jpexs/decompiler/flash/abc/ClassPath.java | 12 ++--- .../decompiler/flash/abc/ScriptPack.java | 12 ++--- .../decompiler/flash/abc/avm2/AVM2Code.java | 14 +++--- .../abc/avm2/model/LocalRegAVM2Item.java | 2 +- .../decompiler/flash/abc/types/Multiname.java | 31 +++++++----- .../action/model/CallFunctionActionItem.java | 13 ++--- .../action/model/DirectValueActionItem.java | 12 ++--- .../action/model/GetMemberActionItem.java | 13 ++--- .../action/model/GetVariableActionItem.java | 7 +-- .../flash/action/swf4/RegisterNumber.java | 6 +-- .../commonshape/ExportRectangle.java | 10 ++-- .../flash/exporters/commonshape/Point.java | 6 +-- .../decompiler/flash/helpers/FontHelper.java | 10 ++-- .../flash/helpers/collections/MyEntry.java | 11 ++--- .../decompiler/flash/timeline/Frame.java | 5 +- .../decompiler/flash/timeline/TagScript.java | 3 +- .../jpexs/decompiler/flash/types/MATRIX.java | 24 ++++----- .../jpexs/decompiler/graph/DottedChain.java | 7 +-- .../com/jpexs/decompiler/graph/GraphPart.java | 11 ++++- .../com/jpexs/decompiler/graph/GraphPath.java | 49 ++++++++++++------- .../src/com/jpexs/decompiler/graph/Loop.java | 5 +- .../decompiler/graph/TypeFunctionItem.java | 4 +- .../com/jpexs/decompiler/graph/TypeItem.java | 6 +-- .../decompiler/graph/model/BinaryOpItem.java | 15 +++--- 24 files changed, 160 insertions(+), 128 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java index 46f541284..4afffd1ea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java @@ -24,9 +24,9 @@ import java.util.Objects; */ public class ClassPath { - public String packageStr; + public final String packageStr; - public String className; + public final String className; public ClassPath(String packageStr, String className) { this.packageStr = packageStr; @@ -41,8 +41,8 @@ public class ClassPath { @Override public int hashCode() { int hash = 7; - hash = 37 * hash + Objects.hashCode(this.packageStr); - hash = 37 * hash + Objects.hashCode(this.className); + hash = 37 * hash + Objects.hashCode(packageStr); + hash = 37 * hash + Objects.hashCode(className); return hash; } @@ -55,9 +55,9 @@ public class ClassPath { return false; } final ClassPath other = (ClassPath) obj; - if (!Objects.equals(this.packageStr, other.packageStr)) { + if (!Objects.equals(packageStr, other.packageStr)) { return false; } - return Objects.equals(this.className, other.className); + return Objects.equals(className, other.className); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index e8b17caa4..e9e72c944 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -224,9 +224,9 @@ public class ScriptPack extends AS3ClassTreeItem { @Override public int hashCode() { int hash = 7; - hash = 79 * hash + Objects.hashCode(this.abc); - hash = 79 * hash + this.scriptIndex; - hash = 79 * hash + Objects.hashCode(this.path); + hash = 79 * hash + Objects.hashCode(abc); + hash = 79 * hash + scriptIndex; + hash = 79 * hash + Objects.hashCode(path); return hash; } @@ -239,13 +239,13 @@ public class ScriptPack extends AS3ClassTreeItem { return false; } final ScriptPack other = (ScriptPack) obj; - if (!Objects.equals(this.abc, other.abc)) { + if (!Objects.equals(abc, other.abc)) { return false; } - if (this.scriptIndex != other.scriptIndex) { + if (scriptIndex != other.scriptIndex) { return false; } - if (!Objects.equals(this.path, other.path)) { + if (!Objects.equals(path, other.path)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index a129b0937..89cbee71a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -298,6 +298,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -1767,9 +1768,9 @@ public class AVM2Code implements Cloneable { private class Slot { - public GraphTargetItem scope; + public final GraphTargetItem scope; - public Multiname multiname; + public final Multiname multiname; public Slot(GraphTargetItem scope, Multiname multiname) { this.scope = scope; @@ -1779,8 +1780,9 @@ public class AVM2Code implements Cloneable { @Override public boolean equals(Object obj) { if (obj instanceof Slot) { - return (((Slot) obj).scope.getThroughRegister() == scope.getThroughRegister()) - && (((Slot) obj).multiname == multiname); + Slot slot = (Slot) obj; + return (slot.scope.getThroughRegister() == scope.getThroughRegister()) + && (slot.multiname == multiname); } return false; } @@ -1788,8 +1790,8 @@ public class AVM2Code implements Cloneable { @Override public int hashCode() { int hash = 7; - hash = 59 * hash + (this.scope != null ? this.scope.hashCode() : 0); - hash = 59 * hash + (this.multiname != null ? this.multiname.hashCode() : 0); + hash = 59 * hash + (scope != null ? Objects.hashCode(scope.getThroughRegister()) : 0); + hash = 59 * hash + Objects.hashCode(multiname); return hash; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java index 6b898f45f..40322a77a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/LocalRegAVM2Item.java @@ -36,7 +36,7 @@ import java.util.Set; public class LocalRegAVM2Item extends AVM2Item { - public int regIndex; + public final int regIndex; public GraphTargetItem computedValue; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index f1d7ccdba..1c8339864 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -53,17 +53,17 @@ public class Multiname { private static final String[] multinameKindNames = new String[]{"Qname", "QnameA", "Multiname", "MultinameA", "RTQname", "RTQnameA", "MultinameL", "RTQnameL", "RTQnameLA", "MultinameLA", "TypeName"}; - public int kind = -1; + public final int kind; - public int name_index = 0; + public int name_index; - public int namespace_index = 0; + public final int namespace_index; - public int namespace_set_index = 0; + public final int namespace_set_index; - public int qname_index = 0; //for TypeName + public final int qname_index; //for TypeName - public List params; //for TypeName + public final List params; //for TypeName @Internal public boolean deleted; @@ -79,6 +79,11 @@ public class Multiname { } public Multiname() { + kind = -1; + namespace_index = 0; + namespace_set_index = 0; + qname_index = 0; + params = null; } public Multiname(int kind, int name_index, int namespace_index, int namespace_set_index, int qname_index, List params) { @@ -335,12 +340,12 @@ public class Multiname { @Override public int hashCode() { int hash = 7; - hash = 53 * hash + this.kind; - hash = 53 * hash + this.name_index; - hash = 53 * hash + this.namespace_index; - hash = 53 * hash + this.namespace_set_index; - hash = 53 * hash + this.qname_index; - hash = 53 * hash + Objects.hashCode(this.params); + hash = 53 * hash + kind; + hash = 53 * hash + name_index; + hash = 53 * hash + namespace_index; + hash = 53 * hash + namespace_set_index; + hash = 53 * hash + qname_index; + hash = 53 * hash + Objects.hashCode(params); return hash; } @@ -368,7 +373,7 @@ public class Multiname { if (this.qname_index != other.qname_index) { return false; } - if (!Objects.equals(this.params, other.params)) { + if (!Objects.equals(params, other.params)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java index 3c8ba7c73..2c70d733c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -27,13 +27,14 @@ import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import java.util.List; +import java.util.Objects; import java.util.Set; public class CallFunctionActionItem extends ActionItem { - public GraphTargetItem functionName; + public final GraphTargetItem functionName; - public List arguments; + public final List arguments; public GraphTargetItem calculatedFunction; @@ -99,8 +100,8 @@ public class CallFunctionActionItem extends ActionItem { @Override public int hashCode() { int hash = 3; - hash = 37 * hash + (this.functionName != null ? this.functionName.hashCode() : 0); - hash = 37 * hash + (this.arguments != null ? this.arguments.hashCode() : 0); + hash = 37 * hash + Objects.hashCode(functionName); + hash = 37 * hash + Objects.hashCode(arguments); return hash; } @@ -113,10 +114,10 @@ public class CallFunctionActionItem extends ActionItem { return false; } final CallFunctionActionItem other = (CallFunctionActionItem) obj; - if (this.functionName != other.functionName && (this.functionName == null || !this.functionName.equals(other.functionName))) { + if (!Objects.equals(functionName, other.functionName)) { return false; } - if (this.arguments != other.arguments && (this.arguments == null || !this.arguments.equals(other.arguments))) { + if (!Objects.equals(this.arguments, other.arguments)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index feeb5402c..851b21771 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -39,11 +39,11 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { public Object value; - public List constants; + public final List constants; public GraphTargetItem computedRegValue; - public int pos = -1; + public final int pos; public DirectValueActionItem(Object o) { this(null, 0, o, new ArrayList<>()); @@ -204,8 +204,8 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { @Override public int hashCode() { int hash = 7; - hash = 71 * hash + Objects.hashCode(this.value); - hash = 71 * hash + System.identityHashCode(this.constants); + hash = 71 * hash + Objects.hashCode(value); + hash = 71 * hash + Objects.hashCode(constants); hash = 71 * hash + pos; return hash; } @@ -219,10 +219,10 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { return false; } final DirectValueActionItem other = (DirectValueActionItem) obj; - if (!Objects.equals(this.value, other.value)) { + if (!Objects.equals(value, other.value)) { return false; } - if (!Objects.equals(this.constants, other.constants)) { + if (!Objects.equals(constants, other.constants)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java index 7b5225723..5891d8633 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -28,12 +28,13 @@ import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import java.util.ArrayList; import java.util.List; +import java.util.Objects; public class GetMemberActionItem extends ActionItem { - public GraphTargetItem object; + public final GraphTargetItem object; - public GraphTargetItem memberName; + public final GraphTargetItem memberName; @Override public List getAllSubItems() { @@ -71,8 +72,8 @@ public class GetMemberActionItem extends ActionItem { @Override public int hashCode() { int hash = 5; - hash = 47 * hash + (this.object != null ? this.object.hashCode() : 0); - hash = 47 * hash + (this.memberName != null ? this.memberName.hashCode() : 0); + hash = 47 * hash + Objects.hashCode(object); + hash = 47 * hash + Objects.hashCode(memberName); return hash; } @@ -85,10 +86,10 @@ public class GetMemberActionItem extends ActionItem { return false; } final GetMemberActionItem other = (GetMemberActionItem) obj; - if (this.object != other.object && (this.object == null || !this.object.equals(other.object))) { + if (!Objects.equals(object, other.object)) { return false; } - if (this.memberName != other.memberName && (this.memberName == null || !this.memberName.equals(other.memberName))) { + if (!Objects.equals(memberName, other.memberName)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java index 2afbcf9a6..878af466e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetVariableActionItem.java @@ -29,11 +29,12 @@ import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Set; public class GetVariableActionItem extends ActionItem { - public GraphTargetItem name; + public final GraphTargetItem name; private GraphTargetItem computedValue; @@ -115,7 +116,7 @@ public class GetVariableActionItem extends ActionItem { @Override public int hashCode() { int hash = 3; - hash = 13 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 13 * hash + Objects.hashCode(name); return hash; } @@ -128,7 +129,7 @@ public class GetVariableActionItem extends ActionItem { return false; } final GetVariableActionItem other = (GetVariableActionItem) obj; - if (this.name != other.name && (this.name == null || !this.name.equals(other.name))) { + if (!Objects.equals(name, other.name)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java index 999cbef8c..36787c2be 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/RegisterNumber.java @@ -21,14 +21,14 @@ import java.io.Serializable; public class RegisterNumber implements Serializable { - public int number; + public final int number; public String name = null; @Override public int hashCode() { int hash = 3; - hash = 47 * hash + this.number; + hash = 47 * hash + number; return hash; } @@ -41,7 +41,7 @@ public class RegisterNumber implements Serializable { return false; } final RegisterNumber other = (RegisterNumber) obj; - if (this.number != other.number) { + if (number != other.number) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java index 0d778e83e..806bbefc4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java @@ -25,13 +25,13 @@ import java.awt.geom.Rectangle2D; */ public class ExportRectangle { - public double xMin; + public final double xMin; - public double yMin; + public final double yMin; - public double xMax; + public final double xMax; - public double yMax; + public final double yMax; public ExportRectangle(double xMin, double yMin, double xMax, double yMax) { this.xMin = xMin; @@ -77,6 +77,6 @@ public class ExportRectangle { ExportRectangle r = (ExportRectangle) obj; return (xMin == r.xMin) && (yMin == r.yMin) && (xMax == r.xMax) && (yMax == r.yMax); } - return super.equals(obj); + return false; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java index 8f32128d6..489014005 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java @@ -22,9 +22,9 @@ package com.jpexs.decompiler.flash.exporters.commonshape; */ public class Point { - public double x; + public final double x; - public double y; + public final double y; public Point(double x, double y) { this.x = x; @@ -44,6 +44,6 @@ public class Point { Point pt = (Point) obj; return (x == pt.x) && (y == pt.y); } - return super.equals(obj); + return false; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java index 5fdb1d958..be3190d29 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java @@ -217,9 +217,9 @@ public class FontHelper { public static class KerningPair { - public char char1; + public final char char1; - public char char2; + public final char char2; public int kerning; @@ -247,13 +247,13 @@ public class FontHelper { return false; } final KerningPair other = (KerningPair) obj; - if (this.char1 != other.char1) { + if (char1 != other.char1) { return false; } - if (this.char2 != other.char2) { + if (char2 != other.char2) { return false; } - if (this.kerning != other.kerning) { + if (kerning != other.kerning) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java index 9fada2fe8..19a2519c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/MyEntry.java @@ -44,8 +44,8 @@ public class MyEntry implements Entry { @Override public int hashCode() { int hash = 7; - hash = 61 * hash + Objects.hashCode(this.key); - hash = 61 * hash + Objects.hashCode(this.value); + hash = 61 * hash + Objects.hashCode(key); + hash = 61 * hash + Objects.hashCode(value); return hash; } @@ -57,12 +57,11 @@ public class MyEntry implements Entry { if (getClass() != obj.getClass()) { return false; } - @SuppressWarnings("unchecked") - final MyEntry other = (MyEntry) obj; - if (!Objects.equals(this.key, other.key)) { + final MyEntry other = (MyEntry) obj; + if (!Objects.equals(key, other.key)) { return false; } - if (!Objects.equals(this.value, other.value)) { + if (!Objects.equals(value, other.value)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java index 3d4719500..a9ef3c9b1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.types.RGB; import com.jpexs.decompiler.flash.types.RGBA; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.TreeMap; /** @@ -41,7 +42,7 @@ public class Frame implements TreeItem, Exportable { public RGB backgroundColor = new RGBA(0, 0, 0, 0); - public Timeline timeline; + public final Timeline timeline; public List sounds = new ArrayList<>(); @@ -92,7 +93,7 @@ public class Frame implements TreeItem, Exportable { public boolean equals(Object obj) { if (obj instanceof Frame) { Frame frameObj = (Frame) obj; - return timeline.equals(frameObj.timeline) && frame == frameObj.frame; + return Objects.equals(timeline, frameObj.timeline) && frame == frameObj.frame; } return false; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/TagScript.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/TagScript.java index 3382bbdf5..678a9f132 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/TagScript.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/TagScript.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.Exportable; import com.jpexs.decompiler.flash.treeitems.TreeItem; import java.util.List; +import java.util.Objects; /** * @@ -66,7 +67,7 @@ public class TagScript implements TreeItem, Exportable { @Override public boolean equals(Object obj) { if (obj instanceof TagScript) { - return tag.equals(((TagScript) obj).getTag()); + return Objects.equals(tag, ((TagScript) obj).tag); } return false; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/MATRIX.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/MATRIX.java index 00d11b9e6..4872146bb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/MATRIX.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/MATRIX.java @@ -175,12 +175,12 @@ public class MATRIX implements Serializable { @Override public int hashCode() { int hash = 7; - hash = 37 * hash + this.getScaleX(); - hash = 37 * hash + this.getScaleY(); - hash = 37 * hash + this.getRotateSkew0(); - hash = 37 * hash + this.getRotateSkew1(); - hash = 37 * hash + this.translateX; - hash = 37 * hash + this.translateY; + hash = 37 * hash + getScaleX(); + hash = 37 * hash + getScaleY(); + hash = 37 * hash + getRotateSkew0(); + hash = 37 * hash + getRotateSkew1(); + hash = 37 * hash + translateX; + hash = 37 * hash + translateY; return hash; } @@ -193,22 +193,22 @@ public class MATRIX implements Serializable { return false; } final MATRIX other = (MATRIX) obj; - if (this.getScaleX() != other.getScaleX()) { + if (getScaleX() != other.getScaleX()) { return false; } - if (this.getScaleY() != other.getScaleY()) { + if (getScaleY() != other.getScaleY()) { return false; } - if (this.getRotateSkew0() != other.getRotateSkew0()) { + if (getRotateSkew0() != other.getRotateSkew0()) { return false; } - if (this.getRotateSkew1() != other.getRotateSkew1()) { + if (getRotateSkew1() != other.getRotateSkew1()) { return false; } - if (this.translateX != other.translateX) { + if (translateX != other.translateX) { return false; } - if (this.translateY != other.translateY) { + if (translateY != other.translateY) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java index e99d32d12..9c8bcca86 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java @@ -27,13 +27,14 @@ import java.util.Objects; */ public class DottedChain { - public List parts = new ArrayList<>(); + public final List parts; public DottedChain(List parts) { this.parts = new ArrayList<>(parts); } public DottedChain(String... parts) { + this.parts = new ArrayList<>(); for (int i = 0; i < parts.length; i++) { this.parts.add(parts[i]); } @@ -81,7 +82,7 @@ public class DottedChain { @Override public int hashCode() { int hash = 3; - hash = 89 * hash + Objects.hashCode(this.parts); + hash = 89 * hash + Objects.hashCode(parts); return hash; } @@ -97,7 +98,7 @@ public class DottedChain { return false; } final DottedChain other = (DottedChain) obj; - if (!Objects.equals(this.parts, other.parts)) { + if (!Objects.equals(parts, other.parts)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java index 74165eb54..2998bf3c8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java @@ -28,14 +28,21 @@ import java.util.List; public class GraphPart implements Serializable { public static final int TYPE_NONE = 0; + public static final int TYPE_LOOP_HEADER = 1; + public static final int TYPE_PRELOOP = 3; + public static final int TYPE_REENTRY = 2; public boolean traversed = false; + public int DFSP_pos = 0; + public GraphPart iloop_header; + public int type = TYPE_NONE; + public boolean irreducible = false; public int start = 0; @@ -315,10 +322,10 @@ public class GraphPart implements Serializable { return false; } final GraphPart other = (GraphPart) obj; - if (this.start != other.start) { + if (start != other.start) { return false; } - if (this.end != other.end) { + if (end != other.end) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPath.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPath.java index 8906aef49..5e0ba49d3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPath.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPath.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph; import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** * @@ -30,7 +31,7 @@ public class GraphPath implements Serializable { private final List vals = new ArrayList<>(); - public String rootName = ""; + public final String rootName; public GraphPath(String rootName, List keys, List vals) { this.rootName = rootName; @@ -39,10 +40,15 @@ public class GraphPath implements Serializable { } public GraphPath(List keys, List vals) { + rootName = ""; this.keys.addAll(keys); this.vals.addAll(vals); } + public GraphPath() { + rootName = ""; + } + public boolean startsWith(GraphPath p) { if (p.length() > length()) { return false; @@ -52,10 +58,10 @@ public class GraphPath implements Serializable { List otherVals = new ArrayList<>(p.vals); for (int i = 0; i < p.length(); i++) { - if (keys.get(i) != otherKeys.get(i)) { + if (!Objects.equals(keys.get(i), otherKeys.get(i))) { return false; } - if (vals.get(i) != otherVals.get(i)) { + if (!Objects.equals(vals.get(i), otherVals.get(i))) { return false; } } @@ -82,9 +88,6 @@ public class GraphPath implements Serializable { this.rootName = rootName; } - public GraphPath() { - } - public int length() { return vals.size(); } @@ -100,9 +103,9 @@ public class GraphPath implements Serializable { @Override public int hashCode() { int hash = 5; - hash = 23 * hash + (this.keys != null ? this.keys.hashCode() : 0); - hash = 23 * hash + (this.vals != null ? this.vals.hashCode() : 0); - hash = 23 * hash + (this.rootName != null ? this.rootName.hashCode() : 0); + hash = 23 * hash + arrHashCode(keys); + hash = 23 * hash + arrHashCode(vals); + hash = 23 * hash + Objects.hashCode(rootName); return hash; } @@ -115,34 +118,44 @@ public class GraphPath implements Serializable { return false; } final GraphPath other = (GraphPath) obj; - if (this.rootName == null && other.rootName != null) { - return false; - } - if (this.rootName != null && other.rootName == null) { + if ((rootName == null) != (other.rootName == null)) { return false; } - if (this.rootName != null && other.rootName != null) { - if (!this.rootName.equals(other.rootName)) { - return false; - } + if (!Objects.equals(rootName, other.rootName)) { + return false; } if (!arrMatch(keys, other.keys)) { return false; } + if (!arrMatch(vals, other.vals)) { return false; } + return true; } + private static int arrHashCode(List arr) { + if (arr == null || arr.isEmpty()) { + return 0; + } + + int hash = 5; + for (Integer i : arr) { + hash = 23 * hash + Objects.hashCode(i); + } + + return hash; + } + private static boolean arrMatch(List arr, List arr2) { if (arr.size() != arr2.size()) { return false; } for (int i = 0; i < arr.size(); i++) { - if (arr.get(i) != arr2.get(i)) { + if (!Objects.equals(arr.get(i), arr2.get(i))) { return false; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Loop.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Loop.java index 7a0bd4299..7a984b1d6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Loop.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Loop.java @@ -36,7 +36,7 @@ public class Loop implements Serializable { public List breakCandidatesLevels = new ArrayList<>(); - public long id; + public final long id; public int leadsToMark; @@ -73,10 +73,9 @@ public class Loop implements Serializable { return false; } final Loop other = (Loop) obj; - if (this.id != other.id) { + if (id != other.id) { return false; } return true; } - } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeFunctionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeFunctionItem.java index ea47eab73..db91616d5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeFunctionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeFunctionItem.java @@ -45,7 +45,7 @@ public class TypeFunctionItem extends GraphTargetItem { @Override public int hashCode() { int hash = 7; - hash = 83 * hash + Objects.hashCode(this.fullTypeName); + hash = 83 * hash + Objects.hashCode(fullTypeName); return hash; } @@ -58,7 +58,7 @@ public class TypeFunctionItem extends GraphTargetItem { return false; } final TypeFunctionItem other = (TypeFunctionItem) obj; - if (!Objects.equals(this.fullTypeName, other.fullTypeName)) { + if (!Objects.equals(fullTypeName, other.fullTypeName)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java index 77f4320ed..4f18a478f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java @@ -40,7 +40,7 @@ public class TypeItem extends GraphTargetItem { public static UnboundedTypeItem UNBOUNDED = new UnboundedTypeItem(); - public DottedChain fullTypeName; + public final DottedChain fullTypeName; public TypeItem(String s) { this(s == null ? new DottedChain() : new DottedChain(s.split("\\."))); @@ -58,7 +58,7 @@ public class TypeItem extends GraphTargetItem { @Override public int hashCode() { int hash = 7; - hash = 83 * hash + Objects.hashCode(this.fullTypeName); + hash = 83 * hash + Objects.hashCode(fullTypeName); return hash; } @@ -71,7 +71,7 @@ public class TypeItem extends GraphTargetItem { return false; } final TypeItem other = (TypeItem) obj; - if (!Objects.equals(this.fullTypeName, other.fullTypeName)) { + if (!Objects.equals(fullTypeName, other.fullTypeName)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java index cc4f85a45..aa3da921a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Set; public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { @@ -31,7 +32,7 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { public GraphTargetItem rightSide; - protected String operator = ""; + protected final String operator; @Override public GraphPart getFirstPart() { @@ -107,9 +108,9 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { @Override public int hashCode() { int hash = 7; - hash = 71 * hash + (this.leftSide != null ? this.leftSide.hashCode() : 0); - hash = 71 * hash + (this.rightSide != null ? this.rightSide.hashCode() : 0); - hash = 71 * hash + (this.operator != null ? this.operator.hashCode() : 0); + hash = 71 * hash + Objects.hashCode(leftSide); + hash = 71 * hash + Objects.hashCode(rightSide); + hash = 71 * hash + Objects.hashCode(operator); return hash; } @@ -138,13 +139,13 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { return false; } final BinaryOpItem other = (BinaryOpItem) obj; - if (this.leftSide != other.leftSide && (this.leftSide == null || !this.leftSide.equals(other.leftSide))) { + if (!Objects.equals(leftSide, other.leftSide)) { return false; } - if (this.rightSide != other.rightSide && (this.rightSide == null || !this.rightSide.equals(other.rightSide))) { + if (!Objects.equals(rightSide, other.rightSide)) { return false; } - if ((this.operator == null) ? (other.operator != null) : !this.operator.equals(other.operator)) { + if (!Objects.equals(operator, other.operator)) { return false; } return true; From c07dc61b3fe7ea2bffb02ca4deee5c5603b498f9 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 12 Jul 2015 18:18:07 +0200 Subject: [PATCH 02/25] build fix --- .../flash/action/model/GetMemberActionItem.java | 2 +- .../flash/exporters/commonshape/ExportRectangle.java | 8 ++++---- .../decompiler/flash/exporters/commonshape/Point.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java index 5891d8633..37de3830a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -32,7 +32,7 @@ import java.util.Objects; public class GetMemberActionItem extends ActionItem { - public final GraphTargetItem object; + public GraphTargetItem object; public final GraphTargetItem memberName; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java index 806bbefc4..969f1883f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/ExportRectangle.java @@ -25,13 +25,13 @@ import java.awt.geom.Rectangle2D; */ public class ExportRectangle { - public final double xMin; + public double xMin; - public final double yMin; + public double yMin; - public final double xMax; + public double xMax; - public final double yMax; + public double yMax; public ExportRectangle(double xMin, double yMin, double xMax, double yMax) { this.xMin = xMin; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java index 489014005..22ad6c428 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/commonshape/Point.java @@ -22,9 +22,9 @@ package com.jpexs.decompiler.flash.exporters.commonshape; */ public class Point { - public final double x; + public double x; - public final double y; + public double y; public Point(double x, double y) { this.x = x; From cf0e976172bdb6c333bea73abaaf376dbda625da Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 12 Jul 2015 18:27:55 +0200 Subject: [PATCH 03/25] build fix again --- .../src/com/jpexs/decompiler/flash/abc/types/Multiname.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index 1c8339864..dd5a80847 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -57,7 +57,7 @@ public class Multiname { public int name_index; - public final int namespace_index; + public int namespace_index; public final int namespace_set_index; From dd4933967e9b996cdcb6204226985634a060b911 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sun, 12 Jul 2015 21:27:49 +0200 Subject: [PATCH 04/25] fullyQualifiedaNames are DottedChains --- .../decompiler/flash/abc/AVM2LocalData.java | 3 ++- .../decompiler/flash/abc/avm2/AVM2Code.java | 7 ++--- .../decompiler/flash/abc/avm2/CodeStats.java | 3 ++- .../flash/abc/avm2/graph/AVM2Graph.java | 5 ++-- .../flash/abc/avm2/graph/AVM2GraphSource.java | 5 ++-- .../avm2/instructions/AVM2Instruction.java | 5 ++-- .../avm2/instructions/DeobfuscatePopIns.java | 3 ++- .../instructions/InstructionDefinition.java | 5 ++-- .../abc/avm2/instructions/SetTypeIns.java | 12 +++++---- .../avm2/instructions/alchemy/Lf32Ins.java | 3 ++- .../avm2/instructions/alchemy/Lf64Ins.java | 3 ++- .../avm2/instructions/alchemy/Li16Ins.java | 3 ++- .../avm2/instructions/alchemy/Li32Ins.java | 3 ++- .../abc/avm2/instructions/alchemy/Li8Ins.java | 3 ++- .../avm2/instructions/alchemy/Sf32Ins.java | 3 ++- .../avm2/instructions/alchemy/Sf64Ins.java | 3 ++- .../avm2/instructions/alchemy/Si16Ins.java | 3 ++- .../avm2/instructions/alchemy/Si32Ins.java | 3 ++- .../abc/avm2/instructions/alchemy/Si8Ins.java | 3 ++- .../avm2/instructions/alchemy/Sxi16Ins.java | 3 ++- .../avm2/instructions/alchemy/Sxi1Ins.java | 3 ++- .../avm2/instructions/alchemy/Sxi8Ins.java | 3 ++- .../avm2/instructions/arithmetic/AddIIns.java | 12 +++++---- .../avm2/instructions/arithmetic/AddIns.java | 3 ++- .../arithmetic/DecrementIIns.java | 3 ++- .../instructions/arithmetic/DecrementIns.java | 3 ++- .../instructions/arithmetic/DivideIns.java | 3 ++- .../arithmetic/IncrementIIns.java | 3 ++- .../instructions/arithmetic/IncrementIns.java | 3 ++- .../instructions/arithmetic/ModuloIns.java | 3 ++- .../instructions/arithmetic/MultiplyIIns.java | 3 ++- .../instructions/arithmetic/MultiplyIns.java | 3 ++- .../instructions/arithmetic/NegateIIns.java | 3 ++- .../instructions/arithmetic/NegateIns.java | 3 ++- .../avm2/instructions/arithmetic/NotIns.java | 3 ++- .../instructions/arithmetic/SubtractIIns.java | 3 ++- .../instructions/arithmetic/SubtractIns.java | 3 ++- .../avm2/instructions/bitwise/BitAndIns.java | 3 ++- .../avm2/instructions/bitwise/BitNotIns.java | 3 ++- .../avm2/instructions/bitwise/BitOrIns.java | 3 ++- .../avm2/instructions/bitwise/BitXorIns.java | 3 ++- .../avm2/instructions/bitwise/LShiftIns.java | 3 ++- .../avm2/instructions/bitwise/RShiftIns.java | 3 ++- .../avm2/instructions/bitwise/URShiftIns.java | 3 ++- .../instructions/comparison/EqualsIns.java | 3 ++- .../comparison/GreaterEqualsIns.java | 3 ++- .../comparison/GreaterThanIns.java | 3 ++- .../comparison/LessEqualsIns.java | 3 ++- .../instructions/comparison/LessThanIns.java | 3 ++- .../comparison/StrictEqualsIns.java | 3 ++- .../construction/ConstructIns.java | 3 ++- .../construction/ConstructPropIns.java | 3 ++- .../construction/ConstructSuperIns.java | 3 ++- .../construction/NewActivationIns.java | 3 ++- .../construction/NewArrayIns.java | 5 ++-- .../construction/NewCatchIns.java | 3 ++- .../construction/NewClassIns.java | 3 ++- .../construction/NewFunctionIns.java | 3 ++- .../construction/NewObjectIns.java | 3 ++- .../avm2/instructions/executing/CallIns.java | 3 ++- .../instructions/executing/CallMethodIns.java | 3 ++- .../executing/CallPropLexIns.java | 12 +++++---- .../executing/CallPropVoidIns.java | 3 ++- .../executing/CallPropertyIns.java | 3 ++- .../instructions/executing/CallStaticIns.java | 3 ++- .../instructions/executing/CallSuperIns.java | 3 ++- .../executing/CallSuperVoidIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfEqIns.java | 3 ++- .../avm2/instructions/jumps/IfFalseIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfGeIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfGtIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfLeIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfLtIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfNGeIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfNGtIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfNLeIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfNLtIns.java | 3 ++- .../abc/avm2/instructions/jumps/IfNeIns.java | 3 ++- .../instructions/jumps/IfStrictEqIns.java | 3 ++- .../instructions/jumps/IfStrictNeIns.java | 3 ++- .../avm2/instructions/jumps/IfTrueIns.java | 3 ++- .../abc/avm2/instructions/jumps/JumpIns.java | 3 ++- .../instructions/jumps/LookupSwitchIns.java | 3 ++- .../instructions/localregs/DecLocalIIns.java | 3 ++- .../instructions/localregs/DecLocalIns.java | 3 ++- .../localregs/GetLocalTypeIns.java | 3 ++- .../instructions/localregs/IncLocalIIns.java | 3 ++- .../instructions/localregs/IncLocalIns.java | 3 ++- .../avm2/instructions/localregs/KillIns.java | 3 ++- .../localregs/SetLocalTypeIns.java | 5 ++-- .../instructions/other/DeletePropertyIns.java | 3 ++- .../avm2/instructions/other/FindDefIns.java | 3 ++- .../instructions/other/FindPropertyIns.java | 3 ++- .../other/FindPropertyStrictIns.java | 3 ++- .../instructions/other/GetDescendantsIns.java | 3 ++- .../instructions/other/GetGlobalScopeIns.java | 3 ++- .../instructions/other/GetGlobalSlotIns.java | 3 ++- .../avm2/instructions/other/GetLexIns.java | 3 ++- .../instructions/other/GetPropertyIns.java | 3 ++- .../instructions/other/GetScopeObjectIns.java | 3 ++- .../avm2/instructions/other/GetSlotIns.java | 3 ++- .../avm2/instructions/other/GetSuperIns.java | 3 ++- .../avm2/instructions/other/HasNext2Ins.java | 3 ++- .../avm2/instructions/other/HasNextIns.java | 3 ++- .../abc/avm2/instructions/other/InIns.java | 3 ++- .../instructions/other/InitPropertyIns.java | 3 ++- .../avm2/instructions/other/NextNameIns.java | 3 ++- .../avm2/instructions/other/NextValueIns.java | 3 ++- .../instructions/other/ReturnValueIns.java | 3 ++- .../instructions/other/ReturnVoidIns.java | 3 ++- .../instructions/other/SetGlobalSlotIns.java | 5 ++-- .../instructions/other/SetPropertyIns.java | 5 ++-- .../avm2/instructions/other/SetSlotIns.java | 5 ++-- .../avm2/instructions/other/SetSuperIns.java | 5 ++-- .../abc/avm2/instructions/other/ThrowIns.java | 3 ++- .../abc/avm2/instructions/stack/DupIns.java | 3 ++- .../abc/avm2/instructions/stack/PopIns.java | 3 ++- .../avm2/instructions/stack/PopScopeIns.java | 3 ++- .../avm2/instructions/stack/PushByteIns.java | 3 ++- .../instructions/stack/PushDoubleIns.java | 3 ++- .../avm2/instructions/stack/PushFalseIns.java | 3 ++- .../avm2/instructions/stack/PushIntIns.java | 3 ++- .../instructions/stack/PushNamespaceIns.java | 3 ++- .../avm2/instructions/stack/PushNanIns.java | 3 ++- .../avm2/instructions/stack/PushNullIns.java | 3 ++- .../avm2/instructions/stack/PushScopeIns.java | 3 ++- .../avm2/instructions/stack/PushShortIns.java | 3 ++- .../instructions/stack/PushStringIns.java | 3 ++- .../avm2/instructions/stack/PushTrueIns.java | 3 ++- .../avm2/instructions/stack/PushUIntIns.java | 3 ++- .../instructions/stack/PushUndefinedIns.java | 3 ++- .../avm2/instructions/stack/PushWithIns.java | 3 ++- .../abc/avm2/instructions/stack/SwapIns.java | 3 ++- .../avm2/instructions/types/ApplyTypeIns.java | 3 ++- .../avm2/instructions/types/AsTypeIns.java | 3 ++- .../instructions/types/AsTypeLateIns.java | 3 ++- .../avm2/instructions/types/CoerceAIns.java | 5 ++-- .../avm2/instructions/types/CoerceIns.java | 5 ++-- .../types/CoerceOrConvertTypeIns.java | 12 +++++---- .../avm2/instructions/types/CoerceSIns.java | 5 ++-- .../avm2/instructions/types/ConvertBIns.java | 5 ++-- .../avm2/instructions/types/ConvertDIns.java | 5 ++-- .../avm2/instructions/types/ConvertIIns.java | 5 ++-- .../avm2/instructions/types/ConvertOIns.java | 5 ++-- .../avm2/instructions/types/ConvertSIns.java | 5 ++-- .../avm2/instructions/types/ConvertUIns.java | 5 ++-- .../instructions/types/InstanceOfIns.java | 3 ++- .../avm2/instructions/types/IsTypeIns.java | 3 ++- .../instructions/types/IsTypeLateIns.java | 3 ++- .../avm2/instructions/types/TypeOfIns.java | 3 ++- .../avm2/instructions/xml/CheckFilterIns.java | 3 ++- .../abc/avm2/instructions/xml/DXNSIns.java | 3 ++- .../avm2/instructions/xml/DXNSLateIns.java | 3 ++- .../avm2/instructions/xml/EscXAttrIns.java | 3 ++- .../avm2/instructions/xml/EscXElemIns.java | 3 ++- .../abc/avm2/model/FullMultinameAVM2Item.java | 5 ++-- .../abc/avm2/model/NewFunctionAVM2Item.java | 5 ++-- .../flash/abc/types/ABCException.java | 9 ++++--- .../decompiler/flash/abc/types/ClassInfo.java | 3 ++- .../flash/abc/types/InstanceInfo.java | 5 ++-- .../flash/abc/types/MethodBody.java | 7 ++--- .../flash/abc/types/MethodInfo.java | 7 ++--- .../decompiler/flash/abc/types/Multiname.java | 8 +++--- .../flash/abc/types/ScriptInfo.java | 3 ++- .../flash/abc/types/traits/Trait.java | 14 +++++----- .../flash/abc/types/traits/TraitClass.java | 26 +++++++++---------- .../flash/abc/types/traits/TraitFunction.java | 11 ++++---- .../types/traits/TraitMethodGetterSetter.java | 11 ++++---- .../abc/types/traits/TraitSlotConst.java | 13 +++++----- .../flash/abc/types/traits/Traits.java | 11 ++++---- .../decompiler/graph/model/LocalData.java | 5 ++-- 171 files changed, 429 insertions(+), 257 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java index e738f951a..9ee961304 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/AVM2LocalData.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import java.util.ArrayList; @@ -53,7 +54,7 @@ public class AVM2LocalData extends BaseLocalData { public HashMap localRegNames; - public List fullyQualifiedNames; + public List fullyQualifiedNames; public ArrayList parsedExceptions; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 89cbee71a..9e456edb8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -276,6 +276,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.graph.Block; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphPart; import com.jpexs.decompiler.graph.GraphSourceItem; @@ -1457,7 +1458,7 @@ public class AVM2Code implements Cloneable { return pos2adr(fixIPAfterDebugLine(adr2pos(addr, true))); } - public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, ABC abc, AVM2ConstantPool constants, List method_info, MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean[] visited, HashMap localRegAssigmentIps, HashMap> refs) throws ConvertException, InterruptedException { + public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, ABC abc, AVM2ConstantPool constants, List method_info, MethodBody body, int start, int end, HashMap localRegNames, List fullyQualifiedNames, boolean[] visited, HashMap localRegAssigmentIps, HashMap> refs) throws ConvertException, InterruptedException { calcKilledStats(body); boolean debugMode = DEBUG_MODE; if (debugMode) { @@ -1749,7 +1750,7 @@ public class AVM2Code implements Cloneable { return maxRegister + 1; } - public HashMap getLocalRegTypes(AVM2ConstantPool constants, List fullyQualifiedNames) { + public HashMap getLocalRegTypes(AVM2ConstantPool constants, List fullyQualifiedNames) { HashMap ret = new HashMap<>(); AVM2Instruction prev = null; for (AVM2Instruction ins : code) { @@ -1873,7 +1874,7 @@ public class AVM2Code implements Cloneable { }*/ } - public List toGraphTargetItems(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, AVM2ConstantPool constants, List method_info, MethodBody body, HashMap localRegNames, ScopeStack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { + public List toGraphTargetItems(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, AVM2ConstantPool constants, List method_info, MethodBody body, HashMap localRegNames, ScopeStack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { initToSource(); List list; HashMap localRegs = new HashMap<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java index 5bb8c3c09..0afc0fffb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/CodeStats.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.model.LocalData; import java.util.List; @@ -41,7 +42,7 @@ public class CodeStats { public InstructionStats[] instructionStats; - public GraphTextWriter toString(GraphTextWriter writer, ABC abc, List fullyQualifiedNames) { + public GraphTextWriter toString(GraphTextWriter writer, ABC abc, List fullyQualifiedNames) { writer.appendNoHilight("Stats: maxstack=" + maxstack + ", maxscope=" + maxscope + ", maxlocal=" + maxlocal).newLine(); int i = 0; int ms = 0; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index d83abf413..b7f75d13c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -56,6 +56,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictNeqAVM2Item; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.ecma.EcmaScript; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphPart; import com.jpexs.decompiler.graph.GraphPartMulti; @@ -95,7 +96,7 @@ public class AVM2Graph extends Graph { return avm2code; } - public AVM2Graph(AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, ScopeStack scopeStack, HashMap localRegNames, List fullyQualifiedNames, HashMap localRegAssigmentIps, HashMap> refs) { + public AVM2Graph(AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, ScopeStack scopeStack, HashMap localRegNames, List fullyQualifiedNames, HashMap localRegAssigmentIps, HashMap> refs) { super(new AVM2GraphSource(code, isStatic, scriptIndex, classIndex, localRegs, scopeStack, abc, body, localRegNames, fullyQualifiedNames, localRegAssigmentIps, refs), body.getExceptionEntries()); this.avm2code = code; this.abc = abc; @@ -111,7 +112,7 @@ public class AVM2Graph extends Graph { } - public static List translateViaGraph(String path, AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, ScopeStack scopeStack, HashMap localRegNames, List fullyQualifiedNames, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { + public static List translateViaGraph(String path, AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, ScopeStack scopeStack, HashMap localRegNames, List fullyQualifiedNames, int staticOperation, HashMap localRegAssigmentIps, HashMap> refs) throws InterruptedException { AVM2Graph g = new AVM2Graph(code, abc, body, isStatic, scriptIndex, classIndex, localRegs, scopeStack, localRegNames, fullyQualifiedNames, localRegAssigmentIps, refs); AVM2LocalData localData = new AVM2LocalData(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java index c15483e34..4ccb7dcde 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.ConvertOutput; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphPart; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -56,7 +57,7 @@ public class AVM2GraphSource extends GraphSource { HashMap localRegNames; - List fullyQualifiedNames; + List fullyQualifiedNames; HashMap localRegAssigmentIps; @@ -66,7 +67,7 @@ public class AVM2GraphSource extends GraphSource { return code; } - public AVM2GraphSource(AVM2Code code, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, ScopeStack scopeStack, ABC abc, MethodBody body, HashMap localRegNames, List fullyQualifiedNames, HashMap localRegAssigmentIp, HashMap> refs) { + public AVM2GraphSource(AVM2Code code, boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, ScopeStack scopeStack, ABC abc, MethodBody body, HashMap localRegNames, List fullyQualifiedNames, HashMap localRegAssigmentIp, HashMap> refs) { this.code = code; this.isStatic = isStatic; this.classIndex = classIndex; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java index 9e7cfe5c8..fe87e516f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java @@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -210,7 +211,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem { return s; } - public String getParams(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String getParams(AVM2ConstantPool constants, List fullyQualifiedNames) { StringBuilder s = new StringBuilder(); for (int i = 0; i < definition.operands.length; i++) { switch (definition.operands[i]) { @@ -319,7 +320,7 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem { return writer; } - public String toStringNoAddress(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String toStringNoAddress(AVM2ConstantPool constants, List fullyQualifiedNames) { String s = definition.instructionName; s += getParams(constants, fullyQualifiedNames) + getComment(); return s; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java index a27c2c87f..b444fb3f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class DeobfuscatePopIns extends PopIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.pop(); //Just ignore the value } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index 8ffab106d..923311391 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -30,6 +30,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -87,7 +88,7 @@ public class InstructionDefinition implements Serializable { throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented"); } - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { } protected FullMultinameAVM2Item resolveMultiname(TranslateStack stack, AVM2ConstantPool constants, int multinameIndex, AVM2Instruction ins) { @@ -117,7 +118,7 @@ public class InstructionDefinition implements Serializable { } - protected String resolveMultinameNoPop(int pos, Stack stack, AVM2ConstantPool constants, int multinameIndex, AVM2Instruction ins, List fullyQualifiedNames) { + protected String resolveMultinameNoPop(int pos, Stack stack, AVM2ConstantPool constants, int multinameIndex, AVM2Instruction ins, List fullyQualifiedNames) { String ns = ""; String name; if (constants.getMultiname(multinameIndex).needsNs()) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java index 9fa698830..22341a436 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/SetTypeIns.java @@ -1,28 +1,30 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.instructions; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.graph.DottedChain; import java.util.HashMap; import java.util.List; import java.util.Stack; public interface SetTypeIns { - public abstract String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException; + public abstract String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java index 215c47c7f..8573ccc59 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, 'f', 32)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java index 9b971e5a5..88c9a3a12 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, 'f', 64)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java index 44a3c0267..77853be33 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, 'i', 16)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java index e38c32477..19047860f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, 'i', 32)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java index 6987e579a..a1911718d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); stack.push(new AlchemyLoadAVM2Item(ins, ofs, 'i', 8)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java index c4b738610..9c3e3af38 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); output.add(new AlchemyStoreAVM2Item(ins, value, ofs, 'f', 32)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java index aff8f6ed1..c4b8ce5a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); output.add(new AlchemyStoreAVM2Item(ins, value, ofs, 'f', 64)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java index b8719b254..aa3570b3d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); output.add(new AlchemyStoreAVM2Item(ins, value, ofs, 'i', 16)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java index ef7124bd1..c938d1919 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); output.add(new AlchemyStoreAVM2Item(ins, value, ofs, 'i', 32)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java index 9a10cda59..524e716f8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem ofs = stack.pop(); GraphTargetItem value = stack.pop(); output.add(new AlchemyStoreAVM2Item(ins, value, ofs, 'i', 8)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java index fa63166b5..f02c830b5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemySignExtendAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Sxi16Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem value = stack.pop(); stack.push(new AlchemySignExtendAVM2Item(ins, value, 16)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java index e3a792330..4130ed3e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemySignExtendAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Sxi1Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem value = stack.pop(); stack.push(new AlchemySignExtendAVM2Item(ins, value, 1)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java index 3b6976421..9a10fa479 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.AlchemySignExtendAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class Sxi8Ins extends InstructionDefinition implements AlchemyTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem value = stack.pop(); stack.push(new AlchemySignExtendAVM2Item(ins, value, 8)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java index 7dd897c58..429ff85e2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic; import com.jpexs.decompiler.flash.abc.ABC; @@ -22,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -36,7 +38,7 @@ public class AddIIns extends AddIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new AddAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java index f9ffb4a0e..4291faae6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -60,7 +61,7 @@ public class AddIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new AddAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java index a51bce8d8..66781c0b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.DecrementAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -56,7 +57,7 @@ public class DecrementIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new DecrementAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java index 4a9c30204..342ef5090 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.DecrementAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -56,7 +57,7 @@ public class DecrementIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new DecrementAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java index f0cb1cf9b..7370cfb05 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.DivideAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -66,7 +67,7 @@ public class DivideIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new DivideAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java index dc662171b..97a5ba6a8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IncrementAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class IncrementIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IncrementAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java index 9dda3ac64..ba45ad0ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IncrementAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class IncrementIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IncrementAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java index f9b5e5fb9..492dc17b6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.ModuloAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class ModuloIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new ModuloAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java index 9d2e17840..5642a0256 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.MultiplyAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class MultiplyIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new MultiplyAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java index 83725febe..85f4f14d8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.MultiplyAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -59,7 +60,7 @@ public class MultiplyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new MultiplyAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java index bd3545d13..f969156ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.NegAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NegateIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = stack.pop(); stack.push(new NegAVM2Item(ins, v)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java index 9c171dbcf..bcc13c94f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.NegAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NegateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = stack.pop(); stack.push(new NegAVM2Item(ins, v)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java index ed2961e28..96bf80972 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -36,7 +37,7 @@ public class NotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = stack.pop(); stack.push(v.invert(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java index dadcd10b1..d60307568 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class SubtractIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new SubtractAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java index 414f4da90..68bc22cb7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class SubtractIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new SubtractAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java index 0a7af1b30..9b709d187 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitAndAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class BitAndIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new BitAndAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java index f0bd5fc94..c950d5318 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitNotAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class BitNotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = stack.pop(); stack.push(new BitNotAVM2Item(ins, v)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java index 7e3cbff25..522dc13fc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitOrAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class BitOrIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new BitOrAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java index d485f25ba..91ee16ed4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.BitXorAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class BitXorIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new BitXorAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java index 92f07e974..2a07b679c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LShiftAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class LShiftIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LShiftAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java index 4d39a5909..92efa6d36 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.RShiftAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class RShiftIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new RShiftAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java index 475da2ce5..f22b0612f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.URShiftAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class URShiftIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new URShiftAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java index f427e8cc5..90dbc3a26 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.EqAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -46,7 +47,7 @@ public class EqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new EqAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java index 1f7760c33..c5a537f41 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterEqualsIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.GeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class GreaterEqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new GeAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java index 8252f2c93..953a0e2bf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/GreaterThanIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.GtAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class GreaterThanIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new GtAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java index 1ed77ab08..9a9b8f88d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessEqualsIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class LessEqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LeAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java index 6b2591a27..bdf6d755c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/LessThanIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LtAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class LessThanIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LtAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java index bb20e54ed..5602f4c83 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/StrictEqualsIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictEqAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class StrictEqualsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new StrictEqAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java index a3d743050..2e4982bbc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java @@ -34,6 +34,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.XMLAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -76,7 +77,7 @@ public class ConstructIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java index 8205f775b..35215dde5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.XMLAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -56,7 +57,7 @@ public class ConstructPropIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java index 793f6802a..e6225a010 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConstructSuperAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -52,7 +53,7 @@ public class ConstructSuperIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java index 6ae75d69c..d7ac7835c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewActivationIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NewActivationAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NewActivationIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NewActivationAVM2Item(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java index b579cef9e..72595ec3e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.NewArrayAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -40,12 +41,12 @@ public class NewArrayIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { GraphTargetItem item = stack.pop(); - //No PopItems in this loop, since some obfuscators put there large numbers + //No PopItems in this loop, since some obfuscators put there large numbers if (item instanceof PopItem) { stack.push(new NullAVM2Item(ins)); return; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java index f73d1fec3..580ee3aaf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewCatchIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.clauses.ExceptionAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NewCatchIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int exInfo = ins.operands[0]; stack.push(new ExceptionAVM2Item(body.exceptions[exInfo])); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java index 5e668eb12..497713c9c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewClassIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -40,7 +41,7 @@ public class NewClassIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int clsIndex = ins.operands[0]; HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false); stack.pop().toString(writer, LocalData.create(constants, localRegNames, fullyQualifiedNames)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java index 1e28f8c5e..4845b3fcf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewFunctionIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NewFunctionAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NewFunctionIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int methodIndex = ins.operands[0]; NewFunctionAVM2Item function = new NewFunctionAVM2Item(ins, "", path, isStatic, scriptIndex, classIndex, abc, fullyQualifiedNames, constants, method_info, methodIndex); stack.push(function); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java index 70f4b4104..dd5920d83 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.NewObjectAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -41,7 +42,7 @@ public class NewObjectIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int argCount = ins.operands[0]; List args = new ArrayList<>(argCount); for (int a = 0; a < argCount; a++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java index 3c90e4488..6f4902e15 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.CallAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -52,7 +53,7 @@ public class CallIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List args = new ArrayList<>(); for (int a = 0; a < argCount; a++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java index 0cf96ec1e..1ecf0b267 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.CallMethodAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -52,7 +53,7 @@ public class CallMethodIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int methodIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java index bb51e49fe..2655002b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.instructions.executing; import com.jpexs.decompiler.flash.abc.ABC; @@ -23,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.CallPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +40,7 @@ public class CallPropLexIns extends CallPropertyIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java index 976ff7159..189d42f81 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.CallPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -57,7 +58,7 @@ public class CallPropVoidIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java index 8ccafbe53..e53dbc60c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.CallPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -55,7 +56,7 @@ public class CallPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java index 62914a3cc..eafe31dbb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.CallStaticAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -52,7 +53,7 @@ public class CallStaticIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int methodIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java index c39408c3a..6f05e32f6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.CallSuperAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -55,7 +56,7 @@ public class CallSuperIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java index 0001065e9..45d9f8129 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.CallSuperAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -55,7 +56,7 @@ public class CallSuperVoidIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; List args = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java index 7555ae3c0..4776cd665 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.EqAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.NeqAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfEqIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new EqAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java index dad2bdb9d..deea12aa0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v1 = stack.pop(); //stack.push(new NotItem(ins, v1)); stack.push(v1.invert(ins)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java index 9363dabbb..15ae57fac 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LtAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfGeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new GeAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java index 580cb8e16..cad036d68 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GtAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfGtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new GtAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java index acd3cb081..8d3c26c6d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GtAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfLeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LeAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java index 5da79aadb..dc3d68ca7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LtAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfLtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LtAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java index 834f0244e..c6a19885e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LtAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfNGeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LtAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java index d049a6e55..64df6103b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GtAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfNGtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new LeAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java index 41677a62e..b7b351040 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GtAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfNLeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new GtAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java index 726f87bc4..ae231379c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.GeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.LtAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfNLtIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new GeAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java index a13657215..a77c154b7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.EqAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.NeqAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfNeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new NeqAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java index fc53f4fca..10b52cfac 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictEqAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictNeqAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfStrictEqIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new StrictEqAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java index 48cc96fce..fd9e669e7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictEqAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.StrictNeqAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IfStrictNeIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v2 = stack.pop(); GraphTargetItem v1 = stack.pop(); stack.push(new StrictNeqAVM2Item(ins, v1, v2)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java index 677bbff38..5b59c85e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //String v1 = stack.pop().toString(); //stack.push("(" + v1 + ")"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java index 104990550..f30574acb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class JumpIns extends InstructionDefinition implements IfTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //stack.push(new BooleanAVM2Item(ins, Boolean.TRUE));// + ins.operands[0]); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java index e9c961682..ab68b0e3e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/LookupSwitchIns.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -36,7 +37,7 @@ public class LookupSwitchIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //int defaultOffset = ins.operands[0]; //int caseCount = ins.operands[1]; //stack.push("switch(...)"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java index 5b5751176..b5adf18dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -59,7 +60,7 @@ public class DecLocalIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new DecLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java index 5ee042dd3..b9076cd81 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.SubtractAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -59,7 +60,7 @@ public class DecLocalIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new DecLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java index 9d509cbda..e8de18962 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalTypeIns.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.ScriptAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.ThisAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.NotCompileTimeItem; import com.jpexs.decompiler.graph.ScopeStack; @@ -41,7 +42,7 @@ public abstract class GetLocalTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = getRegisterId(ins); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java index c29a0b176..2a6cf603a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IncLocalIIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new IncLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java index 03c595d74..6a58174fa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/IncLocalIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -39,7 +40,7 @@ public class IncLocalIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = ins.operands[0]; output.add(new IncLocalAVM2Item(ins, regId)); if (localRegs.containsKey(regId)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java index fbcf9e6c4..daa0a6632 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/KillIns.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -36,7 +37,7 @@ public class KillIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //kill local register } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index 79c220db1..fbde199d0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -35,6 +35,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreDecrementAVM2Item import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreIncrementAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -50,7 +51,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap regAssignCount, int ip, HashMap> refs, AVM2Code code) { int regId = getRegisterId(ins); GraphTargetItem value = stack.pop(); /*if (localRegs.containsKey(regId)) { @@ -124,7 +125,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S } @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { return AVM2Item.localRegName(localRegNames, getRegisterId(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java index 2a81e3c03..623faed54 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.DeletePropertyAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -50,7 +51,7 @@ public class DeletePropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java index 59fe0c8c4..81e837e9c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindDefIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FindDefAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class FindDefIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; Multiname multiname = constants.getMultiname(multinameIndex); stack.push(new FindDefAVM2Item(ins, multiname)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java index 130573c52..750c71187 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -48,7 +49,7 @@ public class FindPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); stack.push(new FindPropertyAVM2Item(ins, multiname)); //resolve right object diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java index 275cbffdd..781ec23b2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -47,7 +48,7 @@ public class FindPropertyStrictIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); stack.push(new FindPropertyAVM2Item(ins, multiname)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java index f77e5354c..a0efb79f3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetDescendantsAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -48,7 +49,7 @@ public class GetDescendantsIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java index 3dc8865e0..4bcd7cfe0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.ClassAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.ScriptAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -44,7 +45,7 @@ public class GetGlobalScopeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { if (scopeStack.isEmpty()) { if (classIndex == -1) { stack.push(new ScriptAVM2Item(scriptIndex)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java index 5677bba65..f5ed0e21e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -40,7 +41,7 @@ public class GetGlobalSlotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int slotIndex = ins.operands[0]; GraphTargetItem obj = scopeStack.get(0); //scope Multiname slotname = null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java index bb75b2b15..4d57990c0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetLexIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.GetLexAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class GetLexIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; Multiname multiname = constants.getMultiname(multinameIndex); stack.push(new GetLexAVM2Item(ins, multiname)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java index f4470bb00..ade3c1f2c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class GetPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java index 6c2db4774..cd6f6c0ab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetScopeObjectIns.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -36,7 +37,7 @@ public class GetScopeObjectIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int index = ins.operands[0]; stack.push(scopeStack.get(index)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java index 0236d9560..711202329 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java @@ -32,6 +32,7 @@ import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitWithSlot; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class GetSlotIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int slotIndex = ins.operands[0]; GraphTargetItem obj = stack.pop(); //scope obj = obj.getThroughRegister(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java index 1ebc0b3c5..3e20e7b20 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetSuperAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class GetSuperIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); GraphTargetItem obj = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java index 9dcd1aa17..77fa1b693 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNext2Ins.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.HasNextAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.LocalRegAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class HasNext2Ins extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int objectReg = ins.operands[0]; int indexReg = ins.operands[1]; //stack.push("_loc_" + objectReg + ".hasNext(cnt=_loc_" + indexReg + ")"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java index 512fb15c9..e6c5fa412 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.HasNextAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class HasNextIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem curIndex = stack.pop(); GraphTargetItem obj = stack.pop(); stack.push(new HasNextAVM2Item(ins, curIndex, obj)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java index 7e52b8aee..2d04af90d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.InAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class InIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem obj = stack.pop(); GraphTargetItem name = stack.pop(); stack.push(new InAVM2Item(ins, name, obj)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java index 9a027f884..5b3721f8e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.InitPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class InitPropertyIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem val = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java index 76ecbde02..6df6b55c3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextNameIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NextNameAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NextNameIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem index = stack.pop(); GraphTargetItem obj = stack.pop(); stack.push(new NextNameAVM2Item(ins, index, obj)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java index 960acad2d..e548b7643 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NextValueIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NextValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class NextValueIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem index = stack.pop(); GraphTargetItem obj = stack.pop(); stack.push(new NextValueAVM2Item(ins, index, obj)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java index 03b3ebac0..09316b4f9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ReturnValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class ReturnValueIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new ReturnValueAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java index f514e2f5c..5233d7cd9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ReturnVoidAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class ReturnVoidIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new ReturnVoidAVM2Item(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java index 82931f124..4723a2c3f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.SetGlobalSlotAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -40,12 +41,12 @@ public class SetGlobalSlotIns extends InstructionDefinition implements SetTypeIn } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new SetGlobalSlotAVM2Item(ins, ins.operands[0], stack.pop())); } @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { return "globalslot" + ins.operands[0]; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java index 8ae8904fe..2bcdc43cb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java @@ -38,6 +38,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreDecrementAVM2Item import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreIncrementAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -53,7 +54,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem value = stack.pop(); FullMultinameAVM2Item multiname = resolveMultiname(stack, constants, multinameIndex, ins); @@ -143,7 +144,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns } @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; String multiname = resolveMultinameNoPop(0, stack, abc.constants, multinameIndex, ins, fullyQualifiedNames); GraphTargetItem obj = stack.get(1 + resolvedCount(abc.constants, multinameIndex)); //pod vrcholem diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java index 7456f9eea..6c9420e0a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java @@ -43,6 +43,7 @@ import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.abc.types.traits.TraitWithSlot; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -57,7 +58,7 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int slotIndex = ins.operands[0]; GraphTargetItem value = stack.pop(); GraphTargetItem obj = stack.pop(); //scopeId @@ -161,7 +162,7 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { } @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { int slotIndex = ins.operands[0]; ////String obj = stack.get(1); String slotname = ""; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java index bd26115ce..4de0178b7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java @@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -44,7 +45,7 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem value = stack.pop(); @@ -54,7 +55,7 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns { } @Override - public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException { + public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException { int multinameIndex = ins.operands[0]; String multiname = resolveMultinameNoPop(1, stack, abc.constants, multinameIndex, ins, fullyQualifiedNames); HighlightedTextWriter writer = new HighlightedTextWriter(Configuration.getCodeFormatting(), false); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java index 75fd7d460..98dbe8252 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ThrowAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class ThrowIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { output.add(new ThrowAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java index 9e19c47f2..d397f9a97 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class DupIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem v = stack.pop(); stack.push(v); stack.push(new DuplicateItem(ins, v)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java index e774aa683..8a6204e32 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.MarkItem; import com.jpexs.decompiler.graph.ScopeStack; @@ -43,7 +44,7 @@ public class PopIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem top = stack.pop(); if ((!(top instanceof MarkItem))) { output.add(top); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java index ed07d0cb8..c25b1bcea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.WithEndAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.WithObjectAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -44,7 +45,7 @@ public class PopScopeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem scope = scopeStack.pop(); if (scope instanceof WithObjectAVM2Item) { scope = ((WithObjectAVM2Item) scope).scope; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java index ecc0610c5..58e267503 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushByteIns extends InstructionDefinition implements PushIntegerTyp } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, (long) ins.operands[0])); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java index 2b2fad241..5f2b0f6a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.FloatValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushDoubleIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new FloatValueAVM2Item(ins, constants.getDouble(ins.operands[0]))); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java index 80b7b20da..6a235d1bb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushFalseIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new FalseItem(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java index bbe391022..3383d819b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushIntIns extends InstructionDefinition implements PushIntegerType } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, constants.getInt(ins.operands[0]))); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java index 296666d33..404161484 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNamespaceIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NameSpaceAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class PushNamespaceIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NameSpaceAVM2Item(ins, ins.operands[0])); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java index b7be53959..df46af111 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNanIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NanAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class PushNanIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NanAVM2Item(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java index cbdfa59d0..889e82a61 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushNullIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class PushNullIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new NullAVM2Item(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java index d1d8e4ab2..d7005acd9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -42,7 +43,7 @@ public class PushScopeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { scopeStack.push(stack.pop()); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java index e751fdde3..008615d13 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushShortIns extends InstructionDefinition implements PushIntegerTy } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, (long) (short) ins.operands[0])); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java index 01efeafaf..58a03b23c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.StringAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushStringIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new StringAVM2Item(ins, constants.getString(ins.operands[0]))); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java index 8a7dfe263..a28c4d0fe 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushTrueIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new TrueItem(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java index dfdc500ec..84a63174a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class PushUIntIns extends InstructionDefinition implements PushIntegerTyp } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new IntegerValueAVM2Item(ins, constants.getUInt(ins.operands[0]))); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java index 61247047c..25fffd48f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUndefinedIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.UndefinedAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class PushUndefinedIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new UndefinedAVM2Item(ins)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java index 4f91c8f3b..11d8dc0dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.WithAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.WithObjectAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class PushWithIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem w = stack.pop(); WithObjectAVM2Item wot = new WithObjectAVM2Item(ins, w); scopeStack.push(wot); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java index d5dbc4b5b..235b3ce2c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; @@ -46,7 +47,7 @@ public class SwapIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem o1 = stack.pop(); GraphTargetItem o2 = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java index e13042ac6..cc09fe1c6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ApplyTypeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -51,7 +52,7 @@ public class ApplyTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int argCount = ins.operands[0]; List params = new ArrayList<>(); for (int i = 0; i < argCount; i++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java index ababa2187..edb982171 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AsTypeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -49,7 +50,7 @@ public class AsTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem val = stack.pop(); stack.push(new AsTypeAVM2Item(ins, val, new FullMultinameAVM2Item(ins, ins.operands[0]))); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java index 9c31e6a04..5c6079529 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.AsTypeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -47,7 +48,7 @@ public class AsTypeLateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem cls = stack.pop(); GraphTargetItem val = stack.pop(); stack.push(new AsTypeAVM2Item(ins, val, cls)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java index 127c3dc53..35346febc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -48,7 +49,7 @@ public class CoerceAIns extends InstructionDefinition implements CoerceOrConvert } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new CoerceAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -59,7 +60,7 @@ public class CoerceAIns extends InstructionDefinition implements CoerceOrConvert } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return TypeItem.UNBOUNDED; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java index c56f48944..2b6147fab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.parser.script.PropertyAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,13 +46,13 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; stack.push(new CoerceAVM2Item(ins, stack.pop(), PropertyAVM2Item.multinameToType(multinameIndex, constants))); } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; return PropertyAVM2Item.multinameToType(multinameIndex, constants); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceOrConvertTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceOrConvertTypeIns.java index d7e41a8fc..a5f5c539c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceOrConvertTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceOrConvertTypeIns.java @@ -1,22 +1,24 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.instructions.types; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import java.util.List; @@ -26,5 +28,5 @@ import java.util.List; */ public interface CoerceOrConvertTypeIns { - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames); + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index 4a5803a94..72be9784f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new CoerceAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -55,7 +56,7 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("String"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java index 27aa45ff7..9616a2d64 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -55,7 +56,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -65,7 +66,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("Boolean"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java index bba81267b..a88a93fd4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -63,7 +64,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -73,7 +74,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("Number"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 0d3a3d6c4..5b852bdda 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -61,7 +62,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -71,7 +72,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("int"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java index 7464f4856..9b21931d0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -44,7 +45,7 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -54,7 +55,7 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("Object"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java index 3f0fb7482..3f3459e6c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -55,7 +56,7 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("String"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java index 3fa5636c3..4bf1f3c46 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -44,7 +45,7 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @@ -54,7 +55,7 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver } @Override - public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { + public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { return new TypeItem("uint"); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java index d97a6b3e4..a89d4cda3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.InstanceOfAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class InstanceOfIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem type = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new InstanceOfAVM2Item(ins, value, type)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java index daddc0630..a8f88af7b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.operations.IsTypeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -38,7 +39,7 @@ public class IsTypeIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { int multinameIndex = ins.operands[0]; GraphTargetItem value = stack.pop(); stack.push(new IsTypeAVM2Item(ins, value, new FullMultinameAVM2Item(ins, multinameIndex))); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java index 0b52d7ba4..4f37d8bf8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.IsTypeAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class IsTypeLateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem type = stack.pop(); GraphTargetItem value = stack.pop(); stack.push(new IsTypeAVM2Item(ins, value, type)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java index 93c390866..f7256e0bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.operations.TypeOfAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -37,7 +38,7 @@ public class TypeOfIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new TypeOfAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java index 890c8e2a6..aa6d7c620 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.FilteredCheckAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -43,7 +44,7 @@ public class CheckFilterIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem obj = stack.pop(); stack.push(new FilteredCheckAVM2Item(ins, obj)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java index 1554e35a8..68926c435 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.DefaultXMLNamespace; import com.jpexs.decompiler.flash.abc.avm2.model.StringAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -47,7 +48,7 @@ public class DXNSIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { //FIXME!!! - search namespace output.add(new DefaultXMLNamespace(ins, new StringAVM2Item(ins, constants.getString(ins.operands[0])))); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java index dec64d8b4..ffbbb0c60 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.DefaultXMLNamespace; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -44,7 +45,7 @@ public class DXNSLateIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { GraphTargetItem xmlns = stack.pop(); output.add(new DefaultXMLNamespace(ins, xmlns)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java index 81949e578..9b8192c12 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.EscapeXAttrAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class EscXAttrIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new EscapeXAttrAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java index 1a00051c6..f7c773ad7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.model.EscapeXElemAVM2Item; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TranslateStack; @@ -45,7 +46,7 @@ public class EscXElemIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.push(new EscapeXElemAVM2Item(ins, stack.pop())); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index c2e640778..02e64801d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -59,7 +60,7 @@ public class FullMultinameAVM2Item extends AVM2Item { return (name != null) || (namespace != null); } - public boolean isXML(AVM2ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException { + public boolean isXML(AVM2ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) throws InterruptedException { String cname; if (name != null) { cname = name.toString(LocalData.create(constants, localRegNames, fullyQualifiedNames)); @@ -95,7 +96,7 @@ public class FullMultinameAVM2Item extends AVM2Item { writer.append("]"); } else { AVM2ConstantPool constants = localData.constantsAvm2; - List fullyQualifiedNames = localData.fullyQualifiedNames; + List fullyQualifiedNames = localData.fullyQualifiedNames; if (multinameIndex > 0 && multinameIndex < constants.constant_multiname.size()) { writer.append(constants.getMultiname(multinameIndex).getName(constants, fullyQualifiedNames, false)); } else { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java index fd0b604b7..1346a9ca8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.decompiler.graph.TypeItem; @@ -45,7 +46,7 @@ public class NewFunctionAVM2Item extends AVM2Item { public ABC abc; - public List fullyQualifiedNames; + public List fullyQualifiedNames; public AVM2ConstantPool constants; @@ -53,7 +54,7 @@ public class NewFunctionAVM2Item extends AVM2Item { public int methodIndex; - public NewFunctionAVM2Item(AVM2Instruction instruction, String functionName, String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, List fullyQualifiedNames, AVM2ConstantPool constants, List methodInfo, int methodIndex) { + public NewFunctionAVM2Item(AVM2Instruction instruction, String functionName, String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, List fullyQualifiedNames, AVM2ConstantPool constants, List methodInfo, int methodIndex) { super(instruction, PRECEDENCE_PRIMARY); this.functionName = functionName; this.path = path; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ABCException.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ABCException.java index bc58992b6..8ac9a1df9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ABCException.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ABCException.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.types; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.ConvertException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.Helper; import java.io.Serializable; import java.util.List; @@ -40,11 +41,11 @@ public class ABCException implements Serializable, Cloneable { return "Exception: startServer=" + Helper.formatAddress(start) + " end=" + Helper.formatAddress(end) + " target=" + target + " type_index=" + type_index + " name_index=" + name_index; } - public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { return "Exception: startServer=" + Helper.formatAddress(start) + " end=" + Helper.formatAddress(end) + " target=" + target + " type=\"" + getTypeName(constants, fullyQualifiedNames) + "\" name=\"" + getVarName(constants, fullyQualifiedNames) + "\""; } - public String toString(AVM2ConstantPool constants, AVM2Code code, List fullyQualifiedNames) { + public String toString(AVM2ConstantPool constants, AVM2Code code, List fullyQualifiedNames) { try { return "Exception: startServer=" + code.adr2pos(start) + ":" + code.code.get(code.adr2pos(start)).toStringNoAddress(constants, fullyQualifiedNames) + " end=" + code.adr2pos(end) + ":" + code.code.get(code.adr2pos(end)).toStringNoAddress(constants, fullyQualifiedNames) + " target=" + code.adr2pos(target) + ":" + code.code.get(code.adr2pos(target)).toStringNoAddress(constants, fullyQualifiedNames) + " type=\"" + getTypeName(constants, fullyQualifiedNames) + "\" name=\"" + getVarName(constants, fullyQualifiedNames) + "\""; } catch (ConvertException ex) { @@ -56,14 +57,14 @@ public class ABCException implements Serializable, Cloneable { return (name_index == 0) && (type_index == 0); } - public String getVarName(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String getVarName(AVM2ConstantPool constants, List fullyQualifiedNames) { if (name_index == 0) { return ""; } return constants.getMultiname(name_index).getName(constants, fullyQualifiedNames, false); } - public String getTypeName(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String getTypeName(AVM2ConstantPool constants, List fullyQualifiedNames) { if (type_index == 0) { return "*"; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java index b9ceae26f..dbb3ee305 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ClassInfo.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.types; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.types.traits.Traits; import com.jpexs.decompiler.flash.types.annotations.Internal; +import com.jpexs.decompiler.graph.DottedChain; import java.util.List; public class ClassInfo { @@ -43,7 +44,7 @@ public class ClassInfo { return "method_index=" + cinit_index + "\r\n" + static_traits.toString(); } - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { return "method_index=" + cinit_index + "\r\n" + static_traits.toString(abc, fullyQualifiedNames); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java index 54e305af9..f6925af4e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Traits; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.types.annotations.Internal; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.Helper; import java.util.List; @@ -65,7 +66,7 @@ public class InstanceInfo { return "name_index=" + name_index + " super_index=" + super_index + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString(); } - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { String supIndexStr = "[nothing]"; if (super_index > 0) { supIndexStr = abc.constants.getMultiname(super_index).toString(abc.constants, fullyQualifiedNames); @@ -73,7 +74,7 @@ public class InstanceInfo { return "name_index=" + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " super_index=" + supIndexStr + " flags=" + flags + " protectedNS=" + protectedNS + " interfaces=" + Helper.intArrToString(interfaces) + " method_index=" + iinit_index + "\r\n" + instance_traits.toString(abc, fullyQualifiedNames); } - public GraphTextWriter getClassHeaderStr(GraphTextWriter writer, ABC abc, List fullyQualifiedNames, boolean allowPrivate) { + public GraphTextWriter getClassHeaderStr(GraphTextWriter writer, ABC abc, List fullyQualifiedNames, boolean allowPrivate) { String modifiers; Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); modifiers = ns.getPrefix(abc); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index c5d00c96b..b3afc43b3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.types.annotations.Internal; import com.jpexs.decompiler.flash.types.annotations.SWFField; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.ScopeStack; @@ -269,7 +270,7 @@ public final class MethodBody implements Cloneable { return ret; } - public void convert(final String path, ScriptExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final AVM2ConstantPool constants, final List method_info, final ScopeStack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException { + public void convert(final String path, ScriptExportMode exportMode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final Trait trait, final AVM2ConstantPool constants, final List method_info, final ScopeStack scopeStack, final boolean isStaticInitializer, final GraphTextWriter writer, final List fullyQualifiedNames, final Traits initTraits, boolean firstLevel) throws InterruptedException { if (debugMode) { System.err.println("Decompiling " + path); } @@ -316,7 +317,7 @@ public final class MethodBody implements Cloneable { } } - public GraphTextWriter toString(final String path, ScriptExportMode exportMode, final ABC abc, final Trait trait, final AVM2ConstantPool constants, final List method_info, final GraphTextWriter writer, final List fullyQualifiedNames) throws InterruptedException { + public GraphTextWriter toString(final String path, ScriptExportMode exportMode, final ABC abc, final Trait trait, final AVM2ConstantPool constants, final List method_info, final GraphTextWriter writer, final List fullyQualifiedNames) throws InterruptedException { if (exportMode != ScriptExportMode.AS) { getCode().toASMSource(constants, trait, method_info.get(this.method_info), this, exportMode, writer); } else { @@ -349,7 +350,7 @@ public final class MethodBody implements Cloneable { return writer; } - public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, AVM2ConstantPool constants, List method_info, ScopeStack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) throws InterruptedException { + public MethodBody convertMethodBody(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, Trait trait, AVM2ConstantPool constants, List method_info, ScopeStack scopeStack, boolean isStaticInitializer, List fullyQualifiedNames, Traits initTraits) throws InterruptedException { MethodBody body = clone(); AVM2Code code = body.getCode(); code.markMappedOffsets(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java index 2090c8fbd..5e32ff6c0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.types.annotations.Internal; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.Helper; import java.util.HashMap; import java.util.List; @@ -249,7 +250,7 @@ public class MethodInfo { return ret.toString(); } - public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { String optionalStr = "["; if (optional != null) { for (int i = 0; i < optional.length; i++) { @@ -298,7 +299,7 @@ public class MethodInfo { return constants.getString(name_index); } - public GraphTextWriter getParamStr(GraphTextWriter writer, AVM2ConstantPool constants, MethodBody body, ABC abc, List fullyQualifiedNames) { + public GraphTextWriter getParamStr(GraphTextWriter writer, AVM2ConstantPool constants, MethodBody body, ABC abc, List fullyQualifiedNames) { Map localRegNames = new HashMap<>(); if (body != null && Configuration.getLocalNamesFromDebugInfo.get()) { localRegNames = body.getCode().getLocalRegNamesFromDebug(abc); @@ -363,7 +364,7 @@ public class MethodInfo { return writer; } - public GraphTextWriter getReturnTypeStr(GraphTextWriter writer, AVM2ConstantPool constants, List fullyQualifiedNames) { + public GraphTextWriter getReturnTypeStr(GraphTextWriter writer, AVM2ConstantPool constants, List fullyQualifiedNames) { String rname = "*"; if (ret_type > 0) { Multiname multiname = constants.getMultiname(ret_type); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index dd5a80847..2189a7a49 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -219,14 +219,14 @@ public class Multiname { return ret.toString(); } - private static String multinameToString(AVM2ConstantPool constants, int index, List fullyQualifiedNames) { + private static String multinameToString(AVM2ConstantPool constants, int index, List fullyQualifiedNames) { if (index == 0) { return "null"; } return constants.getMultiname(index).toString(constants, fullyQualifiedNames); } - public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { switch (kind) { case QNAME: @@ -261,7 +261,7 @@ public class Multiname { return null; } - private String typeNameToStr(AVM2ConstantPool constants, List fullyQualifiedNames, boolean raw) { + private String typeNameToStr(AVM2ConstantPool constants, List fullyQualifiedNames, boolean raw) { if (constants.getMultiname(qname_index).name_index == name_index) { return "ambiguousTypeName"; } @@ -283,7 +283,7 @@ public class Multiname { return typeNameStr; } - public String getName(AVM2ConstantPool constants, List fullyQualifiedNames, boolean raw) { + public String getName(AVM2ConstantPool constants, List fullyQualifiedNames, boolean raw) { if (kind == TYPENAME) { return typeNameToStr(constants, fullyQualifiedNames, raw); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java index 42b6e7b63..a11dc73e5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.Traits; import com.jpexs.decompiler.flash.types.annotations.Internal; +import com.jpexs.decompiler.graph.DottedChain; import java.util.ArrayList; import java.util.List; @@ -103,7 +104,7 @@ public class ScriptInfo { return "method_index=" + init_index + "\r\n" + traits.toString(); } - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { return "method_index=" + init_index + "\r\n" + traits.toString(abc, fullyQualifiedNames); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index 6b3c8c0b6..c7a68e6a4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -125,19 +125,19 @@ public abstract class Trait implements Cloneable, Serializable { return "name_index=" + name_index + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata); } - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { return abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata); } - public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.appendNoHilight(abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " kind=" + kindType + " metadata=" + Helper.intArrToString(metadata)); return writer; } - public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { } - public GraphTextWriter toStringPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toStringPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { String nsname = ns.getName(abc.constants, false); @@ -153,7 +153,7 @@ public abstract class Trait implements Cloneable, Serializable { return writer; } - public void convertPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convertPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { String nsname = ns.getName(abc.constants, false); @@ -161,12 +161,12 @@ public abstract class Trait implements Cloneable, Serializable { } } - public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { toString(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); return writer; } - public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { convert(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 0e29d9df5..7eb4e710c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -91,7 +91,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } @Override - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { return "Class " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " class_info=" + class_info + " metadata=" + Helper.intArrToString(metadata); } @@ -195,7 +195,7 @@ public class TraitClass extends Trait implements TraitWithSlot { //} } - private void parseUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, String ignorePackage, List fullyQualifiedNames) { + private void parseUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, String ignorePackage, List fullyQualifiedNames) { if (m != null) { if (m.kind == Multiname.TYPENAME) { if (m.qname_index != 0) { @@ -226,7 +226,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private void parseImportsUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, String ignorePackage, List fullyQualifiedNames) { + private void parseImportsUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, String ignorePackage, List fullyQualifiedNames) { if (m != null) { if (m.kind == Multiname.TYPENAME) { if (m.qname_index != 0) { @@ -253,7 +253,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private void parseImportsUsagesFromMethodInfo(ABC abc, int method_index, List imports, List uses, String ignorePackage, List fullyQualifiedNames, List visitedMethods) { + private void parseImportsUsagesFromMethodInfo(ABC abc, int method_index, List imports, List uses, String ignorePackage, List fullyQualifiedNames, List visitedMethods) { if ((method_index < 0) || (method_index >= abc.method_info.size())) { return; } @@ -312,13 +312,13 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private void parseImportsUsagesFromTraits(ABC abc, Traits ts, List imports, List uses, String ignorePackage, List fullyQualifiedNames) { + private void parseImportsUsagesFromTraits(ABC abc, Traits ts, List imports, List uses, String ignorePackage, List fullyQualifiedNames) { for (Trait t : ts.traits) { parseImportsUsagesFromTrait(abc, t, imports, uses, ignorePackage, fullyQualifiedNames); } } - private void parseImportsUsagesFromTrait(ABC abc, Trait t, List imports, List uses, String ignorePackage, List fullyQualifiedNames) { + private void parseImportsUsagesFromTrait(ABC abc, Trait t, List imports, List uses, String ignorePackage, List fullyQualifiedNames) { if (t instanceof TraitMethodGetterSetter) { TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(tm.name_index), ignorePackage, fullyQualifiedNames); @@ -334,7 +334,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private List getImportsUsages(ABC abc, List imports, List uses, List fullyQualifiedNames) { + private List getImportsUsages(ABC abc, List imports, List uses, List fullyQualifiedNames) { //constructor ClassInfo classInfo = abc.class_info.get(class_info); @@ -365,17 +365,17 @@ public class TraitClass extends Trait implements TraitWithSlot { } @Override - public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { abc.instance_info.get(class_info).getClassHeaderStr(writer, abc, fullyQualifiedNames, false); return writer; } @Override - public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { } @Override - public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { InstanceInfo instanceInfo = abc.instance_info.get(class_info); Multiname instanceInfoMultiname = instanceInfo.getName(abc.constants); @@ -406,8 +406,8 @@ public class TraitClass extends Trait implements TraitWithSlot { for (DottedChain ipath : imports) { String name = ipath.getLast(); DottedChain pkg = ipath.getWithoutLast(); - if (importnames.contains(name) || ((!pkg.toString().isEmpty()) && isBuiltInClass(name))) { - fullyQualifiedNames.add(name); + if (importnames.contains(name) || ((!pkg.parts.isEmpty()) && isBuiltInClass(name))) { + fullyQualifiedNames.add(new DottedChain(name)); } else { importnames.add(name); } @@ -545,7 +545,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } @Override - public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { fullyQualifiedNames = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java index e7b41acb6..fce95011b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitFunction.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.helpers.Helper; import java.util.List; @@ -44,12 +45,12 @@ public class TraitFunction extends Trait implements TraitWithSlot { } @Override - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { return "Function " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata); } @Override - public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { MethodBody body = abc.findBody(method_info); if (body == null) { writer.appendNoHilight("native "); @@ -65,11 +66,11 @@ public class TraitFunction extends Trait implements TraitWithSlot { } @Override - public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { } @Override - public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.startMethod(method_info); toStringHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); if (abc.instance_info.get(classIndex).isInterface()) { @@ -89,7 +90,7 @@ public class TraitFunction extends Trait implements TraitWithSlot { } @Override - public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.startMethod(method_info); convertHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); if (!abc.instance_info.get(classIndex).isInterface()) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java index c15f42a4c..c10e89937 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitMethodGetterSetter.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.ScopeStack; import com.jpexs.helpers.Helper; import java.util.List; @@ -39,16 +40,16 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " MethodGetterSetter " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " disp_id=" + disp_id + " method_info=" + method_info + " metadata=" + Helper.intArrToString(metadata); } @Override - public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { + public void convertHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) { } @Override - public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { + public GraphTextWriter toStringHeader(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) { String addKind = ""; if (kindType == TRAIT_GETTER) { addKind = "get "; @@ -73,7 +74,7 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.startMethod(method_info); path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames, false); convertHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); @@ -87,7 +88,7 @@ public class TraitMethodGetterSetter extends Trait { } @Override - public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { writer.startMethod(method_info); path = path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames, false); toStringHeader(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index ae2d114f6..b1d126734 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.types.annotations.Internal; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.helpers.Helper; @@ -57,7 +58,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { } @Override - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { String typeStr = "*"; if (type_index > 0) { typeStr = abc.constants.getMultiname(type_index).toString(abc.constants, fullyQualifiedNames); @@ -65,7 +66,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { return "0x" + Helper.formatAddress(fileOffset) + " " + Helper.byteArrToString(bytes) + " SlotConst " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " type=" + typeStr + " value=" + (new ValueKind(value_index, value_kind)).toString(abc.constants) + " metadata=" + Helper.intArrToString(metadata); } - public String getType(AVM2ConstantPool constants, List fullyQualifiedNames) { + public String getType(AVM2ConstantPool constants, List fullyQualifiedNames) { String typeStr = "*"; if (type_index > 0) { typeStr = constants.getMultiname(type_index).getName(constants, fullyQualifiedNames, false); @@ -73,7 +74,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { return typeStr; } - public GraphTextWriter getNameStr(GraphTextWriter writer, ABC abc, List fullyQualifiedNames) { + public GraphTextWriter getNameStr(GraphTextWriter writer, ABC abc, List fullyQualifiedNames) { String typeStr = getType(abc.constants, fullyQualifiedNames); if (typeStr.equals("*")) { typeStr = ""; @@ -98,7 +99,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { return writer; } - public void getValueStr(Trait parent, GraphTextWriter writer, ABC abc, List fullyQualifiedNames) throws InterruptedException { + public void getValueStr(Trait parent, GraphTextWriter writer, ABC abc, List fullyQualifiedNames) throws InterruptedException { if (assignedValue != null) { if (parent instanceof TraitClass) { TraitClass tc = (TraitClass) parent; @@ -136,7 +137,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { } @Override - public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Multiname n = getName(abc); boolean showModifier = true; if ((classIndex == -1) && (n != null)) { @@ -161,7 +162,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot { } @Override - public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { getNameStr(writer, abc, fullyQualifiedNames); if (assignedValue != null || value_kind != 0) { getValueStr(parent, writer, abc, fullyQualifiedNames); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java index c9cb189cb..9697e679c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; +import com.jpexs.decompiler.graph.DottedChain; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -75,7 +76,7 @@ public class Traits implements Cloneable, Serializable { return s; } - public String toString(ABC abc, List fullyQualifiedNames) { + public String toString(ABC abc, List fullyQualifiedNames) { String s = ""; for (int t = 0; t < traits.size(); t++) { if (t > 0) { @@ -106,7 +107,7 @@ public class Traits implements Cloneable, Serializable { NulWriter writer; - List fullyQualifiedNames; + List fullyQualifiedNames; int traitIndex; @@ -114,7 +115,7 @@ public class Traits implements Cloneable, Serializable { Trait parent; - public TraitConvertTask(Trait trait, Trait parent, boolean makePackages, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, int traitIndex, boolean parallel) { + public TraitConvertTask(Trait trait, Trait parent, boolean makePackages, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, int traitIndex, boolean parallel) { this.trait = trait; this.parent = parent; this.makePackages = makePackages; @@ -141,7 +142,7 @@ public class Traits implements Cloneable, Serializable { } } - public GraphTextWriter toString(Class[] traitTypes, Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public GraphTextWriter toString(Class[] traitTypes, Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { for (int t = 0; t < traits.size(); t++) { Trait trait = traits.get(t); if (traitTypes != null) { @@ -182,7 +183,7 @@ public class Traits implements Cloneable, Serializable { return writer; } - public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { + public void convert(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { if (!parallel || traits.size() < 2) { for (int t = 0; t < traits.size(); t++) { TraitConvertTask task = new TraitConvertTask(traits.get(t), parent, makePackages, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, t, parallel); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LocalData.java index f71c926c2..70952f6ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/LocalData.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.graph.model; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.action.model.ConstantPool; +import com.jpexs.decompiler.graph.DottedChain; import java.util.HashMap; import java.util.List; @@ -35,7 +36,7 @@ public class LocalData { public HashMap localRegNames; - public List fullyQualifiedNames; + public List fullyQualifiedNames; public static LocalData create(ConstantPool constants) { LocalData localData = new LocalData(); @@ -43,7 +44,7 @@ public class LocalData { return localData; } - public static LocalData create(AVM2ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { + public static LocalData create(AVM2ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { LocalData localData = new LocalData(); localData.constantsAvm2 = constants; localData.localRegNames = localRegNames; From c6b0dc926a3c57e396ca4c0125a2798a8c01e4c9 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Mon, 13 Jul 2015 11:09:05 +0200 Subject: [PATCH 05/25] #968 Sprites export with wrong coloring --- .../decompiler/flash/types/filters/Filtering.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java index e167ded4d..9723b3125 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java @@ -571,14 +571,14 @@ public class Filtering { int g = (rgb >> 8) & 0xff; int b = rgb & 0xff; float[] mr = matrix[0]; - r = cut(mr[0] * r + mr[1] * g + mr[2] * b + mr[3] * a + mr[4]); + int r2 = cut(mr[0] * r + mr[1] * g + mr[2] * b + mr[3] * a + mr[4]); float[] mg = matrix[1]; - g = cut(mg[0] * r + mg[1] * g + mg[2] * b + mg[3] * a + mg[4]); + int g2 = cut(mg[0] * r + mg[1] * g + mg[2] * b + mg[3] * a + mg[4]); float[] mb = matrix[2]; - b = cut(mb[0] * r + mb[1] * g + mb[2] * b + mb[3] * a + mb[4]); + int b2 = cut(mb[0] * r + mb[1] * g + mb[2] * b + mb[3] * a + mb[4]); float[] ma = matrix[3]; - a = cut(ma[0] * r + ma[1] * g + ma[2] * b + ma[3] * a + ma[4]); - pixels[i] = (a << 24) | (r << 16) | (g << 8) | b; + int a2 = cut(ma[0] * r + ma[1] * g + ma[2] * b + ma[3] * a + ma[4]); + pixels[i] = (a2 << 24) | (r2 << 16) | (g2 << 8) | b2; } setRGB(dst, src.getWidth(), src.getHeight(), pixels); return new SerializableImage(dst); From a4d49aeaf09884100e1ecefcd020cfb86620755b Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 20:13:54 +0200 Subject: [PATCH 06/25] using DottedChains (almost) everywhere --- .../flash/IdentifiersDeobfuscation.java | 36 +---- .../flash/SourceGeneratorLocalData.java | 3 +- .../com/jpexs/decompiler/flash/abc/ABC.java | 12 +- .../jpexs/decompiler/flash/abc/ClassPath.java | 7 +- .../decompiler/flash/abc/ScriptPack.java | 25 +--- .../flash/abc/avm2/AVM2ConstantPool.java | 29 ++++ .../flash/abc/avm2/AVM2Deobfuscation.java | 7 + .../instructions/alchemy/AlchemyTypeIns.java | 4 +- .../avm2/instructions/types/CoerceSIns.java | 2 +- .../avm2/instructions/types/ConvertBIns.java | 2 +- .../avm2/instructions/types/ConvertDIns.java | 2 +- .../avm2/instructions/types/ConvertIIns.java | 2 +- .../avm2/instructions/types/ConvertOIns.java | 2 +- .../avm2/instructions/types/ConvertSIns.java | 2 +- .../avm2/instructions/types/ConvertUIns.java | 2 +- .../abc/avm2/model/AlchemyLoadAVM2Item.java | 5 +- .../avm2/model/AlchemySignExtendAVM2Item.java | 3 +- .../flash/abc/avm2/model/FindDefAVM2Item.java | 11 +- .../abc/avm2/model/FullMultinameAVM2Item.java | 2 +- .../abc/avm2/model/InitVectorAVM2Item.java | 15 ++- .../abc/avm2/model/IntegerValueAVM2Item.java | 3 +- .../flash/abc/avm2/model/NanAVM2Item.java | 12 +- .../abc/avm2/model/NewFunctionAVM2Item.java | 2 +- .../abc/avm2/model/NewObjectAVM2Item.java | 3 +- .../flash/abc/avm2/model/NullAVM2Item.java | 12 +- .../abc/avm2/model/UndefinedAVM2Item.java | 12 +- .../flash/abc/avm2/model/XMLAVM2Item.java | 12 +- .../model/clauses/DeclarationAVM2Item.java | 4 +- .../abc/avm2/model/clauses/TryAVM2Item.java | 2 +- .../operations/DeletePropertyAVM2Item.java | 3 +- .../abc/avm2/model/operations/EqAVM2Item.java | 3 +- .../abc/avm2/model/operations/GeAVM2Item.java | 3 +- .../abc/avm2/model/operations/GtAVM2Item.java | 3 +- .../abc/avm2/model/operations/InAVM2Item.java | 12 +- .../model/operations/InstanceOfAVM2Item.java | 12 +- .../avm2/model/operations/IsTypeAVM2Item.java | 12 +- .../abc/avm2/model/operations/LeAVM2Item.java | 3 +- .../abc/avm2/model/operations/LtAVM2Item.java | 3 +- .../avm2/model/operations/NeqAVM2Item.java | 3 +- .../model/operations/StrictEqAVM2Item.java | 3 +- .../model/operations/StrictNeqAVM2Item.java | 3 +- .../parser/script/AVM2SourceGenerator.java | 43 +++--- .../parser/script/ActionScript3Parser.java | 62 ++++----- .../abc/avm2/parser/script/CallAVM2Item.java | 21 ++- .../abc/avm2/parser/script/ClassAVM2Item.java | 4 +- .../abc/avm2/parser/script/ConstAVM2Item.java | 5 +- .../avm2/parser/script/FunctionAVM2Item.java | 7 +- .../avm2/parser/script/GetterAVM2Item.java | 3 +- .../avm2/parser/script/InterfaceAVM2Item.java | 4 +- .../avm2/parser/script/MethodAVM2Item.java | 3 +- .../parser/script/NamespacedAVM2Item.java | 21 +-- .../avm2/parser/script/PackageAVM2Item.java | 4 +- .../avm2/parser/script/PropertyAVM2Item.java | 36 ++--- .../avm2/parser/script/SetterAVM2Item.java | 3 +- .../abc/avm2/parser/script/SlotAVM2Item.java | 5 +- .../parser/script/UnresolvedAVM2Item.java | 90 ++++++------- .../abc/avm2/parser/script/XMLAVM2Item.java | 3 +- .../avm2/parser/script/XMLFilterAVM2Item.java | 3 +- .../flash/abc/types/InstanceInfo.java | 4 +- .../flash/abc/types/MethodInfo.java | 2 +- .../decompiler/flash/abc/types/Multiname.java | 19 +-- .../decompiler/flash/abc/types/Namespace.java | 14 +- .../flash/abc/types/ScriptInfo.java | 4 +- .../decompiler/flash/abc/types/ValueKind.java | 2 +- .../flash/abc/types/traits/Trait.java | 8 +- .../flash/abc/types/traits/TraitClass.java | 74 +++++------ .../abc/usages/ClassNameMultinameUsage.java | 8 +- .../abc/usages/InsideClassMultinameUsage.java | 2 +- .../flash/tags/DoInitActionTag.java | 20 +-- .../jpexs/decompiler/graph/DottedChain.java | 124 +++++++++++++----- .../com/jpexs/decompiler/graph/TypeItem.java | 13 +- .../flash/gui/abc/ClassesListTreeModel.java | 11 +- .../flash/gui/abc/DecompiledEditorPane.java | 4 +- .../decompiler/flash/gui/abc/UsageFrame.java | 4 +- .../abc/tablemodels/NamespaceTableModel.java | 9 +- .../flash/gui/debugger/DebuggerTools.java | 4 +- 76 files changed, 505 insertions(+), 436 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java index bd3cf0a9a..6aa174140 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java @@ -317,6 +317,10 @@ public class IdentifiersDeobfuscation { * @return */ public static String printIdentifier(boolean as3, String s, String... validExceptions) { + if (s.isEmpty()) { + return ""; + } + if (s.startsWith("\u00A7") && s.endsWith("\u00A7")) { // Assuming already printed - TODO:detect better return s; } @@ -343,38 +347,6 @@ public class IdentifiersDeobfuscation { return ret; } - public static String printNamespace(boolean as3, String pkg, String... validNameExceptions) { - Cache nameCache = as3 ? as3NameCache : as2NameCache; - if (nameCache.contains(pkg)) { - return nameCache.get(pkg); - } - - if (pkg.isEmpty()) { - nameCache.put(pkg, pkg); - return pkg; - } - - String[] parts; - if (pkg.contains(".")) { - parts = pkg.split("\\."); - } else { - parts = new String[]{pkg}; - } - - StringBuilder ret = new StringBuilder(); - for (int i = 0; i < parts.length; i++) { - if (i > 0) { - ret.append("."); - } - - ret.append(printIdentifier(as3, parts[i], validNameExceptions)); - } - - String retStr = ret.toString(); - nameCache.put(pkg, retStr); - return retStr; - } - public static GraphTextWriter escapeOIdentifier(String s, GraphTextWriter writer) { for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java index b999561f1..12d6dfcc0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.ScriptInfo; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import java.io.Serializable; import java.util.ArrayList; @@ -57,7 +58,7 @@ public class SourceGeneratorLocalData implements Serializable { public Map> traitUsages = new HashMap<>(); - public String pkg = ""; + public DottedChain pkg = DottedChain.EMPTY; public List scopeStack = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java index dba2f2b40..b7abb9d5f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -109,7 +109,7 @@ public class ABC { public ABCContainerTag parentTag; /* Map from multiname index of namespace value to namespace name**/ - private Map namespaceMap; + private Map namespaceMap; public ABC(ABCContainerTag tag) { this.parentTag = tag; @@ -814,15 +814,15 @@ public class ABC { } } - private Map getNamespaceMap() { + private Map getNamespaceMap() { if (namespaceMap == null) { - Map map = new HashMap<>(); + Map map = new HashMap<>(); for (ScriptInfo si : script_info) { for (Trait t : si.traits.traits) { if (t instanceof TraitSlotConst) { TraitSlotConst s = ((TraitSlotConst) t); if (s.isNamespace()) { - String key = constants.getNamespace(s.value_index).getName(constants, true); // assume not null + DottedChain key = constants.getNamespace(s.value_index).getName(constants, true); // assume not null DottedChain val = constants.getMultiname(s.name_index).getNameWithNamespace(constants); map.put(key, val); } @@ -857,13 +857,13 @@ public class ABC { return bodyIdxFromMethodIdx; } - public DottedChain nsValueToName(String value) { + public DottedChain nsValueToName(DottedChain value) { if (getNamespaceMap().containsKey(value)) { return getNamespaceMap().get(value); } else { DottedChain ns = getDeobfuscation().builtInNs(value); if (ns == null) { - return new DottedChain(""); + return DottedChain.EMPTY; } else { return ns; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java index 4afffd1ea..467b9ecce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc; +import com.jpexs.decompiler.graph.DottedChain; import java.util.Objects; /** @@ -24,18 +25,18 @@ import java.util.Objects; */ public class ClassPath { - public final String packageStr; + public final DottedChain packageStr; public final String className; - public ClassPath(String packageStr, String className) { + public ClassPath(DottedChain packageStr, String className) { this.packageStr = packageStr; this.className = className; } @Override public String toString() { - return (packageStr == null || packageStr.isEmpty()) ? className : packageStr + "." + className; + return (packageStr == null || packageStr.isEmpty()) ? className : packageStr.toPrintableString(true) + "." + className; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index e9e72c944..0db060517 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.helpers.FileTextWriter; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; import com.jpexs.helpers.Path; @@ -82,8 +83,8 @@ public class ScriptPack extends AS3ClassTreeItem { this.allABCs = allAbcs; } - public String getPathPackage() { - String packageName = ""; + public DottedChain getPathPackage() { + DottedChain packageName = DottedChain.EMPTY; for (int t : traitIndices) { Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc); Namespace ns = name.getNamespace(abc.constants); @@ -108,8 +109,8 @@ public class ScriptPack extends AS3ClassTreeItem { public File getExportFile(String directory, ScriptExportSettings exportSettings) throws IOException { String scriptName = getPathScriptName(); - String packageName = getPathPackage(); - File outDir = new File(directory + File.separatorChar + makeDirPath(packageName)); + DottedChain packageName = getPathPackage(); + File outDir = new File(directory + File.separatorChar + packageName.toFilePath()); Path.createDirectorySafe(outDir); String fileName = outDir.toString() + File.separator + Helper.makeFileName(scriptName) + exportSettings.getFileExtension(); return new File(fileName); @@ -128,22 +129,6 @@ public class ScriptPack extends AS3ClassTreeItem { } return packageName.equals("") ? scriptName : packageName + "." + scriptName; }*/ - private static String makeDirPath(String packageName) { - if (packageName.isEmpty()) { - return ""; - } - String[] pathParts; - if (packageName.contains(".")) { - pathParts = packageName.split("\\."); - } else { - pathParts = new String[]{packageName}; - } - for (int i = 0; i < pathParts.length; i++) { - pathParts[i] = Helper.makeFileName(pathParts[i]); - } - return Helper.joinStrings(pathParts, File.separator); - } - public void convert(final NulWriter writer, final List traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException { for (int t : traitIndices) { Trait trait = traits.get(t); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java index 77f344082..642c4b5f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java @@ -20,9 +20,12 @@ import com.jpexs.decompiler.flash.abc.types.Decimal; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.abc.types.NamespaceSet; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.utf8.Utf8PrintWriter; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @@ -47,6 +50,8 @@ public class AVM2ConstantPool { public List constant_multiname = new ArrayList<>(); + public Map dottedChainCache = new HashMap<>(); + public synchronized int addInt(long value) { constant_int.add(value); return constant_int.size() - 1; @@ -340,6 +345,14 @@ public class AVM2ConstantPool { return id; } + public int getStringId(DottedChain val, boolean add) { + if (val == null) { + return 0; + } + + return getStringId(val.toRawString(), add); + } + public int getIntId(long val, boolean add) { int id = getIntId(val); if (add && id == 0) { @@ -404,6 +417,22 @@ public class AVM2ConstantPool { return id; } + public DottedChain getDottedChain(int index) { + String str = getString(index); + DottedChain chain = dottedChainCache.get(str); + if (chain == null) { + if (str.isEmpty()) { + chain = DottedChain.EMPTY; + } else { + chain = new DottedChain(str.split("\\.")); + } + + dottedChainCache.put(str, chain); + } + + return chain; + } + public void dump(Utf8PrintWriter writer) { String s = ""; for (int i = 1; i < constant_int.size(); i++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java index 004cf9f15..13ba6d063 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java @@ -92,6 +92,13 @@ public class AVM2Deobfuscation { return isValid; } + public DottedChain builtInNs(DottedChain ns) { + if (ns == null || ns.size() != 1) { + return null; + } + return builtInNs(ns.get(0)); + } + public DottedChain builtInNs(String ns) { if (ns == null) { return null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/AlchemyTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/AlchemyTypeIns.java index 6c0753739..24b4b438e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/AlchemyTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/AlchemyTypeIns.java @@ -16,11 +16,13 @@ */ package com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy; +import com.jpexs.decompiler.graph.DottedChain; + /** * * @author JPEXS */ public interface AlchemyTypeIns { - public static final String ALCHEMY_PACKAGE = "avm2.intrinsics.memory"; + public static final DottedChain ALCHEMY_PACKAGE = new DottedChain("avm2", "intrinsics", "memory"); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index 72be9784f..bd856cf3d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -57,6 +57,6 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("String"); + return new TypeItem(new DottedChain("String")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java index 9616a2d64..a328724dd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java @@ -67,6 +67,6 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java index a88a93fd4..3dfbf2908 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java @@ -75,6 +75,6 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("Number"); + return new TypeItem(new DottedChain("Number")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 5b852bdda..9d4fe21da 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -73,6 +73,6 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("int"); + return new TypeItem(new DottedChain("int")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java index 9b21931d0..968661991 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java @@ -56,6 +56,6 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("Object"); + return new TypeItem(new DottedChain("Object")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java index 3f3459e6c..59a46683c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java @@ -57,6 +57,6 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("String"); + return new TypeItem(new DottedChain("String")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java index 4bf1f3c46..a16eb0db8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java @@ -56,6 +56,6 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem("uint"); + return new TypeItem(new DottedChain("uint")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java index 7e746d3ff..a414c99cc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Li32Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Li8Ins; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -86,9 +87,9 @@ public class AlchemyLoadAVM2Item extends AVM2Item { public GraphTargetItem returnType() { switch (type) { case 'i': - return new TypeItem("int"); + return new TypeItem(new DottedChain("int")); case 'f': - return new TypeItem("Number"); + return new TypeItem(new DottedChain("Number")); } return TypeItem.UNBOUNDED; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index db2675cb0..991bf68e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi1Ins; import com.jpexs.decompiler.flash.abc.avm2.instructions.alchemy.Sxi8Ins; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -52,7 +53,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("int"); + return new TypeItem(new DottedChain("int")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java index d113d6ee1..1600d9270 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -33,7 +34,7 @@ public class FindDefAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append(propertyName.getNamespace(localData.constantsAvm2).getName(localData.constantsAvm2, false)); //assume not null name + return writer.append(propertyName.getNamespace(localData.constantsAvm2).getName(localData.constantsAvm2, false).toPrintableString(true)); //assume not null name } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index 02e64801d..03d0b4ccb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -73,7 +73,7 @@ public class FullMultinameAVM2Item extends AVM2Item { } else { Namespace ns = constants.getMultiname(multinameIndex).getNamespace(constants); if ((ns != null) && (ns.name_index != 0)) { - cns = ns.getName(constants, false); + cns = ns.getName(constants, false).toPrintableString(true); } } return cname.equals("XML") && cns.isEmpty(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java index 30834edd6..335bd63e7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java @@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.abc.types.NamespaceSet; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -45,6 +46,18 @@ import java.util.List; */ public class InitVectorAVM2Item extends AVM2Item { + public static final DottedChain VECTOR_PACKAGE = new DottedChain("__AS3__", "vec"); + + public static final DottedChain VECTOR_FQN = new DottedChain("__AS3__", "vec", "Vector"); + + public static final DottedChain VECTOR_INT = new DottedChain("__AS3__", "vec", "Vector$int"); + + public static final DottedChain VECTOR_DOUBLE = new DottedChain("__AS3__", "vec", "Vector$double"); + + public static final DottedChain VECTOR_UINT = new DottedChain("__AS3__", "vec", "Vector$uint"); + + public static final DottedChain VECTOR_OBJECT = new DottedChain("__AS3__", "vec", "Vector$object"); + public GraphTargetItem subtype; public List arguments; @@ -97,7 +110,7 @@ public class InitVectorAVM2Item extends AVM2Item { public GraphTargetItem returnType() { List pars = new ArrayList<>(); pars.add(subtype); - return new ApplyTypeAVM2Item(null, new TypeItem("__AS3__.vec.Vector"), pars); + return new ApplyTypeAVM2Item(null, new TypeItem(VECTOR_FQN), pars); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java index 7fe0682dc..03599e588 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushShortIns; import com.jpexs.decompiler.flash.abc.avm2.parser.script.AVM2SourceGenerator; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -73,7 +74,7 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer @Override public GraphTargetItem returnType() { - return new TypeItem("int"); + return new TypeItem(new DottedChain("int")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java index 2bc0ce86f..da5cbe5db 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -20,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNanIns; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -47,7 +49,7 @@ public class NanAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("Number"); + return new TypeItem(new DottedChain("Number")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java index 1346a9ca8..a554381a4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java @@ -98,7 +98,7 @@ public class NewFunctionAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("Function"); + return new TypeItem(new DottedChain("Function")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java index 7359809ce..82694d8e8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.NewObjectIns; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -63,7 +64,7 @@ public class NewObjectAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("Object"); + return new TypeItem(new DottedChain("Object")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java index cd0844f94..3c2b441a4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -21,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushNullIns; import com.jpexs.decompiler.flash.ecma.Null; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -59,7 +61,7 @@ public class NullAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("null"); + return new TypeItem(new DottedChain("null")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java index eacf63dc7..6505d6ef1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -21,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushUndefinedIns; import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -52,7 +54,7 @@ public class UndefinedAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("Undefined"); + return new TypeItem(new DottedChain("Undefined")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java index d77e20abc..123ff0405 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java @@ -1,22 +1,24 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -49,7 +51,7 @@ public class XMLAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("XML"); + return new TypeItem(new DottedChain("XML")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java index 93b117e15..7800ad516 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java @@ -89,7 +89,7 @@ public class DeclarationAVM2Item extends AVM2Item { if (lti.value instanceof ConvertAVM2Item) { coerType = ((ConvertAVM2Item) lti.value).type; } - srcData.declaredType = (coerType instanceof TypeItem) ? ((TypeItem) coerType).fullTypeName.toPrintableString() : "*"; + srcData.declaredType = (coerType instanceof TypeItem) ? ((TypeItem) coerType).fullTypeName.toPrintableString(true) : "*"; writer.append("var "); writer.append(localName); writer.append(":"); @@ -102,7 +102,7 @@ public class DeclarationAVM2Item extends AVM2Item { HighlightData srcData = getSrcData(); srcData.localName = ssti.getNameAsStr(localData); srcData.declaration = true; - srcData.declaredType = (type instanceof TypeItem) ? ((TypeItem) type).fullTypeName.toPrintableString() : "*"; + srcData.declaredType = (type instanceof TypeItem) ? ((TypeItem) type).fullTypeName.toPrintableString(true) : "*"; writer.append("var "); ssti.getName(writer, localData); writer.append(":"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java index 6d7d6b462..877ea7b1a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java @@ -92,7 +92,7 @@ public class TryAVM2Item extends AVM2Item implements Block { int eti = catchExceptions.get(e).type_index; - data.declaredType = eti <= 0 ? "*" : localData.constantsAvm2.constant_multiname.get(eti).getNameWithNamespace(localData.constantsAvm2).toPrintableString(); + data.declaredType = eti <= 0 ? "*" : localData.constantsAvm2.constant_multiname.get(eti).getNameWithNamespace(localData.constantsAvm2).toPrintableString(true); writer.hilightSpecial(localName, HighlightSpecialType.TRY_NAME, e, data); writer.append(":"); writer.hilightSpecial(catchExceptions.get(e).getTypeName(localData.constantsAvm2, localData.fullyQualifiedNames), HighlightSpecialType.TRY_TYPE, e); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java index 4c8a5f772..3a61b1943 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.parser.script.PropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.parser.script.UnresolvedAVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -87,7 +88,7 @@ public class DeletePropertyAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java index 9d17d4562..42f364bec 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfEqIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNeIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.EqualsTypeItem; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -68,6 +69,6 @@ public class EqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java index 8b34b4cd1..86e31fb50 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfGeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNGeIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -74,6 +75,6 @@ public class GeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java index 864cdfe03..4dc3bec1f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfGtIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNGtIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -67,6 +68,6 @@ public class GtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java index 45b33b01f..df7edf1e5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java @@ -1,24 +1,26 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.other.InIns; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -41,6 +43,6 @@ public class InAVM2Item extends BinaryOpItem { @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java index 04c34f44d..b472c97d5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java @@ -1,24 +1,26 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.InstanceOfIns; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -41,6 +43,6 @@ public class InstanceOfAVM2Item extends BinaryOpItem { @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java index 5515dfe58..7bf7e70ed 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java @@ -1,24 +1,26 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model.operations; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.IsTypeLateIns; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -41,6 +43,6 @@ public class IsTypeAVM2Item extends BinaryOpItem { @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java index 74964cdd1..e65d2482b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfLeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNLeIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -74,6 +75,6 @@ public class LeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java index 472fd1f31..a8b50a278 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfLtIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNLtIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -67,6 +68,6 @@ public class LtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java index e1947b5ab..344c4c8f0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfEqIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfNeIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -69,6 +70,6 @@ public class NeqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfCondit @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java index bf6ab47df..ac1ddc789 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictEqIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictNeIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.EqualsTypeItem; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; @@ -71,6 +72,6 @@ public class StrictEqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfC @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java index fba58968d..1024c1150 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictEqIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictNeIns; import com.jpexs.decompiler.flash.ecma.EcmaScript; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -72,6 +73,6 @@ public class StrictNeqAVM2Item extends BinaryOpItem implements LogicalOpItem, If @Override public GraphTargetItem returnType() { - return new TypeItem("Boolean"); + return new TypeItem(new DottedChain("Boolean")); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 3191ebfa6..77edde533 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -138,6 +138,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; @@ -1195,12 +1196,11 @@ public class AVM2SourceGenerator implements SourceGenerator { return abc; } - public void generateClass(List importedClasses, List sinitVariables, boolean staticNeedsActivation, List staticInit, List openedNamespaces, int namespace, int initScope, String pkg, ClassInfo classInfo, InstanceInfo instanceInfo, SourceGeneratorLocalData localData, boolean isInterface, String name, String superName, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List traitItems, Reference class_index) throws AVM2ParseException, CompilationException { + public void generateClass(List importedClasses, List sinitVariables, boolean staticNeedsActivation, List staticInit, List openedNamespaces, int namespace, int initScope, DottedChain pkg, ClassInfo classInfo, InstanceInfo instanceInfo, SourceGeneratorLocalData localData, boolean isInterface, String name, String superName, GraphTargetItem extendsVal, List implementsStr, GraphTargetItem constructor, List traitItems, Reference class_index) throws AVM2ParseException, CompilationException { localData.currentClass = name; localData.pkg = pkg; - List ret = new ArrayList<>(); if (extendsVal == null && !isInterface) { - extendsVal = new TypeItem("Object"); + extendsVal = new TypeItem(new DottedChain("Object")); } ParsedSymbol s = null; @@ -1298,7 +1298,7 @@ public class AVM2SourceGenerator implements SourceGenerator { return ret; } - public int generateClass(int namespace, ClassInfo ci, InstanceInfo ii, int initScope, String pkg, SourceGeneratorLocalData localData, AVM2Item cls, Reference class_index) throws AVM2ParseException, CompilationException { + public int generateClass(int namespace, ClassInfo ci, InstanceInfo ii, int initScope, DottedChain pkg, SourceGeneratorLocalData localData, AVM2Item cls, Reference class_index) throws AVM2ParseException, CompilationException { /*ClassInfo ci = new ClassInfo(); InstanceInfo ii = new InstanceInfo(); abc.class_info.add(ci); @@ -1405,7 +1405,7 @@ public class AVM2SourceGenerator implements SourceGenerator { return false; } - public int method(boolean subMethod, boolean isInterface, List callStack, String pkg, boolean needsActivation, List subvariables, int initScope, boolean hasRest, int line, String className, String superType, boolean constructor, SourceGeneratorLocalData localData, List paramTypes, List paramNames, List paramValues, List body, GraphTargetItem retType) throws CompilationException { + public int method(boolean subMethod, boolean isInterface, List callStack, DottedChain pkg, boolean needsActivation, List subvariables, int initScope, boolean hasRest, int line, String className, String superType, boolean constructor, SourceGeneratorLocalData localData, List paramTypes, List paramNames, List paramValues, List body, GraphTargetItem retType) throws CompilationException { //Reference hasArgs = new Reference<>(Boolean.FALSE); //calcRegisters(localData,needsActivation,paramNames,subvariables,body, hasArgs); SourceGeneratorLocalData newlocalData = new SourceGeneratorLocalData(new HashMap<>(), 1, true, 0); @@ -1868,7 +1868,7 @@ public class AVM2SourceGenerator implements SourceGenerator { return null; } - private int genNs(List importedClasses, String pkg, String custom, int namespace, List openedNamespaces, SourceGeneratorLocalData localData, int line) throws CompilationException { + private int genNs(List importedClasses, DottedChain pkg, String custom, int namespace, List openedNamespaces, SourceGeneratorLocalData localData, int line) throws CompilationException { if (custom != null) { PropertyAVM2Item prop = new PropertyAVM2Item(null, custom, abc, allABCs, openedNamespaces, new ArrayList<>()); Reference value = new Reference<>(null); @@ -1913,7 +1913,7 @@ public class AVM2SourceGenerator implements SourceGenerator { return namespace; } - public void generateTraitsPhase2(List importedClasses, String pkg, List items, Trait[] traits, List openedNamespaces, SourceGeneratorLocalData localData) throws CompilationException { + public void generateTraitsPhase2(List importedClasses, DottedChain pkg, List items, Trait[] traits, List openedNamespaces, SourceGeneratorLocalData localData) throws CompilationException { for (int k = 0; k < items.size(); k++) { GraphTargetItem item = items.get(k); if (traits[k] == null) { @@ -2173,12 +2173,12 @@ public class AVM2SourceGenerator implements SourceGenerator { } else { parentNamesAddNames(abc, allABCs, abc.instance_info.get(tc.class_info).name_index, parents, new ArrayList<>(), new ArrayList<>()); - for (int i = parents.size() - 1; i >= 1; i--) { + for (int i = parents.size() - 1; i >= 0; i--) { mbCode.add(ins(new GetLexIns(), parents.get(i))); mbCode.add(ins(new PushScopeIns())); traitScope++; } - mbCode.add(ins(new GetLexIns(), parents.get(1))); + mbCode.add(ins(new GetLexIns(), parents.get(0))); } mbCode.add(ins(new NewClassIns(), tc.class_info)); if (!abc.instance_info.get(tc.class_info).isInterface()) { @@ -2245,25 +2245,12 @@ public class AVM2SourceGenerator implements SourceGenerator { } } if (t instanceof TraitFunction) { - return new TypeItem("Function"); + return new TypeItem(new DottedChain("Function")); } return TypeItem.UNBOUNDED; } - private static boolean eq(Object a, Object b) { - if (a == null && b == null) { - return true; - } - if (a == null) { - return false; - } - if (b == null) { - return false; - } - return a.equals(b); - } - - public static boolean searchPrototypeChain(boolean instanceOnly, List abcs, String pkg, String obj, String propertyName, Reference outName, Reference outNs, Reference outPropNs, Reference outPropNsKind, Reference outPropNsIndex, Reference outPropType, Reference outPropValue) { + public static boolean searchPrototypeChain(boolean instanceOnly, List abcs, DottedChain pkg, String obj, String propertyName, Reference outName, Reference outNs, Reference outPropNs, Reference outPropNsKind, Reference outPropNsIndex, Reference outPropType, Reference outPropValue) { for (ABC abc : abcs) { if (!instanceOnly) { @@ -2272,7 +2259,7 @@ public class AVM2SourceGenerator implements SourceGenerator { continue; } for (Trait t : ii.traits.traits) { - if (eq(pkg, t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true))) { + if (Objects.equals(pkg, t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true))) { if (propertyName.equals(t.getName(abc).getName(abc.constants, null, true))) { outName.setVal(obj); outNs.setVal(pkg); @@ -2297,7 +2284,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } Multiname clsName = ii.getName(abc.constants); if (obj.equals(clsName.getName(abc.constants, null, true))) { - if (eq(pkg, clsName.getNamespace(abc.constants).getName(abc.constants, true))) { + if (Objects.equals(pkg, clsName.getNamespace(abc.constants).getName(abc.constants, true))) { //class found for (Trait t : ii.instance_traits.traits) { @@ -2356,7 +2343,7 @@ public class AVM2SourceGenerator implements SourceGenerator { public static void parentNames(ABC abc, List allABCs, int name_index, List indices, List names, List namespaces, List outABCs) { indices.add(name_index); names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, null, true)); - namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants, true)); + namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants, true).toRawString()); Multiname mname = abc.constants.constant_multiname.get(name_index); outABCs.add(abc); @@ -2370,7 +2357,7 @@ public class AVM2SourceGenerator implements SourceGenerator { Multiname m = a.constants.constant_multiname.get(a.instance_info.get(i).name_index); if (m.getName(a.constants, null, true).equals(mname.getName(abc.constants, null, true))) { - if (m.getNamespace(a.constants).hasName(mname.getNamespace(abc.constants).getName(abc.constants, true), a.constants)) { + if (m.getNamespace(a.constants).hasName(mname.getNamespace(abc.constants).getName(abc.constants, true).toRawString(), a.constants)) { //Multiname superName = a.constants.constant_multiname.get(a.instance_info.get(i).super_index); abcs.remove(a); if (a.instance_info.get(i).super_index != 0) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index 42171b0dc..780dc013b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -144,7 +144,7 @@ public class ActionScript3Parser { return uniqLast; } - private List commands(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, List variables) throws IOException, AVM2ParseException { + private List commands(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, List variables) throws IOException, AVM2ParseException { List ret = new ArrayList<>(); if (debugMode) { System.out.println("commands:"); @@ -159,12 +159,12 @@ public class ActionScript3Parser { return ret; } - private GraphTargetItem type(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem type(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, List variables) throws IOException, AVM2ParseException { ParsedSymbol s = lex(); if (s.type == SymbolType.MULTIPLY) { return new UnboundedTypeItem(); } else if (s.type == SymbolType.VOID) { - return new TypeItem("void"); + return new TypeItem(new DottedChain("void")); } else { lexer.pushback(s); } @@ -174,7 +174,7 @@ public class ActionScript3Parser { return t; } - private GraphTargetItem memberOrCall(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, GraphTargetItem newcmds, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem memberOrCall(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, GraphTargetItem newcmds, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { if (debugMode) { System.out.println("memberOrCall:"); } @@ -223,7 +223,7 @@ public class ActionScript3Parser { return ret; } - private GraphTargetItem applyType(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, GraphTargetItem obj, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem applyType(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, GraphTargetItem obj, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { GraphTargetItem ret = obj; ParsedSymbol s = lex(); if (s.type == SymbolType.TYPENAME) { @@ -250,7 +250,7 @@ public class ActionScript3Parser { return ret; } - private GraphTargetItem member(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, GraphTargetItem obj, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem member(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, GraphTargetItem obj, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { if (debugMode) { System.out.println("member:"); } @@ -317,7 +317,7 @@ public class ActionScript3Parser { return ret; } - private GraphTargetItem name(TypeItem thisType, String pkg, Reference needsActivation, boolean typeOnly, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables, List importedClasses) throws IOException, AVM2ParseException { + private GraphTargetItem name(TypeItem thisType, DottedChain pkg, Reference needsActivation, boolean typeOnly, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables, List importedClasses) throws IOException, AVM2ParseException { ParsedSymbol s = lex(); DottedChain name = new DottedChain(); String name2 = ""; @@ -330,7 +330,7 @@ public class ActionScript3Parser { s = lex(); boolean attrBracket = false; - name.parts.add(name2); + name = name.add(name2); while (s.isType(SymbolType.DOT)) { //name += s.value.toString(); //. or :: s = lex(); @@ -353,7 +353,7 @@ public class ActionScript3Parser { expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER, SymbolType.NAMESPACE); name2 += s.value.toString(); } - name.parts.add(name2); + name = name.add(name2); s = lex(); } String nsname = null; @@ -373,7 +373,7 @@ public class ActionScript3Parser { } GraphTargetItem ret = null; - if (!name.parts.isEmpty()) { + if (!name.isEmpty()) { UnresolvedAVM2Item unr = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, typeOnly, null, lexer.yyline(), name, null, openedNamespaces); //unr.setIndex(index); variables.add(unr); @@ -439,7 +439,7 @@ public class ActionScript3Parser { return ret; } - private List call(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private List call(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { List ret = new ArrayList<>(); //expected(SymbolType.PARENT_OPEN); //MUST BE HANDLED BY CALLER ParsedSymbol s = lex(); @@ -454,12 +454,12 @@ public class ActionScript3Parser { return ret; } - private MethodAVM2Item method(String pkg, boolean isInterface, String customAccess, Reference needsActivation, List importedClasses, boolean override, boolean isFinal, TypeItem thisType, List openedNamespaces, boolean isStatic, int namespace, String functionName, boolean isMethod, List variables) throws IOException, AVM2ParseException { + private MethodAVM2Item method(DottedChain pkg, boolean isInterface, String customAccess, Reference needsActivation, List importedClasses, boolean override, boolean isFinal, TypeItem thisType, List openedNamespaces, boolean isStatic, int namespace, String functionName, boolean isMethod, List variables) throws IOException, AVM2ParseException { FunctionAVM2Item f = function(pkg, isInterface, needsActivation, importedClasses, namespace, thisType, openedNamespaces, functionName, isMethod, variables); return new MethodAVM2Item(f.pkg, f.isInterface, customAccess, f.needsActivation, f.hasRest, f.line, override, isFinal, isStatic, f.namespace, functionName, f.paramTypes, f.paramNames, f.paramValues, f.body, f.subvariables, f.retType); } - private FunctionAVM2Item function(String pkg, boolean isInterface, Reference needsActivation, List importedClasses, int namespace, TypeItem thisType, List openedNamespaces, String functionName, boolean isMethod, List variables) throws IOException, AVM2ParseException { + private FunctionAVM2Item function(DottedChain pkg, boolean isInterface, Reference needsActivation, List importedClasses, int namespace, TypeItem thisType, List openedNamespaces, String functionName, boolean isMethod, List variables) throws IOException, AVM2ParseException { openedNamespaces = new ArrayList<>(openedNamespaces); //local copy int line = lexer.yyline(); ParsedSymbol s; @@ -540,10 +540,10 @@ public class ActionScript3Parser { return new FunctionAVM2Item(pkg, isInterface, needsActivation2.getVal(), namespace, hasRest, line, functionName, paramTypes, paramNames, paramValues, body, subvariables, retType); } - private GraphTargetItem traits(String scriptName, boolean scriptTraits, List sinitVariables, Reference sinitNeedsActivation, List staticInitializer, List importedClasses, int privateNs, int protectedNs, int publicNs, int packageInternalNs, int protectedStaticNs, List openedNamespaces, String pkg, String classNameStr, boolean isInterface, List traits) throws AVM2ParseException, IOException, CompilationException { + private GraphTargetItem traits(String scriptName, boolean scriptTraits, List sinitVariables, Reference sinitNeedsActivation, List staticInitializer, List importedClasses, int privateNs, int protectedNs, int publicNs, int packageInternalNs, int protectedStaticNs, List openedNamespaces, DottedChain pkg, String classNameStr, boolean isInterface, List traits) throws AVM2ParseException, IOException, CompilationException { ParsedSymbol s; GraphTargetItem constr = null; - TypeItem thisType = pkg == null && classNameStr == null ? null : new TypeItem(pkg == null || "".equals(pkg) ? classNameStr : pkg + "." + classNameStr); + TypeItem thisType = pkg == null && classNameStr == null ? null : new TypeItem(pkg == null || pkg.isEmpty() ? new DottedChain(classNameStr) : pkg.add(classNameStr)); List constrVariables = new ArrayList<>(); List originalOpenedNamespaces = openedNamespaces; int originalPrivateNs = privateNs; @@ -824,7 +824,7 @@ public class ActionScript3Parser { lexer.pushback(s); } - ConstAVM2Item ns = new ConstAVM2Item(pkg, customAccess, true, namespace, nname, new TypeItem("Namespace"), new StringAVM2Item(null, nval), lexer.yyline()); + ConstAVM2Item ns = new ConstAVM2Item(pkg, customAccess, true, namespace, nname, new TypeItem(new DottedChain("Namespace")), new StringAVM2Item(null, nval), lexer.yyline()); traits.add(ns); break; case CONST: @@ -888,7 +888,7 @@ public class ActionScript3Parser { return constr; } - private GraphTargetItem classTraits(String scriptName, int gpublicNs, String pkg, List importedClasses, boolean isDynamic, boolean isFinal, List openedNamespaces, String packageName, int namespace, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, AVM2ParseException, CompilationException { + private GraphTargetItem classTraits(String scriptName, int gpublicNs, DottedChain pkg, List importedClasses, boolean isDynamic, boolean isFinal, List openedNamespaces, DottedChain packageName, int namespace, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List implementsStr, List variables) throws IOException, AVM2ParseException, CompilationException { GraphTargetItem ret = null; @@ -1045,7 +1045,7 @@ public class ActionScript3Parser { } } - private List xmltag(TypeItem thisType, String pkg, Reference usesVars, List openedTags, Reference closedVarTags, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private List xmltag(TypeItem thisType, DottedChain pkg, Reference usesVars, List openedTags, Reference closedVarTags, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { ParsedSymbol s = null; List rets = new ArrayList<>(); //GraphTargetItem ret = null; @@ -1174,7 +1174,7 @@ public class ActionScript3Parser { return rets; } - private GraphTargetItem xml(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem xml(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { List openedTags = new ArrayList<>(); int closedVarTags = 0; @@ -1185,7 +1185,7 @@ public class ActionScript3Parser { return ret; } - private GraphTargetItem command(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, boolean mustBeCommand, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem command(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forinlevel, boolean mustBeCommand, List variables) throws IOException, AVM2ParseException { LexBufferer buf = new LexBufferer(); lexer.addListener(buf); GraphTargetItem ret = null; @@ -1668,7 +1668,7 @@ public class ActionScript3Parser { } - private GraphTargetItem expression(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem expression(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { return expression(thisType, pkg, needsActivation, importedClasses, openedNamespaces, false, registerVars, inFunction, inMethod, allowRemainder, variables); } @@ -1736,7 +1736,7 @@ public class ActionScript3Parser { return false; } - private int brackets(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, List ret, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { + private int brackets(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, List ret, HashMap registerVars, boolean inFunction, boolean inMethod, List variables) throws IOException, AVM2ParseException { ParsedSymbol s = lex(); int arrCnt = 0; if (s.type == SymbolType.BRACKET_OPEN) { @@ -1760,7 +1760,7 @@ public class ActionScript3Parser { return arrCnt; } - private GraphTargetItem commaExpression(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forInLevel, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem commaExpression(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, Stack loops, Map loopLabels, HashMap registerVars, boolean inFunction, boolean inMethod, int forInLevel, List variables) throws IOException, AVM2ParseException { GraphTargetItem cmd = null; List expr = new ArrayList<>(); ParsedSymbol s; @@ -1782,7 +1782,7 @@ public class ActionScript3Parser { return new CommaExpressionItem(null, expr); } - private GraphTargetItem expression(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem expression(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { GraphTargetItem prim = expressionPrimary(thisType, pkg, needsActivation, importedClasses, openedNamespaces, allowEmpty, registerVars, inFunction, inMethod, allowRemainder, variables); if (prim == null) { return null; @@ -1812,7 +1812,7 @@ public class ActionScript3Parser { return lookahead; } - private GraphTargetItem expression1(GraphTargetItem lhs, int min_precedence, TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem expression1(GraphTargetItem lhs, int min_precedence, TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { if (debugMode) { System.out.println("expression1:"); } @@ -2025,7 +2025,7 @@ public class ActionScript3Parser { return lhs; } - private GraphTargetItem expressionPrimary(TypeItem thisType, String pkg, Reference needsActivation, List importedClasses, List openedNamespaces, boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { + private GraphTargetItem expressionPrimary(TypeItem thisType, DottedChain pkg, Reference needsActivation, List importedClasses, List openedNamespaces, boolean allowEmpty, HashMap registerVars, boolean inFunction, boolean inMethod, boolean allowRemainder, List variables) throws IOException, AVM2ParseException { if (debugMode) { System.out.println("primary:"); } @@ -2260,18 +2260,18 @@ public class ActionScript3Parser { private PackageAVM2Item parsePackage(List openedNamespaces) throws IOException, AVM2ParseException, CompilationException { List items = new ArrayList<>(); expectedType(SymbolType.PACKAGE); - String name = ""; + DottedChain name = DottedChain.EMPTY; ParsedSymbol s = lex(); if (s.type != SymbolType.CURLY_OPEN) { expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER); - name = s.value.toString(); + name = name.add(s.value.toString()); s = lex(); } while (s.type != SymbolType.CURLY_OPEN) { expected(s, lexer.yyline(), SymbolType.DOT); s = lex(); expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER); - name += "." + s.value.toString(); + name.add(s.value.toString()); s = lex(); } @@ -2283,7 +2283,7 @@ public class ActionScript3Parser { s = lex(); expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER); DottedChain imp = new DottedChain(); - imp.parts.add(s.value.toString()); + imp = imp.add(s.value.toString()); s = lex(); boolean isStar = false; while (s.type == SymbolType.DOT) { @@ -2295,7 +2295,7 @@ public class ActionScript3Parser { break; } expected(s, lexer.yyline(), SymbolGroup.IDENTIFIER); - imp.parts.add(s.value.toString()); + imp = imp.add(s.value.toString()); s = lex(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index 2f2b05c51..d289bdd02 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.abc.types.ValueKind; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -77,14 +78,12 @@ public class CallAVM2Item extends AVM2Item { List allAbcs = new ArrayList<>(); allAbcs.add(g.abc); allAbcs.addAll(g.allABCs); - String cname; - String pkgName = ""; - cname = localData.currentClass; - pkgName = localData.pkg; + String cname = localData.currentClass; + DottedChain pkgName = localData.pkg; GraphTargetItem obj = null; Reference outName = new Reference<>(""); - Reference outNs = new Reference<>(""); - Reference outPropNs = new Reference<>(""); + Reference outNs = new Reference<>(DottedChain.EMPTY); + Reference outPropNs = new Reference<>(DottedChain.EMPTY); Reference outPropNsKind = new Reference<>(1); Reference outPropNsIndex = new Reference<>(0); Reference outPropType = new Reference<>(null); @@ -114,13 +113,11 @@ public class CallAVM2Item extends AVM2Item { List allAbcs = new ArrayList<>(); allAbcs.add(g.abc); allAbcs.addAll(g.allABCs); - String cname; - String pkgName = ""; - cname = localData.currentClass; - pkgName = localData.pkg; + String cname = localData.currentClass; + DottedChain pkgName = localData.pkg; Reference outName = new Reference<>(""); - Reference outNs = new Reference<>(""); - Reference outPropNs = new Reference<>(""); + Reference outNs = new Reference<>(DottedChain.EMPTY); + Reference outPropNs = new Reference<>(DottedChain.EMPTY); Reference outPropNsKind = new Reference<>(1); Reference outPropNsIndex = new Reference<>(0); Reference outPropType = new Reference<>(null); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java index cd49a855d..a8efef843 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ClassAVM2Item.java @@ -57,7 +57,7 @@ public class ClassAVM2Item extends AVM2Item implements Block { public List importedClasses; - public String pkg; + public DottedChain pkg; @Override public List> getSubs() { @@ -68,7 +68,7 @@ public class ClassAVM2Item extends AVM2Item implements Block { return ret; } - public ClassAVM2Item(List importedClasses, String pkg, List openedNamespaces, int protectedNs, boolean isDynamic, boolean isFinal, int namespace, String className, GraphTargetItem extendsOp, List implementsOp, List staticInit, boolean staticInitActivation, List sinitVariables, GraphTargetItem constructor, List traits) { + public ClassAVM2Item(List importedClasses, DottedChain pkg, List openedNamespaces, int protectedNs, boolean isDynamic, boolean isFinal, int namespace, String className, GraphTargetItem extendsOp, List implementsOp, List staticInit, boolean staticInitActivation, List sinitVariables, GraphTargetItem constructor, List traits) { super(null, NOPRECEDENCE); this.importedClasses = importedClasses; this.pkg = pkg; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java index cb646c105..6e231f9fd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2.parser.script; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -39,7 +40,7 @@ public class ConstAVM2Item extends AVM2Item { public int line; - public String pkg; + public DottedChain pkg; public int getNamespace() { return namespace; @@ -49,7 +50,7 @@ public class ConstAVM2Item extends AVM2Item { return isStatic; } - public ConstAVM2Item(String pkg, String customNamespace, boolean isStatic, int namespace, String var, GraphTargetItem type, GraphTargetItem value, int line) { + public ConstAVM2Item(DottedChain pkg, String customNamespace, boolean isStatic, int namespace, String var, GraphTargetItem type, GraphTargetItem value, int line) { super(null, NOPRECEDENCE, value); this.pkg = pkg; this.line = line; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java index 6b201fb5b..d6df407d8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -59,9 +60,9 @@ public class FunctionAVM2Item extends AVM2Item { public boolean isInterface; - public String pkg; + public DottedChain pkg; - public FunctionAVM2Item(String pkg, boolean isInterface, boolean needsActivation, int namespace, boolean hasRest, int line, String functionName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + public FunctionAVM2Item(DottedChain pkg, boolean isInterface, boolean needsActivation, int namespace, boolean hasRest, int line, String functionName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { super(null, NOPRECEDENCE); this.pkg = pkg; this.needsActivation = needsActivation; @@ -85,7 +86,7 @@ public class FunctionAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("Function"); + return new TypeItem(new DottedChain("Function")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java index 425f84ddb..5740ab150 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/GetterAVM2Item.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import java.util.List; @@ -25,7 +26,7 @@ import java.util.List; */ public class GetterAVM2Item extends MethodAVM2Item { - public GetterAVM2Item(String pkg, boolean isInterface, String customNamespace, boolean needsActivation, boolean hasRest, int line, boolean override, boolean isFinal, boolean isStatic, int namespace, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + public GetterAVM2Item(DottedChain pkg, boolean isInterface, String customNamespace, boolean needsActivation, boolean hasRest, int line, boolean override, boolean isFinal, boolean isStatic, int namespace, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { super(pkg, isInterface, customNamespace, needsActivation, hasRest, line, override, isFinal, isStatic, namespace, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java index 70d5625e4..d4fb23155 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/InterfaceAVM2Item.java @@ -42,11 +42,11 @@ public class InterfaceAVM2Item extends AVM2Item { public List openedNamespaces; - public String pkg; + public DottedChain pkg; public List importedClasses; - public InterfaceAVM2Item(List importedClasses, String pkg, List openedNamespaces, boolean isFinal, int namespace, String name, List superInterfaces, List traits) { + public InterfaceAVM2Item(List importedClasses, DottedChain pkg, List openedNamespaces, boolean isFinal, int namespace, String name, List superInterfaces, List traits) { super(null, NOPRECEDENCE); this.importedClasses = importedClasses; this.pkg = pkg; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java index bdb836735..80ad71974 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/MethodAVM2Item.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.abc.avm2.parser.script; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; import java.util.List; @@ -37,7 +38,7 @@ public class MethodAVM2Item extends FunctionAVM2Item { public boolean isInterface; - public MethodAVM2Item(String pkg, boolean isInterface, String customNamespace, boolean needsActivation, boolean hasRest, int line, boolean override, boolean isFinal, boolean isStatic, int namespace, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + public MethodAVM2Item(DottedChain pkg, boolean isInterface, String customNamespace, boolean needsActivation, boolean hasRest, int line, boolean override, boolean isFinal, boolean isStatic, int namespace, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { super(pkg, isInterface, needsActivation, namespace, hasRest, line, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); this.isStatic = isStatic; this.override = override; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java index 166cc1ab6..85fc5bb56 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java @@ -36,6 +36,7 @@ import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.NamespaceSet; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -116,10 +117,10 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { */ if (name != null) { return toSourceMerge(localData, generator, - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), dupSetTemp(localData, generator, name_temp), - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), dupSetTemp(localData, generator, ns_temp), //Start get original //getTemp(localData, generator, ns_temp), generateCoerce(generator, "Namespace"), ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(variableName, true), 0, 0, 0, new ArrayList()), true)), @@ -168,8 +169,8 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { if (name == null) { if (assignedValue != null) { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), nameItem, ins(new ConvertSIns()), assignedValue, + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), nameItem, ins(new ConvertSIns()), assignedValue, needsReturn ? dupSetTemp(localData, generator, ret_temp) : null, ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), needsReturn ? getTemp(localData, generator, ret_temp) : null, @@ -177,9 +178,9 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { ); } else { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), call ? dupSetTemp(localData, generator, obj_temp) : null, - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), nameItem, ins(new ConvertSIns()), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), nameItem, ins(new ConvertSIns()), construct ? callargs : null, ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true), construct ? callargs.size() : null), call ? getTemp(localData, generator, obj_temp) : null, @@ -192,8 +193,8 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { } else { if (assignedValue != null) { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), assignedValue, + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), assignedValue, needsReturn ? dupSetTemp(localData, generator, ret_temp) : null, ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), needsReturn ? getTemp(localData, generator, ret_temp) : null, @@ -201,9 +202,9 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { ); } else { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), call ? dupSetTemp(localData, generator, obj_temp) : null, - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem("Namespace")), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), construct ? callargs : null, ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true), construct ? callargs.size() : null), call ? getTemp(localData, generator, obj_temp) : null, diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java index 65e16378d..7f43c043a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PackageAVM2Item.java @@ -33,13 +33,13 @@ public class PackageAVM2Item extends AVM2Item { public List items; - public String packageName; + public DottedChain packageName; public List importedClasses = new ArrayList<>(); public int publicNs = 0; - public PackageAVM2Item(int publicNs, List importedClasses, String packageName, List items) { + public PackageAVM2Item(int publicNs, List importedClasses, DottedChain packageName, List items) { super(null, NOPRECEDENCE); this.publicNs = publicNs; this.importedClasses = importedClasses; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index 99274526a..fe6df1767 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -33,6 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PopIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertDIns; import com.jpexs.decompiler.flash.abc.avm2.model.ApplyTypeAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item; +import com.jpexs.decompiler.flash.abc.avm2.model.InitVectorAVM2Item; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.Multiname; @@ -44,6 +45,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -195,19 +197,19 @@ public class PropertyAVM2Item extends AssignableAVM2Item { List abcs = new ArrayList<>(); abcs.add(abc); abcs.addAll(otherABCs); - if (ttype.equals(new TypeItem("__AS3__.vec.Vector"))) { + if (ttype.equals(new TypeItem(InitVectorAVM2Item.VECTOR_FQN))) { switch ("" + objSubType) { case "int": - ttype = new TypeItem("__AS3__.vec.Vector$int"); + ttype = new TypeItem(InitVectorAVM2Item.VECTOR_INT); break; case "Number": - ttype = new TypeItem("__AS3__.vec.Vector$double"); + ttype = new TypeItem(InitVectorAVM2Item.VECTOR_DOUBLE); break; case "uint": - ttype = new TypeItem("__AS3__.vec.Vector$uint"); + ttype = new TypeItem(InitVectorAVM2Item.VECTOR_UINT); break; default: - ttype = new TypeItem("__AS3__.vec.Vector$object"); + ttype = new TypeItem(InitVectorAVM2Item.VECTOR_OBJECT); } } loopa: @@ -219,8 +221,8 @@ public class PropertyAVM2Item extends AssignableAVM2Item { Multiname m = ii.getName(a.constants); if (multinameToType(ii.name_index, a.constants).equals(ttype)) { Reference outName = new Reference<>(""); - Reference outNs = new Reference<>(""); - Reference outPropNs = new Reference<>(""); + Reference outNs = new Reference<>(DottedChain.EMPTY); + Reference outPropNs = new Reference<>(DottedChain.EMPTY); Reference outPropNsKind = new Reference<>(1); Reference outPropNsIndex = new Reference<>(0); Reference outPropType = new Reference<>(null); @@ -248,7 +250,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { if (t.getName(abc).getName(abc.constants, null, true).equals(propertyName)) { if (t instanceof TraitSlotConst) { TraitSlotConst tsc = (TraitSlotConst) t; - objType = new TypeItem("Function"); + objType = new TypeItem(new DottedChain("Function")); propType = multinameToType(tsc.type_index, abc.constants); propIndex = tsc.name_index; if (!localData.traitUsages.containsKey(b)) { @@ -264,7 +266,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { for (int i = 0; i < openedNamespaces.size(); i++) { int nsindex = openedNamespaces.get(i); int nsKind = abc.constants.constant_namespace.get(openedNamespaces.get(i)).kind; - String nsname = abc.constants.constant_namespace.get(openedNamespaces.get(i)).getName(abc.constants, true); + DottedChain nsname = abc.constants.constant_namespace.get(openedNamespaces.get(i)).getName(abc.constants, true); int name_index = 0; for (int m = 1; m < abc.constants.constant_multiname.size(); m++) { Multiname mname = abc.constants.constant_multiname.get(m); @@ -310,7 +312,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { } for (Trait t : si.traits.traits) { if (t.name_index == name_index) { - objType = new TypeItem("Object"); + objType = new TypeItem(new DottedChain("Object")); propType = AVM2SourceGenerator.getTraitReturnType(abc, t); propIndex = t.name_index; if (t instanceof TraitSlotConst) { @@ -336,8 +338,8 @@ public class PropertyAVM2Item extends AssignableAVM2Item { Multiname n = a.constants.constant_multiname.get(ii.name_index); if (n.getNamespace(a.constants).kind == Namespace.KIND_PACKAGE && n.getNamespace(a.constants).getName(a.constants, true).equals(nsname)) { Reference outName = new Reference<>(""); - Reference outNs = new Reference<>(""); - Reference outPropNs = new Reference<>(""); + Reference outNs = new Reference<>(DottedChain.EMPTY); + Reference outPropNs = new Reference<>(DottedChain.EMPTY); Reference outPropNsKind = new Reference<>(1); Reference outPropNsIndex = new Reference<>(0); Reference outPropType = new Reference<>(null); @@ -622,13 +624,11 @@ public class PropertyAVM2Item extends AssignableAVM2Item { Object obj = object; if (obj == null) { - String cname; - String pkgName = ""; - cname = localData.currentClass; - pkgName = localData.pkg; + String cname = localData.currentClass; + DottedChain pkgName = localData.pkg; Reference outName = new Reference<>(""); - Reference outNs = new Reference<>(""); - Reference outPropNs = new Reference<>(""); + Reference outNs = new Reference<>(DottedChain.EMPTY); + Reference outPropNs = new Reference<>(DottedChain.EMPTY); Reference outPropNsKind = new Reference<>(1); Reference outPropNsIndex = new Reference<>(0); Reference outPropType = new Reference<>(null); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java index 4f7b33ab3..3b57def5d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SetterAVM2Item.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import java.util.List; @@ -25,7 +26,7 @@ import java.util.List; */ public class SetterAVM2Item extends MethodAVM2Item { - public SetterAVM2Item(String pkg, boolean isInterface, String customNamespace, boolean needsActivation, boolean hasRest, int line, boolean override, boolean isFinal, boolean isStatic, int namespace, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { + public SetterAVM2Item(DottedChain pkg, boolean isInterface, String customNamespace, boolean needsActivation, boolean hasRest, int line, boolean override, boolean isFinal, boolean isStatic, int namespace, String methodName, List paramTypes, List paramNames, List paramValues, List body, List subvariables, GraphTargetItem retType) { super(pkg, isInterface, customNamespace, needsActivation, hasRest, line, override, isFinal, isStatic, namespace, methodName, paramTypes, paramNames, paramValues, body, subvariables, retType); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java index 287d4648e..6acb087ad 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2.parser.script; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -39,7 +40,7 @@ public class SlotAVM2Item extends AVM2Item { public int line; - public String pkg; + public DottedChain pkg; public int getNamespace() { return namespace; @@ -49,7 +50,7 @@ public class SlotAVM2Item extends AVM2Item { return isStatic; } - public SlotAVM2Item(String pkg, String customNamespace, boolean isStatic, int namespace, String var, GraphTargetItem type, GraphTargetItem value, int line) { + public SlotAVM2Item(DottedChain pkg, String customNamespace, boolean isStatic, int namespace, String var, GraphTargetItem type, GraphTargetItem value, int line) { super(null, NOPRECEDENCE, value); this.pkg = pkg; this.line = line; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java index 9673872b4..4d3014aa1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceAIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceSIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.ConvertIIns; +import com.jpexs.decompiler.flash.abc.avm2.model.InitVectorAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.IntegerValueAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NanAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.NullAVM2Item; @@ -127,7 +128,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { */ public void appendName(String name) { - this.name.parts.add(name); + this.name = this.name.add(name); } public void setDefinition(boolean definition) { @@ -289,26 +290,25 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { } public GraphTargetItem resolve(GraphTargetItem thisType, List paramTypes, List paramNames, ABC abc, List otherAbcs, List callStack, List variables) throws CompilationException { - List parts = name.parts; if (scopeStack.isEmpty()) { //Everything is multiname property in with command //search for variable for (AssignableAVM2Item a : variables) { if (a instanceof NameAVM2Item) { NameAVM2Item n = (NameAVM2Item) a; - if (n.isDefinition() && parts.get(0).equals(n.getVariableName())) { - NameAVM2Item ret = new NameAVM2Item(n.type, n.line, parts.get(0), null, false, openedNamespaces); + if (n.isDefinition() && name.get(0).equals(n.getVariableName())) { + NameAVM2Item ret = new NameAVM2Item(n.type, n.line, name.get(0), null, false, openedNamespaces); ret.setSlotScope(n.getSlotScope()); ret.setSlotNumber(n.getSlotNumber()); ret.setRegNumber(n.getRegNumber()); resolved = ret; - for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); - if (i == parts.size() - 1) { + for (int i = 1; i < name.size(); i++) { + resolved = new PropertyAVM2Item(resolved, name.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); + if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } } - if (parts.size() == 1) { + if (name.size() == 1) { ret.setAssignedValue(assignedValue); } ret.setNs(n.getNs()); @@ -321,16 +321,16 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { for (DottedChain imp : importedClasses) { String impName = imp.getLast(); - if (impName.equals(parts.get(0))) { + if (impName.equals(name.get(0))) { TypeItem ret = new TypeItem(imp); resolved = ret; - for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); - if (i == parts.size() - 1) { + for (int i = 1; i < name.size(); i++) { + resolved = new PropertyAVM2Item(resolved, name.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); + if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } } - if (parts.size() == 1 && assignedValue != null) { + if (name.size() == 1 && assignedValue != null) { throw new CompilationException("Cannot assign type", line); } return resolvedRoot = ret; @@ -341,26 +341,26 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { List allAbcs = new ArrayList<>(); allAbcs.add(abc); allAbcs.addAll(otherAbcs); - for (int i = 0; i < parts.size(); i++) { - DottedChain fname = new DottedChain(parts.subList(0, i + 1)); //Helper.joinStrings(parts.subList(0, i + 1), "."); + for (int i = 0; i < name.size(); i++) { + DottedChain fname = name.subChain(i + 1); for (ABC a : allAbcs) { for (int c = 0; c < a.instance_info.size(); c++) { if (a.instance_info.get(c).deleted) { continue; } if (a.instance_info.get(c).name_index > 0 && fname.equals(a.instance_info.get(c).getName(a.constants).getNameWithNamespace(a.constants))) { - if (!subtypes.isEmpty() && parts.size() > i + 1) { + if (!subtypes.isEmpty() && name.size() > i + 1) { continue; } TypeItem ret = new TypeItem(fname); resolved = ret; - for (int j = i + 1; j < parts.size(); j++) { - resolved = new PropertyAVM2Item(resolved, parts.get(j), abc, otherAbcs, openedNamespaces, new ArrayList<>()); - if (j == parts.size() - 1) { + for (int j = i + 1; j < name.size(); j++) { + resolved = new PropertyAVM2Item(resolved, name.get(j), abc, otherAbcs, openedNamespaces, new ArrayList<>()); + if (j == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } } - if (parts.size() == i + 1 && assignedValue != null) { + if (name.size() == i + 1 && assignedValue != null) { throw new CompilationException("Cannot assign type", line); } @@ -382,10 +382,10 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { continue; } if ((a.instance_info.get(c).getName(a.constants) != null && a == abc && a.instance_info.get(c).getName(a.constants).namespace_index == ni) - || (ons.kind != Namespace.KIND_PRIVATE && a.instance_info.get(c).getName(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants).hasName(ons.getName(abc.constants, true), a.constants))) { + || (ons.kind != Namespace.KIND_PRIVATE && a.instance_info.get(c).getName(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants).hasName(ons.getName(abc.constants, true).toRawString(), a.constants))) { String cname = a.instance_info.get(c).getName(a.constants).getName(a.constants, null, true); - if (parts.get(0).equals(cname)) { - if (!subtypes.isEmpty() && parts.size() > 1) { + if (name.get(0).equals(cname)) { + if (!subtypes.isEmpty() && name.size() > 1) { continue; } TypeItem ret = new TypeItem(a.instance_info.get(c).getName(a.constants).getNameWithNamespace(a.constants)); @@ -399,13 +399,13 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { ret.subtypes.add(st.fullTypeName); }*/ resolved = ret; - for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); - if (i == parts.size() - 1) { + for (int i = 1; i < name.size(); i++) { + resolved = new PropertyAVM2Item(resolved, name.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); + if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } } - if (parts.size() == 1 && assignedValue != null) { + if (name.size() == 1 && assignedValue != null) { throw new CompilationException("Cannot assign type", line); } @@ -416,26 +416,26 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { } } - if (parts.get(0).equals("this") || parts.get(0).equals("super")) { + if (name.get(0).equals("this") || name.get(0).equals("super")) { if (thisType == null) { throw new CompilationException("Cannot use this in that context", line); } - NameAVM2Item ret = new NameAVM2Item(thisType, line, parts.get(0), null, false, openedNamespaces); + NameAVM2Item ret = new NameAVM2Item(thisType, line, name.get(0), null, false, openedNamespaces); resolved = ret; - for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); - if (i == parts.size() - 1) { + for (int i = 1; i < name.size(); i++) { + resolved = new PropertyAVM2Item(resolved, name.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); + if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } } - if (parts.size() == 1) { + if (name.size() == 1) { ret.setAssignedValue(assignedValue); } return resolvedRoot = ret; } - if (paramNames.contains(parts.get(0)) || parts.get(0).equals("arguments")) { - int ind = paramNames.indexOf(parts.get(0)); + if (paramNames.contains(name.get(0)) || name.get(0).equals("arguments")) { + int ind = paramNames.indexOf(name.get(0)); GraphTargetItem t = TypeItem.UNBOUNDED; if (ind == -1) { @@ -443,22 +443,22 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { t = paramTypes.get(ind); } //else rest parameter - GraphTargetItem ret = new NameAVM2Item(t, line, parts.get(0), null, false, openedNamespaces); + GraphTargetItem ret = new NameAVM2Item(t, line, name.get(0), null, false, openedNamespaces); resolved = ret; - for (int i = 1; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); - if (i == parts.size() - 1) { + for (int i = 1; i < name.size(); i++) { + resolved = new PropertyAVM2Item(resolved, name.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<>()); + if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } } - if (parts.size() == 1) { + if (name.size() == 1) { ((NameAVM2Item) ret).setAssignedValue(assignedValue); } return resolvedRoot = ret; } - if (/*!subtypes.isEmpty() && */parts.size() == 1 && parts.get(0).equals("Vector")) { - TypeItem ret = new TypeItem("__AS3__.vec.Vector"); + if (/*!subtypes.isEmpty() && */name.size() == 1 && name.get(0).equals("Vector")) { + TypeItem ret = new TypeItem(InitVectorAVM2Item.VECTOR_FQN); /*for (String s : subtypes) { UnresolvedAVM2Item su = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, true, null, line, s, null, openedNamespaces); su.resolve(thisType, paramTypes, paramNames, abc, otherAbcs, callStack, variables); @@ -477,13 +477,13 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { } resolved = null; GraphTargetItem ret = null; - for (int i = 0; i < parts.size(); i++) { - resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, callStack); + for (int i = 0; i < name.size(); i++) { + resolved = new PropertyAVM2Item(resolved, name.get(i), abc, otherAbcs, openedNamespaces, callStack); if (ret == null) { ((PropertyAVM2Item) resolved).scopeStack = scopeStack; ret = resolved; } - if (i == parts.size() - 1) { + if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).setAssignedValue(assignedValue); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java index c881a6a72..169dda052 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -54,7 +55,7 @@ public class XMLAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("XML"); + return new TypeItem(new DottedChain("XML")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java index 7f18cf4f2..b0b3eec3b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.avm2.model.AVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -55,7 +56,7 @@ public class XMLFilterAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem("String"); + return new TypeItem(new DottedChain("String")); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java index f6925af4e..5e1298dfa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/InstanceInfo.java @@ -100,7 +100,7 @@ public class InstanceInfo { writer.hilightSpecial(abc.constants.getMultiname(name_index).getName(abc.constants, null/* No full names here*/, false), HighlightSpecialType.CLASS_NAME); if (super_index > 0) { - String typeName = abc.constants.getMultiname(super_index).getNameWithNamespace(abc.constants).toPrintableString(); + String typeName = abc.constants.getMultiname(super_index).getNameWithNamespace(abc.constants).toPrintableString(true); writer.appendNoHilight(" extends "); writer.hilightSpecial(abc.constants.getMultiname(super_index).getName(abc.constants, fullyQualifiedNames, false), HighlightSpecialType.TYPE_NAME, typeName); } @@ -114,7 +114,7 @@ public class InstanceInfo { if (i > 0) { writer.append(", "); } - String typeName = abc.constants.getMultiname(interfaces[i]).getNameWithNamespace(abc.constants).toPrintableString(); + String typeName = abc.constants.getMultiname(interfaces[i]).getNameWithNamespace(abc.constants).toPrintableString(true); writer.hilightSpecial(abc.constants.getMultiname(interfaces[i]).getName(abc.constants, fullyQualifiedNames, false), HighlightSpecialType.TYPE_NAME, typeName); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java index 5e32ff6c0..dda32b07e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java @@ -311,7 +311,7 @@ public class MethodInfo { } String ptype = "*"; if (param_types[i] > 0) { - ptype = constants.getMultiname(param_types[i]).getNameWithNamespace(constants).toPrintableString(); + ptype = constants.getMultiname(param_types[i]).getNameWithNamespace(constants).toPrintableString(true); } HighlightData pdata = new HighlightData(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index 2189a7a49..477451686 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.types.annotations.Internal; import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.Helper; -import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -189,7 +188,7 @@ public class Multiname { } int type = constants.getNamespace(index).kind; int name_index = constants.getNamespace(index).name_index; - String name = name_index == 0 ? null : constants.getNamespace(index).getName(constants, true); + String name = name_index == 0 ? null : constants.getNamespace(index).getName(constants, true).toRawString(); int sub = -1; for (int n = 1; n < constants.getNamespaceCount(); n++) { if (constants.getNamespace(n).kind == type && constants.getNamespace(n).name_index == name_index) { @@ -296,27 +295,19 @@ public class Multiname { String name = constants.getString(name_index); if (fullyQualifiedNames != null && fullyQualifiedNames.contains(name)) { DottedChain dc = getNameWithNamespace(constants); - return raw ? dc.toString() : dc.toPrintableString(); + return raw ? dc.toString() : dc.toPrintableString(true); } return (isAttribute() ? "@" : "") + (raw ? name : IdentifiersDeobfuscation.printIdentifier(true, name)); } } public DottedChain getNameWithNamespace(AVM2ConstantPool constants) { - StringBuilder ret = new StringBuilder(); Namespace ns = getNamespace(constants); - List chain = new ArrayList<>(); + String name = getName(constants, null, true); if (ns != null) { - String nsname = ns.getName(constants, true); - if (nsname != null && !nsname.isEmpty()) { - String parts[] = nsname.split("\\."); - for (String p : parts) { - chain.add(p); - } - } + return ns.getName(constants, true).add(name); } - chain.add(getName(constants, null, true)); - return new DottedChain(chain); + return new DottedChain(name); } public Namespace getNamespace(AVM2ConstantPool constants) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java index 37bdb280b..3c9556e68 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java @@ -16,10 +16,10 @@ */ package com.jpexs.decompiler.flash.abc.types; -import com.jpexs.decompiler.flash.IdentifiersDeobfuscation; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.types.annotations.Internal; +import com.jpexs.decompiler.graph.DottedChain; public class Namespace { @@ -94,7 +94,7 @@ public class Namespace { } public String toString(AVM2ConstantPool constants) { - return getName(constants, false); + return getName(constants, false).toPrintableString(true); } public String getNameWithKind(AVM2ConstantPool constants) { @@ -114,14 +114,12 @@ public class Namespace { return kindStr; } - public String getName(AVM2ConstantPool constants, boolean raw) { + public DottedChain getName(AVM2ConstantPool constants, boolean raw) { if (name_index == 0) { - return null; + return DottedChain.EMPTY; } - if (raw) { - return constants.getString(name_index); - } - return IdentifiersDeobfuscation.printNamespace(true, constants.getString(name_index)); + + return constants.getDottedChain(name_index); } public boolean hasName(String name, AVM2ConstantPool constants) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java index a11dc73e5..b1c95340a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java @@ -73,7 +73,7 @@ public class ScriptInfo { Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE_INTERNAL) || (ns.kind == Namespace.KIND_PACKAGE)) { - String packageName = ns.getName(abc.constants, false); // assume not null package + DottedChain packageName = ns.getName(abc.constants, false); // assume not null package String objectName = name.getName(abc.constants, null, false); List traitIndices = new ArrayList<>(); @@ -83,7 +83,7 @@ public class ScriptInfo { otherTraits.clear(); } - if (packagePrefix == null || packageName.startsWith(packagePrefix)) { + if (packagePrefix == null || packageName.toPrintableString(true).startsWith(packagePrefix)) { ClassPath cp = new ClassPath(packageName, objectName); ret.add(new ScriptPack(cp, abc, allAbcs, scriptIndex, traitIndices)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java index 097adcda7..9993a2bb6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java @@ -157,7 +157,7 @@ public class ValueKind { case CONSTANT_ExplicitNamespace: case CONSTANT_StaticProtectedNs: case CONSTANT_PrivateNs: - ret = "\"" + constants.getNamespace(value_index).getName(constants, true) + "\""; //assume not null name + ret = "\"" + constants.getNamespace(value_index).getName(constants, true).toRawString() + "\""; //assume not null name break; } return ret; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index c7a68e6a4..23c90a3ec 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -140,7 +140,7 @@ public abstract class Trait implements Cloneable, Serializable { public GraphTextWriter toStringPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { - String nsname = ns.getName(abc.constants, false); + String nsname = ns.getName(abc.constants, false).toPrintableString(true); writer.appendNoHilight("package"); if (!nsname.isEmpty()) { writer.appendNoHilight(" " + nsname); //assume not null name @@ -156,7 +156,7 @@ public abstract class Trait implements Cloneable, Serializable { public void convertPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { - String nsname = ns.getName(abc.constants, false); + String nsname = ns.getName(abc.constants, false).toPrintableString(true); convert(parent, path + nsname, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); } } @@ -183,8 +183,8 @@ public abstract class Trait implements Cloneable, Serializable { public ClassPath getPath(ABC abc) { Multiname name = getName(abc); Namespace ns = name.getNamespace(abc.constants); - String packageName = ns.getName(abc.constants, false); - String objectName = name.getName(abc.constants, null, false); + DottedChain packageName = ns.getName(abc.constants, false); + String objectName = name.getName(abc.constants, null, true); return new ClassPath(packageName, objectName); //assume not null name } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 7eb4e710c..6d38d1080 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other.FindPropertyStrict import com.jpexs.decompiler.flash.abc.avm2.instructions.other.GetLexIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.AsTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceIns; +import com.jpexs.decompiler.flash.abc.avm2.model.InitVectorAVM2Item; import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.ClassInfo; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; @@ -95,13 +96,13 @@ public class TraitClass extends Trait implements TraitWithSlot { return "Class " + abc.constants.getMultiname(name_index).toString(abc.constants, fullyQualifiedNames) + " slot=" + slot_id + " class_info=" + class_info + " metadata=" + Helper.intArrToString(metadata); } - private boolean parseUsagesFromNS(ABC abc, List imports, List uses, int namespace_index, String ignorePackage, String name) { + private boolean parseUsagesFromNS(ABC abc, List imports, List uses, int namespace_index, DottedChain ignorePackage, String name) { Namespace ns = abc.constants.getNamespace(namespace_index); if (name.isEmpty()) { name = "*"; } - String nsname = ns.getName(abc.constants, ns.kind == Namespace.KIND_NAMESPACE); - DottedChain newimport = nsname == null ? new DottedChain() : new DottedChain(nsname.split("\\.")); + boolean raw = ns.kind == Namespace.KIND_NAMESPACE; + DottedChain newimport = ns.getName(abc.constants, raw); /*if ((ns.kind != Namespace.KIND_PACKAGE) && (ns.kind != Namespace.KIND_NAMESPACE) && (ns.kind != Namespace.KIND_STATIC_PROTECTED)) { @@ -111,23 +112,21 @@ public class TraitClass extends Trait implements TraitWithSlot { DottedChain oldimport = newimport; newimport = new DottedChain(); for (ABCContainerTag abcTag : abc.getAbcTags()) { - DottedChain newname = abcTag.getABC().nsValueToName(oldimport == null ? null : oldimport.toString()); - if (newname.toString().equals("-")) { + DottedChain newname = abcTag.getABC().nsValueToName(oldimport); + if (newname.size() == 1 && newname.get(0).equals("-")) { return true; } - if (!newname.toString().isEmpty()) { + + if (!newname.isEmpty()) { newimport = newname; break; } } - if (newimport.parts.isEmpty()) { - newimport = oldimport; - newimport.parts.add(name); + if (newimport.isEmpty()) { + newimport = oldimport.add(name); } - if (!newimport.parts.isEmpty() && newimport.toString().isEmpty()) { - newimport.parts.clear(); - } - if (newimport.parts.isEmpty()) { + + if (newimport.isEmpty()) { /* if(ns.kind==Namespace.KIND_PACKAGE){ newimport+=".*"; }*/ @@ -141,7 +140,7 @@ public class TraitClass extends Trait implements TraitWithSlot { String usname = newimport.getLast(); if (ns.kind == Namespace.KIND_PACKAGE) { if (!pkg.equals(ignorePackage)) { - if (!pkg.toString().equals("__AS3__.vec")) { //Automatic import + if (!pkg.equals(InitVectorAVM2Item.VECTOR_PACKAGE)) { //Automatic import imports.add(newimport); } } @@ -163,39 +162,35 @@ public class TraitClass extends Trait implements TraitWithSlot { return false; } - private void parseImportsUsagesFromNS(ABC abc, List imports, List uses, int namespace_index, String ignorePackage, String name) { + private void parseImportsUsagesFromNS(ABC abc, List imports, List uses, int namespace_index, DottedChain ignorePackage, String name) { Namespace ns = abc.constants.getNamespace(namespace_index); if (name.isEmpty()) { name = "*"; } - String niS = ns.getName(abc.constants, false); - DottedChain newimport = niS == null ? new DottedChain() : new DottedChain(niS.split("\\.")); + DottedChain newimport = ns.getName(abc.constants, false); if (parseUsagesFromNS(abc, imports, uses, namespace_index, ignorePackage, name)) { return; } else if ((ns.kind != Namespace.KIND_PACKAGE) && (ns.kind != Namespace.KIND_PACKAGE_INTERNAL)) { return; } - if (newimport.parts.isEmpty()) { - newimport = new DottedChain(""); - } - newimport.parts.add(name); + newimport = newimport.add(name); //WUT? /*if (newimport.contains(":")) { return; }*/ if (!imports.contains(newimport)) { DottedChain pkg = newimport.getWithoutLast(); //.substring(0, newimport.lastIndexOf('.')); - if (pkg.toString().equals("__AS3__.vec")) { //special case - is imported always + if (pkg.equals(InitVectorAVM2Item.VECTOR_PACKAGE)) { //special case - is imported always return; } - if (!pkg.toString().equals(ignorePackage)) { + if (!pkg.equals(ignorePackage)) { imports.add(newimport); } } //} } - private void parseUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, String ignorePackage, List fullyQualifiedNames) { + private void parseUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, DottedChain ignorePackage, List fullyQualifiedNames) { if (m != null) { if (m.kind == Multiname.TYPENAME) { if (m.qname_index != 0) { @@ -226,7 +221,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private void parseImportsUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, String ignorePackage, List fullyQualifiedNames) { + private void parseImportsUsagesFromMultiname(ABC abc, List imports, List uses, Multiname m, DottedChain ignorePackage, List fullyQualifiedNames) { if (m != null) { if (m.kind == Multiname.TYPENAME) { if (m.qname_index != 0) { @@ -240,7 +235,7 @@ public class TraitClass extends Trait implements TraitWithSlot { return; } Namespace ns = m.getNamespace(abc.constants); - String name = m.getName(abc.constants, fullyQualifiedNames, false); + String name = m.getName(abc.constants, fullyQualifiedNames, true); NamespaceSet nss = m.getNamespaceSet(abc.constants); if (ns != null) { parseImportsUsagesFromNS(abc, imports, uses, m.namespace_index, ignorePackage, name); @@ -253,7 +248,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private void parseImportsUsagesFromMethodInfo(ABC abc, int method_index, List imports, List uses, String ignorePackage, List fullyQualifiedNames, List visitedMethods) { + private void parseImportsUsagesFromMethodInfo(ABC abc, int method_index, List imports, List uses, DottedChain ignorePackage, List fullyQualifiedNames, List visitedMethods) { if ((method_index < 0) || (method_index >= abc.method_info.size())) { return; } @@ -274,7 +269,7 @@ public class TraitClass extends Trait implements TraitWithSlot { } for (AVM2Instruction ins : body.getCode().code) { if (ins.definition instanceof AlchemyTypeIns) { - DottedChain nimport = new DottedChain((AlchemyTypeIns.ALCHEMY_PACKAGE + "." + ins.definition.instructionName).split("\\.")); + DottedChain nimport = AlchemyTypeIns.ALCHEMY_PACKAGE.add(ins.definition.instructionName); if (!imports.contains(nimport)) { imports.add(nimport); } @@ -312,13 +307,13 @@ public class TraitClass extends Trait implements TraitWithSlot { } } - private void parseImportsUsagesFromTraits(ABC abc, Traits ts, List imports, List uses, String ignorePackage, List fullyQualifiedNames) { + private void parseImportsUsagesFromTraits(ABC abc, Traits ts, List imports, List uses, DottedChain ignorePackage, List fullyQualifiedNames) { for (Trait t : ts.traits) { parseImportsUsagesFromTrait(abc, t, imports, uses, ignorePackage, fullyQualifiedNames); } } - private void parseImportsUsagesFromTrait(ABC abc, Trait t, List imports, List uses, String ignorePackage, List fullyQualifiedNames) { + private void parseImportsUsagesFromTrait(ABC abc, Trait t, List imports, List uses, DottedChain ignorePackage, List fullyQualifiedNames) { if (t instanceof TraitMethodGetterSetter) { TraitMethodGetterSetter tm = (TraitMethodGetterSetter) t; parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(tm.name_index), ignorePackage, fullyQualifiedNames); @@ -339,7 +334,7 @@ public class TraitClass extends Trait implements TraitWithSlot { ClassInfo classInfo = abc.class_info.get(class_info); InstanceInfo instanceInfo = abc.instance_info.get(class_info); - String packageName = instanceInfo.getName(abc.constants).getNamespace(abc.constants).getName(abc.constants, false); //assume not null name + DottedChain packageName = instanceInfo.getName(abc.constants).getNamespace(abc.constants).getName(abc.constants, false); //assume not null name parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(instanceInfo.name_index), packageName, fullyQualifiedNames); @@ -380,13 +375,13 @@ public class TraitClass extends Trait implements TraitWithSlot { InstanceInfo instanceInfo = abc.instance_info.get(class_info); Multiname instanceInfoMultiname = instanceInfo.getName(abc.constants); String instanceInfoName = instanceInfoMultiname.getName(abc.constants, fullyQualifiedNames, false); - String packageName = instanceInfoMultiname.getNamespace(abc.constants).getName(abc.constants, false); //assume not null name + DottedChain packageName = instanceInfoMultiname.getNamespace(abc.constants).getName(abc.constants, false); //assume not null name List namesInThisPackage = new ArrayList<>(); for (ABCContainerTag tag : abc.getAbcTags()) { for (ScriptInfo si : tag.getABC().script_info) { for (Trait t : si.traits.traits) { ClassPath classPath = t.getPath(tag.getABC()); - String pkg = classPath.packageStr == null ? "" : classPath.packageStr; + DottedChain pkg = classPath.packageStr == null ? DottedChain.EMPTY : classPath.packageStr; if (pkg.equals(packageName)) { namesInThisPackage.add(classPath.className); } @@ -406,7 +401,7 @@ public class TraitClass extends Trait implements TraitWithSlot { for (DottedChain ipath : imports) { String name = ipath.getLast(); DottedChain pkg = ipath.getWithoutLast(); - if (importnames.contains(name) || ((!pkg.parts.isEmpty()) && isBuiltInClass(name))) { + if (importnames.contains(name) || isBuiltInClass(name)) { fullyQualifiedNames.add(new DottedChain(name)); } else { importnames.add(name); @@ -429,13 +424,12 @@ public class TraitClass extends Trait implements TraitWithSlot { for (int i = 0; i < imports.size(); i++) { DottedChain imp = imports.get(i); - DottedChain pkg = imp.getWithoutLast(); //imp.substring(0, imp.lastIndexOf('.')); - String name = imp.getLast();//imp.substring(imp.lastIndexOf('.') + 1); + DottedChain pkg = imp.getWithoutLast(); + String name = imp.getLast(); if (name.equals("*")) { continue; } - DottedChain dAll = new DottedChain(pkg.parts); - dAll.parts.add("*"); + DottedChain dAll = pkg.add("*"); if (imports.contains(dAll)) { imports.remove(i); i--; @@ -444,8 +438,8 @@ public class TraitClass extends Trait implements TraitWithSlot { boolean hasImport = false; for (DottedChain imp : imports) { - if (!imp.parts.get(0).isEmpty()) { //No imports from root package - writer.appendNoHilight("import " + imp + ";").newLine(); + if (imp.size() > 1) { //No imports from root package + writer.appendNoHilight("import " + imp.toPrintableString(true) + ";").newLine(); hasImport = true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java index 56f98f9a9..db6d24aac 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/ClassNameMultinameUsage.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -30,6 +30,6 @@ public class ClassNameMultinameUsage extends InsideClassMultinameUsage implement @Override public String toString() { - return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants).toPrintableString(); + return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants).toPrintableString(true); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java index 6244374aa..6baa8bef7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/usages/InsideClassMultinameUsage.java @@ -36,7 +36,7 @@ public abstract class InsideClassMultinameUsage extends MultinameUsage { @Override public String toString() { - return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants).toPrintableString(); + return "class " + abc.constants.getMultiname(abc.instance_info.get(classIndex).name_index).getNameWithNamespace(abc.constants).toPrintableString(true); } public int getMultinameIndex() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 96d4067ad..53c4bafe9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -201,31 +201,21 @@ public class DoInitActionTag extends Tag implements CharacterIdTag, ASMSource { @Override public String getExportFileName() { - String expName = swf.getExportName(spriteId); - if ((expName == null) || expName.isEmpty()) { + String expName = swf == null ? "" : swf.getExportName(spriteId); + if (expName == null || expName.isEmpty()) { return super.getExportFileName(); } - String[] pathParts; - if (expName.contains(".")) { - pathParts = expName.split("\\."); - } else { - pathParts = new String[]{expName}; - } + String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName}; return pathParts[pathParts.length - 1]; } @Override public String getName() { String expName = swf == null ? "" : swf.getExportName(spriteId); - if ((expName == null) || expName.isEmpty()) { + if (expName == null || expName.isEmpty()) { return super.getName(); } - String[] pathParts; - if (expName.contains(".")) { - pathParts = expName.split("\\."); - } else { - pathParts = new String[]{expName}; - } + String[] pathParts = expName.contains(".") ? expName.split("\\.") : new String[]{expName}; return pathParts[pathParts.length - 1]; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java index 9c8bcca86..adc809f6d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java @@ -17,80 +17,144 @@ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.IdentifiersDeobfuscation; +import com.jpexs.helpers.Helper; +import java.io.File; +import java.io.Serializable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Objects; /** * * @author JPEXS */ -public class DottedChain { +public class DottedChain implements Serializable { - public final List parts; + public static final DottedChain EMPTY = new DottedChain(); + + private final String[] parts; + + private final int hash; public DottedChain(List parts) { - this.parts = new ArrayList<>(parts); + this.parts = parts.toArray(new String[parts.size()]); + hash = calcHash(); } public DottedChain(String... parts) { - this.parts = new ArrayList<>(); - for (int i = 0; i < parts.length; i++) { - this.parts.add(parts[i]); - } + this.parts = parts; + hash = calcHash(); + } + + public boolean isEmpty() { + return parts.length == 0; + } + + public int size() { + return parts.length; + } + + public String get(int index) { + return parts[index]; + } + + public DottedChain subChain(int count) { + String[] nparts = Arrays.copyOfRange(parts, 0, count); + return new DottedChain(nparts); } public String getLast() { - if (parts.isEmpty()) { + if (parts.length == 0) { return ""; } else { - return parts.get(parts.size() - 1); + return parts[parts.length - 1]; } } public DottedChain getWithoutLast() { - List nparts = new ArrayList<>(parts); - if (!nparts.isEmpty()) { - nparts.remove(nparts.size() - 1); + if (parts.length < 2) { + return EMPTY; } + + String[] nparts = Arrays.copyOfRange(parts, 0, parts.length - 1); return new DottedChain(nparts); } - public String toPrintableString() { + public DottedChain add(String name) { + String[] nparts = new String[parts.length + 1]; + if (parts.length > 0) { + System.arraycopy(parts, 0, nparts, 0, parts.length); + } + + nparts[nparts.length - 1] = name; + return new DottedChain(nparts); + } + + private String toString(boolean as3, boolean raw) { + if (parts.length == 0 || (parts.length == 1 && parts[0].isEmpty())) { + return ""; + } + StringBuilder ret = new StringBuilder(); - for (int i = 0; i < parts.size(); i++) { + for (int i = 0; i < parts.length; i++) { if (i > 0) { ret.append("."); } - ret.append(IdentifiersDeobfuscation.printIdentifier(true, parts.get(0))); + + String part = parts[i]; + boolean lastStar = i == parts.length - 1 && "*".equals(part); + ret.append((raw || lastStar) ? part : IdentifiersDeobfuscation.printIdentifier(as3, part)); } return ret.toString(); } + public String toFilePath() { + if (parts.length == 0 || (parts.length == 1 && parts[0].isEmpty())) { + return ""; + } + + StringBuilder ret = new StringBuilder(); + for (int i = 0; i < parts.length; i++) { + if (i > 0) { + ret.append(File.separator); + } + + ret.append(Helper.makeFileName(IdentifiersDeobfuscation.printIdentifier(true, parts[i]))); + } + return ret.toString(); + } + + public List toList() { + return new ArrayList<>(Arrays.asList(parts)); + } + + public String toPrintableString(boolean as3) { + return toString(as3, false); + } + + public String toRawString() { + return toString(false/*ignored*/, true); + } + @Override public String toString() { - StringBuilder ret = new StringBuilder(); - for (int i = 0; i < parts.size(); i++) { - if (i > 0) { - ret.append("."); - } - ret.append(parts.get(i)); - } - return ret.toString(); + return toRawString(); } @Override public int hashCode() { - int hash = 3; - hash = 89 * hash + Objects.hashCode(parts); return hash; } + private int calcHash() { + if (parts.length > 0 && parts[0].equals("§§")) { + int a = 1; + } + return Arrays.hashCode(parts); + } + @Override public boolean equals(Object obj) { - if (obj instanceof String) { - obj = new DottedChain(((String) obj).split("\\.")); - } if (obj == null) { return false; } @@ -98,7 +162,7 @@ public class DottedChain { return false; } final DottedChain other = (DottedChain) obj; - if (!Objects.equals(parts, other.parts)) { + if (!Arrays.equals(parts, other.parts)) { return false; } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java index 4f18a478f..880eb0ede 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java @@ -32,11 +32,11 @@ import java.util.Objects; */ public class TypeItem extends GraphTargetItem { - public static TypeItem BOOLEAN = new TypeItem("Boolean"); + public static TypeItem BOOLEAN = new TypeItem(new DottedChain("Boolean")); - public static TypeItem STRING = new TypeItem("String"); + public static TypeItem STRING = new TypeItem(new DottedChain("String")); - public static TypeItem ARRAY = new TypeItem("Array"); + public static TypeItem ARRAY = new TypeItem(new DottedChain("Array")); public static UnboundedTypeItem UNBOUNDED = new UnboundedTypeItem(); @@ -79,10 +79,11 @@ public class TypeItem extends GraphTargetItem { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException { + boolean as3 = localData.constantsAvm2 != null; if (localData.fullyQualifiedNames.contains(fullTypeName)) { - writer.hilightSpecial(IdentifiersDeobfuscation.printNamespace(localData.constantsAvm2 != null, fullTypeName.toPrintableString()), HighlightSpecialType.TYPE_NAME, fullTypeName.toPrintableString()); + writer.hilightSpecial(fullTypeName.toPrintableString(as3), HighlightSpecialType.TYPE_NAME, fullTypeName.toPrintableString(as3)); } else { - writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(localData.constantsAvm2 != null, fullTypeName.getLast()), HighlightSpecialType.TYPE_NAME, fullTypeName.toPrintableString()); + writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(as3, fullTypeName.getLast()), HighlightSpecialType.TYPE_NAME, fullTypeName.toPrintableString(as3)); } return writer; @@ -100,7 +101,7 @@ public class TypeItem extends GraphTargetItem { @Override public String toString() { - return fullTypeName.toString(); + return fullTypeName.toRawString(); } @Override diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java b/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java index c7d2855a0..2fb6b3a46 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ClassesListTreeModel.java @@ -24,9 +24,9 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.timeline.AS3Package; import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem; +import com.jpexs.decompiler.graph.DottedChain; import java.util.ArrayList; import java.util.List; -import java.util.StringTokenizer; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; import javax.swing.tree.TreeModel; @@ -81,17 +81,16 @@ public class ClassesListTreeModel extends AS3ClassTreeItem implements TreeModel continue; } - String packageStr = item.getClassPath().packageStr; + DottedChain packageStr = item.getClassPath().packageStr; AS3Package pkg = ensurePackage(packageStr); pkg.addScriptPack(item); } } - private AS3Package ensurePackage(String packageStr) { - StringTokenizer st = new StringTokenizer(packageStr, "."); + private AS3Package ensurePackage(DottedChain packageStr) { AS3Package parent = root; - while (st.hasMoreTokens()) { - String pathElement = st.nextToken(); + for (int i = 0; i < packageStr.size(); i++) { + String pathElement = packageStr.get(i); AS3Package pkg = parent.getSubPackage(pathElement); if (pkg == null) { pkg = new AS3Package(pathElement, swf); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 0d60adc6b..06085ee73 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -520,7 +520,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL if (tm != null) { String name = ""; if (classIndex > -1) { - name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString(); + name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString(true); } Trait currentTrait = null; @@ -571,7 +571,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL } currentMethodHighlight = null; currentTrait = null; - String name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString(); + String name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants).toPrintableString(true); currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java b/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java index 21a398abd..94253c59b 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/UsageFrame.java @@ -92,7 +92,7 @@ public class UsageFrame extends AppDialog implements MouseListener { cont.add(new JScrollPane(usageList), BorderLayout.CENTER); cont.add(buttonsPanel, BorderLayout.SOUTH); setSize(400, 300); - setTitle((definitions ? translate("dialog.title.declaration") : translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants).toPrintableString()); + setTitle((definitions ? translate("dialog.title.declaration") : translate("dialog.title")) + abc.constants.getMultiname(multinameIndex).getNameWithNamespace(abc.constants).toPrintableString(true)); View.centerScreen(this); View.setWindowIcon(this); } @@ -133,7 +133,7 @@ public class UsageFrame extends AppDialog implements MouseListener { settrait.run(); } else { abcPanel.decompiledTextArea.addScriptListener(settrait); - abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants).toPrintableString()); + abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.abc.instance_info.get(icu.classIndex).getName(abcPanel.abc.constants).getNameWithNamespace(abcPanel.abc.constants).toPrintableString(true)); } } } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java index ac0d16d04..21496b776 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.gui.abc.tablemodels; import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.graph.DottedChain; import javax.swing.event.TableModelListener; import javax.swing.table.TableModel; @@ -124,11 +125,11 @@ public class NamespaceTableModel implements TableModel { if (rowIndex == 0) { return "-"; } - String val = abc.constants.getNamespace(rowIndex).getName(abc.constants, true); - if (val == null) { - val = "-"; + DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants, true); + if (chain == null) { + return "-"; } - return val; + return chain.toRawString(); default: return null; } diff --git a/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java b/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java index 6a6abcf3f..179f51838 100644 --- a/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java +++ b/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java @@ -54,7 +54,7 @@ public class DebuggerTools { for (ABCContainerTag ac : swf.getAbcList()) { ABC a = ac.getABC(); for (ScriptPack m : a.getScriptPacks(DEBUGGER_PACKAGE, allAbcList)) { - if (isDebuggerClass(m.getClassPath().packageStr, null)) { + if (isDebuggerClass(m.getClassPath().packageStr.toRawString(), null)) { return m; } } @@ -87,7 +87,7 @@ public class DebuggerTools { public static void replaceTraceCalls(SWF swf, String fname) { if (hasDebugger(swf)) { - String debuggerPkg = getDebuggerScriptPack(swf).getClassPath().packageStr; + String debuggerPkg = getDebuggerScriptPack(swf).getClassPath().packageStr.toRawString(); //change trace to fname for (ABCContainerTag ct : swf.getAbcList()) { ABC a = ct.getABC(); From af3553e38768aae68c89ac1d54dff710b6e27b98 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 21:11:08 +0200 Subject: [PATCH 07/25] more DottedChains --- .../com/jpexs/decompiler/flash/abc/ABC.java | 9 +- .../decompiler/flash/abc/ScriptPack.java | 2 +- .../flash/abc/avm2/AVM2Deobfuscation.java | 8 +- .../avm2/instructions/types/CoerceSIns.java | 2 +- .../avm2/instructions/types/ConvertBIns.java | 2 +- .../avm2/instructions/types/ConvertDIns.java | 2 +- .../avm2/instructions/types/ConvertIIns.java | 2 +- .../avm2/instructions/types/ConvertOIns.java | 2 +- .../avm2/instructions/types/ConvertSIns.java | 2 +- .../avm2/instructions/types/ConvertUIns.java | 2 +- .../abc/avm2/model/AlchemyLoadAVM2Item.java | 4 +- .../avm2/model/AlchemySignExtendAVM2Item.java | 2 +- .../flash/abc/avm2/model/FindDefAVM2Item.java | 2 +- .../abc/avm2/model/FullMultinameAVM2Item.java | 2 +- .../abc/avm2/model/IntegerValueAVM2Item.java | 2 +- .../flash/abc/avm2/model/NanAVM2Item.java | 2 +- .../abc/avm2/model/NewFunctionAVM2Item.java | 2 +- .../abc/avm2/model/NewObjectAVM2Item.java | 2 +- .../flash/abc/avm2/model/NullAVM2Item.java | 2 +- .../abc/avm2/model/UndefinedAVM2Item.java | 2 +- .../flash/abc/avm2/model/XMLAVM2Item.java | 2 +- .../model/clauses/DeclarationAVM2Item.java | 9 +- .../abc/avm2/model/clauses/TryAVM2Item.java | 3 +- .../operations/DeletePropertyAVM2Item.java | 2 +- .../abc/avm2/model/operations/EqAVM2Item.java | 2 +- .../abc/avm2/model/operations/GeAVM2Item.java | 2 +- .../abc/avm2/model/operations/GtAVM2Item.java | 2 +- .../abc/avm2/model/operations/InAVM2Item.java | 2 +- .../model/operations/InstanceOfAVM2Item.java | 2 +- .../avm2/model/operations/IsTypeAVM2Item.java | 2 +- .../abc/avm2/model/operations/LeAVM2Item.java | 2 +- .../abc/avm2/model/operations/LtAVM2Item.java | 2 +- .../avm2/model/operations/NeqAVM2Item.java | 2 +- .../model/operations/StrictEqAVM2Item.java | 2 +- .../model/operations/StrictNeqAVM2Item.java | 2 +- .../parser/script/AVM2SourceGenerator.java | 26 +++--- .../parser/script/ActionScript3Parser.java | 4 +- .../avm2/parser/script/FunctionAVM2Item.java | 2 +- .../parser/script/NamespacedAVM2Item.java | 20 ++--- .../avm2/parser/script/PropertyAVM2Item.java | 10 +-- .../parser/script/UnresolvedAVM2Item.java | 2 +- .../abc/avm2/parser/script/XMLAVM2Item.java | 2 +- .../avm2/parser/script/XMLFilterAVM2Item.java | 2 +- .../flash/abc/types/MethodInfo.java | 6 +- .../decompiler/flash/abc/types/Multiname.java | 4 +- .../decompiler/flash/abc/types/Namespace.java | 4 +- .../flash/abc/types/ScriptInfo.java | 2 +- .../decompiler/flash/abc/types/ValueKind.java | 4 +- .../flash/abc/types/traits/Trait.java | 8 +- .../flash/abc/types/traits/TraitClass.java | 8 +- .../flash/helpers/hilight/HighlightData.java | 3 +- .../jpexs/decompiler/graph/DottedChain.java | 88 ++++++++++++++----- .../com/jpexs/decompiler/graph/TypeItem.java | 6 +- .../decompiler/flash/ActionScript3Test.java | 3 +- .../flash/gui/debugger/DebuggerTools.java | 2 +- 55 files changed, 179 insertions(+), 120 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java index b7abb9d5f..5db4e745d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -822,7 +822,7 @@ public class ABC { if (t instanceof TraitSlotConst) { TraitSlotConst s = ((TraitSlotConst) t); if (s.isNamespace()) { - DottedChain key = constants.getNamespace(s.value_index).getName(constants, true); // assume not null + DottedChain key = constants.getNamespace(s.value_index).getName(constants); // assume not null DottedChain val = constants.getMultiname(s.name_index).getNameWithNamespace(constants); map.put(key, val); } @@ -1037,10 +1037,15 @@ public class ABC { return findMethodBodyByName(classId, methodName); } + public int findClassByName(DottedChain name) { + String str = name == null ? null : name.toRawString(); + return findClassByName(str); + } + public int findClassByName(String name) { for (int c = 0; c < instance_info.size(); c++) { DottedChain s = constants.getMultiname(instance_info.get(c).name_index).getNameWithNamespace(constants); - if (name.equals(s.toString())) { + if (name.equals(s.toRawString())) { return c; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 0db060517..2b138d447 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -89,7 +89,7 @@ public class ScriptPack extends AS3ClassTreeItem { Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc); Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { - packageName = ns.getName(abc.constants, false); // assume not null + packageName = ns.getName(abc.constants); // assume not null } } return packageName; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java index 13ba6d063..9e5473d59 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java @@ -56,6 +56,10 @@ public class AVM2Deobfuscation { private final Map usageTypesCount = new HashMap<>(); + public static final DottedChain FLASH_PROXY = new DottedChain("flash", "utils", "flash_proxy"); + + public static final DottedChain BUILTIN = new DottedChain("-"); + public AVM2Deobfuscation(AVM2ConstantPool constants) { this.constants = constants; } @@ -104,10 +108,10 @@ public class AVM2Deobfuscation { return null; } if (ns.equals("http://www.adobe.com/2006/actionscript/flash/proxy")) { - return new DottedChain("flash", "utils", "flash_proxy"); + return FLASH_PROXY; } if (ns.equals("http://adobe.com/AS3/2006/builtin")) { - return new DottedChain("-"); + return BUILTIN; } return null; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index bd856cf3d..dc8ae1403 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -57,6 +57,6 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("String")); + return new TypeItem(DottedChain.STRING); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java index a328724dd..14f61aa42 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java @@ -67,6 +67,6 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java index 3dfbf2908..d34924b91 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java @@ -75,6 +75,6 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("Number")); + return new TypeItem(DottedChain.NUMBER); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 9d4fe21da..594d1e1c1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -73,6 +73,6 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("int")); + return new TypeItem(DottedChain.INT); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java index 968661991..67f948da6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java @@ -56,6 +56,6 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("Object")); + return new TypeItem(DottedChain.OBJECT); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java index 59a46683c..fac1d9ace 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java @@ -57,6 +57,6 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("String")); + return new TypeItem(DottedChain.STRING); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java index a16eb0db8..0f5f53604 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java @@ -56,6 +56,6 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { - return new TypeItem(new DottedChain("uint")); + return new TypeItem(DottedChain.UINT); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java index a414c99cc..d9acc90a8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyLoadAVM2Item.java @@ -87,9 +87,9 @@ public class AlchemyLoadAVM2Item extends AVM2Item { public GraphTargetItem returnType() { switch (type) { case 'i': - return new TypeItem(new DottedChain("int")); + return new TypeItem(DottedChain.INT); case 'f': - return new TypeItem(new DottedChain("Number")); + return new TypeItem(DottedChain.NUMBER); } return TypeItem.UNBOUNDED; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index 991bf68e1..ea770a025 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -53,7 +53,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("int")); + return new TypeItem(DottedChain.INT); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java index 1600d9270..47cc7867e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FindDefAVM2Item.java @@ -34,7 +34,7 @@ public class FindDefAVM2Item extends AVM2Item { @Override public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) { - return writer.append(propertyName.getNamespace(localData.constantsAvm2).getName(localData.constantsAvm2, false).toPrintableString(true)); //assume not null name + return writer.append(propertyName.getNamespace(localData.constantsAvm2).getName(localData.constantsAvm2).toPrintableString(true)); //assume not null name } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java index 03d0b4ccb..7d678a69f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/FullMultinameAVM2Item.java @@ -73,7 +73,7 @@ public class FullMultinameAVM2Item extends AVM2Item { } else { Namespace ns = constants.getMultiname(multinameIndex).getNamespace(constants); if ((ns != null) && (ns.name_index != 0)) { - cns = ns.getName(constants, false).toPrintableString(true); + cns = ns.getName(constants).toPrintableString(true); } } return cname.equals("XML") && cns.isEmpty(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java index 03599e588..f86c63e09 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IntegerValueAVM2Item.java @@ -74,7 +74,7 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("int")); + return new TypeItem(DottedChain.INT); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java index da5cbe5db..7ea68e9fd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NanAVM2Item.java @@ -49,7 +49,7 @@ public class NanAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Number")); + return new TypeItem(DottedChain.NUMBER); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java index a554381a4..dd6391799 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewFunctionAVM2Item.java @@ -98,7 +98,7 @@ public class NewFunctionAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Function")); + return new TypeItem(DottedChain.FUNCTION); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java index 82694d8e8..5be4b4f32 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NewObjectAVM2Item.java @@ -64,7 +64,7 @@ public class NewObjectAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Object")); + return new TypeItem(DottedChain.OBJECT); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java index 3c2b441a4..637d7fdcb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NullAVM2Item.java @@ -61,7 +61,7 @@ public class NullAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("null")); + return new TypeItem(DottedChain.NULL); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java index 6505d6ef1..c488463ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/UndefinedAVM2Item.java @@ -54,7 +54,7 @@ public class UndefinedAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Undefined")); + return new TypeItem(DottedChain.UNDEFINED); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java index 123ff0405..f97b007f1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/XMLAVM2Item.java @@ -51,7 +51,7 @@ public class XMLAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("XML")); + return new TypeItem(DottedChain.XML); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java index 7800ad516..177fd8791 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/DeclarationAVM2Item.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.SetSlotAVM2Item; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TypeItem; import com.jpexs.decompiler.graph.model.LocalData; @@ -58,7 +59,7 @@ public class DeclarationAVM2Item extends AVM2Item { HighlightData srcData = getSrcData(); srcData.localName = localName; srcData.declaration = true; - srcData.declaredType = "*"; + srcData.declaredType = DottedChain.ALL; writer.append("var "); writer.append(localName); return writer; @@ -69,7 +70,7 @@ public class DeclarationAVM2Item extends AVM2Item { HighlightData srcData = getSrcData(); srcData.localName = sti.getNameAsStr(localData); srcData.declaration = true; - srcData.declaredType = "*"; + srcData.declaredType = DottedChain.ALL; writer.append("var "); sti.getName(writer, localData); return writer; @@ -89,7 +90,7 @@ public class DeclarationAVM2Item extends AVM2Item { if (lti.value instanceof ConvertAVM2Item) { coerType = ((ConvertAVM2Item) lti.value).type; } - srcData.declaredType = (coerType instanceof TypeItem) ? ((TypeItem) coerType).fullTypeName.toPrintableString(true) : "*"; + srcData.declaredType = (coerType instanceof TypeItem) ? ((TypeItem) coerType).fullTypeName : DottedChain.ALL; writer.append("var "); writer.append(localName); writer.append(":"); @@ -102,7 +103,7 @@ public class DeclarationAVM2Item extends AVM2Item { HighlightData srcData = getSrcData(); srcData.localName = ssti.getNameAsStr(localData); srcData.declaration = true; - srcData.declaredType = (type instanceof TypeItem) ? ((TypeItem) type).fullTypeName.toPrintableString(true) : "*"; + srcData.declaredType = (type instanceof TypeItem) ? ((TypeItem) type).fullTypeName : DottedChain.ALL; writer.append("var "); ssti.getName(writer, localData); writer.append(":"); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java index 877ea7b1a..32ed9eaa6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/clauses/TryAVM2Item.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.graph.Block; import com.jpexs.decompiler.graph.CompilationException; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; @@ -92,7 +93,7 @@ public class TryAVM2Item extends AVM2Item implements Block { int eti = catchExceptions.get(e).type_index; - data.declaredType = eti <= 0 ? "*" : localData.constantsAvm2.constant_multiname.get(eti).getNameWithNamespace(localData.constantsAvm2).toPrintableString(true); + data.declaredType = eti <= 0 ? DottedChain.ALL : localData.constantsAvm2.constant_multiname.get(eti).getNameWithNamespace(localData.constantsAvm2); writer.hilightSpecial(localName, HighlightSpecialType.TRY_NAME, e, data); writer.append(":"); writer.hilightSpecial(catchExceptions.get(e).getTypeName(localData.constantsAvm2, localData.fullyQualifiedNames), HighlightSpecialType.TRY_TYPE, e); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java index 3a61b1943..fc2a76564 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/DeletePropertyAVM2Item.java @@ -88,7 +88,7 @@ public class DeletePropertyAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java index 42f364bec..99a31e159 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/EqAVM2Item.java @@ -69,6 +69,6 @@ public class EqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java index 86e31fb50..73f353ace 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GeAVM2Item.java @@ -75,6 +75,6 @@ public class GeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java index 4dc3bec1f..f2d51939e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/GtAVM2Item.java @@ -68,6 +68,6 @@ public class GtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java index df7edf1e5..1e901e867 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InAVM2Item.java @@ -43,6 +43,6 @@ public class InAVM2Item extends BinaryOpItem { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java index b472c97d5..a98653559 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/InstanceOfAVM2Item.java @@ -43,6 +43,6 @@ public class InstanceOfAVM2Item extends BinaryOpItem { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java index 7bf7e70ed..4034f4311 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/IsTypeAVM2Item.java @@ -43,6 +43,6 @@ public class IsTypeAVM2Item extends BinaryOpItem { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java index e65d2482b..ae2062b04 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LeAVM2Item.java @@ -75,6 +75,6 @@ public class LeAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java index a8b50a278..4b0d55c83 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/LtAVM2Item.java @@ -68,6 +68,6 @@ public class LtAVM2Item extends BinaryOpItem implements LogicalOpItem, IfConditi @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java index 344c4c8f0..518020d09 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/NeqAVM2Item.java @@ -70,6 +70,6 @@ public class NeqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfCondit @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java index ac1ddc789..315489125 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictEqAVM2Item.java @@ -72,6 +72,6 @@ public class StrictEqAVM2Item extends BinaryOpItem implements LogicalOpItem, IfC @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java index 1024c1150..80bf7e953 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/operations/StrictNeqAVM2Item.java @@ -73,6 +73,6 @@ public class StrictNeqAVM2Item extends BinaryOpItem implements LogicalOpItem, If @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Boolean")); + return new TypeItem(DottedChain.BOOLEAN); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 77edde533..5cdca82f4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -1200,7 +1200,7 @@ public class AVM2SourceGenerator implements SourceGenerator { localData.currentClass = name; localData.pkg = pkg; if (extendsVal == null && !isInterface) { - extendsVal = new TypeItem(new DottedChain("Object")); + extendsVal = new TypeItem(DottedChain.OBJECT); } ParsedSymbol s = null; @@ -1898,7 +1898,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if (t instanceof TraitSlotConst) { if (((TraitSlotConst) t).isNamespace()) { Namespace ns = a.constants.getNamespace(((TraitSlotConst) t).value_index); - return abc.constants.getNamespaceId(new Namespace(ns.kind, abc.constants.getStringId(ns.getName(a.constants, true), true)), 0, true); + return abc.constants.getNamespaceId(new Namespace(ns.kind, abc.constants.getStringId(ns.getName(a.constants), true)), 0, true); } } } @@ -2218,7 +2218,7 @@ public class AVM2SourceGenerator implements SourceGenerator { abc.constants.getMultinameId( new Multiname(Multiname.QNAME, abc.constants.getStringId(superName.getName(a.constants, null, true), true), - abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants, true), true)), 0, true), 0, 0, new ArrayList<>()), true) + abc.constants.getNamespaceId(new Namespace(superName.getNamespace(a.constants).kind, abc.constants.getStringId(superName.getNamespace(a.constants).getName(a.constants), true)), 0, true), 0, 0, new ArrayList<>()), true) ); } } @@ -2245,7 +2245,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } } if (t instanceof TraitFunction) { - return new TypeItem(new DottedChain("Function")); + return new TypeItem(DottedChain.FUNCTION); } return TypeItem.UNBOUNDED; } @@ -2259,11 +2259,11 @@ public class AVM2SourceGenerator implements SourceGenerator { continue; } for (Trait t : ii.traits.traits) { - if (Objects.equals(pkg, t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true))) { + if (Objects.equals(pkg, t.getName(abc).getNamespace(abc.constants).getName(abc.constants))) { if (propertyName.equals(t.getName(abc).getName(abc.constants, null, true))) { outName.setVal(obj); outNs.setVal(pkg); - outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true)); + outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants)); outPropNsKind.setVal(t.getName(abc).getNamespace(abc.constants).kind); outPropNsIndex.setVal(abc.constants.getNamespaceSubIndex(t.getName(abc).namespace_index)); outPropType.setVal(getTraitReturnType(abc, t)); @@ -2284,7 +2284,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } Multiname clsName = ii.getName(abc.constants); if (obj.equals(clsName.getName(abc.constants, null, true))) { - if (Objects.equals(pkg, clsName.getNamespace(abc.constants).getName(abc.constants, true))) { + if (Objects.equals(pkg, clsName.getNamespace(abc.constants).getName(abc.constants))) { //class found for (Trait t : ii.instance_traits.traits) { @@ -2294,7 +2294,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if (propertyName.equals(t.getName(abc).getName(abc.constants, null, true))) { outName.setVal(obj); outNs.setVal(pkg); - outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true)); + outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants)); outPropNsKind.setVal(t.getName(abc).getNamespace(abc.constants).kind); outPropNsIndex.setVal(abc.constants.getNamespaceSubIndex(t.getName(abc).namespace_index)); outPropType.setVal(getTraitReturnType(abc, t)); @@ -2314,7 +2314,7 @@ public class AVM2SourceGenerator implements SourceGenerator { if (propertyName.equals(t.getName(abc).getName(abc.constants, null, true))) { outName.setVal(obj); outNs.setVal(pkg); - outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants, true)); + outPropNs.setVal(t.getName(abc).getNamespace(abc.constants).getName(abc.constants)); outPropNsKind.setVal(t.getName(abc).getNamespace(abc.constants).kind); outPropNsIndex.setVal(abc.constants.getNamespaceSubIndex(t.getName(abc).namespace_index)); outPropType.setVal(getTraitReturnType(abc, t)); @@ -2329,7 +2329,7 @@ public class AVM2SourceGenerator implements SourceGenerator { Multiname superName = abc.constants.constant_multiname.get(ii.super_index); if (superName != null) { - return searchPrototypeChain(instanceOnly, abcs, superName.getNamespace(abc.constants).getName(abc.constants, true), superName.getName(abc.constants, null, true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue); + return searchPrototypeChain(instanceOnly, abcs, superName.getNamespace(abc.constants).getName(abc.constants), superName.getName(abc.constants, null, true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue); } else { return false; } @@ -2343,7 +2343,7 @@ public class AVM2SourceGenerator implements SourceGenerator { public static void parentNames(ABC abc, List allABCs, int name_index, List indices, List names, List namespaces, List outABCs) { indices.add(name_index); names.add(abc.constants.constant_multiname.get(name_index).getName(abc.constants, null, true)); - namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants, true).toRawString()); + namespaces.add(abc.constants.constant_multiname.get(name_index).getNamespace(abc.constants).getName(abc.constants).toRawString()); Multiname mname = abc.constants.constant_multiname.get(name_index); outABCs.add(abc); @@ -2357,7 +2357,7 @@ public class AVM2SourceGenerator implements SourceGenerator { Multiname m = a.constants.constant_multiname.get(a.instance_info.get(i).name_index); if (m.getName(a.constants, null, true).equals(mname.getName(abc.constants, null, true))) { - if (m.getNamespace(a.constants).hasName(mname.getNamespace(abc.constants).getName(abc.constants, true).toRawString(), a.constants)) { + if (m.getNamespace(a.constants).hasName(mname.getNamespace(abc.constants).getName(abc.constants).toRawString(), a.constants)) { //Multiname superName = a.constants.constant_multiname.get(a.instance_info.get(i).super_index); abcs.remove(a); if (a.instance_info.get(i).super_index != 0) { @@ -2458,7 +2458,7 @@ public class AVM2SourceGenerator implements SourceGenerator { for (int i = 1; i < abc.constants.constant_multiname.size(); i++) { Multiname mname = abc.constants.constant_multiname.get(i); if (mname != null && name.equals(mname.getName(abc.constants, null, true))) { - if (mname.getNamespace(abc.constants) != null && pkg.equals(mname.getNamespace(abc.constants).getName(abc.constants, true))) { + if (mname.getNamespace(abc.constants) != null && pkg.equals(mname.getNamespace(abc.constants).getName(abc.constants))) { name_index = i; break; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index 780dc013b..03441596c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -164,7 +164,7 @@ public class ActionScript3Parser { if (s.type == SymbolType.MULTIPLY) { return new UnboundedTypeItem(); } else if (s.type == SymbolType.VOID) { - return new TypeItem(new DottedChain("void")); + return new TypeItem(DottedChain.VOID); } else { lexer.pushback(s); } @@ -824,7 +824,7 @@ public class ActionScript3Parser { lexer.pushback(s); } - ConstAVM2Item ns = new ConstAVM2Item(pkg, customAccess, true, namespace, nname, new TypeItem(new DottedChain("Namespace")), new StringAVM2Item(null, nval), lexer.yyline()); + ConstAVM2Item ns = new ConstAVM2Item(pkg, customAccess, true, namespace, nname, new TypeItem(DottedChain.NAMESPACE), new StringAVM2Item(null, nval), lexer.yyline()); traits.add(ns); break; case CONST: diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java index d6df407d8..070117f0e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/FunctionAVM2Item.java @@ -86,7 +86,7 @@ public class FunctionAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("Function")); + return new TypeItem(DottedChain.FUNCTION); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java index 85fc5bb56..a264d8cfc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java @@ -117,10 +117,10 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { */ if (name != null) { return toSourceMerge(localData, generator, - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)), ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), dupSetTemp(localData, generator, name_temp), - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)), dupSetTemp(localData, generator, ns_temp), //Start get original //getTemp(localData, generator, ns_temp), generateCoerce(generator, "Namespace"), ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAME, g.abc.constants.getStringId(variableName, true), 0, 0, 0, new ArrayList()), true)), @@ -169,8 +169,8 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { if (name == null) { if (assignedValue != null) { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), nameItem, ins(new ConvertSIns()), assignedValue, + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)), nameItem, ins(new ConvertSIns()), assignedValue, needsReturn ? dupSetTemp(localData, generator, ret_temp) : null, ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), needsReturn ? getTemp(localData, generator, ret_temp) : null, @@ -178,9 +178,9 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { ); } else { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)) : null, nameItem, ins(new ConvertSIns()), obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true)), call ? dupSetTemp(localData, generator, obj_temp) : null, - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), nameItem, ins(new ConvertSIns()), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)), nameItem, ins(new ConvertSIns()), construct ? callargs : null, ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(Multiname.RTQNAMEL, 0, 0, 0, 0, new ArrayList<>()), true), construct ? callargs.size() : null), call ? getTemp(localData, generator, obj_temp) : null, @@ -193,8 +193,8 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { } else { if (assignedValue != null) { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), assignedValue, + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)), assignedValue, needsReturn ? dupSetTemp(localData, generator, ret_temp) : null, ins(new SetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), needsReturn ? getTemp(localData, generator, ret_temp) : null, @@ -202,9 +202,9 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { ); } else { return toSourceMerge(localData, generator, - obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), + obj == null ? ns : null, obj == null ? NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)) : null, obj != null ? obj : ins(new FindPropertyStrictIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true)), call ? dupSetTemp(localData, generator, obj_temp) : null, - ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(new DottedChain("Namespace"))), + ns, NameAVM2Item.generateCoerce(localData, generator, new TypeItem(DottedChain.NAMESPACE)), construct ? callargs : null, ins(construct ? new ConstructPropIns() : delete ? new DeletePropertyIns() : new GetPropertyIns(), g.abc.constants.getMultinameId(new Multiname(attr ? Multiname.RTQNAMEA : Multiname.RTQNAME, g.abc.constants.getStringId(name, true), 0, 0, 0, new ArrayList<>()), true), construct ? callargs.size() : null), call ? getTemp(localData, generator, obj_temp) : null, diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index fe6df1767..0385f7151 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -227,7 +227,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { Reference outPropNsIndex = new Reference<>(0); Reference outPropType = new Reference<>(null); Reference outPropValue = new Reference<>(null); - if (AVM2SourceGenerator.searchPrototypeChain(false, abcs, m.getNamespace(a.constants).getName(a.constants, true), m.getName(a.constants, null, true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) { + if (AVM2SourceGenerator.searchPrototypeChain(false, abcs, m.getNamespace(a.constants).getName(a.constants), m.getName(a.constants, null, true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) { objType = new TypeItem("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal()); propType = outPropType.getVal(); propIndex = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, @@ -250,7 +250,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { if (t.getName(abc).getName(abc.constants, null, true).equals(propertyName)) { if (t instanceof TraitSlotConst) { TraitSlotConst tsc = (TraitSlotConst) t; - objType = new TypeItem(new DottedChain("Function")); + objType = new TypeItem(DottedChain.FUNCTION); propType = multinameToType(tsc.type_index, abc.constants); propIndex = tsc.name_index; if (!localData.traitUsages.containsKey(b)) { @@ -266,7 +266,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { for (int i = 0; i < openedNamespaces.size(); i++) { int nsindex = openedNamespaces.get(i); int nsKind = abc.constants.constant_namespace.get(openedNamespaces.get(i)).kind; - DottedChain nsname = abc.constants.constant_namespace.get(openedNamespaces.get(i)).getName(abc.constants, true); + DottedChain nsname = abc.constants.constant_namespace.get(openedNamespaces.get(i)).getName(abc.constants); int name_index = 0; for (int m = 1; m < abc.constants.constant_multiname.size(); m++) { Multiname mname = abc.constants.constant_multiname.get(m); @@ -312,7 +312,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { } for (Trait t : si.traits.traits) { if (t.name_index == name_index) { - objType = new TypeItem(new DottedChain("Object")); + objType = new TypeItem(DottedChain.OBJECT); propType = AVM2SourceGenerator.getTraitReturnType(abc, t); propIndex = t.name_index; if (t instanceof TraitSlotConst) { @@ -336,7 +336,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { continue; } Multiname n = a.constants.constant_multiname.get(ii.name_index); - if (n.getNamespace(a.constants).kind == Namespace.KIND_PACKAGE && n.getNamespace(a.constants).getName(a.constants, true).equals(nsname)) { + if (n.getNamespace(a.constants).kind == Namespace.KIND_PACKAGE && n.getNamespace(a.constants).getName(a.constants).equals(nsname)) { Reference outName = new Reference<>(""); Reference outNs = new Reference<>(DottedChain.EMPTY); Reference outPropNs = new Reference<>(DottedChain.EMPTY); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java index 4d3014aa1..9d71abbf7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java @@ -382,7 +382,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { continue; } if ((a.instance_info.get(c).getName(a.constants) != null && a == abc && a.instance_info.get(c).getName(a.constants).namespace_index == ni) - || (ons.kind != Namespace.KIND_PRIVATE && a.instance_info.get(c).getName(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants).hasName(ons.getName(abc.constants, true).toRawString(), a.constants))) { + || (ons.kind != Namespace.KIND_PRIVATE && a.instance_info.get(c).getName(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants) != null && a.instance_info.get(c).getName(a.constants).getNamespace(a.constants).hasName(ons.getName(abc.constants).toRawString(), a.constants))) { String cname = a.instance_info.get(c).getName(a.constants).getName(a.constants, null, true); if (name.get(0).equals(cname)) { if (!subtypes.isEmpty() && name.size() > 1) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java index 169dda052..f76d5d811 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java @@ -55,7 +55,7 @@ public class XMLAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("XML")); + return new TypeItem(DottedChain.XML); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java index b0b3eec3b..e3a240292 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java @@ -56,7 +56,7 @@ public class XMLFilterAVM2Item extends AVM2Item { @Override public GraphTargetItem returnType() { - return new TypeItem(new DottedChain("String")); + return new TypeItem(DottedChain.STRING); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java index dda32b07e..2756f6f1f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java @@ -309,9 +309,9 @@ public class MethodInfo { if (i > 0) { writer.appendNoHilight(", "); } - String ptype = "*"; + DottedChain ptype = DottedChain.ALL; if (param_types[i] > 0) { - ptype = constants.getMultiname(param_types[i]).getNameWithNamespace(constants).toPrintableString(true); + ptype = constants.getMultiname(param_types[i]).getNameWithNamespace(constants); } HighlightData pdata = new HighlightData(); @@ -356,7 +356,7 @@ public class MethodInfo { HighlightData pdata = new HighlightData(); pdata.declaration = true; - pdata.declaredType = "*"; + pdata.declaredType = DottedChain.ALL; pdata.localName = restName; writer.append(restAdd); writer.hilightSpecial(restName, HighlightSpecialType.FLAG_NEED_REST, 0, pdata); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index 477451686..e770a2cc4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -188,7 +188,7 @@ public class Multiname { } int type = constants.getNamespace(index).kind; int name_index = constants.getNamespace(index).name_index; - String name = name_index == 0 ? null : constants.getNamespace(index).getName(constants, true).toRawString(); + String name = name_index == 0 ? null : constants.getNamespace(index).getName(constants).toRawString(); int sub = -1; for (int n = 1; n < constants.getNamespaceCount(); n++) { if (constants.getNamespace(n).kind == type && constants.getNamespace(n).name_index == name_index) { @@ -305,7 +305,7 @@ public class Multiname { Namespace ns = getNamespace(constants); String name = getName(constants, null, true); if (ns != null) { - return ns.getName(constants, true).add(name); + return ns.getName(constants).add(name); } return new DottedChain(name); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java index 3c9556e68..b345e8f78 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java @@ -94,7 +94,7 @@ public class Namespace { } public String toString(AVM2ConstantPool constants) { - return getName(constants, false).toPrintableString(true); + return getName(constants).toPrintableString(true); } public String getNameWithKind(AVM2ConstantPool constants) { @@ -114,7 +114,7 @@ public class Namespace { return kindStr; } - public DottedChain getName(AVM2ConstantPool constants, boolean raw) { + public DottedChain getName(AVM2ConstantPool constants) { if (name_index == 0) { return DottedChain.EMPTY; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java index b1c95340a..4b7c59119 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ScriptInfo.java @@ -73,7 +73,7 @@ public class ScriptInfo { Namespace ns = name.getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE_INTERNAL) || (ns.kind == Namespace.KIND_PACKAGE)) { - DottedChain packageName = ns.getName(abc.constants, false); // assume not null package + DottedChain packageName = ns.getName(abc.constants); // assume not null package String objectName = name.getName(abc.constants, null, false); List traitIndices = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java index 9993a2bb6..7021972d7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/ValueKind.java @@ -157,7 +157,7 @@ public class ValueKind { case CONSTANT_ExplicitNamespace: case CONSTANT_StaticProtectedNs: case CONSTANT_PrivateNs: - ret = "\"" + constants.getNamespace(value_index).getName(constants, true).toRawString() + "\""; //assume not null name + ret = "\"" + constants.getNamespace(value_index).getName(constants).toRawString() + "\""; //assume not null name break; } return ret; @@ -199,7 +199,7 @@ public class ValueKind { case CONSTANT_ExplicitNamespace: case CONSTANT_StaticProtectedNs: case CONSTANT_PrivateNs: - ret = constants.getNamespace(value_index).getKindStr() + "(\"" + constants.getNamespace(value_index).getName(constants, true) + "\")"; //assume not null name + ret = constants.getNamespace(value_index).getKindStr() + "(\"" + constants.getNamespace(value_index).getName(constants).toRawString() + "\")"; //assume not null name break; } return ret; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java index 23c90a3ec..1308fbd00 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Trait.java @@ -79,7 +79,7 @@ public abstract class Trait implements Cloneable, Serializable { if (m.namespace_index == -1) { break; } - DottedChain dc = abcTag.getABC().nsValueToName(abc.constants.getNamespace(m.namespace_index).getName(abc.constants, true)); + DottedChain dc = abcTag.getABC().nsValueToName(abc.constants.getNamespace(m.namespace_index).getName(abc.constants)); nsname = dc.getLast(); if (nsname == null) { @@ -140,7 +140,7 @@ public abstract class Trait implements Cloneable, Serializable { public GraphTextWriter toStringPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { - String nsname = ns.getName(abc.constants, false).toPrintableString(true); + String nsname = ns.getName(abc.constants).toPrintableString(true); writer.appendNoHilight("package"); if (!nsname.isEmpty()) { writer.appendNoHilight(" " + nsname); //assume not null name @@ -156,7 +156,7 @@ public abstract class Trait implements Cloneable, Serializable { public void convertPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List fullyQualifiedNames, boolean parallel) throws InterruptedException { Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants); if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) { - String nsname = ns.getName(abc.constants, false).toPrintableString(true); + String nsname = ns.getName(abc.constants).toPrintableString(true); convert(parent, path + nsname, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel); } } @@ -183,7 +183,7 @@ public abstract class Trait implements Cloneable, Serializable { public ClassPath getPath(ABC abc) { Multiname name = getName(abc); Namespace ns = name.getNamespace(abc.constants); - DottedChain packageName = ns.getName(abc.constants, false); + DottedChain packageName = ns.getName(abc.constants); String objectName = name.getName(abc.constants, null, true); return new ClassPath(packageName, objectName); //assume not null name } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 6d38d1080..870966d97 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -102,7 +102,7 @@ public class TraitClass extends Trait implements TraitWithSlot { name = "*"; } boolean raw = ns.kind == Namespace.KIND_NAMESPACE; - DottedChain newimport = ns.getName(abc.constants, raw); + DottedChain newimport = ns.getName(abc.constants); /*if ((ns.kind != Namespace.KIND_PACKAGE) && (ns.kind != Namespace.KIND_NAMESPACE) && (ns.kind != Namespace.KIND_STATIC_PROTECTED)) { @@ -167,7 +167,7 @@ public class TraitClass extends Trait implements TraitWithSlot { if (name.isEmpty()) { name = "*"; } - DottedChain newimport = ns.getName(abc.constants, false); + DottedChain newimport = ns.getName(abc.constants); if (parseUsagesFromNS(abc, imports, uses, namespace_index, ignorePackage, name)) { return; } else if ((ns.kind != Namespace.KIND_PACKAGE) && (ns.kind != Namespace.KIND_PACKAGE_INTERNAL)) { @@ -334,7 +334,7 @@ public class TraitClass extends Trait implements TraitWithSlot { ClassInfo classInfo = abc.class_info.get(class_info); InstanceInfo instanceInfo = abc.instance_info.get(class_info); - DottedChain packageName = instanceInfo.getName(abc.constants).getNamespace(abc.constants).getName(abc.constants, false); //assume not null name + DottedChain packageName = instanceInfo.getName(abc.constants).getNamespace(abc.constants).getName(abc.constants); //assume not null name parseImportsUsagesFromMultiname(abc, imports, uses, abc.constants.getMultiname(instanceInfo.name_index), packageName, fullyQualifiedNames); @@ -375,7 +375,7 @@ public class TraitClass extends Trait implements TraitWithSlot { InstanceInfo instanceInfo = abc.instance_info.get(class_info); Multiname instanceInfoMultiname = instanceInfo.getName(abc.constants); String instanceInfoName = instanceInfoMultiname.getName(abc.constants, fullyQualifiedNames, false); - DottedChain packageName = instanceInfoMultiname.getNamespace(abc.constants).getName(abc.constants, false); //assume not null name + DottedChain packageName = instanceInfoMultiname.getNamespace(abc.constants).getName(abc.constants); //assume not null name List namesInThisPackage = new ArrayList<>(); for (ABCContainerTag tag : abc.getAbcTags()) { for (ScriptInfo si : tag.getABC().script_info) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/HighlightData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/HighlightData.java index 3733e2360..817b533e7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/HighlightData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/HighlightData.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.helpers.hilight; +import com.jpexs.decompiler.graph.DottedChain; import java.io.Serializable; /** @@ -26,7 +27,7 @@ public class HighlightData implements Cloneable, Serializable { public boolean declaration; - public String declaredType; + public DottedChain declaredType; public String localName; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java index adc809f6d..ae2a47ffb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java @@ -32,58 +32,102 @@ public class DottedChain implements Serializable { public static final DottedChain EMPTY = new DottedChain(); + public static final DottedChain BOOLEAN = new DottedChain("Boolean"); + + public static final DottedChain STRING = new DottedChain("String"); + + public static final DottedChain ARRAY = new DottedChain("Array"); + + public static final DottedChain NUMBER = new DottedChain("Number"); + + public static final DottedChain OBJECT = new DottedChain("Object"); + + public static final DottedChain INT = new DottedChain("int"); + + public static final DottedChain UINT = new DottedChain("uint"); + + public static final DottedChain UNDEFINED = new DottedChain("Undefined"); + + public static final DottedChain XML = new DottedChain("XML"); + + public static final DottedChain NULL = new DottedChain("null"); + + public static final DottedChain FUNCTION = new DottedChain("Function"); + + public static final DottedChain VOID = new DottedChain("void"); + + public static final DottedChain NAMESPACE = new DottedChain("Namespace"); + + public static final DottedChain ALL = new DottedChain("*"); + private final String[] parts; + private final int length; + private final int hash; public DottedChain(List parts) { - this.parts = parts.toArray(new String[parts.size()]); + length = parts.size(); + this.parts = parts.toArray(new String[length]); hash = calcHash(); } public DottedChain(String... parts) { + length = parts.length; + this.parts = parts; + hash = calcHash(); + } + + private DottedChain(String[] parts, int length) { + this.length = length; this.parts = parts; hash = calcHash(); } public boolean isEmpty() { - return parts.length == 0; + return length == 0; } public int size() { - return parts.length; + return length; } public String get(int index) { + if (index >= length) { + throw new ArrayIndexOutOfBoundsException(); + } + return parts[index]; } public DottedChain subChain(int count) { - String[] nparts = Arrays.copyOfRange(parts, 0, count); - return new DottedChain(nparts); + if (count > length) { + throw new ArrayIndexOutOfBoundsException(); + } + + return new DottedChain(parts, count); } public String getLast() { - if (parts.length == 0) { + if (length == 0) { return ""; } else { - return parts[parts.length - 1]; + return parts[length - 1]; } } public DottedChain getWithoutLast() { - if (parts.length < 2) { + if (length < 2) { return EMPTY; } - String[] nparts = Arrays.copyOfRange(parts, 0, parts.length - 1); - return new DottedChain(nparts); + return new DottedChain(parts, length - 1); } public DottedChain add(String name) { - String[] nparts = new String[parts.length + 1]; - if (parts.length > 0) { - System.arraycopy(parts, 0, nparts, 0, parts.length); + String[] nparts = new String[length + 1]; + if (length > 0) { + System.arraycopy(parts, 0, nparts, 0, length); } nparts[nparts.length - 1] = name; @@ -91,30 +135,30 @@ public class DottedChain implements Serializable { } private String toString(boolean as3, boolean raw) { - if (parts.length == 0 || (parts.length == 1 && parts[0].isEmpty())) { + if (length == 0) { return ""; } StringBuilder ret = new StringBuilder(); - for (int i = 0; i < parts.length; i++) { + for (int i = 0; i < length; i++) { if (i > 0) { ret.append("."); } String part = parts[i]; - boolean lastStar = i == parts.length - 1 && "*".equals(part); + boolean lastStar = i == length - 1 && "*".equals(part); ret.append((raw || lastStar) ? part : IdentifiersDeobfuscation.printIdentifier(as3, part)); } return ret.toString(); } public String toFilePath() { - if (parts.length == 0 || (parts.length == 1 && parts[0].isEmpty())) { + if (length == 0) { return ""; } StringBuilder ret = new StringBuilder(); - for (int i = 0; i < parts.length; i++) { + for (int i = 0; i < length; i++) { if (i > 0) { ret.append(File.separator); } @@ -147,10 +191,12 @@ public class DottedChain implements Serializable { } private int calcHash() { - if (parts.length > 0 && parts[0].equals("§§")) { - int a = 1; + int result = 1; + for (int i = 0; i < length; i++) { + result = 31 * result + parts[i].hashCode(); } - return Arrays.hashCode(parts); + + return result; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java index 880eb0ede..1ec2c2e1c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TypeItem.java @@ -32,11 +32,11 @@ import java.util.Objects; */ public class TypeItem extends GraphTargetItem { - public static TypeItem BOOLEAN = new TypeItem(new DottedChain("Boolean")); + public static TypeItem BOOLEAN = new TypeItem(DottedChain.BOOLEAN); - public static TypeItem STRING = new TypeItem(new DottedChain("String")); + public static TypeItem STRING = new TypeItem(DottedChain.STRING); - public static TypeItem ARRAY = new TypeItem(new DottedChain("Array")); + public static TypeItem ARRAY = new TypeItem(DottedChain.ARRAY); public static UnboundedTypeItem UNBOUNDED = new UnboundedTypeItem(); diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3Test.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3Test.java index ab3aff734..6d3f41161 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3Test.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/ActionScript3Test.java @@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.helpers.HighlightedTextWriter; import com.jpexs.decompiler.flash.helpers.NulWriter; import com.jpexs.decompiler.flash.tags.DoABC2Tag; import com.jpexs.decompiler.flash.tags.Tag; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.ScopeStack; import java.io.BufferedInputStream; import java.io.FileInputStream; @@ -60,7 +61,7 @@ public class ActionScript3Test extends ActionScriptTestBase { } } assertNotNull(tag); - clsIndex = tag.getABC().findClassByName("classes.Test"); + clsIndex = tag.getABC().findClassByName(new DottedChain("classes", "Test")); assertTrue(clsIndex > -1); this.abc = tag.getABC(); Configuration.autoDeobfuscate.set(false); diff --git a/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java b/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java index 179f51838..80805407d 100644 --- a/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java +++ b/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java @@ -93,7 +93,7 @@ public class DebuggerTools { ABC a = ct.getABC(); for (int i = 1; i < a.constants.constant_multiname.size(); i++) { Multiname m = a.constants.constant_multiname.get(i); - if ("trace".equals(m.getNameWithNamespace(a.constants).toString())) { + if ("trace".equals(m.getNameWithNamespace(a.constants).toRawString())) { m.namespace_index = a.constants.getNamespaceId(new Namespace(Namespace.KIND_PACKAGE, a.constants.getStringId(debuggerPkg, true)), 0, true); m.name_index = a.constants.getStringId(fname, true); ((Tag) ct).setModified(true); From ace72938bddb4ebcfddb8ee39b769a7a49e433a0 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 21:23:43 +0200 Subject: [PATCH 08/25] DottedChain equals fix --- .../src/com/jpexs/decompiler/graph/DottedChain.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java index ae2a47ffb..3fbff38b9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java @@ -208,9 +208,18 @@ public class DottedChain implements Serializable { return false; } final DottedChain other = (DottedChain) obj; - if (!Arrays.equals(parts, other.parts)) { + if (length != other.length) { return false; } + + for (int i = 0; i < length; i++) { + String s1 = parts[i]; + String s2 = other.parts[i]; + if (!s1.equals(s2)) { + return false; + } + } + return true; } } From 74c78b4b285bf4bd9c496c29683963f6cb067641 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 21:27:37 +0200 Subject: [PATCH 09/25] build fix --- .../decompiler/flash/gui/abc/ABCPanel.java | 4 ++-- .../flash/gui/abc/DecompiledEditorPane.java | 17 +++++++++-------- .../abc/tablemodels/NamespaceTableModel.java | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index d7d3dc6a9..abc659f6e 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -480,7 +480,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener("")) != -1; + return decompiledTextArea.getLocalDeclarationOfPos(pos, new Reference<>(null)) != -1; } private void gotoDeclaration(int pos) { @@ -525,7 +525,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener("")); + int dpos = decompiledTextArea.getLocalDeclarationOfPos(pos, new Reference<>(null)); if (dpos > -1) { decompiledTextArea.setCaretPosition(dpos); } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 06085ee73..3781adb8f 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -41,6 +41,7 @@ import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import com.jpexs.decompiler.graph.DottedChain; import java.awt.Point; import java.util.ArrayList; import java.util.List; @@ -250,7 +251,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL return getMultinameAtPos(getCaretPosition()); } - public int getLocalDeclarationOfPos(int pos, Reference type) { + public int getLocalDeclarationOfPos(int pos, Reference type) { Highlighting sh = Highlighting.searchPos(specialHighlights, pos); Highlighting h = Highlighting.searchPos(highlights, pos); @@ -275,7 +276,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL Highlighting ch = Highlighting.searchPos(classHighlights, pos); int cindex = (int) ch.getProperties().index; ABC abc = getABC(); - type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc.constants).toString()); + type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc.constants)); return ch.startPos; } @@ -329,15 +330,15 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL if (t.type != TokenType.IDENTIFIER && t.type != TokenType.KEYWORD || t.type == TokenType.REGEX) { return false; } - Reference locTypeRef = new Reference<>(""); + Reference locTypeRef = new Reference<>(DottedChain.EMPTY); getLocalDeclarationOfPos(t.start, locTypeRef); - String currentType = locTypeRef.getVal(); - if (currentType.equals("*")) { + DottedChain currentType = locTypeRef.getVal(); + if (currentType.equals(DottedChain.ALL)) { return false; } boolean found; t = sd.getNextToken(t); - while (t != lastToken && !currentType.equals("*")) { + while (t != lastToken && !currentType.equals(DottedChain.ALL)) { t = sd.getNextToken(t); String ident = t.getString(sd); found = false; @@ -356,7 +357,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL traitIndex.setVal(j); classTrait.setVal(false); multinameIndex.setVal(tr.name_index); - currentType = ii.getName(a.constants).getNameWithNamespace(a.constants).toString(); + currentType = ii.getName(a.constants).getNameWithNamespace(a.constants); found = true; break loopi; } @@ -371,7 +372,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL traitIndex.setVal(j); classTrait.setVal(true); multinameIndex.setVal(tr.name_index); - currentType = ii.getName(a.constants).getNameWithNamespace(a.constants).toString(); + currentType = ii.getName(a.constants).getNameWithNamespace(a.constants); found = true; break loopi; } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java index 21496b776..059537cdc 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java @@ -125,7 +125,7 @@ public class NamespaceTableModel implements TableModel { if (rowIndex == 0) { return "-"; } - DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants, true); + DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants); if (chain == null) { return "-"; } From c4530dfdd5d84c14078f65d705c9b486c8826da1 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 21:52:44 +0200 Subject: [PATCH 10/25] #967 Replace DefineText content from CLI --- .../flash/importers/TextImporter.java | 39 +++++++++++-------- .../console/CommandLineArgumentParser.java | 25 +++++++++++- .../jpexs/decompiler/flash/gui/MainPanel.java | 6 +-- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/TextImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/TextImporter.java index 5bf9ddc54..06fa79231 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/TextImporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/TextImporter.java @@ -119,26 +119,33 @@ public class TextImporter { for (String fileName : files) { String texts = Helper.readTextFile(Path.combine(textsFolder.getPath(), fileName)); int characterId = Integer.parseInt(fileName.split("\\.")[0]); - String recordSeparator = Helper.newLine + Configuration.textExportSingleFileRecordSeparator.get() + Helper.newLine; - boolean formatted = !texts.contains(recordSeparator) && texts.startsWith("[" + Helper.newLine); - if (!formatted) { - String[] records = texts.split(recordSeparator); - TextTag textTag = swf.getText(characterId); - if (textTag != null) { - String text = textTag.getFormattedText().text; - if (!saveText(textTag, text, records)) { - return; - } + TextTag textTag = swf.getText(characterId); + if (!importText(textTag, texts)) { + return; + } + } + } + + public boolean importText(TextTag textTag, String newText) { + String recordSeparator = Helper.newLine + Configuration.textExportSingleFileRecordSeparator.get() + Helper.newLine; + boolean formatted = !newText.contains(recordSeparator) && newText.startsWith("[" + Helper.newLine); + if (!formatted) { + String[] records = newText.split(recordSeparator); + if (textTag != null) { + String text = textTag.getFormattedText().text; + if (!saveText(textTag, text, records)) { + return false; } - } else { - TextTag textTag = swf.getText(characterId); - if (textTag != null) { - if (!saveText(textTag, texts, null)) { - return; - } + } + } else { + if (textTag != null) { + if (!saveText(textTag, newText, null)) { + return false; } } } + + return true; } /** diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 05670831c..22586dc88 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -83,6 +83,7 @@ import com.jpexs.decompiler.flash.importers.BinaryDataImporter; import com.jpexs.decompiler.flash.importers.ImageImporter; import com.jpexs.decompiler.flash.importers.ShapeImporter; import com.jpexs.decompiler.flash.importers.SwfXmlImporter; +import com.jpexs.decompiler.flash.importers.TextImporter; import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag; import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag; @@ -95,8 +96,11 @@ import com.jpexs.decompiler.flash.tags.base.ButtonTag; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; +import com.jpexs.decompiler.flash.tags.base.MissingCharacterHandler; import com.jpexs.decompiler.flash.tags.base.ShapeTag; import com.jpexs.decompiler.flash.tags.base.SoundTag; +import com.jpexs.decompiler.flash.tags.base.TextImportErrorHandler; +import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.treeitems.SWFList; import com.jpexs.decompiler.flash.types.ColorTransform; import com.jpexs.decompiler.flash.types.RECT; @@ -107,6 +111,7 @@ import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; import com.jpexs.helpers.Path; import com.jpexs.helpers.streams.SeekableInputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import com.sun.jna.Platform; import com.sun.jna.platform.win32.Kernel32; import gnu.jpdf.PDFJob; @@ -316,7 +321,7 @@ public class CommandLineArgumentParser { out.println(" " + (cnt++) + ") -zoom "); out.println(" ...apply zoom during export (currently for FlashPaper conversion only)"); out.println(" " + (cnt++) + ") -replace (|) [methodBodyIndex1] [(|) [methodBodyIndex2]]..."); - out.println(" ...replaces the data of the specified BinaryData, Image, DefineSound tag or Script"); + out.println(" ...replaces the data of the specified BinaryData, Image, Text, DefineSound tag or Script"); out.println(" ...methodBodyIndexN parameter should be specified if and only if the imported entity is an AS3 P-Code"); out.println(" " + (cnt++) + ") -replaceAlpha [ ]..."); out.println(" ...replaces the alpha channel of the specified JPEG3 or JPEG4 tag"); @@ -1788,6 +1793,24 @@ public class CommandLineArgumentParser { } else if (characterTag instanceof ShapeTag) { ShapeTag shapeTag = (ShapeTag) characterTag; new ShapeImporter().importImage(shapeTag, data); + } else if (characterTag instanceof TextTag) { + TextTag textTag = (TextTag) characterTag; + new TextImporter(new MissingCharacterHandler(), new TextImportErrorHandler() { + + @Override + public boolean handle(TextTag textTag) { + String msg = "Error during text import."; + logger.log(Level.SEVERE, msg); + return false; + } + + @Override + public boolean handle(TextTag textTag, String message, long line) { + String msg = "Error during text import: %text% on line %line%".replace("%text%", message).replace("%line%", Long.toString(line)); + logger.log(Level.SEVERE, msg); + return false; + } + }).importText(textTag, new String(data, Utf8Helper.charset)); } else if (characterTag instanceof SoundTag) { SoundTag st = (SoundTag) characterTag; int soundFormat = SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN; diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 0f392f8d2..792a297fc 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -1981,12 +1981,12 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se private final ConfigurationItem showAgainInvalidText = new ConfigurationItem<>("showAgainInvalidText", true, true); private String getTextTagInfo(TextTag textTag) { - String ret = ""; + StringBuilder ret = new StringBuilder(); if (textTag != null) { - ret += " TextId: " + textTag.getCharacterId() + " (" + String.join(", ", textTag.getTexts()) + ")"; + ret.append(" TextId: ").append(textTag.getCharacterId()).append(" (").append(String.join(", ", textTag.getTexts())).append(")"); } - return ret; + return ret.toString(); } @Override From 602a2f0a63c8d4e361e6cf09b178afda9644ce6e Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 22:14:55 +0200 Subject: [PATCH 11/25] DottedChain namespace fix --- .../com/jpexs/decompiler/flash/abc/ABC.java | 20 ++++++++++++------- .../flash/abc/avm2/AVM2Deobfuscation.java | 7 ------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java index 5db4e745d..c57d15399 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -109,7 +109,7 @@ public class ABC { public ABCContainerTag parentTag; /* Map from multiname index of namespace value to namespace name**/ - private Map namespaceMap; + private Map namespaceMap; public ABC(ABCContainerTag tag) { this.parentTag = tag; @@ -814,15 +814,15 @@ public class ABC { } } - private Map getNamespaceMap() { + private Map getNamespaceMap() { if (namespaceMap == null) { - Map map = new HashMap<>(); + Map map = new HashMap<>(); for (ScriptInfo si : script_info) { for (Trait t : si.traits.traits) { if (t instanceof TraitSlotConst) { TraitSlotConst s = ((TraitSlotConst) t); if (s.isNamespace()) { - DottedChain key = constants.getNamespace(s.value_index).getName(constants); // assume not null + String key = constants.getNamespace(s.value_index).getName(constants).toRawString(); // assume not null DottedChain val = constants.getMultiname(s.name_index).getNameWithNamespace(constants); map.put(key, val); } @@ -858,10 +858,16 @@ public class ABC { } public DottedChain nsValueToName(DottedChain value) { - if (getNamespaceMap().containsKey(value)) { - return getNamespaceMap().get(value); + if (value == null) { + return null; + } + + String valueStr = value.toRawString(); + + if (getNamespaceMap().containsKey(valueStr)) { + return getNamespaceMap().get(valueStr); } else { - DottedChain ns = getDeobfuscation().builtInNs(value); + DottedChain ns = getDeobfuscation().builtInNs(valueStr); if (ns == null) { return DottedChain.EMPTY; } else { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java index 9e5473d59..2589e03dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java @@ -96,13 +96,6 @@ public class AVM2Deobfuscation { return isValid; } - public DottedChain builtInNs(DottedChain ns) { - if (ns == null || ns.size() != 1) { - return null; - } - return builtInNs(ns.get(0)); - } - public DottedChain builtInNs(String ns) { if (ns == null) { return null; From 56a0f9666166391355b317d2c30968f28bb88b7f Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 15 Jul 2015 10:27:34 +0200 Subject: [PATCH 12/25] some new string builders --- .../flash/abc/types/MethodInfo.java | 33 ++++++++++--------- .../decompiler/flash/abc/types/Multiname.java | 17 +++++----- .../flash/generators/AS3Generator.java | 8 ++--- .../flash/gui/abc/DecompiledEditorPane.java | 8 ++--- .../decompiler/flash/gui/abc/DetailPanel.java | 3 +- .../flash/gui/abc/TraitsListItem.java | 4 +-- .../abc/tablemodels/MultinameTableModel.java | 3 +- 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java index 2756f6f1f..b389ab2f5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java @@ -251,42 +251,43 @@ public class MethodInfo { } public String toString(AVM2ConstantPool constants, List fullyQualifiedNames) { - String optionalStr = "["; + StringBuilder optionalStr = new StringBuilder(); + optionalStr.append("["); if (optional != null) { for (int i = 0; i < optional.length; i++) { if (i > 0) { - optionalStr += ","; + optionalStr.append(","); } - optionalStr += optional[i].toString(constants); + optionalStr.append(optional[i].toString(constants)); } } - optionalStr += "]"; + optionalStr.append("]"); - String param_typesStr = ""; + StringBuilder param_typesStr = new StringBuilder(); for (int i = 0; i < param_types.length; i++) { if (i > 0) { - param_typesStr += ","; + param_typesStr.append(","); } if (param_types[i] == 0) { - param_typesStr += "*"; + param_typesStr.append("*"); } else { - param_typesStr += constants.getMultiname(param_types[i]).toString(constants, fullyQualifiedNames); + param_typesStr.append(constants.getMultiname(param_types[i]).toString(constants, fullyQualifiedNames)); } } - String paramNamesStr = ""; + StringBuilder paramNamesStr = new StringBuilder(); for (int i = 0; i < paramNames.length; i++) { if (i > 0) { - paramNamesStr += ","; + paramNamesStr.append(","); } - paramNamesStr += constants.getString(paramNames[i]); + paramNamesStr.append(constants.getString(paramNames[i])); } - String ret_typeStr = ""; + String ret_typeStr; if (ret_type == 0) { - ret_typeStr += "*"; + ret_typeStr = "*"; } else { - ret_typeStr += constants.getMultiname(ret_type).toString(constants, fullyQualifiedNames); + ret_typeStr = constants.getMultiname(ret_type).toString(constants, fullyQualifiedNames); } return "param_types=" + param_typesStr + " ret_type=" + ret_typeStr + " name=\"" + constants.getString(name_index) + "\" flags=" + flags + " optional=" + optionalStr + " paramNames=" + paramNamesStr; @@ -325,7 +326,7 @@ public class MethodInfo { writer.hilightSpecial(IdentifiersDeobfuscation.printIdentifier(true, constants.getString(paramNames[i])), HighlightSpecialType.PARAM_NAME, i, pdata); } else { pdata.localName = "param" + (i + 1); - writer.hilightSpecial("param" + (i + 1), HighlightSpecialType.PARAM_NAME, i, pdata); + writer.hilightSpecial(pdata.localName, HighlightSpecialType.PARAM_NAME, i, pdata); } writer.appendNoHilight(":"); if (param_types[i] == 0) { @@ -344,7 +345,7 @@ public class MethodInfo { if (flagNeed_rest()) { String restAdd = ""; if ((param_types != null) && (param_types.length > 0)) { - restAdd += ", "; + restAdd = ", "; } restAdd += "... "; String restName; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index e770a2cc4..50a270658 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -264,22 +264,23 @@ public class Multiname { if (constants.getMultiname(qname_index).name_index == name_index) { return "ambiguousTypeName"; } - String typeNameStr = constants.getMultiname(qname_index).getName(constants, fullyQualifiedNames, raw); + StringBuilder typeNameStr = new StringBuilder() + typeNameStr.append(constants.getMultiname(qname_index).getName(constants, fullyQualifiedNames, raw)); if (!params.isEmpty()) { - typeNameStr += ".<"; + typeNameStr.append(".<"); for (int i = 0; i < params.size(); i++) { if (i > 0) { - typeNameStr += ","; + typeNameStr.append(","); } if (params.get(i) == 0) { - typeNameStr += "*"; + typeNameStr.append("*"); } else { - typeNameStr += constants.getMultiname(params.get(i)).getName(constants, fullyQualifiedNames, raw); + typeNameStr.append(constants.getMultiname(params.get(i)).getName(constants, fullyQualifiedNames, raw)); } } - typeNameStr += ">"; + typeNameStr.append(">"); } - return typeNameStr; + return typeNameStr.toString(); } public String getName(AVM2ConstantPool constants, List fullyQualifiedNames, boolean raw) { @@ -295,7 +296,7 @@ public class Multiname { String name = constants.getString(name_index); if (fullyQualifiedNames != null && fullyQualifiedNames.contains(name)) { DottedChain dc = getNameWithNamespace(constants); - return raw ? dc.toString() : dc.toPrintableString(true); + return raw ? dc.toRawString() : dc.toPrintableString(true); } return (isAttribute() ? "@" : "") + (raw ? name : IdentifiersDeobfuscation.printIdentifier(true, name)); } diff --git a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/AS3Generator.java b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/AS3Generator.java index 677d755b9..7ae192e6f 100644 --- a/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/AS3Generator.java +++ b/libsrc/ffdec_lib/test/com/jpexs/decompiler/flash/generators/AS3Generator.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -57,7 +57,7 @@ public class AS3Generator { StringBuilder s = new StringBuilder(); for (Trait t : abc.instance_info.get(classId).instance_traits.traits) { if (t instanceof TraitMethodGetterSetter) { - String name = t.getName(abc).getName(abc.constants, new ArrayList<>(), true); + String name = t.getName(abc).getName(abc.constants, null, true); if (name.startsWith("test")) { s.append("@Test\r\npublic void "); s.append(name); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 3781adb8f..54f465f87 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -351,7 +351,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL InstanceInfo ii = a.instance_info.get(cindex); for (int j = 0; j < ii.instance_traits.traits.size(); j++) { Trait tr = ii.instance_traits.traits.get(j); - if (ident.equals(tr.getName(a).getName(a.constants, new ArrayList<>(), false /*NOT RAW!*/))) { + if (ident.equals(tr.getName(a).getName(a.constants, null, false /*NOT RAW!*/))) { classIndex.setVal(cindex); abcIndex.setVal(i); traitIndex.setVal(j); @@ -366,7 +366,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL ClassInfo ci = a.class_info.get(cindex); for (int j = 0; j < ci.static_traits.traits.size(); j++) { Trait tr = ci.static_traits.traits.get(j); - if (ident.equals(tr.getName(a).getName(a.constants, new ArrayList<>(), false /*NOT RAW!*/))) { + if (ident.equals(tr.getName(a).getName(a.constants, null, false /*NOT RAW!*/))) { classIndex.setVal(cindex); abcIndex.setVal(i); traitIndex.setVal(j); @@ -532,7 +532,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { - name += ":" + currentTrait.getName(abc).getName(abc.constants, new ArrayList<>(), false); + name += ":" + currentTrait.getName(abc).getName(abc.constants, null, false); } } } @@ -576,7 +576,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { - name += ":" + currentTrait.getName(abc).getName(abc.constants, new ArrayList<>(), false); + name += ":" + currentTrait.getName(abc).getName(abc.constants, null, false); } displayMethod(pos, abc.findMethodIdByTraitId(classIndex, lastTraitIndex), name, currentTrait, isStatic); diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java index fdac71150..284035289 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DetailPanel.java @@ -28,7 +28,6 @@ import java.awt.CardLayout; import java.awt.FlowLayout; import java.awt.Insets; import java.awt.event.ActionEvent; -import java.util.ArrayList; import java.util.HashMap; import javax.swing.BoxLayout; import javax.swing.JButton; @@ -188,7 +187,7 @@ public class DetailPanel extends JPanel implements TagEditorPanel { traitNameLabel.setText("-"); } else { if (abcPanel != null) { - traitNameLabel.setText(trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, new ArrayList<>(), false)); + traitNameLabel.setText(trait.getName(abcPanel.abc).getName(abcPanel.abc.constants, null, false)); } } } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java b/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java index f866590a6..901325a91 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/TraitsListItem.java @@ -77,9 +77,9 @@ public class TraitsListItem { public String toStringName() { if ((type != Type.INITIALIZER) && isStatic) { - return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList<>(), false); + return abc.class_info.get(classIndex).static_traits.traits.get(index).getName(abc).getName(abc.constants, null, false); } else if ((type != Type.INITIALIZER) && (!isStatic)) { - return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(abc.constants, new ArrayList<>(), false); + return abc.instance_info.get(classIndex).instance_traits.traits.get(index).getName(abc).getName(abc.constants, null, false); } else if (!isStatic) { return "__" + STR_INSTANCE_INITIALIZER; } else { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java index c125480e7..e2c61362a 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/MultinameTableModel.java @@ -17,7 +17,6 @@ package com.jpexs.decompiler.flash.gui.abc.tablemodels; import com.jpexs.decompiler.flash.abc.ABC; -import java.util.ArrayList; import javax.swing.event.TableModelListener; import javax.swing.table.TableModel; @@ -128,7 +127,7 @@ public class MultinameTableModel implements TableModel { if (abc.constants.getMultiname(rowIndex).name_index == -1) { return ""; } - return abc.constants.getMultiname(rowIndex).getName(abc.constants, new ArrayList<>(), true); + return abc.constants.getMultiname(rowIndex).getName(abc.constants, null, true); case 3: if (rowIndex == 0) { return ""; From c0ea48896a98ba344204b37c33f35c76fd2797e2 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 15 Jul 2015 10:34:30 +0200 Subject: [PATCH 13/25] build fix --- .../src/com/jpexs/decompiler/flash/abc/types/Multiname.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index 50a270658..ed5542257 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -264,7 +264,7 @@ public class Multiname { if (constants.getMultiname(qname_index).name_index == name_index) { return "ambiguousTypeName"; } - StringBuilder typeNameStr = new StringBuilder() + StringBuilder typeNameStr = new StringBuilder(); typeNameStr.append(constants.getMultiname(qname_index).getName(constants, fullyQualifiedNames, raw)); if (!params.isEmpty()) { typeNameStr.append(".<"); From a7d5a9309604dc100e2fd6a921c9b1f43f4be4f9 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 15 Jul 2015 14:24:46 +0200 Subject: [PATCH 14/25] as2 export fix --- .../decompiler/flash/exporters/script/ExportScriptTask.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java index be3d76f44..b0a2435fc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.exporters.script; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; import com.jpexs.decompiler.flash.EventListener; +import com.jpexs.decompiler.flash.RetryTask; import com.jpexs.decompiler.flash.RunnableIOExResult; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.configuration.Configuration; @@ -114,6 +115,8 @@ public class ExportScriptTask implements Callable { eventListener.handleExportingEvent("script", index, count, f); } + new RetryTask(rio, handler).run(); + if (eventListener != null) { long time = stopTime - startTime; eventListener.handleExportedEvent("script", index, count, f + ", " + Helper.formatTimeSec(time)); From c9efbedc40df24b971314e8db8e076eca69b9555 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 15 Jul 2015 16:54:32 +0200 Subject: [PATCH 15/25] config setting to overwrite exported files --- .../src/com/jpexs/decompiler/flash/abc/ScriptPack.java | 3 +++ .../jpexs/decompiler/flash/configuration/Configuration.java | 4 ++++ .../decompiler/flash/exporters/script/ExportScriptTask.java | 6 +++++- .../decompiler/flash/console/CommandLineArgumentParser.java | 6 ++---- .../flash/gui/locales/AdvancedSettingsDialog.properties | 2 ++ .../flash/gui/locales/AdvancedSettingsDialog_hu.properties | 6 ++++++ 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 2b138d447..66bda3a12 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -194,6 +194,9 @@ public class ScriptPack extends AS3ClassTreeItem { if (!exportSettings.singleFile) { file = getExportFile(directory, exportSettings); + if (file.exists() && !Configuration.overwriteExistingFiles.get()) { + return file; + } } try (FileTextWriter writer = exportSettings.singleFile ? null : new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index d28ebb772..fd9a6f35a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -145,6 +145,10 @@ public class Configuration { @ConfigurationCategory("ui") public static final ConfigurationItem useRibbonInterface = null; + @ConfigurationDefaultBoolean(true) + @ConfigurationCategory("export") + public static final ConfigurationItem overwriteExistingFiles = null; + @ConfigurationDefaultBoolean(false) @ConfigurationCategory("export") public static final ConfigurationItem openFolderAfterFlaExport = null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java index b0a2435fc..4051cfa6c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportScriptTask.java @@ -82,11 +82,15 @@ public class ExportScriptTask implements Callable { public void run() throws IOException, InterruptedException { startTime = System.currentTimeMillis(); + File file = new File(f); if (!exportSettings.singleFile) { Path.createDirectorySafe(new File(directory)); + if (file.exists() && !Configuration.overwriteExistingFiles.get()) { + this.result = file; + return; + } } - File file = new File(f); try (FileTextWriter writer = exportSettings.singleFile ? null : new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(f))) { FileTextWriter writer2 = exportSettings.singleFile ? exportSettings.singleFileWriter : writer; ScriptExportMode exportMode = exportSettings.mode; diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 22586dc88..4b34608e3 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -164,7 +164,8 @@ public class CommandLineArgumentParser { Configuration.parallelSpeedUp, Configuration.internalFlashViewer, Configuration.autoDeobfuscate, - Configuration.cacheOnDisk + Configuration.cacheOnDisk, + Configuration.overwriteExistingFiles }; public static boolean isCommandLineMode() { @@ -584,9 +585,6 @@ public class CommandLineArgumentParser { } String key = cp[0]; String value = cp[1]; - if (key.toLowerCase().equals("paralelSpeedUp".toLowerCase())) { - key = "parallelSpeedUp"; - } for (ConfigurationItem item : commandlineConfigBoolean) { if (key.toLowerCase().equals(item.getName().toLowerCase())) { Boolean bValue = parseBooleanConfigValue(value); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index 7502d8b2a..af3740d03 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -369,3 +369,5 @@ config.description.deobfuscationOldMode = Disable new deobfuscation and use the config.name.ignoreCLikePackages = Ignore FlashCC / Alchemy or similar packages config.description.ignoreCLikePackages = FlashCC/Alchemy packages cannot usually be decompiled correctly. You can disable them to speedup other packages decompilation. +config.name.overwriteExistingFiles = Overwrite the existing files +config.description.overwriteExistingFiles = Overwrite the existing files during export. Currently only for AS2/3 scripts diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties index 545bb3a3d..6260dc64d 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog_hu.properties @@ -365,3 +365,9 @@ config.description.exeExportMode = EXE export m\u00f3d config.name.deobfuscationOldMode = Kapcsol\u00f3 a r\u00e9gi (5.x) deobfuszk\u00e1l\u00e1si m\u00f3d haszn\u00e1lat\u00e1hoz config.description.deobfuscationOldMode = Kikapcsolja az \u00faj deobfuszk\u00e1l\u00e1si m\u00f3dot \u00e9s az el\u0151z\u0151 verzi\u00f3kban l\u00e9v\u0151 m\u00f3dot haszn\u00e1lja. NEM AJ\u00c1NLOTT. + +config.name.ignoreCLikePackages = FlashCC / Alchemy vagy hasonl\u00f3 csomagok figyelmen k\u00edv\u00fcl hagy\u00e1sa +config.description.ignoreCLikePackages = FlashCC/Alchemy csomagok \u00e1ltal\u00e1ban nem ford\u00edthat\u00f3ak vissza hib\u00e1tlanul. Kikapcsolhatod hogy gyorsabban visszaford\u00edtsa a t\u00f6bbi csomagot. + +config.name.overwriteExistingFiles = L\u00e9tez\u0151 f\u00e1jlok fel\u00fcl\u00edr\u00e1sa +config.description.overwriteExistingFiles = Fel\u00fcl\u00edrja a l\u00e9tez\u0151 f\u00e1jlokat export\u00e1l\u00e1s sor\u00e1n. Jelenleg csak az AS2/3 szkriptekre \u00e9rv\u00e9nyes From a61ff138ea421e3f8f075a26acd0ac9932e32991 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 15 Jul 2015 20:15:04 +0200 Subject: [PATCH 16/25] AS editing fix + some DottedChain changes --- .../com/jpexs/decompiler/flash/SourceGeneratorLocalData.java | 2 +- .../flash/abc/avm2/parser/script/AVM2SourceGenerator.java | 4 ++-- .../flash/abc/avm2/parser/script/ActionScript3Parser.java | 4 ++-- .../flash/abc/avm2/parser/script/PropertyAVM2Item.java | 2 +- .../flash/abc/avm2/parser/script/UnresolvedAVM2Item.java | 2 +- .../decompiler/flash/console/CommandLineArgumentParser.java | 2 +- src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java index 12d6dfcc0..fa31413a6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SourceGeneratorLocalData.java @@ -69,7 +69,7 @@ public class SourceGeneratorLocalData implements Serializable { public boolean subMethod = false; public String getFullClass() { - return pkg == null || pkg.isEmpty() ? currentClass : pkg + "." + currentClass; + return pkg == null || pkg.isEmpty() ? currentClass : pkg.toRawString() + "." + currentClass; } public SourceGeneratorLocalData(HashMap registerVars, Integer inFunction, Boolean inMethod, Integer forInLevel) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 5cdca82f4..21bdce713 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -1458,7 +1458,7 @@ public class AVM2SourceGenerator implements SourceGenerator { List registerNames = new ArrayList<>(); List registerTypes = new ArrayList<>(); if (className != null) { - String fullClassName = pkg == null || pkg.isEmpty() ? className : pkg + "." + className; + String fullClassName = pkg == null || pkg.isEmpty() ? className : pkg.toRawString() + "." + className; registerTypes.add(fullClassName); localData.scopeStack.add(new LocalRegAVM2Item(null, registerNames.size(), null)); registerNames.add("this"); @@ -2444,7 +2444,7 @@ public class AVM2SourceGenerator implements SourceGenerator { TypeItem type = (TypeItem) typeItem; DottedChain dname = type.fullTypeName; - String pkg = dname.getWithoutLast().toString(); + String pkg = dname.getWithoutLast().toRawString(); String name = dname.getLast(); for (InstanceInfo ii : abc.instance_info) { Multiname mname = abc.constants.constant_multiname.get(ii.name_index); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index 03441596c..aecde14ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -920,8 +920,8 @@ public class ActionScript3Parser { //int publicNs = namespace; int protectedStaticNs = 0; - openedNamespaces.add(protectedNs = abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PROTECTED, abc.constants.getStringId(packageName == null ? (scriptName + "$0:"/*FIXME?*/ + classNameStr) : packageName.isEmpty() ? classNameStr : packageName + ":" + classNameStr, true)), 0, true)); - openedNamespaces.add(protectedStaticNs = abc.constants.getNamespaceId(new Namespace(Namespace.KIND_STATIC_PROTECTED, abc.constants.getStringId(packageName == null || packageName.isEmpty() ? classNameStr : packageName + ":" + classNameStr, true)), 0, true)); + openedNamespaces.add(protectedNs = abc.constants.getNamespaceId(new Namespace(Namespace.KIND_PROTECTED, abc.constants.getStringId(packageName == null ? (scriptName + "$0:"/*FIXME?*/ + classNameStr) : packageName.isEmpty() ? classNameStr : packageName.toRawString() + ":" + classNameStr, true)), 0, true)); + openedNamespaces.add(protectedStaticNs = abc.constants.getNamespaceId(new Namespace(Namespace.KIND_STATIC_PROTECTED, abc.constants.getStringId(packageName == null || packageName.isEmpty() ? classNameStr : packageName.toRawString() + ":" + classNameStr, true)), 0, true)); if (extendsStr != null) { List indices = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index 0385f7151..24053ae93 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -228,7 +228,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { Reference outPropType = new Reference<>(null); Reference outPropValue = new Reference<>(null); if (AVM2SourceGenerator.searchPrototypeChain(false, abcs, m.getNamespace(a.constants).getName(a.constants), m.getName(a.constants, null, true), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue)) { - objType = new TypeItem("".equals(outNs.getVal()) ? outName.getVal() : outNs.getVal() + "." + outName.getVal()); + objType = new TypeItem(outNs.getVal().isEmpty() ? outName.getVal() : outNs.getVal().toRawString() + "." + outName.getVal()); propType = outPropType.getVal(); propIndex = abc.constants.getMultinameId(new Multiname(Multiname.QNAME, abc.constants.getStringId(propertyName, true), diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java index 9d71abbf7..22575dbca 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java @@ -264,7 +264,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { if (resolved != null) { return resolved.toString(); } - return name.toString(); + return name.toRawString(); } @Override diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 4b34608e3..40e871a7a 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -1401,7 +1401,7 @@ public class CommandLineArgumentParser { inFile.delete(); tmpFile.renameTo(inFile); tmpFile = null; - System.out.println("" + inFile + " overwritten."); + System.out.println(inFile + " overwritten."); } System.out.println("OK"); } catch (FileNotFoundException ex) { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index abc659f6e..a7d07b24c 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -626,7 +626,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener Date: Wed, 15 Jul 2015 22:37:44 +0200 Subject: [PATCH 17/25] using HashSet in Graph.leadsTo --- .../ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java index 2998bf3c8..0f1c966e0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphPart.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph; import com.jpexs.decompiler.flash.BaseLocalData; import java.io.Serializable; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; /** @@ -123,7 +124,7 @@ public class GraphPart implements Serializable { return time; } - private boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, List visited, List loops) throws InterruptedException { + private boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, HashSet visited, List loops) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } @@ -192,7 +193,7 @@ public class GraphPart implements Serializable { for (Loop l : loops) { l.leadsToMark = 0; } - return leadsTo(localData, gr, code, part, new ArrayList<>(), loops); + return leadsTo(localData, gr, code, part, new HashSet<>(), loops); } public GraphPart(int start, int end) { From a91119657537d2b87356fe690a0f38b869e7c522 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Thu, 16 Jul 2015 13:20:23 +0200 Subject: [PATCH 18/25] DottedChains in identifier deobfuscation --- .../flash/IdentifiersDeobfuscation.java | 79 ++++++++----------- .../src/com/jpexs/decompiler/flash/SWF.java | 17 ++-- .../com/jpexs/decompiler/flash/abc/ABC.java | 2 +- .../jpexs/decompiler/flash/abc/ClassPath.java | 4 +- .../flash/abc/avm2/AVM2ConstantPool.java | 7 +- .../flash/abc/avm2/AVM2Deobfuscation.java | 78 +++++++++--------- .../decompiler/flash/abc/types/Multiname.java | 2 +- .../flash/abc/types/traits/TraitClass.java | 3 +- .../jpexs/decompiler/graph/DottedChain.java | 8 ++ 9 files changed, 97 insertions(+), 103 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java index 6aa174140..518a12d6d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java @@ -21,12 +21,13 @@ import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.Cache; import com.jpexs.helpers.Helper; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Random; import java.util.regex.Pattern; @@ -104,26 +105,27 @@ public class IdentifiersDeobfuscation { return false; } - private String fooString(boolean as3, HashMap deobfuscated, String orig, boolean firstUppercase, int rndSize) { + private String fooString(boolean as3, HashMap deobfuscated, String orig, boolean firstUppercase, int rndSize) { boolean exists; String ret; loopfoo: do { exists = false; int len = 3 + rnd.nextInt(rndSize - 3); - ret = ""; + StringBuilder sb = new StringBuilder(len); for (int i = 0; i < len; i++) { - String c = ""; + char c; if ((i % 2) == 0) { - c = "" + FOO_CHARACTERS.charAt(rnd.nextInt(FOO_CHARACTERS.length())); + c = FOO_CHARACTERS.charAt(rnd.nextInt(FOO_CHARACTERS.length())); } else { - c = "" + FOO_JOIN_CHARACTERS.charAt(rnd.nextInt(FOO_JOIN_CHARACTERS.length())); + c = FOO_JOIN_CHARACTERS.charAt(rnd.nextInt(FOO_JOIN_CHARACTERS.length())); } if (i == 0 && firstUppercase) { - c = c.toUpperCase(Locale.ENGLISH); + c = Character.toUpperCase(c); } - ret += c; + sb.append(c); } + ret = sb.toString(); if (allVariableNamesStr.contains(ret)) { exists = true; rndSize += 1; @@ -134,7 +136,7 @@ public class IdentifiersDeobfuscation { rndSize += 1; continue; } - if (deobfuscated.containsValue(ret)) { + if (deobfuscated.containsValue(DottedChain.parse(ret))) { exists = true; rndSize += 1; continue; @@ -143,7 +145,7 @@ public class IdentifiersDeobfuscation { return ret; } - public void deobfuscateInstanceNames(boolean as3, HashMap namesMap, RenameType renameType, List tags, Map selected) { + public void deobfuscateInstanceNames(boolean as3, HashMap namesMap, RenameType renameType, List tags, Map selected) { for (Tag t : tags) { if (t instanceof DefineSpriteTag) { deobfuscateInstanceNames(as3, namesMap, renameType, ((DefineSpriteTag) t).subTags, selected); @@ -170,50 +172,38 @@ public class IdentifiersDeobfuscation { } } - public String deobfuscatePackage(boolean as3, String pkg, HashMap namesMap, RenameType renameType, Map selected) { + public DottedChain deobfuscatePackage(boolean as3, DottedChain pkg, HashMap namesMap, RenameType renameType, Map selected) { if (namesMap.containsKey(pkg)) { return namesMap.get(pkg); } - String[] parts = null; - if (pkg.contains(".")) { - parts = pkg.split("\\."); - } else { - parts = new String[]{pkg}; - } - StringBuilder ret = new StringBuilder(); + List ret = new ArrayList<>(pkg.size()); boolean isChanged = false; - for (int p = 0; p < parts.length; p++) { - if (p > 0) { - ret.append("."); - } - String partChanged = deobfuscateName(as3, parts[p], false, "package", namesMap, renameType, selected); + for (int p = 0; p < pkg.size(); p++) { + String part = pkg.get(p); + String partChanged = deobfuscateName(as3, part, false, "package", namesMap, renameType, selected); if (partChanged != null) { - ret.append(partChanged); + ret.add(partChanged); isChanged = true; } else { - ret.append(parts[p]); + ret.add(part); } } if (isChanged) { - String retStr = ret.toString(); - namesMap.put(pkg, retStr); - return retStr; + DottedChain chain = new DottedChain(ret); + namesMap.put(pkg, chain); + return chain; } return null; } - public String deobfuscateNameWithPackage(boolean as3, String n, HashMap namesMap, RenameType renameType, Map selected) { - String pkg = null; - String name = ""; - if (n.contains(".")) { - pkg = n.substring(0, n.lastIndexOf('.')); - name = n.substring(n.lastIndexOf('.') + 1); - } else { - name = n; - } + public String deobfuscateNameWithPackage(boolean as3, String n, HashMap namesMap, RenameType renameType, Map selected) { + DottedChain nChain = DottedChain.parse(n); + DottedChain pkg = nChain.getWithoutLast(); + String name = nChain.getLast(); + boolean changed = false; if ((pkg != null) && (!pkg.isEmpty())) { - String changedPkg = deobfuscatePackage(as3, pkg, namesMap, renameType, selected); + DottedChain changedPkg = deobfuscatePackage(as3, pkg, namesMap, renameType, selected); if (changedPkg != null) { changed = true; pkg = changedPkg; @@ -258,22 +248,23 @@ public class IdentifiersDeobfuscation { return false; } - public String deobfuscateName(boolean as3, String s, boolean firstUppercase, String usageType, HashMap namesMap, RenameType renameType, Map selected) { + public String deobfuscateName(boolean as3, String s, boolean firstUppercase, String usageType, HashMap namesMap, RenameType renameType, Map selected) { boolean isValid = true; if (usageType == null) { usageType = "name"; } + DottedChain sChain = DottedChain.parse(s); if (selected != null) { - if (selected.containsKey(s)) { - return selected.get(s); + if (selected.containsKey(sChain)) { + return selected.get(sChain).toRawString(); } } isValid = isValidName(as3, s); if (!isValid) { - if (namesMap.containsKey(s)) { - return namesMap.get(s); + if (namesMap.containsKey(sChain)) { + return namesMap.get(sChain).toRawString(); } else { Integer cnt = typeCounts.get(usageType); if (cnt == null) { @@ -294,7 +285,7 @@ public class IdentifiersDeobfuscation { } else if (renameType == RenameType.RANDOMWORD) { ret = fooString(as3, namesMap, s, firstUppercase, DEFAULT_FOO_SIZE); } - namesMap.put(s, ret); + namesMap.put(DottedChain.parse(s), DottedChain.parse(ret)); return ret; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index a3d23cac2..1ab01d567 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -125,6 +125,7 @@ import com.jpexs.decompiler.flash.types.filters.BlendComposite; import com.jpexs.decompiler.flash.types.filters.FILTER; import com.jpexs.decompiler.flash.xfl.FLAVersion; import com.jpexs.decompiler.flash.xfl.XFLConverter; +import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.decompiler.graph.Graph; import com.jpexs.decompiler.graph.GraphSourceItem; import com.jpexs.decompiler.graph.GraphSourceItemContainer; @@ -284,7 +285,7 @@ public final class SWF implements SWFContainerItem, Timelined { public DefineBinaryDataTag binaryData; @Internal - private final HashMap deobfuscated = new HashMap<>(); + private final HashMap deobfuscated = new HashMap<>(); @Internal private final IdentifiersDeobfuscation deobfuscation = new IdentifiersDeobfuscation(); @@ -1886,8 +1887,8 @@ public final class SWF implements SWFContainerItem, Timelined { } public void renameAS2Identifier(String identifier, String newname) throws InterruptedException { - Map selected = new HashMap<>(); - selected.put(identifier, newname); + Map selected = new HashMap<>(); + selected.put(DottedChain.parse(identifier), DottedChain.parse(newname)); renameAS2Identifiers(null, selected); } @@ -1895,7 +1896,7 @@ public final class SWF implements SWFContainerItem, Timelined { return renameAS2Identifiers(renameType, null); } - private int renameAS2Identifiers(RenameType renameType, Map selected) throws InterruptedException { + private int renameAS2Identifiers(RenameType renameType, Map selected) throws InterruptedException { HashMap actionsMap = new HashMap<>(); List allFunctions = new ArrayList<>(); List> allVariableNames = new ArrayList<>(); @@ -1959,7 +1960,7 @@ public final class SWF implements SWFContainerItem, Timelined { String fname = dvf.toStringNoH(null); String changed = deobfuscation.deobfuscateName(false, fname, false, "method", deobfuscated, renameType, selected); if (changed != null) { - deobfuscated.put(fname, changed); + deobfuscated.put(DottedChain.parse(fname), DottedChain.parse(changed)); } } } @@ -1978,7 +1979,7 @@ public final class SWF implements SWFContainerItem, Timelined { String vname = dvf.toStringNoH(null); String changed = deobfuscation.deobfuscateName(false, vname, false, "attribute", deobfuscated, renameType, selected); if (changed != null) { - deobfuscated.put(vname, changed); + deobfuscated.put(DottedChain.parse(vname), DottedChain.parse(changed)); } } } @@ -2014,7 +2015,7 @@ public final class SWF implements SWFContainerItem, Timelined { changedNameStr = changedNameStr2; } ret++; - deobfuscated.put(nameStr, changedNameStr); + deobfuscated.put(DottedChain.parse(nameStr), DottedChain.parse(changedNameStr)); pos++; } name = mem.object; @@ -2038,7 +2039,7 @@ public final class SWF implements SWFContainerItem, Timelined { changedNameStr = changedNameStr2; } ret++; - deobfuscated.put(nameStr, changedNameStr); + deobfuscated.put(DottedChain.parse(nameStr), DottedChain.parse(changedNameStr)); pos++; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java index c57d15399..81a82284e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -282,7 +282,7 @@ public class ABC { } } - public void deobfuscateIdentifiers(HashMap namesMap, RenameType renameType, boolean classesOnly) { + public void deobfuscateIdentifiers(HashMap namesMap, RenameType renameType, boolean classesOnly) { Set stringUsages = getStringUsages(); Set namespaceUsages = getNsStringUsages(); Map stringUsageTypes = new HashMap<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java index 467b9ecce..3a93c56b6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ClassPath.java @@ -30,13 +30,13 @@ public class ClassPath { public final String className; public ClassPath(DottedChain packageStr, String className) { - this.packageStr = packageStr; + this.packageStr = packageStr == null ? DottedChain.EMPTY : packageStr; this.className = className; } @Override public String toString() { - return (packageStr == null || packageStr.isEmpty()) ? className : packageStr.toPrintableString(true) + "." + className; + return packageStr.isEmpty() ? className : packageStr.toPrintableString(true) + "." + className; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java index 642c4b5f2..17384cd43 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2ConstantPool.java @@ -421,12 +421,7 @@ public class AVM2ConstantPool { String str = getString(index); DottedChain chain = dottedChainCache.get(str); if (chain == null) { - if (str.isEmpty()) { - chain = DottedChain.EMPTY; - } else { - chain = new DottedChain(str.split("\\.")); - } - + chain = DottedChain.parse(str); dottedChainCache.put(str, chain); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java index 2589e03dc..69b9a9bf9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Deobfuscation.java @@ -18,8 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2; import com.jpexs.decompiler.flash.abc.RenameType; import com.jpexs.decompiler.graph.DottedChain; +import java.util.ArrayList; import java.util.HashMap; -import java.util.Locale; +import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; @@ -109,7 +110,7 @@ public class AVM2Deobfuscation { return null; } - private String fooString(HashMap deobfuscated, String orig, boolean firstUppercase, int rndSize, String usageType, RenameType renameType) { + private String fooString(HashMap deobfuscated, String orig, boolean firstUppercase, int rndSize, String usageType, RenameType renameType) { boolean exists; String ret; int pos = 0; @@ -131,18 +132,21 @@ public class AVM2Deobfuscation { } else if (renameType == RenameType.RANDOMWORD) { int len = 3 + rnd.nextInt(rndSize - 3); + StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i++) { - String c = ""; + char c; if ((i % 2) == 0) { - c = "" + FOO_CHARACTERS.charAt(rnd.nextInt(FOO_CHARACTERS.length())); + c = FOO_CHARACTERS.charAt(rnd.nextInt(FOO_CHARACTERS.length())); } else { - c = "" + FOO_JOIN_CHARACTERS.charAt(rnd.nextInt(FOO_JOIN_CHARACTERS.length())); + c = FOO_JOIN_CHARACTERS.charAt(rnd.nextInt(FOO_JOIN_CHARACTERS.length())); } if (i == 0 && firstUppercase) { - c = c.toUpperCase(Locale.ENGLISH); + c = Character.toUpperCase(c); } - ret += c; + sb.append(c); } + + ret = sb.toString(); } for (int i = 1; i < constants.getStringCount(); i++) { if (constants.getString(i).equals(ret)) { @@ -156,18 +160,18 @@ public class AVM2Deobfuscation { rndSize += 1; continue; } - if (deobfuscated.containsValue(ret)) { + if (deobfuscated.containsValue(DottedChain.parse(ret))) { exists = true; rndSize += 1; continue; } } while (exists); usageTypesCount.put(usageType, pos); - deobfuscated.put(orig, ret); + deobfuscated.put(DottedChain.parse(orig), DottedChain.parse(ret)); return ret; } - public int deobfuscatePackageName(Map stringUsageTypes, Set stringUsages, HashMap namesMap, int strIndex, RenameType renameType) { + public int deobfuscatePackageName(Map stringUsageTypes, Set stringUsages, HashMap namesMap, int strIndex, RenameType renameType) { if (strIndex <= 0) { return strIndex; } @@ -177,41 +181,35 @@ public class AVM2Deobfuscation { } boolean isValid = isValidNSPart(s); if (!isValid) { - String newName; - if (namesMap.containsKey(s)) { - newName = constants.setString(strIndex, namesMap.get(s)); + DottedChain sChain = DottedChain.parse(s); + DottedChain newName; + if (namesMap.containsKey(sChain)) { + newName = namesMap.get(sChain); + constants.setString(strIndex, newName.toRawString()); } else { - String[] parts = null; - if (s.contains(".")) { - parts = s.split("\\."); - } else { - parts = new String[]{s}; - } - StringBuilder ret = new StringBuilder(); - for (int p = 0; p < parts.length; p++) { - if (p > 0) { - ret.append("."); - } - if (!isValidNSPart(parts[p])) { - ret.append(fooString(namesMap, parts[p], false, DEFAULT_FOO_SIZE, "package", renameType)); + List ret = new ArrayList<>(); + for (int p = 0; p < sChain.size(); p++) { + String part = sChain.get(p); + if (!isValidNSPart(part)) { + ret.add(fooString(namesMap, part, false, DEFAULT_FOO_SIZE, "package", renameType)); } else { - ret.append(parts[p]); + ret.add(part); } } - newName = ret.toString(); - namesMap.put(s, newName); + newName = new DottedChain(ret); + namesMap.put(sChain, newName); } if (stringUsages.contains(strIndex)) { - strIndex = constants.addString(newName); + strIndex = constants.addString(newName.toRawString()); } else { - constants.setString(strIndex, newName); + constants.setString(strIndex, newName.toRawString()); } } return strIndex; } - public int deobfuscateName(Map stringUsageTypes, Set stringUsages, Set namespaceUsages, HashMap namesMap, int strIndex, boolean firstUppercase, RenameType renameType) { + public int deobfuscateName(Map stringUsageTypes, Set stringUsages, Set namespaceUsages, HashMap namesMap, int strIndex, boolean firstUppercase, RenameType renameType) { if (strIndex <= 0) { return strIndex; } @@ -238,18 +236,20 @@ public class AVM2Deobfuscation { } if (!isValid) { - String newname; - if (namesMap.containsKey(s)) { - newname = namesMap.get(s); + DottedChain newname; + DottedChain sChain = DottedChain.parse(s); + if (namesMap.containsKey(sChain)) { + newname = namesMap.get(sChain); } else { - newname = fooString(namesMap, constants.getString(strIndex), firstUppercase, DEFAULT_FOO_SIZE, stringUsageTypes.get(strIndex), renameType); + String str = fooString(namesMap, constants.getString(strIndex), firstUppercase, DEFAULT_FOO_SIZE, stringUsageTypes.get(strIndex), renameType); + newname = DottedChain.parse(str); } if (stringUsages.contains(strIndex) || namespaceUsages.contains(strIndex)) { // this name is already referenced as String strIndex = constants.addString(s); // add new index } - constants.setString(strIndex, newname); - if (!namesMap.containsKey(s)) { - namesMap.put(s, constants.getString(strIndex)); + constants.setString(strIndex, newname.toRawString()); + if (!namesMap.containsKey(sChain)) { + namesMap.put(sChain, DottedChain.parse(constants.getString(strIndex))); } } return strIndex; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index ed5542257..25ab403c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -294,7 +294,7 @@ public class Multiname { return isAttribute() ? "@*" : "*"; } else { String name = constants.getString(name_index); - if (fullyQualifiedNames != null && fullyQualifiedNames.contains(name)) { + if (fullyQualifiedNames != null && fullyQualifiedNames.contains(DottedChain.parse(name))) { DottedChain dc = getNameWithNamespace(constants); return raw ? dc.toRawString() : dc.toPrintableString(true); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java index 870966d97..29e2c5af1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/TraitClass.java @@ -381,8 +381,7 @@ public class TraitClass extends Trait implements TraitWithSlot { for (ScriptInfo si : tag.getABC().script_info) { for (Trait t : si.traits.traits) { ClassPath classPath = t.getPath(tag.getABC()); - DottedChain pkg = classPath.packageStr == null ? DottedChain.EMPTY : classPath.packageStr; - if (pkg.equals(packageName)) { + if (classPath.packageStr.equals(packageName)) { namesInThisPackage.add(classPath.className); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java index 3fbff38b9..204e3cad4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/DottedChain.java @@ -66,6 +66,14 @@ public class DottedChain implements Serializable { private final int hash; + public static final DottedChain parse(String name) { + if (name == null || name.isEmpty()) { + return DottedChain.EMPTY; + } else { + return new DottedChain(name.split("\\.")); + } + } + public DottedChain(List parts) { length = parts.size(); this.parts = parts.toArray(new String[length]); From 3e7d891280a98c9e79ab53eb4181d5ad47220930 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Thu, 16 Jul 2015 16:45:42 +0200 Subject: [PATCH 19/25] allParts is a set in Graph class --- .../flash/abc/avm2/graph/AVM2Graph.java | 8 +- .../decompiler/flash/action/ActionGraph.java | 3 +- .../src/com/jpexs/decompiler/graph/Graph.java | 74 ++++++++++--------- 3 files changed, 45 insertions(+), 40 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index b7f75d13c..29924ad11 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -77,8 +77,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; /** * @@ -136,7 +138,7 @@ public class AVM2Graph extends Graph { localData.refs = refs; localData.code = code; g.init(localData); - List allParts = new ArrayList<>(); + Set allParts = new HashSet<>(); for (GraphPart head : g.heads) { populateParts(head, allParts); } @@ -166,7 +168,7 @@ public class AVM2Graph extends Graph { } @Override - protected List check(Map> partCodes, Map partCodePos, GraphSource code, BaseLocalData localData, List allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + protected List check(Map> partCodes, Map partCodePos, GraphSource code, BaseLocalData localData, Set allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { List ret = null; AVM2LocalData aLocalData = (AVM2LocalData) localData; @@ -649,7 +651,7 @@ public class AVM2Graph extends Graph { } @Override - protected GraphPart checkPart(TranslateStack stack, BaseLocalData localData, GraphPart next, List allParts) { + protected GraphPart checkPart(TranslateStack stack, BaseLocalData localData, GraphPart next, Set allParts) { AVM2LocalData aLocalData = (AVM2LocalData) localData; Map> finallyJumps = aLocalData.finallyJumps; Map ignoredSwitches = aLocalData.ignoredSwitches; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java index 2292f5ed1..41e542faf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -53,6 +53,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * @@ -248,7 +249,7 @@ public class ActionGraph extends Graph { } @Override - protected List check(Map> partCodes, Map partCodePos, GraphSource code, BaseLocalData localData, List allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + protected List check(Map> partCodes, Map partCodePos, GraphSource code, BaseLocalData localData, Set allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { if (!output.isEmpty()) { if (output.get(output.size() - 1) instanceof StoreRegisterActionItem) { StoreRegisterActionItem str = (StoreRegisterActionItem) output.get(output.size() - 1); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index 60af2072e..de430e94e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -75,13 +75,13 @@ public class Graph { * Identify loop exits * * @param localData - * @param N All nodes + * @param allParts All nodes * @return */ - public Map> identifyLoopBreaks(BaseLocalData localData, List N) { + public Map> identifyLoopBreaks(BaseLocalData localData, Set allParts) { Map> lb = new HashMap<>(); - for (GraphPart b0 : N) { + for (GraphPart b0 : allParts) { List np = new ArrayList<>(b0.nextParts); np.addAll(b0.throwParts); for (GraphPart b : np) { @@ -107,10 +107,10 @@ public class Graph { * @param localData * @param loopContinues Result - list of loop headers * @param heads Entries - * @param N All Nodes + * @param appParts All Nodes */ - public void identifyLoops(BaseLocalData localData, List loopContinues, List heads, List N) { - for (GraphPart b : N) { + public void identifyLoops(BaseLocalData localData, List loopContinues, List heads, Set appParts) { + for (GraphPart b : appParts) { b.traversed = false; b.DFSP_pos = 0; b.irreducible = false; @@ -169,7 +169,7 @@ public class Graph { folParts.addAll(b0.throwParts); b0.traversed = true; - b0.DFSP_pos = DFSP_pos; //Mark b0’s position in DFSP + b0.DFSP_pos = DFSP_pos; //Mark b0’s position in DFSP for (GraphPart b : folParts) { b = checkPart(null, localData, b, null); if (b == null) { @@ -180,7 +180,7 @@ public class Graph { GraphPart nh = trav_loops_DFS(localData, loopHeaders, b, DFSP_pos + 1); tag_lhead(b0, nh); } else { - if (b.DFSP_pos > 0) { // b in DFSP(b0) + if (b.DFSP_pos > 0) { // b in DFSP(b0) //case (B) if (b.type != GraphPart.TYPE_LOOP_HEADER) { b.type = GraphPart.TYPE_LOOP_HEADER; @@ -194,7 +194,7 @@ public class Graph { if (h.DFSP_pos > 0) { // h in DFSP(b0) //case (D) tag_lhead(b0, h); - } else { // h not in DFSP(b0) + } else { // h not in DFSP(b0) //case (E), reentry b.type = GraphPart.TYPE_REENTRY; //TODO:and b0,b ? h.irreducible = true; @@ -233,7 +233,7 @@ public class Graph { } } - protected static void populateParts(GraphPart part, List allParts) { + protected static void populateParts(GraphPart part, Set allParts) { if (allParts.contains(part)) { return; } @@ -243,40 +243,43 @@ public class Graph { } } - public GraphPart deepCopy(GraphPart part, List visited, List copies) { - if (visited == null) { - visited = new ArrayList<>(); + public GraphPart deepCopy(GraphPart part) { + return deepCopy(part, new HashMap<>()); + } + + private GraphPart deepCopy(GraphPart part, Map copies) { + GraphPart copy = copies.get(part); + if (copy != null) { + return copy; } - if (copies == null) { - copies = new ArrayList<>(); - } - if (visited.contains(part)) { - return copies.get(visited.indexOf(part)); - } - visited.add(part); - GraphPart copy = new GraphPart(part.start, part.end); + + copy = new GraphPart(part.start, part.end); copy.path = part.path; - copies.add(copy); + copies.put(part, copy); copy.nextParts = new ArrayList<>(); for (int i = 0; i < part.nextParts.size(); i++) { - copy.nextParts.add(deepCopy(part.nextParts.get(i), visited, copies)); + copy.nextParts.add(deepCopy(part.nextParts.get(i), copies)); } + for (int i = 0; i < part.refs.size(); i++) { - copy.refs.add(deepCopy(part.refs.get(i), visited, copies)); + copy.refs.add(deepCopy(part.refs.get(i), copies)); } + return copy; } - public void resetGraph(GraphPart part, List visited) { + public void resetGraph(GraphPart part, Set visited) { if (visited.contains(part)) { return; } + visited.add(part); int pos = 0; for (GraphPart p : part.nextParts) { if (!visited.contains(p)) { p.path = part.path.sub(pos, p.end); } + resetGraph(p, visited); pos++; } @@ -567,7 +570,7 @@ public class Graph { } public List translate(BaseLocalData localData, int staticOperation, String path) throws InterruptedException { - List allParts = new ArrayList<>(); + Set allParts = new HashSet<>(); for (GraphPart head : heads) { populateParts(head, allParts); } @@ -919,11 +922,11 @@ public class Graph { return false; } - protected List check(Map> partCodes, Map partCodePos, GraphSource code, BaseLocalData localData, List allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { + protected List check(Map> partCodes, Map partCodePos, GraphSource code, BaseLocalData localData, Set allParts, TranslateStack stack, GraphPart parent, GraphPart part, List stopPart, List loops, List output, Loop currentLoop, int staticOperation, String path) throws InterruptedException { return null; } - protected GraphPart checkPart(TranslateStack stack, BaseLocalData localData, GraphPart part, List allParts) { + protected GraphPart checkPart(TranslateStack stack, BaseLocalData localData, GraphPart part, Set allParts) { return part; } @@ -995,9 +998,8 @@ public class Graph { list.remove(list.size() - 1); } - protected List printGraph(Map> partCodes, Map partCodePos, BaseLocalData localData, TranslateStack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, int staticOperation, String path) throws InterruptedException { - List visited = new ArrayList<>(); - return printGraph(partCodes, partCodePos, visited, localData, stack, allParts, parent, part, stopPart, loops, null, staticOperation, path, 0); + protected List printGraph(Map> partCodes, Map partCodePos, BaseLocalData localData, TranslateStack stack, Set allParts, GraphPart parent, GraphPart part, List stopPart, List loops, int staticOperation, String path) throws InterruptedException { + return printGraph(partCodes, partCodePos, new HashSet<>(), localData, stack, allParts, parent, part, stopPart, loops, null, staticOperation, path, 0); } protected GraphTargetItem checkLoop(LoopItem loopItem, BaseLocalData localData, List loops) { @@ -1005,7 +1007,7 @@ public class Graph { } //TODO: Make this faster!!! - private void getPrecontinues(String path, BaseLocalData localData, GraphPart parent, GraphPart part, List allParts, List loops, List stopPart) throws InterruptedException { + private void getPrecontinues(String path, BaseLocalData localData, GraphPart parent, GraphPart part, Set allParts, List loops, List stopPart) throws InterruptedException { try { markLevels(path, localData, part, allParts, loops); } catch (ThreadDeath | InterruptedException iex) { @@ -1063,13 +1065,13 @@ public class Graph { clearLoops(loops);*/ } - private void markLevels(String path, BaseLocalData localData, GraphPart part, List allParts, List loops) throws InterruptedException { + private void markLevels(String path, BaseLocalData localData, GraphPart part, Set allParts, List loops) throws InterruptedException { clearLoops(loops); - markLevels(path, localData, part, allParts, loops, new ArrayList<>(), 1, new ArrayList<>(), 0); + markLevels(path, localData, part, allParts, loops, new ArrayList<>(), 1, new HashSet<>(), 0); clearLoops(loops); } - private void markLevels(String path, BaseLocalData localData, GraphPart part, List allParts, List loops, List stopPart, int level, List visited, int recursionLevel) throws InterruptedException { + private void markLevels(String path, BaseLocalData localData, GraphPart part, Set allParts, List loops, List stopPart, int level, Set visited, int recursionLevel) throws InterruptedException { boolean debugMode = false; if (stopPart == null) { stopPart = new ArrayList<>(); @@ -1499,7 +1501,7 @@ public class Graph { } } - protected List printGraph(Map> partCodes, Map partCodePos, List visited, BaseLocalData localData, TranslateStack stack, List allParts, GraphPart parent, GraphPart part, List stopPart, List loops, List ret, int staticOperation, String path, int recursionLevel) throws InterruptedException { + protected List printGraph(Map> partCodes, Map partCodePos, Set visited, BaseLocalData localData, TranslateStack stack, Set allParts, GraphPart parent, GraphPart part, List stopPart, List loops, List ret, int staticOperation, String path, int recursionLevel) throws InterruptedException { if (Thread.currentThread().isInterrupted()) { throw new InterruptedException(); } From a6dc717225552dc530e7c0abb5d4a1932350ed7a Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Fri, 17 Jul 2015 09:19:51 +0200 Subject: [PATCH 20/25] calculating the action length without writing it to a stream --- .../decompiler/flash/SWFInputStream.java | 2 +- .../decompiler/flash/abc/ABCInputStream.java | 3 +- .../parser/script/AVM2SourceGenerator.java | 3 +- .../script/ExceptionMarkAVM2Instruction.java | 3 +- .../flash/abc/types/MethodBody.java | 3 +- .../jpexs/decompiler/flash/action/Action.java | 50 +++++-- .../flash/action/ActionGraphSource.java | 2 +- .../action/flashlite/ActionStrictMode.java | 32 +++-- .../flash/action/swf3/ActionGetURL.java | 26 ++-- .../flash/action/swf3/ActionGoToLabel.java | 24 ++-- .../flash/action/swf3/ActionGotoFrame.java | 32 +++-- .../flash/action/swf3/ActionSetTarget.java | 24 ++-- .../flash/action/swf3/ActionWaitForFrame.java | 25 ++-- .../flash/action/swf4/ActionGetURL2.java | 29 ++-- .../flash/action/swf4/ActionGotoFrame2.java | 36 +++-- .../flash/action/swf4/ActionIf.java | 23 +-- .../flash/action/swf4/ActionJump.java | 23 +-- .../flash/action/swf4/ActionPush.java | 134 +++++++++++------- .../action/swf4/ActionWaitForFrame2.java | 23 +-- .../flash/action/swf5/ActionConstantPool.java | 33 +++-- .../action/swf5/ActionDefineFunction.java | 42 +++--- .../action/swf5/ActionStoreRegister.java | 23 +-- .../flash/action/swf5/ActionWith.java | 27 ++-- .../action/swf7/ActionDefineFunction2.java | 66 +++++---- .../flash/action/swf7/ActionTry.java | 51 ++++--- .../flash/exporters/FontExporter.java | 3 +- .../flash/exporters/MovieExporter.java | 2 +- .../decompiler/flash/tags/DefineFont4Tag.java | 2 +- .../decompiler/flash/tags/JPEGTablesTag.java | 2 +- .../flash/types/BUTTONCONDACTION.java | 2 +- .../flash/types/gfx/GFxInputStream.java | 3 +- .../decompiler/flash/xfl/XFLConverter.java | 6 +- .../src/com/jpexs/helpers/ByteArrayRange.java | 4 +- .../com/jpexs/helpers/utf8/Utf8Helper.java | 14 +- .../flash/gui/action/ActionPanel.java | 3 + 35 files changed, 454 insertions(+), 326 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 9e2877a39..34b29b85d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -302,7 +302,7 @@ public class SWFInputStream implements AutoCloseable { private static final Logger logger = Logger.getLogger(SWFInputStream.class.getName()); - private static final byte[] BYTE_ARRAY_EMPTY = new byte[0]; + public static final byte[] BYTE_ARRAY_EMPTY = new byte[0]; private final List listeners = new ArrayList<>(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java index e154022f5..071c67736 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ABCInputStream.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.abc; import com.jpexs.decompiler.flash.EndOfStreamException; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.abc.types.Decimal; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.MethodInfo; @@ -63,7 +64,7 @@ public class ABCInputStream implements AutoCloseable { public byte[] stopBuffer() { if (bufferOs == null) { - return new byte[0]; + return SWFInputStream.BYTE_ARRAY_EMPTY; } byte[] ret = bufferOs.toByteArray(); bufferOs.reset(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 21bdce713..1b5dfc29e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; @@ -218,7 +219,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } catch (IOException ex) { Logger.getLogger(AVM2SourceGenerator.class.getName()).log(Level.SEVERE, null, ex); } - return new byte[0]; + return SWFInputStream.BYTE_ARRAY_EMPTY; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java index a592f9160..6a19fb00c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ExceptionMarkAVM2Instruction.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; @@ -38,7 +39,7 @@ public class ExceptionMarkAVM2Instruction extends AVM2Instruction { @Override public byte[] getBytes() { - return new byte[0]; + return SWFInputStream.BYTE_ARRAY_EMPTY; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index b3afc43b3..527b8c7ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.types; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ABCInputStream; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; @@ -92,7 +93,7 @@ public final class MethodBody implements Cloneable { public MethodBody(ABC abc) { this.traits = new Traits(); - this.codeBytes = new byte[0]; + this.codeBytes = SWFInputStream.BYTE_ARRAY_EMPTY; this.exceptions = new ABCException[0]; this.abc = abc; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index d5878e724..4d6320b8c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -195,7 +195,7 @@ public abstract class Action implements GraphSourceItem { } public int getTotalActionLength() { - return actionLength + 1 + ((actionCode >= 0x80) ? 2 : 0); + return actionLength + 1 + (actionCode >= 0x80 ? 2 : 0); } /** @@ -301,8 +301,19 @@ public abstract class Action implements GraphSourceItem { * @param version SWF version * @return Array of bytes */ - public byte[] getBytes(int version) { - return surroundWithAction(new byte[0], version); + public final byte[] getBytes(int version) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + SWFOutputStream sos = new SWFOutputStream(baos, version); + try { + getContentBytes(sos); + sos.close(); + } catch (IOException e) { + throw new Error("This should never happen.", e); + } + return surroundWithAction(baos.toByteArray(), version); + } + + protected void getContentBytes(SWFOutputStream sos) throws IOException { } /** @@ -311,18 +322,27 @@ public abstract class Action implements GraphSourceItem { * @param version SWF version * @return Length */ - public int getBytesLength(int version) { - return getBytes(version).length; + public final int getBytesLength(int version) { + int contentLength = getContentBytesLength(); + if (contentLength == -1) { + return getBytes(version).length; + } + + return contentLength + 1 + (actionCode >= 0x80 ? 2 : 0); + } + + protected int getContentBytesLength() { + return 0; } /** - * Uptates the action length to the length calculated from action bytes + * Updates the action length to the length calculated from action bytes * * @param version SWF version */ public void updateLength(int version) { - int length = getBytes(version).length; - actionLength = length - 1 - ((actionCode >= 0x80) ? 2 : 0); + int length = getBytesLength(version); + actionLength = length - 1 - (actionCode >= 0x80 ? 2 : 0); } /** @@ -332,7 +352,7 @@ public abstract class Action implements GraphSourceItem { * @param version SWF version * @return Byte array */ - protected byte[] surroundWithAction(byte[] data, int version) { + private byte[] surroundWithAction(byte[] data, int version) { ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); SWFOutputStream sos2 = new SWFOutputStream(baos2, version); try { @@ -942,7 +962,17 @@ public abstract class Action implements GraphSourceItem { } List out; try { - out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); + try { + out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); + } catch (InterruptedException ex) { + throw ex; + } catch (Exception ex) { + boolean inter = Thread.currentThread().isInterrupted(); + ActionList a = new ActionList(actions); + String b = a.toString(); + String c = b; + throw ex; + } } catch (OutOfMemoryError | TranslateException | StackOverflowError ex2) { logger.log(Level.SEVERE, "Decompilation error in: " + path, ex2); if (ex2 instanceof OutOfMemoryError) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java index 0c124a16b..88de6e40e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraphSource.java @@ -78,7 +78,7 @@ public class ActionGraphSource extends GraphSource { @Override public List translatePart(GraphPart part, BaseLocalData localData, TranslateStack stack, int start, int end, int staticOperation, String path) throws InterruptedException { - return (Action.actionsPartToTree(registerNames, variables, functions, stack, actions, start, end, version, staticOperation, path)); + return Action.actionsPartToTree(registerNames, variables, functions, stack, actions, start, end, version, staticOperation, path); } private List posCache = null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java index 8248c4729..ac2aa636a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/flashlite/ActionStrictMode.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.flashlite; import com.jpexs.decompiler.flash.SWFInputStream; @@ -23,7 +24,6 @@ import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -43,16 +43,18 @@ public class ActionStrictMode extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI8(mode); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI8(mode); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 1; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java index 9a3db56a1..dc32ad192 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGetURL.java @@ -30,7 +30,7 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -63,17 +63,19 @@ public class ActionGetURL extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeString(urlString); - sos.writeString(targetString); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeString(urlString); + sos.writeString(targetString); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return Utf8Helper.getBytesLength(urlString) + Utf8Helper.getBytesLength(targetString) + 2; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java index 5a788489b..1e9808715 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGoToLabel.java @@ -25,7 +25,7 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -52,16 +52,18 @@ public class ActionGoToLabel extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeString(label); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeString(label); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return Utf8Helper.getBytesLength(label) + 1; } public ActionGoToLabel(FlasmLexer lexer) throws IOException, ActionParseException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java index 57876b701..a63f49b3b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionGotoFrame.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.swf3; import com.jpexs.decompiler.flash.SWFInputStream; @@ -23,7 +24,6 @@ import com.jpexs.decompiler.flash.action.parser.ActionParseException; import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -48,16 +48,18 @@ public class ActionGotoFrame extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI16(frame); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI16(frame); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 2; } public ActionGotoFrame(FlasmLexer lexer) throws IOException, ActionParseException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java index eb3abbfde..45991ad25 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionSetTarget.java @@ -25,7 +25,7 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -52,16 +52,18 @@ public class ActionSetTarget extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeString(targetName); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeString(targetName); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return Utf8Helper.getBytesLength(targetName) + 1; } public ActionSetTarget(FlasmLexer lexer) throws IOException, ActionParseException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java index 3d7a51039..54ec7074b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf3/ActionWaitForFrame.java @@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.action.special.ActionStore; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -64,17 +63,19 @@ public class ActionWaitForFrame extends Action implements ActionStore { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI16(frame); - sos.writeUI8(skipCount); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI16(frame); + sos.writeUI8(skipCount); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 3; } public ActionWaitForFrame(FlasmLexer lexer) throws IOException, ActionParseException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java index 9cd4f5721..55d96db47 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java @@ -36,7 +36,6 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.types.annotations.Reserved; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -78,19 +77,21 @@ public class ActionGetURL2 extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUB(1, loadVariablesFlag ? 1 : 0); - sos.writeUB(1, loadTargetFlag ? 1 : 0); - sos.writeUB(4, reserved); - sos.writeUB(2, sendVarsMethod); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUB(1, loadVariablesFlag ? 1 : 0); + sos.writeUB(1, loadTargetFlag ? 1 : 0); + sos.writeUB(4, reserved); + sos.writeUB(2, sendVarsMethod); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 1; } public ActionGetURL2(FlasmLexer lexer) throws IOException, ActionParseException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java index bf8990a92..94314c2a7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java @@ -25,7 +25,6 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.types.annotations.Reserved; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -59,21 +58,28 @@ public class ActionGotoFrame2 extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUB(6, reserved); - sos.writeUB(1, sceneBiasFlag ? 1 : 0); - sos.writeUB(1, playFlag ? 1 : 0); - if (sceneBiasFlag) { - sos.writeUI16(sceneBias); - } - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUB(6, reserved); + sos.writeUB(1, sceneBiasFlag ? 1 : 0); + sos.writeUB(1, playFlag ? 1 : 0); + if (sceneBiasFlag) { + sos.writeUI16(sceneBias); } - return surroundWithAction(baos.toByteArray(), version); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + int res = 1; + if (sceneBiasFlag) { + res += 2; + } + + return res; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java index eb4199b61..f9af92b1b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java @@ -25,7 +25,6 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.List; import java.util.Set; @@ -66,16 +65,18 @@ public class ActionIf extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeSI16(offset); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeSI16(offset); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 2; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java index 92bf4e6ed..735a7056b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionJump.java @@ -26,7 +26,6 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.graph.GraphSource; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.List; import java.util.Set; @@ -67,16 +66,18 @@ public class ActionJump extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeSI16(offset); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeSI16(offset); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 2; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index 40d498120..70c327738 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -40,7 +40,7 @@ import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.decompiler.graph.model.FalseItem; import com.jpexs.decompiler.graph.model.TrueItem; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -135,57 +135,95 @@ public class ActionPush extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - for (Object o : values) { - if (o instanceof String) { - sos.writeUI8(0); - sos.writeString((String) o); - } else if (o instanceof Float) { - sos.writeUI8(1); - sos.writeFLOAT((Float) o); - } else if (o instanceof Null) { - sos.writeUI8(2); - } else if (o instanceof Undefined) { - sos.writeUI8(3); - } else if (o instanceof RegisterNumber) { - sos.writeUI8(4); - sos.writeUI8(((RegisterNumber) o).number); - } else if (o instanceof Boolean) { - sos.writeUI8(5); - sos.writeUI8((Boolean) o ? 1 : 0); - } else if (o instanceof Double || o instanceof Long) { - if (o instanceof Long) { - long l = (Long) o; - if (l < -0x80000000 || l > 0x7fffffff) { - o = (double) l; - } - } - if (o instanceof Double) { - sos.writeUI8(6); - sos.writeDOUBLE((Double) o); - } else if (o instanceof Long) { - sos.writeUI8(7); - sos.writeSI32((Long) o); - } - } else if (o instanceof ConstantIndex) { - int cIndex = ((ConstantIndex) o).index; - if (cIndex < 256) { - sos.writeUI8(8); - sos.writeUI8(cIndex); - } else { - sos.writeUI8(9); - sos.writeUI16(cIndex); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + for (Object o : values) { + if (o instanceof String) { + sos.writeUI8(0); + sos.writeString((String) o); + } else if (o instanceof Float) { + sos.writeUI8(1); + sos.writeFLOAT((Float) o); + } else if (o instanceof Null) { + sos.writeUI8(2); + } else if (o instanceof Undefined) { + sos.writeUI8(3); + } else if (o instanceof RegisterNumber) { + sos.writeUI8(4); + sos.writeUI8(((RegisterNumber) o).number); + } else if (o instanceof Boolean) { + sos.writeUI8(5); + sos.writeUI8((Boolean) o ? 1 : 0); + } else if (o instanceof Double || o instanceof Long) { + if (o instanceof Long) { + long l = (Long) o; + if (l < -0x80000000 || l > 0x7fffffff) { + o = (double) l; } } + if (o instanceof Double) { + sos.writeUI8(6); + sos.writeDOUBLE((Double) o); + } else if (o instanceof Long) { + sos.writeUI8(7); + sos.writeSI32((Long) o); + } + } else if (o instanceof ConstantIndex) { + int cIndex = ((ConstantIndex) o).index; + if (cIndex < 256) { + sos.writeUI8(8); + sos.writeUI8(cIndex); + } else { + sos.writeUI8(9); + sos.writeUI16(cIndex); + } } - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); } - return surroundWithAction(baos.toByteArray(), version); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + int res = 0; + for (Object o : values) { + if (o instanceof String) { + res += Utf8Helper.getBytesLength((String) o) + 2; + } else if (o instanceof Float) { + res += 5; + } else if (o instanceof Null) { + res++; + } else if (o instanceof Undefined) { + res++; + } else if (o instanceof RegisterNumber) { + res += 2; + } else if (o instanceof Boolean) { + res += 2; + } else if (o instanceof Double || o instanceof Long) { + if (o instanceof Long) { + long l = (Long) o; + if (l < -0x80000000 || l > 0x7fffffff) { + o = (double) l; + } + } + if (o instanceof Double) { + res += 9; + } else if (o instanceof Long) { + res += 5; + } + } else if (o instanceof ConstantIndex) { + int cIndex = ((ConstantIndex) o).index; + if (cIndex < 256) { + res += 2; + } else { + res += 3; + } + } + } + + return res; } public static boolean isValidValue(Object value) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java index 59569ca52..eedc9bd2d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionWaitForFrame2.java @@ -29,7 +29,6 @@ import com.jpexs.decompiler.flash.action.special.ActionStore; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -100,16 +99,18 @@ public class ActionWaitForFrame2 extends Action implements ActionStore { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI8(skipCount); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI8(skipCount); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 1; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java index e3854d408..fd3f3ed0e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionConstantPool.java @@ -25,7 +25,7 @@ import com.jpexs.decompiler.flash.action.parser.pcode.FlasmLexer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -63,19 +63,26 @@ public class ActionConstantPool extends Action { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI16(constantPool.size()); - for (String s : constantPool) { - sos.writeString(s); - } - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI16(constantPool.size()); + for (String s : constantPool) { + sos.writeString(s); } - return surroundWithAction(baos.toByteArray(), version); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + int res = 2; + for (String s : constantPool) { + res += Utf8Helper.getBytesLength(s) + 1; + } + + return res; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index 6943653e7..f74e189d7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -29,7 +29,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -84,28 +84,32 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta @Override public long getHeaderSize() { - return getBytes(version).length; + return getBytesLength(version); } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); - try { - sos.writeString(functionName); - sos.writeUI16(paramNames.size()); - for (String s : paramNames) { - sos.writeString(s); - } - sos.writeUI16(codeSize); - sos.close(); - - baos2.write(surroundWithAction(baos.toByteArray(), version)); - } catch (IOException e) { - throw new Error("This should never happen.", e); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeString(functionName); + sos.writeUI16(paramNames.size()); + for (String s : paramNames) { + sos.writeString(s); } - return baos2.toByteArray(); + sos.writeUI16(codeSize); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + int res = Utf8Helper.getBytesLength(functionName) + 5; + for (String s : paramNames) { + res += Utf8Helper.getBytesLength(s) + 1; + } + + return res; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java index 4100767a4..5433078c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java @@ -34,7 +34,6 @@ import com.jpexs.decompiler.flash.action.swf4.RegisterNumber; import com.jpexs.decompiler.graph.GraphSourceItemPos; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -59,16 +58,18 @@ public class ActionStoreRegister extends Action implements StoreTypeAction { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI8(registerNumber); - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return surroundWithAction(baos.toByteArray(), version); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI8(registerNumber); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 1; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java index 0da5d8aa0..5a910f874 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java @@ -27,7 +27,6 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -63,18 +62,18 @@ public class ActionWith extends Action implements GraphSourceItemContainer { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUI16(codeSize); - sos.close(); - baos2.write(surroundWithAction(baos.toByteArray(), version)); - } catch (IOException e) { - throw new Error("This should never happen.", e); - } - return baos2.toByteArray(); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUI16(codeSize); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + return 2; } @Override @@ -110,7 +109,7 @@ public class ActionWith extends Action implements GraphSourceItemContainer { @Override public long getHeaderSize() { - return surroundWithAction(new byte[]{0, 0}, version).length; + return super.getBytesLength(version) + 2; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 3fd1b3d44..0709f24db 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -30,7 +30,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -143,40 +143,44 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont @Override public long getHeaderSize() { - return getBytes(version).length; + return getBytesLength(version); } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); - try { - sos.writeString(functionName); - sos.writeUI16(paramNames.size()); - sos.writeUI8(registerCount); - sos.writeUB(1, preloadParentFlag ? 1 : 0); - sos.writeUB(1, preloadRootFlag ? 1 : 0); - sos.writeUB(1, suppressSuperFlag ? 1 : 0); - sos.writeUB(1, preloadSuperFlag ? 1 : 0); - sos.writeUB(1, suppressArgumentsFlag ? 1 : 0); - sos.writeUB(1, preloadArgumentsFlag ? 1 : 0); - sos.writeUB(1, suppressThisFlag ? 1 : 0); - sos.writeUB(1, preloadThisFlag ? 1 : 0); - sos.writeUB(7, reserved); - sos.writeUB(1, preloadGlobalFlag ? 1 : 0); - for (int i = 0; i < paramNames.size(); i++) { - sos.writeUI8(paramRegisters.get(i)); - sos.writeString(paramNames.get(i)); - } - sos.writeUI16(codeSize); - sos.close(); - - baos2.write(surroundWithAction(baos.toByteArray(), version)); - } catch (IOException e) { - throw new Error("This should never happen.", e); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeString(functionName); + sos.writeUI16(paramNames.size()); + sos.writeUI8(registerCount); + sos.writeUB(1, preloadParentFlag ? 1 : 0); + sos.writeUB(1, preloadRootFlag ? 1 : 0); + sos.writeUB(1, suppressSuperFlag ? 1 : 0); + sos.writeUB(1, preloadSuperFlag ? 1 : 0); + sos.writeUB(1, suppressArgumentsFlag ? 1 : 0); + sos.writeUB(1, preloadArgumentsFlag ? 1 : 0); + sos.writeUB(1, suppressThisFlag ? 1 : 0); + sos.writeUB(1, preloadThisFlag ? 1 : 0); + sos.writeUB(7, reserved); + sos.writeUB(1, preloadGlobalFlag ? 1 : 0); + for (int i = 0; i < paramNames.size(); i++) { + sos.writeUI8(paramRegisters.get(i)); + sos.writeString(paramNames.get(i)); } - return baos2.toByteArray(); + sos.writeUI16(codeSize); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + int res = Utf8Helper.getBytesLength(functionName) + 8; + for (int i = 0; i < paramNames.size(); i++) { + res += Utf8Helper.getBytesLength(paramNames.get(i)) + 2; + } + + return res; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java index ce902c5b0..77b8f62c0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionTry.java @@ -33,7 +33,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemContainer; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import com.jpexs.helpers.Helper; -import java.io.ByteArrayOutputStream; +import com.jpexs.helpers.utf8.Utf8Helper; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -95,27 +95,34 @@ public class ActionTry extends Action implements GraphSourceItemContainer { } @Override - public byte[] getBytes(int version) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - SWFOutputStream sos = new SWFOutputStream(baos, version); - try { - sos.writeUB(5, reserved); - sos.writeUB(1, catchInRegisterFlag ? 1 : 0); - sos.writeUB(1, finallyBlockFlag ? 1 : 0); - sos.writeUB(1, catchBlockFlag ? 1 : 0); - sos.writeUI16((int) trySize); - sos.writeUI16((int) catchSize); - sos.writeUI16((int) finallySize); - if (catchInRegisterFlag) { - sos.writeUI8(catchRegister); - } else { - sos.writeString(catchName == null ? "" : catchName); - } - sos.close(); - } catch (IOException e) { - throw new Error("This should never happen.", e); + protected void getContentBytes(SWFOutputStream sos) throws IOException { + sos.writeUB(5, reserved); + sos.writeUB(1, catchInRegisterFlag ? 1 : 0); + sos.writeUB(1, finallyBlockFlag ? 1 : 0); + sos.writeUB(1, catchBlockFlag ? 1 : 0); + sos.writeUI16((int) trySize); + sos.writeUI16((int) catchSize); + sos.writeUI16((int) finallySize); + if (catchInRegisterFlag) { + sos.writeUI8(catchRegister); + } else { + sos.writeString(catchName == null ? "" : catchName); } - return surroundWithAction(baos.toByteArray(), version); + } + + /** + * Gets the length of action converted to bytes + * + * @return Length + */ + @Override + protected int getContentBytesLength() { + int res = 8; + if (!catchInRegisterFlag) { + res += Utf8Helper.getBytesLength(catchName == null ? "" : catchName); + } + + return res; } public ActionTry(FlasmLexer lexer, int version) throws IOException, ActionParseException { @@ -173,7 +180,7 @@ public class ActionTry extends Action implements GraphSourceItemContainer { @Override public long getHeaderSize() { - return getBytes(version).length; + return getBytesLength(version); } public long getTrySize() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FontExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FontExporter.java index f76a68eca..d14c41969 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FontExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FontExporter.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.ApplicationInfo; import com.jpexs.decompiler.flash.EventListener; import com.jpexs.decompiler.flash.RetryTask; import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.exporters.modes.FontExportMode; import com.jpexs.decompiler.flash.exporters.settings.FontExportSettings; @@ -122,7 +123,7 @@ public class FontExporter { } catch (IOException ex) { Logger.getLogger(FontExporter.class.getName()).log(Level.SEVERE, null, ex); } - return new byte[0]; + return SWFInputStream.BYTE_ARRAY_EMPTY; } public void exportFont(FontTag ft, FontExportMode mode, File file) throws IOException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java index d8e16cb2c..6483aeb33 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/MovieExporter.java @@ -98,7 +98,7 @@ public class MovieExporter { HashMap frames = new HashMap<>(); SWF.populateVideoFrames(videoStream.characterID, swf.tags, frames); if (frames.isEmpty()) { - return new byte[0]; + return SWFInputStream.BYTE_ARRAY_EMPTY; } //double ms = 1000.0f / ((float) frameRate); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java index a8224373e..4c91576f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java @@ -62,7 +62,7 @@ public class DefineFont4Tag extends CharacterTag { super(swf, ID, NAME, null); fontID = swf.getNextCharacterId(); fontName = "New font"; - fontData = new byte[0]; + fontData = SWFInputStream.BYTE_ARRAY_EMPTY; } public DefineFont4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java index a23b34c61..1517eaab4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java @@ -39,7 +39,7 @@ public class JPEGTablesTag extends Tag { */ public JPEGTablesTag(SWF swf) { super(swf, ID, NAME, null); - jpegData = new byte[0]; + jpegData = SWFInputStream.BYTE_ARRAY_EMPTY; } public JPEGTablesTag(SWFInputStream sis, ByteArrayRange data) throws IOException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index dfc3ed7df..f31ccfd27 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -58,7 +58,7 @@ public class BUTTONCONDACTION implements ASMSource, Serializable { public BUTTONCONDACTION() { swf = null; tag = null; - actionBytes = new ByteArrayRange(new byte[0]); + actionBytes = new ByteArrayRange(SWFInputStream.BYTE_ARRAY_EMPTY); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GFxInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GFxInputStream.java index f7b874b94..31b014632 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GFxInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/GFxInputStream.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.types.gfx; +import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.dumpview.DumpInfo; import com.jpexs.helpers.MemoryInputStream; import com.jpexs.helpers.utf8.Utf8Helper; @@ -215,7 +216,7 @@ public class GFxInputStream { */ public byte[] readBytes(long count, String name) throws IOException { if (count <= 0) { - return new byte[0]; + return SWFInputStream.BYTE_ARRAY_EMPTY; } newDumpLevel(name, "bytes"); byte[] ret = new byte[(int) count]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 2eb4a2d50..d693fa031 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -1366,7 +1366,7 @@ public class XFLConverter { boolean soundType = false; boolean soundSize = false; long soundSampleCount = 0; - byte[] soundData = new byte[0]; + byte[] soundData = SWFInputStream.BYTE_ARRAY_EMPTY; int[] rateMap = {5, 11, 22, 44}; String exportFormat = "flv"; if (symbol instanceof SoundStreamHeadTypeTag) { @@ -1491,7 +1491,7 @@ public class XFLConverter { } SoundTag st = (SoundTag) symbol; SoundFormat fmt = st.getSoundFormat(); - byte[] data = new byte[0]; + byte[] data = SWFInputStream.BYTE_ARRAY_EMPTY; try { data = new SoundExporter().exportSound(st, SoundExportMode.MP3_WAV); } catch (IOException ex) { @@ -1544,7 +1544,7 @@ public class XFLConverter { break; } - byte[] data = new byte[0]; + byte[] data = SWFInputStream.BYTE_ARRAY_EMPTY; try { data = new MovieExporter().exportMovie(video, MovieExportMode.FLV); } catch (IOException ex) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/ByteArrayRange.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/ByteArrayRange.java index 9168ba7ae..2682a585e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/ByteArrayRange.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/ByteArrayRange.java @@ -16,13 +16,15 @@ */ package com.jpexs.helpers; +import com.jpexs.decompiler.flash.SWFInputStream; + /** * * @author JPEXS */ public class ByteArrayRange { - public static final ByteArrayRange EMPTY = new ByteArrayRange(new byte[0]); + public static final ByteArrayRange EMPTY = new ByteArrayRange(SWFInputStream.BYTE_ARRAY_EMPTY); private final byte[] array; diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/utf8/Utf8Helper.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/utf8/Utf8Helper.java index ba938b072..e9691dbe2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/utf8/Utf8Helper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/utf8/Utf8Helper.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library 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 * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.helpers.utf8; import java.io.UnsupportedEncodingException; @@ -38,4 +39,9 @@ public class Utf8Helper { public static byte[] getBytes(String string) { return string.getBytes(charset); } + + public static int getBytesLength(String string) { + // todo: make it faster without actually writing it to an array + return string.getBytes(charset).length; + } } diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 5f25d66ff..7dd06a435 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -52,6 +52,7 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; +import com.jpexs.helpers.Stopwatch; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; @@ -423,7 +424,9 @@ public class ActionPanel extends JPanel implements SearchListener Date: Fri, 17 Jul 2015 09:23:16 +0200 Subject: [PATCH 21/25] debug things removed --- .../com/jpexs/decompiler/flash/action/Action.java | 12 +----------- .../decompiler/flash/gui/action/ActionPanel.java | 3 --- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java index 4d6320b8c..9fd06575e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/Action.java @@ -962,17 +962,7 @@ public abstract class Action implements GraphSourceItem { } List out; try { - try { - out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); - } catch (InterruptedException ex) { - throw ex; - } catch (Exception ex) { - boolean inter = Thread.currentThread().isInterrupted(); - ActionList a = new ActionList(actions); - String b = a.toString(); - String c = b; - throw ex; - } + out = ActionGraph.translateViaGraph(cnt.getRegNames(), variables2, functions, actions.subList(adr2ip(actions, endAddr), adr2ip(actions, endAddr + size)), version, staticOperation, path + (cntName == null ? "" : "/" + cntName)); } catch (OutOfMemoryError | TranslateException | StackOverflowError ex2) { logger.log(Level.SEVERE, "Decompilation error in: " + path, ex2); if (ex2 instanceof OutOfMemoryError) { diff --git a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 7dd06a435..5f25d66ff 100644 --- a/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -52,7 +52,6 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; -import com.jpexs.helpers.Stopwatch; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; @@ -424,9 +423,7 @@ public class ActionPanel extends JPanel implements SearchListener Date: Fri, 17 Jul 2015 09:35:03 +0200 Subject: [PATCH 22/25] allow to export only as2 or as3 from command line --- libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java | 4 ++++ .../flash/console/CommandLineArgumentParser.java | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 1ab01d567..e15864d9c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -1348,6 +1348,10 @@ public final class SWF implements SWFContainerItem, Timelined { } public List exportActionScript(AbortRetryIgnoreHandler handler, String outdir, ScriptExportSettings exportSettings, boolean parallel, EventListener evl) throws IOException { + return exportActionScript(handler, outdir, exportSettings, parallel, evl, true, true); + } + + public List exportActionScript(AbortRetryIgnoreHandler handler, String outdir, ScriptExportSettings exportSettings, boolean parallel, EventListener evl, boolean as2, boolean as3) throws IOException { List ret = new ArrayList<>(); if (isAS3()) { diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 40e871a7a..2cac50ea2 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -1042,6 +1042,8 @@ public class CommandLineArgumentParser { } String[] validExportItems = new String[]{ "script", + "script_as2", + "script_as3", "image", "shape", "morphshape", @@ -1285,7 +1287,10 @@ public class CommandLineArgumentParser { } ScriptExportSettings scriptExportSettings = new ScriptExportSettings(enumFromStr(formats.get("script"), ScriptExportMode.class), singleScriptFile); - if (exportAll || exportFormats.contains("script")) { + boolean exportAllScript = exportAll || exportFormats.contains("script"); + boolean exportAs2Script = exportAllScript || exportFormats.contains("script_as2"); + boolean exportAs3Script = exportAllScript || exportFormats.contains("script_as3"); + if (exportAs2Script || exportAs3Script) { System.out.println("Exporting scripts..."); if (as3classes.isEmpty()) { as3classes = parseSelectClassOld(args); @@ -1301,7 +1306,7 @@ public class CommandLineArgumentParser { exportOK = swf.exportAS3Class(as3class, scriptsFolder, scriptExportSettings, parallel, evl) && exportOK; } } else { - exportOK = swf.exportActionScript(handler, scriptsFolder, scriptExportSettings, parallel, evl) != null && exportOK; + exportOK = swf.exportActionScript(handler, scriptsFolder, scriptExportSettings, parallel, evl, exportAs2Script, exportAs3Script) != null && exportOK; } } } From 684af502a6e9540d5961889a29eaaab62ef47566 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Fri, 17 Jul 2015 10:37:04 +0200 Subject: [PATCH 23/25] #978 Class names are case sensitive, but filenames are not, so they are overwritten sometimes during export --- .../src/com/jpexs/decompiler/flash/SWF.java | 3 ++- .../decompiler/flash/abc/ScriptPack.java | 14 +++++++----- .../exporters/script/AS3ScriptExporter.java | 22 ++++++++++++++++++- .../exporters/script/ExportPackTask.java | 8 +++---- .../jpexs/decompiler/flash/gui/MainPanel.java | 3 ++- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index e15864d9c..da87c6ccf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -1274,7 +1274,8 @@ public final class SWF implements SWFContainerItem, Timelined { } String eventData = cnt + scr.getPath() + " ..."; evl.handleExportingEvent("tag", i + 1, abcList.size(), eventData); - scr.export(outdir, exportSettings, parallel); + File file = scr.getExportFile(outdir, exportSettings); + scr.export(file, exportSettings, parallel); evl.handleExportedEvent("tag", i + 1, abcList.size(), eventData); exported = true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 66bda3a12..e2d4063bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -107,11 +107,14 @@ public class ScriptPack extends AS3ClassTreeItem { return scriptName; } - public File getExportFile(String directory, ScriptExportSettings exportSettings) throws IOException { + public File getExportFile(String directory, ScriptExportSettings exportSettings) { + if (exportSettings.singleFile) { + return null; + } + String scriptName = getPathScriptName(); DottedChain packageName = getPathPackage(); File outDir = new File(directory + File.separatorChar + packageName.toFilePath()); - Path.createDirectorySafe(outDir); String fileName = outDir.toString() + File.separator + Helper.makeFileName(scriptName) + exportSettings.getFileExtension(); return new File(fileName); } @@ -189,16 +192,15 @@ public class ScriptPack extends AS3ClassTreeItem { appendTo(writer, traits, exportMode, parallel); } - public File export(String directory, ScriptExportSettings exportSettings, boolean parallel) throws IOException, InterruptedException { - File file = null; - + public File export(File file, ScriptExportSettings exportSettings, boolean parallel) throws IOException, InterruptedException { if (!exportSettings.singleFile) { - file = getExportFile(directory, exportSettings); if (file.exists() && !Configuration.overwriteExistingFiles.get()) { return file; } } + Path.createDirectorySafe(file.getParentFile()); + try (FileTextWriter writer = exportSettings.singleFile ? null : new FileTextWriter(Configuration.getCodeFormatting(), new FileOutputStream(file))) { FileTextWriter writer2 = exportSettings.singleFile ? exportSettings.singleFileWriter : writer; toSource(writer2, abc.script_info.get(scriptIndex).traits.traits, exportSettings.mode, parallel); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java index e10c8b643..0cb560e9a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS3ScriptExporter.java @@ -24,9 +24,12 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.exporters.settings.ScriptExportSettings; import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Helper; +import com.jpexs.helpers.Path; import java.io.File; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -51,12 +54,29 @@ public class AS3ScriptExporter { int cnt = 1; List tasks = new ArrayList<>(); + Set files = new HashSet<>(); for (ScriptPack item : packs) { if (!item.isSimple && Configuration.ignoreCLikePackages.get()) { continue; } - tasks.add(new ExportPackTask(handler, cnt++, packs.size(), item.getClassPath(), item, outdir, exportSettings, parallel, evl)); + File file = item.getExportFile(outdir, exportSettings); + String filePath = file.getPath(); + if (files.contains(filePath.toLowerCase())) { + String parentPath = file.getParent(); + String fileName = file.getName(); + String extension = Path.getExtension(fileName); + String fileNameWithoutExtension = Path.getFileNameWithoutExtension(file); + int i = 2; + do { + filePath = Path.combine(parentPath, fileNameWithoutExtension + "_" + i++ + extension); + } while (files.contains(filePath.toUpperCase())); + + file = new File(filePath); + } + + files.add(filePath.toLowerCase()); + tasks.add(new ExportPackTask(handler, cnt++, packs.size(), item.getClassPath(), item, file, exportSettings, parallel, evl)); } if (!parallel || tasks.size() < 2) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportPackTask.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportPackTask.java index 483d0a21d..48c9363cf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportPackTask.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/ExportPackTask.java @@ -36,7 +36,7 @@ public class ExportPackTask implements Callable { ScriptPack pack; - String directory; + File file; ScriptExportSettings exportSettings; @@ -56,9 +56,9 @@ public class ExportPackTask implements Callable { EventListener eventListener; - public ExportPackTask(AbortRetryIgnoreHandler handler, int index, int count, ClassPath path, ScriptPack pack, String directory, ScriptExportSettings exportSettings, boolean parallel, EventListener evl) { + public ExportPackTask(AbortRetryIgnoreHandler handler, int index, int count, ClassPath path, ScriptPack pack, File file, ScriptExportSettings exportSettings, boolean parallel, EventListener evl) { this.pack = pack; - this.directory = directory; + this.file = file; this.exportSettings = exportSettings; this.path = path; this.index = index; @@ -74,7 +74,7 @@ public class ExportPackTask implements Callable { @Override public void run() throws IOException, InterruptedException { startTime = System.currentTimeMillis(); - this.result = pack.export(directory, exportSettings, parallel); + this.result = pack.export(file, exportSettings, parallel); stopTime = System.currentTimeMillis(); } }; diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 792a297fc..7f119c7f8 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -1244,7 +1244,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } Main.startWork(translate("work.exporting") + " " + (i + 1) + "/" + as3scripts.size() + " " + tls.getPath() + " ...", null); - ret.add(tls.export(scriptsFolder, scriptExportSettings, parallel)); + File file = tls.getExportFile(scriptsFolder, scriptExportSettings); + ret.add(tls.export(file, scriptExportSettings, parallel)); } } } else { From 248b86e01f9158b4baa1dd33ea713477b28c114e Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Fri, 17 Jul 2015 11:17:07 +0200 Subject: [PATCH 24/25] export only as2 or as3 fix --- libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index da87c6ccf..c66493cff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -1356,9 +1356,13 @@ public final class SWF implements SWFContainerItem, Timelined { List ret = new ArrayList<>(); if (isAS3()) { - ret.addAll(new AS3ScriptExporter().exportActionScript3(this, handler, outdir, exportSettings, parallel, evl)); + if (as3) { + ret.addAll(new AS3ScriptExporter().exportActionScript3(this, handler, outdir, exportSettings, parallel, evl)); + } } else { - ret.addAll(new AS2ScriptExporter().exportAS2Scripts(handler, outdir, getASMs(true), exportSettings, parallel, evl)); + if (as2) { + ret.addAll(new AS2ScriptExporter().exportAS2Scripts(handler, outdir, getASMs(true), exportSettings, parallel, evl)); + } } return ret; } From 6171ad56db9e04938d71046b56d1bcdee4fbcdd7 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Fri, 17 Jul 2015 11:55:05 +0200 Subject: [PATCH 25/25] actionwith fix --- .../src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java index 5a910f874..ac8bd6aa4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java @@ -109,7 +109,7 @@ public class ActionWith extends Action implements GraphSourceItemContainer { @Override public long getHeaderSize() { - return super.getBytesLength(version) + 2; + return getBytesLength(version); } @Override