diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b018254c..6e31f1ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Added - Debugger - Button to disconnect current session (stay listening) - [#2644] Debugger - Button to sort variables alphabetically +- AS3 Direct editation - Error when accessing inaccessible namespace ### Fixed - [#2643] APNG export - images containing multiple IDAT chunks @@ -13,6 +14,7 @@ All notable changes to this project will be documented in this file. - [#2645] Windows MSI installer - Cannot change install directory - Long delay before switching critical status bar titles (Causing many actions to look slow - for example Debug listening) +- AS3 goto definition missing some namespaces ### Changed - Icon of Debug listen action from ear to phone receiver 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 2af8206d9..c21b2300a 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 @@ -2508,10 +2508,13 @@ public class AVM2SourceGenerator implements SourceGenerator { */ public static boolean searchPrototypeChain(String nsKeyword, Integer namespaceSuffix, List otherNs, int privateNs, int protectedNs, int staticProtectedNs, int internalNs, boolean instanceOnly, AbcIndexing abc, DottedChain pkg, String obj, String propertyName, Reference outName, Reference outNs, Reference outPropNs, Reference outPropNsKind, Reference outPropNsIndex, Reference outPropType, Reference outPropValue, Reference outPropValueAbc, Reference isType, Reference outPropTrait) { + AVM2ConstantPool constants = abc.getSelectedAbc().constants; + int publicNs = constants.getNamespaceId(Namespace.KIND_PACKAGE, "", 0, false); + if (nsKeyword != null) { switch (nsKeyword) { case "public": - return searchPrototypeChain(0, instanceOnly, abc, pkg, obj, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType, outPropTrait); + return searchPrototypeChain(publicNs, instanceOnly, abc, pkg, obj, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType, outPropTrait); case "protected": if (searchPrototypeChain(staticProtectedNs, instanceOnly, abc, pkg, obj, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType, outPropTrait)) { return true; @@ -2542,14 +2545,14 @@ public class AVM2SourceGenerator implements SourceGenerator { } } - return searchPrototypeChain(0, instanceOnly, abc, pkg, obj, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType, outPropTrait); + return searchPrototypeChain(publicNs, instanceOnly, abc, pkg, obj, propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType, outPropTrait); } private static boolean searchPrototypeChain(int selectedNs, boolean instanceOnly, AbcIndexing abc, DottedChain pkg, String obj, String propertyName, Reference outName, Reference outNs, Reference outPropNs, Reference outPropNsKind, Reference outPropNsIndex, Reference outPropType, Reference outPropValue, Reference outPropValueAbc, Reference isType, Reference outPropTrait) { isType.setVal(false); AbcIndexing.TraitIndex sp = abc.findScriptProperty(pkg.addWithSuffix(propertyName)); if (sp == null) { - Reference foundStatic = new Reference<>(null); + Reference foundStatic = new Reference<>(null); sp = abc.findProperty(new AbcIndexing.PropertyDef(propertyName, new TypeItem(pkg.addWithSuffix(obj)), abc.getSelectedAbc(), selectedNs), !instanceOnly, true, true, foundStatic); } if (sp != null) { @@ -3086,7 +3089,7 @@ public class AVM2SourceGenerator implements SourceGenerator { ret.add(ins(AVM2Instructions.NewObject, 0)); ret.add(ins(AVM2Instructions.PushWith)); scope = localData.scopeStack.size(); - localData.scopeStack.add(new PropertyAVM2Item(null, false, item.functionName, "" /*??*/, abcIndex, new ArrayList<>(), localData.callStack, false, null)); + localData.scopeStack.add(new PropertyAVM2Item(null, false, item.functionName, "" /*??*/, abcIndex, new ArrayList<>(), localData.callStack, false, null, -1)); } AVM2ConstantPool constants = abcIndex.getSelectedAbc().constants; ret.add(ins(AVM2Instructions.NewFunction, method(null, false, constants.getStringId(item.functionName, true), true, false, false, localData.callStack, localData.pkg, item.needsActivation, item.subvariables, 0 /*Set later*/, item.hasRest, item.line, localData.currentClassBaseName, null, false, localData, item.paramTypes, item.paramNames, item.paramValues, item.body, item.retType))); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AbcIndexing.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AbcIndexing.java index 421161134..6209209c2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AbcIndexing.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AbcIndexing.java @@ -162,13 +162,16 @@ public final class AbcIndexing { return; } Namespace ns = abc.constants.getNamespace(propNsIndex); - this.propNsKind = ns.kind; + //this.propNsKind = ns.kind; switch (ns.kind) { - case Namespace.KIND_PACKAGE: - case Namespace.KIND_NAMESPACE: + case Namespace.KIND_PACKAGE: + case Namespace.KIND_PACKAGE_INTERNAL: case Namespace.KIND_PROTECTED: case Namespace.KIND_STATIC_PROTECTED: - this.abc = null; + //this.abc = null; + //this.propNsString = abc.constants.getNamespace(propNsIndex).getRawName(abc.constants); + break; + case Namespace.KIND_NAMESPACE: this.propNsString = abc.constants.getNamespace(propNsIndex).getRawName(abc.constants); break; default: @@ -187,8 +190,11 @@ public final class AbcIndexing { this.propName = propName; this.parent = parent; this.abc = null; - this.propNsKind = nsKind; - this.propNsString = propNsString; + if (nsKind == Namespace.KIND_NAMESPACE) { + this.propNsString = propNsString; + } + //this.propNsKind = nsKind; + //this.propNsString = propNsString; } @Override @@ -242,12 +248,7 @@ public final class AbcIndexing { private int propNsIndex = 0; - private ABC abc = null; - - private void setPrivate(ABC abc, int propNsIndex) { - this.propNsIndex = propNsIndex; - this.abc = abc; - } + private ABC abc = null; /** * Gets property name @@ -280,9 +281,12 @@ public final class AbcIndexing { return; } int k = abc.constants.getNamespace(nsIndex).kind; - if (k != Namespace.KIND_PACKAGE) { + /*if (k != Namespace.KIND_PACKAGE) { setPrivate(abc, nsIndex); - } + }*/ + + this.propNsIndex = nsIndex; + this.abc = abc; } /** @@ -840,33 +844,26 @@ public final class AbcIndexing { * @param prop Property to find * @param findStatic Find static properties * @param findInstance Find instance properties + * @param foundStatic Whether result is static * @return Trait index or null */ - public TraitIndex findNsProperty(PropertyNsDef prop, boolean findStatic, boolean findInstance) { - - if (findStatic && classNsProperties.containsKey(prop)) { - if (!classNsProperties.containsKey(prop)) { - if (parent != null) { - TraitIndex ret = parent.findNsProperty(prop, findStatic, findInstance); - if (ret != null) { - return ret; - } - } - } else { + public TraitIndex findNsProperty(PropertyNsDef prop, boolean findStatic, boolean findInstance, Reference foundStatic) { + if (findStatic) { + if (classNsProperties.containsKey(prop)) { + foundStatic.setVal(true); return classNsProperties.get(prop); - } + } } if (findInstance && instanceNsProperties.containsKey(prop)) { - if (!instanceNsProperties.containsKey(prop)) { - if (parent != null) { - TraitIndex ret = parent.findNsProperty(prop, findStatic, findInstance); - if (ret != null) { - return ret; - } - } - } else { - return instanceNsProperties.get(prop); - } + foundStatic.setVal(false); + return instanceNsProperties.get(prop); + } + + if (parent != null) { + TraitIndex ret = parent.findProperty(new PropertyDef(prop.propName, new TypeItem(prop.ns), prop.abc, prop.propNsIndex), findStatic, findInstance, true, foundStatic); + if (ret != null) { + return ret; + } } return null; } 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 0add52d18..2b1c09e93 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 @@ -358,7 +358,7 @@ public class ActionScript3Parser { if (ns != null) { ret = new NamespacedAVM2Item(ns, propName, propItem, ret, attr, openedNamespaces, null); } else { - ret = new PropertyAVM2Item(ret, attr, propName, nsSuffix, abcIndex, openedNamespaces, new ArrayList<>(), nullDot, nsKeyword); + ret = new PropertyAVM2Item(ret, attr, propName, nsSuffix, abcIndex, openedNamespaces, new ArrayList<>(), nullDot, nsKeyword, lexer.yyline()); } s = lex(); } @@ -472,7 +472,7 @@ public class ActionScript3Parser { } if (nsname != null) { if (nsKeyword != null && nspropItem == null) { - ret = new PropertyAVM2Item(ret, nsAtribute, nsprop, nsSuffix, abcIndex, openedNamespaces, new ArrayList(), false, nsKeyword); + ret = new PropertyAVM2Item(ret, nsAtribute, nsprop, nsSuffix, abcIndex, openedNamespaces, new ArrayList(), false, nsKeyword, lexer.yyline()); } else { UnresolvedAVM2Item ns = new UnresolvedAVM2Item(new ArrayList<>(), importedClasses, typeOnly, null, lexer.yyline(), new DottedChain(new String[]{nsname}), null, openedNamespaces, abcIndex); variables.add(ns); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3SimpleParser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3SimpleParser.java index ae902de41..c45cbe3d3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3SimpleParser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3SimpleParser.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.abc.avm2.parser.script; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException; import com.jpexs.decompiler.flash.simpleparser.CatchScope; @@ -2371,7 +2372,11 @@ public class ActionScript3SimpleParser implements SimpleParser { List vars = new ArrayList<>(); List importedClasses = new ArrayList<>(); List openedNamespaces = new ArrayList<>(); - for (String name : abc.getSwf().getAbcIndex().getPackageObjects(DottedChain.TOPLEVEL)) { + SWF swf = abc.getSwf(); + if (swf == null) { + return; + } + for (String name : swf.getAbcIndex().getPackageObjects(DottedChain.TOPLEVEL)) { externalTypes.add(new Path(name)); } externalTypes.add(new Path("__AS3__", "vec", "Vector")); 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 38a730748..696b6709b 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 @@ -136,7 +136,7 @@ public class CallAVM2Item extends AVM2Item { nobj.setRegNumber(0); obj = nobj; }*/ - PropertyAVM2Item p = new PropertyAVM2Item(obj, n.isAttribute(), n.getVariableName(), n.getNamespaceSuffix(), g.abcIndex, n.openedNamespaces, new ArrayList<>(), false, null); + PropertyAVM2Item p = new PropertyAVM2Item(obj, n.isAttribute(), n.getVariableName(), n.getNamespaceSuffix(), g.abcIndex, n.openedNamespaces, new ArrayList<>(), false, null, line); p.setAssignedValue(n.getAssignedValue()); callable = p; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java index 6e59d02ee..ca3821203 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespaceItem.java @@ -136,7 +136,7 @@ public class NamespaceItem { } if (kind == KIND_NAMESPACE_CUSTOM) { String custom = name.toRawString(); - PropertyAVM2Item prop = new PropertyAVM2Item(null, false, custom, "", abcIndex, openedNamespaces, new ArrayList<>(), false, null); + PropertyAVM2Item prop = new PropertyAVM2Item(null, false, custom, "", abcIndex, openedNamespaces, new ArrayList<>(), false, null, -1); Reference value = new Reference<>(null); Reference outAbc = new Reference<>(null); Reference isType = new Reference<>(false); 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 f3967bcf3..751303cc6 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 @@ -45,8 +45,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; +import java.util.Objects; import java.util.logging.Level; import java.util.logging.Logger; @@ -98,10 +100,12 @@ public class PropertyAVM2Item extends AssignableAVM2Item { public List scopeStack = new ArrayList<>(); private final boolean nullish; private final String nsKeyword; + + private int line; @Override public AssignableAVM2Item copy() { - PropertyAVM2Item p = new PropertyAVM2Item(object, attribute, propertyName, namespaceSuffix, abcIndex, openedNamespaces, callStack, nullish, nsKeyword); + PropertyAVM2Item p = new PropertyAVM2Item(object, attribute, propertyName, namespaceSuffix, abcIndex, openedNamespaces, callStack, nullish, nsKeyword, line); return p; } @@ -117,8 +121,9 @@ public class PropertyAVM2Item extends AssignableAVM2Item { * @param callStack Call stack * @param nullish Nullish * @param nsKeyword Namespace keyword (public,protected,private,internal) + * @param line Source code line */ - public PropertyAVM2Item(GraphTargetItem object, boolean attribute, String propertyName, String namespaceSuffix, AbcIndexing abcIndex, List openedNamespaces, List callStack, boolean nullish, String nsKeyword) { + public PropertyAVM2Item(GraphTargetItem object, boolean attribute, String propertyName, String namespaceSuffix, AbcIndexing abcIndex, List openedNamespaces, List callStack, boolean nullish, String nsKeyword, int line) { this.attribute = attribute; this.propertyName = propertyName; this.namespaceSuffix = namespaceSuffix; @@ -128,6 +133,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { this.callStack = callStack; this.nullish = nullish; this.nsKeyword = nsKeyword; + this.line = line; } @Override @@ -302,7 +308,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { propValueAbc = sp.abc; propTrait = sp.trait; } - } + } if (propType == null && AVM2SourceGenerator.searchPrototypeChain(nsKeyword, namespaceSuffixInt, otherNs, localData.privateNs, localData.protectedNs, localData.staticProtectedNs, localData.internalNs, false, abcIndex, ftn.getWithoutLast(), ftn.getLast(), propertyName, outName, outNs, outPropNs, outPropNsKind, outPropNsIndex, outPropType, outPropValue, outPropValueAbc, isType, outPropTrait)) { objType = new TypeItem(outNs.getVal().addWithSuffix(outName.getVal())); propType = outPropType.getVal(); @@ -313,6 +319,39 @@ public class PropertyAVM2Item extends AssignableAVM2Item { propValue = outPropValue.getVal(); propValueAbc = outPropValueAbc.getVal(); propTrait = outPropTrait.getVal(); + int nsIndex = propTrait.getName(propValueAbc).namespace_index; + Namespace ns = propValueAbc.constants.getNamespace(nsIndex); + String pkg = ftn.getWithoutLast().toRawString(); + switch (ns.kind) { + case Namespace.KIND_PRIVATE: + if (!(otherNs.contains(nsIndex) && propValueAbc == abc)) { + throw new CompilationException("Property " + propertyName + " has private access in " + objType.toString(), line); + } + break; + case Namespace.KIND_PACKAGE_INTERNAL: + if (!pkg.equals(localData.pkg.toRawString())) { + throw new CompilationException("Property " + propertyName + " has package internal access in " + objType.toString(), line); + } + break; + case Namespace.KIND_PROTECTED: + case Namespace.KIND_STATIC_PROTECTED: + AbcIndexing.ClassIndex ci = abcIndex.findClass(thisType, abc, localData.scriptIndex); + boolean found = false; + String nsName = ns.getName(propValueAbc.constants).toRawString(); + while (ci != null) { + DottedChain clsName = ci.abc.instance_info.get(ci.index).getName(ci.abc.constants).getNameWithNamespace(new HashSet<>(), ci.abc, ci.abc.constants, false); + String clsNsName = clsName.isTopLevel() ? clsName.getLast() : clsName.getWithoutLast().toRawString() + ":" + clsName.getLast(); + if (Objects.equals(nsName, clsNsName)) { + found = true; + break; + } + ci = ci.parent; + } + if (!found) { + throw new CompilationException("Property " + propertyName + " has protected access in " + objType.toString(), line); + } + break; + } } } } @@ -364,7 +403,8 @@ public class PropertyAVM2Item extends AssignableAVM2Item { } } if (nsKind == Namespace.KIND_PACKAGE && propertyName != null) { - AbcIndexing.TraitIndex p = abcIndex.findNsProperty(new AbcIndexing.PropertyNsDef(propertyName, nsname, abc, nsindex), true, true); + Reference foundStatic = new Reference<>(null); + AbcIndexing.TraitIndex p = abcIndex.findNsProperty(new AbcIndexing.PropertyNsDef(propertyName, nsname, abc, nsindex), true, true, foundStatic); Reference outName = new Reference<>(""); Reference outNs = 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 92a34e8bd..bedfe250f 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 @@ -420,7 +420,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { ret.setRegNumber(n.getRegNumber()); resolved = ret; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -447,7 +447,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { GraphTargetItem ret = new NameAVM2Item(t, line, name.isAttribute(0), name.get(0), name.getNamespaceSuffix(0), null, false, openedNamespaces, abcIndex, false); resolved = ret; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -460,7 +460,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { boolean isProperty = false; if (localData != null) { //resolve can be called without localData - PropertyAVM2Item resolvedx = new PropertyAVM2Item(null, name.isAttribute(0), name.get(0), name.getNamespaceSuffix(0), abc, openedNamespaces, callStack, false, null); + PropertyAVM2Item resolvedx = new PropertyAVM2Item(null, name.isAttribute(0), name.get(0), name.getNamespaceSuffix(0), abc, openedNamespaces, callStack, false, null, line); ((PropertyAVM2Item) resolvedx).scopeStack = scopeStack; ((PropertyAVM2Item) resolvedx).setAssignedValue(assignedValue); Reference objectType = new Reference<>(null); @@ -490,7 +490,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { if (ci != null) { resolved = ti; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -517,7 +517,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { } resolved = ti; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -536,7 +536,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { resolved = ret; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -573,7 +573,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { TypeItem ret = new TypeItem(fname); resolved = ret; for (int j = i + 1; j < name.size(); j++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(j), name.get(j), name.getNamespaceSuffix(j), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(j), name.get(j), name.getNamespaceSuffix(j), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (j == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -602,7 +602,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { TypeItem ret = ti; resolved = ret; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -639,7 +639,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { NameAVM2Item ret = new NameAVM2Item(ntype, line, name.isAttribute(0), name.get(0), name.getNamespaceSuffix(0), null, false, openedNamespaces, abcIndex, false); resolved = ret; for (int i = 1; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, new ArrayList<>(), false, null, line); if (i == name.size() - 1) { ((PropertyAVM2Item) resolved).assignedValue = assignedValue; } @@ -662,7 +662,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { resolved = null; GraphTargetItem ret = null; for (int i = 0; i < name.size(); i++) { - resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, callStack, false, null); + resolved = new PropertyAVM2Item(resolved, name.isAttribute(i), name.get(i), name.getNamespaceSuffix(i), abc, openedNamespaces, callStack, false, null, line); if (ret == null) { ((PropertyAVM2Item) resolved).scopeStack = scopeStack; ret = resolved; diff --git a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring.swf b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring.swf index d5bb3532b..8c9aa707d 100644 Binary files a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring.swf and b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring.swf differ diff --git a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/DOMDocument.xml b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/DOMDocument.xml index c16c0879e..184e648fe 100644 --- a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/DOMDocument.xml +++ b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/DOMDocument.xml @@ -183,6 +183,9 @@ btnSpeedDown.addEventListener(MouseEvent.CLICK, onSpeedDown); + + + @@ -200,8 +203,5 @@ btnSpeedDown.addEventListener(MouseEvent.CLICK, onSpeedDown); - - - \ No newline at end of file diff --git a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/META-INF/metadata.xml b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/META-INF/metadata.xml index fe30b6721..8ec1ced4e 100644 --- a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/META-INF/metadata.xml +++ b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/META-INF/metadata.xml @@ -5,8 +5,8 @@ xmlns:xmp="http://ns.adobe.com/xap/1.0/"> Adobe Flash Professional CS6 - build 481 2026-02-16T10:31:42-08:00 - 2026-02-21T09:45:46-08:00 - 2026-02-21T09:45:46-08:00 + 2026-02-27T13:55:44-08:00 + 2026-02-27T13:55:44-08:00 @@ -22,7 +22,7 @@ xmp.did:7FE581FA660BF11197008EF33C376745 xmp.did:EDF1CDD4690BF11197008EF33C376745 - xmp.iid:3B7DE8AB4B0FF111A0D3B09FD2F43FD4 + xmp.iid:909574812614F1118B04B924A153AAEA xmp.did:7FE581FA660BF11197008EF33C376745 @@ -51,6 +51,12 @@ 2026-02-16T10:31:42-08:00 Adobe Flash Professional CS6 - build 481 + + created + xmp.iid:909574812614F1118B04B924A153AAEA + 2026-02-16T10:31:42-08:00 + Adobe Flash Professional CS6 - build 481 + diff --git a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/PublishSettings.xml b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/PublishSettings.xml index f8e0a6f85..6046e6ad8 100644 --- a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/PublishSettings.xml +++ b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/PublishSettings.xml @@ -79,7 +79,7 @@ . CONFIG::FLASH_AUTHORING="true"; - 0 + 1 1 0 @@ -158,7 +158,7 @@ 0 1 1 - + 0 1 0 1 diff --git a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/bin/SymDepend.cache b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/bin/SymDepend.cache index 2debd5f6d..a3750bd23 100644 Binary files a/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/bin/SymDepend.cache and b/libsrc/ffdec_lib/testdata/debug_game/as3_scoring/bin/SymDepend.cache differ diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 0897acae2..19d834c5f 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -1221,7 +1221,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener(), ci.abc.getSwf(), true); + String scriptNamePrintable = DottedChain.parseWithSuffix(scriptName.toString()).toPrintableString(new LinkedHashSet<>(), swfRef.getVal(), true); if (swfRef.getVal() == abc.getSwf()) { hilightScript(getOpenable(), scriptNamePrintable);