From 79f2f7cd45ab7f1bf3e64e6de161e3055e5c1161 Mon Sep 17 00:00:00 2001 From: Honfika Date: Tue, 15 Oct 2013 22:24:17 +0200 Subject: [PATCH] replace hex tags to comment in export, AS2 highlight fixed --- trunk/src/com/jpexs/decompiler/flash/TagNode.java | 4 +++- trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java | 1 + trunk/src/com/jpexs/decompiler/flash/action/Action.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/TagNode.java index caf0d2704..78cf0fb7c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/TagNode.java +++ b/trunk/src/com/jpexs/decompiler/flash/TagNode.java @@ -305,7 +305,9 @@ public class TagNode { } else if (exportMode != ExportMode.SOURCE) { HilightedTextWriter writer = new HilightedTextWriter(false, asm.getActionSourceIndent()); asm.getASMSource(SWF.DEFAULT_VERSION, exportMode, writer, null); - res = asm.getActionSourcePrefix() + writer.toString() + asm.getActionSourceSuffix(); + String str = writer.toString(); + str = Helper.hexToComments(str); + res = asm.getActionSourcePrefix() + str + asm.getActionSourceSuffix(); } else { List as = asm.getActions(SWF.DEFAULT_VERSION); Action.setActionsAddresses(as, 0, SWF.DEFAULT_VERSION); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 899eb5265..6686345dd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -128,6 +128,7 @@ public class ScriptPack { abc.script_info[scriptIndex].traits.traits[t].convert(null, "", abcList, abc, false, exportMode, scriptIndex, -1, writer, new ArrayList(), parallel); } String s = Graph.removeNonRefenrencedLoopLabels(writer.toString()); + s = Helper.hexToComments(s); fos.write(s.getBytes("utf-8")); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 9b98739ea..8df65c1c3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -721,7 +721,7 @@ public class Action implements GraphSourceItem { * @return HilightedTextWriter with Source code */ public static String actionsToSource(List actions, int version, String path, boolean highlight, int indent) { - HilightedTextWriter writer = new HilightedTextWriter(false, indent); + HilightedTextWriter writer = new HilightedTextWriter(highlight, indent); Action.actionsToSource(actions, SWF.DEFAULT_VERSION, ""/*FIXME*/, writer); String s = Graph.removeNonRefenrencedLoopLabels(writer.toString()); return s;