diff --git a/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugConnection.as b/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugConnection.as index b0787dda0..14c813e10 100644 --- a/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugConnection.as +++ b/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugConnection.as @@ -13,11 +13,14 @@ private static var inited:Boolean = false; private static var name:String; public static const DEBUG_VERSION_MAJOR = 1; - public static const DEBUG_VERSION_MINOR = 1; + public static const DEBUG_VERSION_MINOR = 2; public static const MSG_STRING = 0; public static const MSG_LOADER_URL = 1; public static const MSG_LOADER_BYTES = 2; + public static const MSG_LONGSTRING = 3; + public static const MSG_LOADER_URL_GETBYTES = 4; + public static const MSG_LOADER_BYTES_GETBYTES = 5; @@ -38,12 +41,18 @@ private static function writeString(msg){ var b:ByteArray = new ByteArray(); - b.writeUTFBytes(msg); + b.writeUTFBytes(msg); s.writeByte((b.length>>8) & 0xff); s.writeByte(b.length & 0xff); s.writeBytes(b,0,b.length); } + private static function writeLongString(msg){ + var b:ByteArray = new ByteArray(); + b.writeUTFBytes(msg); + writeBytes(b); + } + private static function writeBytes(b:ByteArray){ s.writeByte((b.length>>24) & 0xff); s.writeByte((b.length>>16) & 0xff); @@ -52,6 +61,32 @@ s.writeBytes(b,0,b.length); } + private static function readBytes():ByteArray { + var b:ByteArray = new ByteArray(); + var a1 = s.readUnsignedByte(); + var a2 = s.readUnsignedByte(); + var a3 = s.readUnsignedByte(); + var a4 = s.readUnsignedByte(); + var len = (a1<<24)+(a2<<16)+(a3<<8)+a4; + + s.readBytes(b,0,len); + return b; + } + + private static function readString():String { + var b:ByteArray = new ByteArray(); + var a1 = s.readUnsignedByte(); + var a2 = s.readUnsignedByte(); + var len = (a1<<8)+a2; + + return s.readUTFBytes(len); + } + + private static function readLongString():String { + var b:ByteArray = readBytes(); + return b.readUTFBytes(b.length); + } + public static function initClient(sname){ if(inited){ return; @@ -102,6 +137,12 @@ case MSG_LOADER_BYTES: writeBytes(msg); break; + case MSG_LOADER_URL_GETBYTES: + writeString(msg); + break; + case MSG_LOADER_BYTES_GETBYTES: + writeBytes(msg); + break; } }else{ q.push({type:msgType,data:msg}); diff --git a/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugLoader.as b/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugLoader.as index cdcf3f3f4..503b11ae6 100644 --- a/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugLoader.as +++ b/libsrc/debugswf/com/jpexs/decompiler/flash/debugger/DebugLoader.as @@ -17,6 +17,10 @@ DebugConnection.writeLoaderBytes(bytes); super.loadBytes(bytes,context); } + + public override function toString():String { + return "[object Loader]"; + } } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index 901467054..43ce7001a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -12,7 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. +* License along with this library. */ package com.jpexs.decompiler.flash.xfl; @@ -217,8 +217,8 @@ public class XFLConverter { + "" - + "" - + ""); + + "" + + ""); } private static void convertLineStyle(HashMap characters, LINESTYLE2 ls, int shapeNum, StringBuilder ret) { @@ -2190,7 +2190,7 @@ public class XFLConverter { if (ret2.length() > 0) { ret.append("" + "").append(ret2).append("" - + ""); + + ""); } } @@ -2342,7 +2342,7 @@ public class XFLConverter { if (filters != null) { filterStr.append(""); for (FILTER f : filters) { - convertFilter(f, ret); + convertFilter(f, filterStr); } filterStr.append(""); } diff --git a/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java b/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java index b9a4dd7f7..dadf683a8 100644 --- a/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java +++ b/src/com/jpexs/decompiler/flash/gui/debugger/DebuggerTools.java @@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.DebugLogDialog; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import com.jpexs.decompiler.flash.tags.FileAttributesTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.helpers.Helper; import java.util.ArrayList; @@ -207,6 +208,11 @@ public class DebuggerTools { swf.addTag((Tag) ds, (Tag) firstAbc); swf.getAbcList().add(swf.getAbcList().indexOf(firstAbc), ds); ((Tag) ds).setModified(true); + + //To allow socket connection to FFDec. Is this safe? + FileAttributesTag ft = swf.getFileAttributes(); + ft.useNetwork = true; + ft.setModified(true); } } catch (Exception ex) { diff --git a/src/com/jpexs/decompiler/flash/gui/debugger/debug.swf b/src/com/jpexs/decompiler/flash/gui/debugger/debug.swf index dcad53097..2cdb1a865 100644 Binary files a/src/com/jpexs/decompiler/flash/gui/debugger/debug.swf and b/src/com/jpexs/decompiler/flash/gui/debugger/debug.swf differ