diff --git a/CHANGELOG.md b/CHANGELOG.md index f3f1a7ddc..af878adef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,11 @@ All notable changes to this project will be documented in this file. - SerialNumber tag support (before Flash 7) - FreeCharacter tag support - SyncFrame tag support +- Hex dump improvements: + - view bit count in SB, UB fields + - view tagIDTagLength field parts + - show type after colon, not in parenthesis + - view bytes length in bytes fields ### Fixed - [#2474] Gotos incorrectly decompiled diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 20dd58f12..aad726df3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -933,7 +933,7 @@ public class SWFInputStream implements AutoCloseable { return BYTE_ARRAY_EMPTY; } - newDumpLevel(name, "bytes"); + newDumpLevel(name, "byte[" + count + "]"); byte[] ret = readBytesInternalEx(count); endDumpLevel(); return ret; @@ -983,7 +983,7 @@ public class SWFInputStream implements AutoCloseable { throw new RuntimeException("Data not available - use constructor with data rather than inputstream"); } - newDumpLevel(name, "bytes", specialType, specialValue); + newDumpLevel(name, "byte[" + count + "]", specialType, specialValue); int startPos = (int) is.getPos(); skipBytesEx(count); @@ -1045,7 +1045,7 @@ public class SWFInputStream implements AutoCloseable { return; } - newDumpLevel(name, "bytes"); + newDumpLevel(name, "byte[" + count + "]"); skipBytesEx(count); endDumpLevel(); } @@ -1076,7 +1076,7 @@ public class SWFInputStream implements AutoCloseable { if (count <= 0) { return BYTE_ARRAY_EMPTY; } - newDumpLevel(name, "bytes"); + newDumpLevel(name, "byte[" + count + "]"); byte[] ret = new byte[count]; int i = 0; try { @@ -1104,7 +1104,7 @@ public class SWFInputStream implements AutoCloseable { return BYTE_ARRAY_EMPTY; } - newDumpLevel(name, "bytesZlib"); + newDumpLevel(name, "byteZlib[" + count + "]"); byte[] data = readBytesInternalEx(count); endDumpLevel(); return uncompressByteArray(data); @@ -1188,7 +1188,7 @@ public class SWFInputStream implements AutoCloseable { if (nBits == 0) { return 0; } - newDumpLevel(name, "UB"); + newDumpLevel(name, "UB" + (nBits > 1 ? "[" + nBits + "]" : "")); long ret = readUBInternal(nBits); endDumpLevel(ret); return ret; @@ -1235,7 +1235,7 @@ public class SWFInputStream implements AutoCloseable { if (nBits == 0) { return 0; } - newDumpLevel(name, "SB"); + newDumpLevel(name, "SB" + (nBits > 1 ? "[" + nBits + "]" : "")); long ret = readSBInternal(nBits); endDumpLevel(ret); return ret; @@ -1872,10 +1872,14 @@ public class SWFInputStream implements AutoCloseable { logger.log(Level.FINE, "Reading tag. ID={0}, position: {1}", new Object[]{tagID, pos}); - long tagLength = (tagIDTagLength & 0x003F); + long tagLength = (tagIDTagLength & 0x003F); + DumpInfo di = dumpInfo; + if (di != null) { + di.getChildInfos().get(0).previewValue = tagIDTagLength + " (tagID = " + tagID + ", tagLength = " + tagLength + (tagLength == 0x3f ? " => use UI32" : "") + ")"; + } boolean readLong = false; if (tagLength == 0x3f) { - tagLength = readSI32("tagLength"); + tagLength = readUI32("tagLength"); readLong = true; } int headerLength = readLong ? 6 : 2; @@ -1897,7 +1901,7 @@ public class SWFInputStream implements AutoCloseable { } if (resolve) { - DumpInfo di = dumpInfo; + di = dumpInfo; try { ret = resolveTag(tagStub, level, parallel, skipUnusualTags, lazy, true); } catch (Exception ex) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/dumpview/DumpInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/dumpview/DumpInfo.java index 440bf043f..b27515d00 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/dumpview/DumpInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/dumpview/DumpInfo.java @@ -124,7 +124,7 @@ public class DumpInfo implements TreeItem { @Override public String toString() { String value = previewValue == null ? "" : previewValue.toString(); - return name + " (" + type + ")" + (value.isEmpty() ? "" : " = " + value); + return name + " : " + type + (value.isEmpty() ? "" : " = " + value); } public void resolveTag() {