diff --git a/CHANGELOG.md b/CHANGELOG.md index a85e2f4cc..88b79b906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - Optional heap memory status widget in the titlebar - [#2485] Show variable name in the text tree node label - Deobfuscate identifiers option - non destructible renaming identifiers for display purposes +- Unknown and errored tags moved to special folders ### Fixed - [#2474] Gotos incorrectly decompiled diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java index c2692203f..762070753 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/TagStub.java @@ -70,10 +70,10 @@ public class TagStub extends Tag { return dataStream; } - @Override + /*@Override public String toString() { - return tagName + " [ID = " + id + "]"; - } + return tagName + " (tid = " + id + ")"; + }*/ @Override public Map getNameProperties() { diff --git a/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java b/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java index 7e9d9855e..a477c96ec 100644 --- a/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java +++ b/src/com/jpexs/decompiler/flash/gui/TreeNodeType.java @@ -63,7 +63,7 @@ public enum TreeNodeType { REMOVE_OBJECT, SCALING_GRID, END, - ERROR, + ERRORED, ABC, COOKIE } diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/errored16.png b/src/com/jpexs/decompiler/flash/gui/graphics/errored16.png new file mode 100644 index 000000000..357842f7e Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/errored16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/errored32.png b/src/com/jpexs/decompiler/flash/gui/graphics/errored32.png new file mode 100644 index 000000000..d68ace272 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/errored32.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/foldererrored16.png b/src/com/jpexs/decompiler/flash/gui/graphics/foldererrored16.png new file mode 100644 index 000000000..eb42b4b27 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/foldererrored16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/folderunknown16.png b/src/com/jpexs/decompiler/flash/gui/graphics/folderunknown16.png new file mode 100644 index 000000000..e9072c11c Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/folderunknown16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/unknown16.png b/src/com/jpexs/decompiler/flash/gui/graphics/unknown16.png new file mode 100644 index 000000000..5eb022f2f Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/unknown16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/unknown32.png b/src/com/jpexs/decompiler/flash/gui/graphics/unknown32.png new file mode 100644 index 000000000..d07972017 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/unknown32.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index f2a4f9f94..d27f7cafd 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -1093,4 +1093,7 @@ text.copy = Copy text.selectAll = Select all menu.settings.autoDeobfuscateIdentifiers = Deobfuscate identifiers -deobfuscate_options.deobfuscateIdentifiers = Deobfuscate identifiers \ No newline at end of file +deobfuscate_options.deobfuscateIdentifiers = Deobfuscate identifiers + +node.unknown = unknown +node.errored = errored \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index 016e63f44..be1f0b80c 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -1089,3 +1089,9 @@ deobfuscate_options.skip_uninitialized_class_fields_detection = P\u0159esko\u010 text.copy = Kop\u00edrovat text.selectAll = Vybrat v\u0161e + +menu.settings.autoDeobfuscateIdentifiers = Deobfukovat identifik\u00e1tory +deobfuscate_options.deobfuscateIdentifiers = Deobfukovat identifik\u00e1tory + +node.unknown = nezn\u00e1m\u00e9 +node.errored = chybov\u00e9 \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java index bc7efbb15..d5a90e062 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java @@ -72,6 +72,7 @@ import com.jpexs.decompiler.flash.tags.StartSound2Tag; import com.jpexs.decompiler.flash.tags.StartSoundTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.TagStub; +import com.jpexs.decompiler.flash.tags.UnknownTag; import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.BinaryDataInterface; @@ -143,10 +144,8 @@ public abstract class AbstractTagTree extends JTree { static { ICONS = new HashMap<>(); for (TreeNodeType treeNodeType : TreeNodeType.values()) { - if (treeNodeType != TreeNodeType.UNKNOWN) { - String tagTypeStr = treeNodeType.toString().toLowerCase(Locale.ENGLISH).replace("_", ""); - ICONS.put(treeNodeType, View.getIcon(tagTypeStr + "16")); - } + String tagTypeStr = treeNodeType.toString().toLowerCase(Locale.ENGLISH).replace("_", ""); + ICONS.put(treeNodeType, View.getIcon(tagTypeStr + "16")); } } @@ -484,9 +483,13 @@ public abstract class AbstractTagTree extends JTree { } if (t instanceof TagStub) { - return TreeNodeType.ERROR; + return TreeNodeType.ERRORED; } + if (t instanceof UnknownTag) { + return TreeNodeType.UNKNOWN; + } + if (t instanceof Tag) { return TreeNodeType.OTHER_TAG; } diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java index 045de920e..b30de0910 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeModel.java @@ -102,6 +102,11 @@ public class TagTreeModel extends AbstractTagTreeModel { public static final String FOLDER_SCENES = "scenes"; + public static final String FOLDER_UNKNOWN = "unknown"; + + public static final String FOLDER_ERRORED = "errored"; + + public static final List FOLDERS_ORDER = Arrays.asList( "header", "cookies", @@ -118,6 +123,8 @@ public class TagTreeModel extends AbstractTagTreeModel { "frames", "scenes", "others", + "unknown", + "errored", "scripts" ); @@ -202,7 +209,9 @@ public class TagTreeModel extends AbstractTagTreeModel { List movies, List sounds, List binaryData, - List others + List others, + List unknown, + List errored ) { for (Tag t : timelined.getTags()) { TreeNodeType ttype = TagTree.getTreeNodeType(t); @@ -215,7 +224,7 @@ public class TagTreeModel extends AbstractTagTreeModel { break; case SPRITE: sprites.add(t); - walkTimelinedTagList((DefineSpriteTag) t, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others); + walkTimelinedTagList((DefineSpriteTag) t, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others, unknown, errored); break; case BUTTON: buttons.add(t); @@ -241,6 +250,12 @@ public class TagTreeModel extends AbstractTagTreeModel { case AS: case AS_FRAME: break; + case UNKNOWN: + unknown.add(t); + break; + case ERRORED: + errored.add(t); + break; default: if (t.getId() != ShowFrameTag.ID && !ShowFrameTag.isNestedTagType(t.getId())) { boolean parentFound = false; @@ -283,9 +298,11 @@ public class TagTreeModel extends AbstractTagTreeModel { List sounds = new ArrayList<>(); List binaryData = new ArrayList<>(); List others = new ArrayList<>(); + List unknown = new ArrayList<>(); + List errored = new ArrayList<>(); List emptyFolders = new ArrayList<>(); Map> mappedTags = new HashMap<>(); - walkTimelinedTagList(swf, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others); + walkTimelinedTagList(swf, mappedTags, shapes, morphShapes, sprites, buttons, images, fonts, texts, movies, sounds, binaryData, others, unknown, errored); Timeline timeline = swf.getTimeline(); int frameCount = timeline.getFrameCount(); @@ -364,6 +381,12 @@ public class TagTreeModel extends AbstractTagTreeModel { case "others": addFolderItem(nodeList, emptyFolders, true /*always add*/, translate("node.others"), FOLDER_OTHERS, swf, others); break; + case "unknown": + addFolderItem(nodeList, emptyFolders, false, translate("node.unknown"), FOLDER_UNKNOWN, swf, unknown); + break; + case "errored": + addFolderItem(nodeList, emptyFolders, false, translate("node.errored"), FOLDER_ERRORED, swf, errored); + break; case "scripts": if (swf.isAS3()) { if (!swf.getAbcList().isEmpty()) {