mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 21:31:17 +00:00
Fixed #116 AS3 Cyclic typenames protection
Fixed #116 AS3 Do not parse DoABC tags inside sprites
This commit is contained in:
@@ -1896,9 +1896,9 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
|
||||
|
||||
private static void getAbcTags(Iterable<Tag> list, List<ABCContainerTag> actionScripts) {
|
||||
for (Tag t : list) {
|
||||
if (t instanceof DefineSpriteTag) {
|
||||
/*if (t instanceof DefineSpriteTag) {
|
||||
getAbcTags(((DefineSpriteTag) t).getTags(), actionScripts);
|
||||
}
|
||||
}*/
|
||||
if (t instanceof ABCContainerTag) {
|
||||
actionScripts.add((ABCContainerTag) t);
|
||||
}
|
||||
|
||||
+6
-12
@@ -632,24 +632,22 @@ public final class AbcIndexing {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static GraphTargetItem multinameToType(Set<Integer> visited, int m_index, AVM2ConstantPool constants) {
|
||||
if (visited.contains(m_index)) {
|
||||
Logger.getLogger(AbcIndexing.class.getName()).log(Level.WARNING, "Recursive typename detected");
|
||||
return null;
|
||||
}
|
||||
public static GraphTargetItem multinameToType(int m_index, AVM2ConstantPool constants) {
|
||||
if (m_index == 0) {
|
||||
return TypeItem.UNBOUNDED;
|
||||
}
|
||||
Multiname m = constants.getMultiname(m_index);
|
||||
if (m.isCyclic()) {
|
||||
return null;
|
||||
}
|
||||
if (m.kind == Multiname.TYPENAME) {
|
||||
visited.add(m_index);
|
||||
GraphTargetItem obj = multinameToType(visited, m.qname_index, constants);
|
||||
GraphTargetItem obj = multinameToType(m.qname_index, constants);
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
List<GraphTargetItem> params = new ArrayList<>();
|
||||
for (int pm : m.params) {
|
||||
GraphTargetItem r = multinameToType(visited, pm, constants);
|
||||
GraphTargetItem r = multinameToType(pm, constants);
|
||||
if (r == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -667,10 +665,6 @@ public final class AbcIndexing {
|
||||
}
|
||||
}
|
||||
|
||||
public static GraphTargetItem multinameToType(int m_index, AVM2ConstantPool constants) {
|
||||
return multinameToType(new HashSet<>(), m_index, constants);
|
||||
}
|
||||
|
||||
private static GraphTargetItem getTraitCallReturnType(ABC abc, Trait t) {
|
||||
if (t instanceof TraitSlotConst) {
|
||||
return TypeItem.UNBOUNDED;
|
||||
|
||||
@@ -19,6 +19,7 @@ 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.abc.avm2.parser.script.AbcIndexing;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.helpers.Helper;
|
||||
@@ -29,6 +30,8 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -167,7 +170,12 @@ public class Multiname {
|
||||
}
|
||||
Multiname m = constants.getMultiname(name_index);
|
||||
if (m != null) {
|
||||
m.cyclic = checkCyclicTypeNameSub(constants, name_index, visited);
|
||||
|
||||
boolean cyclic = checkCyclicTypeNameSub(constants, name_index, visited);
|
||||
if (!m.cyclic && cyclic) {
|
||||
Logger.getLogger(AbcIndexing.class.getName()).log(Level.WARNING, "Recursive typename detected");
|
||||
}
|
||||
m.cyclic = cyclic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user