generic tag panel: binary editor now can edit byte[]

This commit is contained in:
2015-08-03 08:32:54 +02:00
parent 47152b3a13
commit 586111ea8a
5 changed files with 1301 additions and 1260 deletions
@@ -23,6 +23,8 @@ import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.ByteArrayRange;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
@@ -72,6 +74,10 @@ public class DebugIDTag extends Tag {
*/
@Override
public void getData(SWFOutputStream sos) throws IOException {
if (debugId.length != 16) {
Logger.getLogger(DebugIDTag.class.getName()).log(Level.WARNING, "DebugID should be 16 bytes");
}
sos.write(debugId);
}
}
@@ -25,6 +25,8 @@ import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.helpers.ByteArrayRange;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Enable flash profiling information
@@ -71,6 +73,10 @@ public class EnableTelemetryTag extends Tag {
public final void readData(SWFInputStream sis, ByteArrayRange data, int level, boolean parallel, boolean skipUnusualTags, boolean lazy) throws IOException {
reserved = (int) sis.readUB(16, "reserved");
if (sis.available() > 0) {
if (passwordHash.length != 32) {
Logger.getLogger(EnableTelemetryTag.class.getName()).log(Level.WARNING, "PasswordHash should be 32 bytes");
}
passwordHash = sis.readBytesEx(32, "passwordHash");
}
}