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 f38a70527..d45bf69fb 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 @@ -253,7 +253,7 @@ public class AVM2ConstantPool implements Cloneable { return index; } - public int getNamespaceId(int kind, int nameIndex, int index) { + private int getNamespaceId(int kind, int nameIndex, int index) { for (int n = 1; n < constant_namespace.size(); n++) { Namespace ns = constant_namespace.get(n); if (ns.name_index == nameIndex && (ns.kind == kind)) { @@ -292,7 +292,7 @@ public class AVM2ConstantPool implements Cloneable { return getNamespaceId(kind, nameIndex, index, add); } - public int getIntId(long value) { + private int getIntId(long value) { for (int i = 1; i < constant_int.size(); i++) { if (constant_int.get(i) == value) { return i; @@ -301,7 +301,7 @@ public class AVM2ConstantPool implements Cloneable { return -1; } - public int getUIntId(long value) { + private int getUIntId(long value) { for (int i = 1; i < constant_uint.size(); i++) { if (constant_uint.get(i) == value) { return i; @@ -310,7 +310,7 @@ public class AVM2ConstantPool implements Cloneable { return -1; } - public int getDoubleId(double value) { + private int getDoubleId(double value) { for (int i = 1; i < constant_double.size(); i++) { if (Double.isNaN(value) && Double.isNaN(constant_double.get(i))) { return i; @@ -322,7 +322,7 @@ public class AVM2ConstantPool implements Cloneable { return -1; } - public int getStringId(String val) { + private int getStringId(String val) { if (val == null) { return 0; } @@ -334,7 +334,7 @@ public class AVM2ConstantPool implements Cloneable { return -1; } - public int getMultinameId(Multiname val) { + private int getMultinameId(Multiname val) { loopm: for (int m = 1; m < constant_multiname.size(); m++) { Multiname mul = constant_multiname.get(m); @@ -393,7 +393,7 @@ public class AVM2ConstantPool implements Cloneable { return id; } - public int getNamespaceSetId(NamespaceSet val) { + private int getNamespaceSetId(NamespaceSet val) { loopi: for (int i = 1; i < constant_namespace_set.size(); i++) { NamespaceSet ts = constant_namespace_set.get(i); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java index c0fdba46a..10921031e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java @@ -757,7 +757,7 @@ public class ASM3Parser { operandsList.add(0); } else { if (parsedOperand.type == ParsedSymbol.TYPE_STRING) { - int sid = constants.getStringId((String) parsedOperand.value); + int sid = constants.getStringId((String) parsedOperand.value, false); if (sid == -1) { if ((missingHandler != null) && (missingHandler.missingString((String) parsedOperand.value))) { sid = constants.addString((String) parsedOperand.value); @@ -778,7 +778,7 @@ public class ASM3Parser { } else { if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { long intVal = (Long) parsedOperand.value; - int iid = constants.getIntId(intVal); + int iid = constants.getIntId(intVal, false); if (iid == -1) { if ((missingHandler != null) && (missingHandler.missingInt(intVal))) { iid = constants.addInt(intVal); @@ -798,7 +798,7 @@ public class ASM3Parser { } else { if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { long intVal = (Long) parsedOperand.value; - int iid = constants.getUIntId(intVal); + int iid = constants.getUIntId(intVal, false); if (iid == -1) { if ((missingHandler != null) && (missingHandler.missingUInt(intVal))) { iid = constants.addUInt(intVal); @@ -825,7 +825,7 @@ public class ASM3Parser { if (parsedOperand.type == ParsedSymbol.TYPE_FLOAT) { doubleVal = (Double) parsedOperand.value; } - int did = constants.getDoubleId(doubleVal); + int did = constants.getDoubleId(doubleVal, false); if (did == -1) { if ((missingHandler != null) && (missingHandler.missingDouble(doubleVal))) { did = constants.addDouble(doubleVal); 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 0b1c118fe..181de0e22 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 @@ -2179,8 +2179,7 @@ public class AVM2SourceGenerator implements SourceGenerator { new Multiname(origM.kind, abcIndex.getSelectedAbc().constants.getStringId(ci.abc.constants.getString(origM.name_index), true), abcIndex.getSelectedAbc().constants.getNamespaceId(origNs.kind, - ci.abc.constants.getString(origNs.name_index), 0, true), 0, 0, new ArrayList<>()) - )); + ci.abc.constants.getString(origNs.name_index), 0, true), 0, 0, new ArrayList<>()), true)); } //add all parent objects to scopestack 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 4dd784905..f73736749 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 @@ -984,7 +984,7 @@ public class ActionScript3Parser { publicNs = gpublicNs; } - openedNamespaces.add(privateNs = abcIndex.getSelectedAbc().constants.addNamespace(new Namespace(Namespace.KIND_PRIVATE, abcIndex.getSelectedAbc().constants.getStringId(pkg.toRawString() + ":" + nameStr)))); + openedNamespaces.add(privateNs = abcIndex.getSelectedAbc().constants.addNamespace(new Namespace(Namespace.KIND_PRIVATE, abcIndex.getSelectedAbc().constants.getStringId(pkg.toRawString() + ":" + nameStr, true)))); openedNamespaces.add(abcIndex.getSelectedAbc().constants.getNamespaceId(Namespace.KIND_NAMESPACE, AS3_NAMESPACE, 0, true)); 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 95ae328e4..0afeada36 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 @@ -115,7 +115,7 @@ public class Namespace { } public DottedChain getName(AVM2ConstantPool constants) { - if (name_index == 0) { + if (name_index == 0 || name_index == -1) { return DottedChain.EMPTY; }