mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 00:50:51 +00:00
dumpview: allow opening multiple swfs, context menu: expand all and close menu items
show abc and actionbytes in dump view, hexview style fixes better scroll to view mode in hex editor
This commit is contained in:
@@ -52,7 +52,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionNewObject;
|
|||||||
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
|
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
|
||||||
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
|
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
|
||||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||||
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
import com.jpexs.decompiler.flash.dumpview.DumpInfoSwfNode;
|
||||||
import com.jpexs.decompiler.flash.ecma.Null;
|
import com.jpexs.decompiler.flash.ecma.Null;
|
||||||
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
|
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
|
||||||
import com.jpexs.decompiler.flash.exporters.FontExporter;
|
import com.jpexs.decompiler.flash.exporters.FontExporter;
|
||||||
@@ -271,7 +271,7 @@ public final class SWF implements TreeItem, Timelined {
|
|||||||
|
|
||||||
private Timeline timeline;
|
private Timeline timeline;
|
||||||
|
|
||||||
public DumpInfo dumpInfo;
|
public DumpInfoSwfNode dumpInfo;
|
||||||
|
|
||||||
public void updateCharacters() {
|
public void updateCharacters() {
|
||||||
characters.clear();
|
characters.clear();
|
||||||
@@ -308,7 +308,7 @@ public final class SWF implements TreeItem, Timelined {
|
|||||||
Tag t = tags.get(i);
|
Tag t = tags.get(i);
|
||||||
if (t instanceof DefineSpriteTag) {
|
if (t instanceof DefineSpriteTag) {
|
||||||
if (!isSpriteValid((DefineSpriteTag) t, new ArrayList<Integer>())) {
|
if (!isSpriteValid((DefineSpriteTag) t, new ArrayList<Integer>())) {
|
||||||
tags.set(i, new TagStub(this, t.getId(), "InvalidSprite", t.getPos(), t.getOriginalLength(), null));
|
tags.set(i, new TagStub(this, t.getId(), "InvalidSprite", t.getOriginalRange(), null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -385,9 +385,7 @@ public final class SWF implements TreeItem, Timelined {
|
|||||||
sos.writeUI8(frameRate);
|
sos.writeUI8(frameRate);
|
||||||
sos.writeUI16(frameCount);
|
sos.writeUI16(frameCount);
|
||||||
|
|
||||||
Map<Tag, Long> tagPositions = new HashMap<>();
|
sos.writeTags(tags);
|
||||||
Map<Tag, Integer> tagLengths = new HashMap<>();
|
|
||||||
sos.writeTags(tags, tagPositions, tagLengths);
|
|
||||||
if (hasEndTag) {
|
if (hasEndTag) {
|
||||||
sos.writeUI16(0);
|
sos.writeUI16(0);
|
||||||
}
|
}
|
||||||
@@ -512,7 +510,7 @@ public final class SWF implements TreeItem, Timelined {
|
|||||||
uncompressedData = baos.toByteArray();
|
uncompressedData = baos.toByteArray();
|
||||||
|
|
||||||
SWFInputStream sis = new SWFInputStream(this, uncompressedData);
|
SWFInputStream sis = new SWFInputStream(this, uncompressedData);
|
||||||
dumpInfo = new DumpInfo("rootswf", "", null, 0, 0);
|
dumpInfo = new DumpInfoSwfNode(this, "rootswf", "", null, 0, 0);
|
||||||
sis.dumpInfo = dumpInfo;
|
sis.dumpInfo = dumpInfo;
|
||||||
sis.readBytesEx(3, "signature"); // skip siganture
|
sis.readBytesEx(3, "signature"); // skip siganture
|
||||||
version = sis.readUI8("version");
|
version = sis.readUI8("version");
|
||||||
@@ -543,7 +541,7 @@ public final class SWF implements TreeItem, Timelined {
|
|||||||
} else {
|
} else {
|
||||||
boolean hasNonUnknownTag = false;
|
boolean hasNonUnknownTag = false;
|
||||||
for (Tag tag : tags) {
|
for (Tag tag : tags) {
|
||||||
if (tag.getOriginalLength() > 2 && Tag.getRequiredTags().contains(tag.getId())) {
|
if (tag.getOriginalDataLength() > 0 && Tag.getRequiredTags().contains(tag.getId())) {
|
||||||
hasNonUnknownTag = true;
|
hasNonUnknownTag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2120,7 +2118,7 @@ public final class SWF implements TreeItem, Timelined {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (ASMSource src : actionsMap.keySet()) {
|
for (ASMSource src : actionsMap.keySet()) {
|
||||||
actionsMap.put(src, Action.removeNops(0, actionsMap.get(src), version, 0, ""/*FIXME path*/));
|
actionsMap.put(src, Action.removeNops(0, actionsMap.get(src), version, ""/*FIXME path*/));
|
||||||
src.setActions(actionsMap.get(src));
|
src.setActions(actionsMap.get(src));
|
||||||
src.setModified();
|
src.setModified();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
|
|||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import com.jpexs.helpers.MemoryInputStream;
|
import com.jpexs.helpers.MemoryInputStream;
|
||||||
import com.jpexs.helpers.ProgressListener;
|
import com.jpexs.helpers.ProgressListener;
|
||||||
@@ -1100,8 +1101,7 @@ public class SWFInputStream implements AutoCloseable {
|
|||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
long pos = tag.getPos();
|
ByteArrayRange data = tag.getOriginalRange();
|
||||||
int length = tag.getOriginalLength();
|
|
||||||
SWF swf = tag.getSwf();
|
SWF swf = tag.getSwf();
|
||||||
TagStub tagStub = (TagStub) tag;
|
TagStub tagStub = (TagStub) tag;
|
||||||
SWFInputStream sis = tagStub.getDataStream();
|
SWFInputStream sis = tagStub.getDataStream();
|
||||||
@@ -1109,127 +1109,127 @@ public class SWFInputStream implements AutoCloseable {
|
|||||||
try {
|
try {
|
||||||
switch (tag.getId()) {
|
switch (tag.getId()) {
|
||||||
case 0:
|
case 0:
|
||||||
ret = new EndTag(swf, pos, length);
|
ret = new EndTag(swf, data);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ret = new ShowFrameTag(swf, pos, length);
|
ret = new ShowFrameTag(swf, data);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ret = new DefineShapeTag(sis, pos, length);
|
ret = new DefineShapeTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 3: FreeCharacter
|
//case 3: FreeCharacter
|
||||||
case 4:
|
case 4:
|
||||||
ret = new PlaceObjectTag(sis, pos, length);
|
ret = new PlaceObjectTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
ret = new RemoveObjectTag(sis, pos, length);
|
ret = new RemoveObjectTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
ret = new DefineBitsTag(sis, pos, length);
|
ret = new DefineBitsTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
ret = new DefineButtonTag(sis, pos, length);
|
ret = new DefineButtonTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
ret = new JPEGTablesTag(sis, pos, length);
|
ret = new JPEGTablesTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
ret = new SetBackgroundColorTag(sis, pos, length);
|
ret = new SetBackgroundColorTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
ret = new DefineFontTag(sis, pos, length);
|
ret = new DefineFontTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
ret = new DefineTextTag(sis, pos, length);
|
ret = new DefineTextTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
ret = new DoActionTag(sis, pos, length);
|
ret = new DoActionTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
ret = new DefineFontInfoTag(sis, pos, length);
|
ret = new DefineFontInfoTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
ret = new DefineSoundTag(sis, pos, length);
|
ret = new DefineSoundTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
ret = new StartSoundTag(sis, pos, length);
|
ret = new StartSoundTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 16:
|
//case 16:
|
||||||
case 17:
|
case 17:
|
||||||
ret = new DefineButtonSoundTag(sis, pos, length);
|
ret = new DefineButtonSoundTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 18:
|
case 18:
|
||||||
ret = new SoundStreamHeadTag(sis, pos, length);
|
ret = new SoundStreamHeadTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 19:
|
case 19:
|
||||||
ret = new SoundStreamBlockTag(sis, pos, length);
|
ret = new SoundStreamBlockTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
ret = new DefineBitsJPEG2Tag(sis, pos, length);
|
ret = new DefineBitsJPEG2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
ret = new DefineBitsLosslessTag(sis, pos, length);
|
ret = new DefineBitsLosslessTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 22:
|
case 22:
|
||||||
ret = new DefineShape2Tag(sis, pos, length);
|
ret = new DefineShape2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
ret = new DefineButtonCxformTag(sis, pos, length);
|
ret = new DefineButtonCxformTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
ret = new ProtectTag(sis, pos, length);
|
ret = new ProtectTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 25: PathsArePostscript
|
//case 25: PathsArePostscript
|
||||||
case 26:
|
case 26:
|
||||||
ret = new PlaceObject2Tag(sis, pos, length);
|
ret = new PlaceObject2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 27:
|
//case 27:
|
||||||
case 28:
|
case 28:
|
||||||
ret = new RemoveObject2Tag(sis, pos, length);
|
ret = new RemoveObject2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 29: SyncFrame
|
//case 29: SyncFrame
|
||||||
//case 30:
|
//case 30:
|
||||||
//case 31: FreeAll
|
//case 31: FreeAll
|
||||||
case 32:
|
case 32:
|
||||||
ret = new DefineShape3Tag(sis, pos, length);
|
ret = new DefineShape3Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
ret = new DefineText2Tag(sis, pos, length);
|
ret = new DefineText2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 34:
|
case 34:
|
||||||
ret = new DefineButton2Tag(sis, pos, length);
|
ret = new DefineButton2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 35:
|
case 35:
|
||||||
ret = new DefineBitsJPEG3Tag(sis, pos, length);
|
ret = new DefineBitsJPEG3Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 36:
|
case 36:
|
||||||
ret = new DefineBitsLossless2Tag(sis, pos, length);
|
ret = new DefineBitsLossless2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 37:
|
case 37:
|
||||||
ret = new DefineEditTextTag(sis, pos, length);
|
ret = new DefineEditTextTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 38: DefineVideo
|
//case 38: DefineVideo
|
||||||
case 39:
|
case 39:
|
||||||
ret = new DefineSpriteTag(sis, level, pos, length, parallel, skipUnusualTags);
|
ret = new DefineSpriteTag(sis, level, data, parallel, skipUnusualTags);
|
||||||
break;
|
break;
|
||||||
//case 40: NameCharacter
|
//case 40: NameCharacter
|
||||||
case 41:
|
case 41:
|
||||||
ret = new ProductInfoTag(sis, pos, length);
|
ret = new ProductInfoTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 42: DefineTextFormat
|
//case 42: DefineTextFormat
|
||||||
case 43:
|
case 43:
|
||||||
ret = new FrameLabelTag(sis, pos, length);
|
ret = new FrameLabelTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 44:
|
//case 44:
|
||||||
case 45:
|
case 45:
|
||||||
ret = new SoundStreamHead2Tag(sis, pos, length);
|
ret = new SoundStreamHead2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 46:
|
case 46:
|
||||||
ret = new DefineMorphShapeTag(sis, pos, length);
|
ret = new DefineMorphShapeTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 47: GenerateFrame
|
//case 47: GenerateFrame
|
||||||
case 48:
|
case 48:
|
||||||
ret = new DefineFont2Tag(sis, pos, length);
|
ret = new DefineFont2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 49: GeneratorCommand
|
//case 49: GeneratorCommand
|
||||||
//case 50: DefineCommandObject
|
//case 50: DefineCommandObject
|
||||||
@@ -1237,148 +1237,148 @@ public class SWFInputStream implements AutoCloseable {
|
|||||||
//case 52: ExternalFont
|
//case 52: ExternalFont
|
||||||
//case 53-55
|
//case 53-55
|
||||||
case 56:
|
case 56:
|
||||||
ret = new ExportAssetsTag(sis, pos, length);
|
ret = new ExportAssetsTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 57:
|
case 57:
|
||||||
ret = new ImportAssetsTag(sis, pos, length);
|
ret = new ImportAssetsTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 58:
|
case 58:
|
||||||
ret = new EnableDebuggerTag(sis, pos, length);
|
ret = new EnableDebuggerTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 59:
|
case 59:
|
||||||
ret = new DoInitActionTag(sis, pos, length);
|
ret = new DoInitActionTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 60:
|
case 60:
|
||||||
ret = new DefineVideoStreamTag(sis, pos, length);
|
ret = new DefineVideoStreamTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 61:
|
case 61:
|
||||||
ret = new VideoFrameTag(sis, pos, length);
|
ret = new VideoFrameTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 62:
|
case 62:
|
||||||
ret = new DefineFontInfo2Tag(sis, pos, length);
|
ret = new DefineFontInfo2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 63:
|
case 63:
|
||||||
ret = new DebugIDTag(sis, pos, length);
|
ret = new DebugIDTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 64:
|
case 64:
|
||||||
ret = new EnableDebugger2Tag(sis, pos, length);
|
ret = new EnableDebugger2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 65:
|
case 65:
|
||||||
ret = new ScriptLimitsTag(sis, pos, length);
|
ret = new ScriptLimitsTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 66:
|
case 66:
|
||||||
ret = new SetTabIndexTag(sis, pos, length);
|
ret = new SetTabIndexTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 67-68:
|
//case 67-68:
|
||||||
case 69:
|
case 69:
|
||||||
ret = new FileAttributesTag(sis, pos, length);
|
ret = new FileAttributesTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 70:
|
case 70:
|
||||||
ret = new PlaceObject3Tag(sis, pos, length);
|
ret = new PlaceObject3Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 71:
|
case 71:
|
||||||
ret = new ImportAssets2Tag(sis, pos, length);
|
ret = new ImportAssets2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 72:
|
case 72:
|
||||||
ret = new DoABCTag(sis, pos, length);
|
ret = new DoABCTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 73:
|
case 73:
|
||||||
ret = new DefineFontAlignZonesTag(sis, pos, length);
|
ret = new DefineFontAlignZonesTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 74:
|
case 74:
|
||||||
ret = new CSMTextSettingsTag(sis, pos, length);
|
ret = new CSMTextSettingsTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 75:
|
case 75:
|
||||||
ret = new DefineFont3Tag(sis, pos, length);
|
ret = new DefineFont3Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 76:
|
case 76:
|
||||||
ret = new SymbolClassTag(sis, pos, length);
|
ret = new SymbolClassTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 77:
|
case 77:
|
||||||
ret = new MetadataTag(sis, pos, length);
|
ret = new MetadataTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 78:
|
case 78:
|
||||||
ret = new DefineScalingGridTag(sis, pos, length);
|
ret = new DefineScalingGridTag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 79-81:
|
//case 79-81:
|
||||||
case 82:
|
case 82:
|
||||||
ret = new DoABCDefineTag(sis, pos, length);
|
ret = new DoABCDefineTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 83:
|
case 83:
|
||||||
ret = new DefineShape4Tag(sis, pos, length);
|
ret = new DefineShape4Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 84:
|
case 84:
|
||||||
ret = new DefineMorphShape2Tag(sis, pos, length);
|
ret = new DefineMorphShape2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 85:
|
//case 85:
|
||||||
case 86:
|
case 86:
|
||||||
ret = new DefineSceneAndFrameLabelDataTag(sis, pos, length);
|
ret = new DefineSceneAndFrameLabelDataTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 87:
|
case 87:
|
||||||
ret = new DefineBinaryDataTag(sis, pos, length);
|
ret = new DefineBinaryDataTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 88:
|
case 88:
|
||||||
ret = new DefineFontNameTag(sis, pos, length);
|
ret = new DefineFontNameTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 89:
|
case 89:
|
||||||
ret = new StartSound2Tag(sis, pos, length);
|
ret = new StartSound2Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 90:
|
case 90:
|
||||||
ret = new DefineBitsJPEG4Tag(sis, pos, length);
|
ret = new DefineBitsJPEG4Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 91:
|
case 91:
|
||||||
ret = new DefineFont4Tag(sis, pos, length);
|
ret = new DefineFont4Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
//case 92: certificate
|
//case 92: certificate
|
||||||
case 93:
|
case 93:
|
||||||
ret = new EnableTelemetryTag(sis, pos, length);
|
ret = new EnableTelemetryTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 94:
|
case 94:
|
||||||
ret = new PlaceObject4Tag(sis, pos, length);
|
ret = new PlaceObject4Tag(sis, data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (gfx) { //GFX tags only in GFX files. There may be incorrect GFX tags in non GFX files
|
if (gfx) { //GFX tags only in GFX files. There may be incorrect GFX tags in non GFX files
|
||||||
switch (tag.getId()) {
|
switch (tag.getId()) {
|
||||||
case 1000:
|
case 1000:
|
||||||
ret = new ExporterInfoTag(sis, pos, length);
|
ret = new ExporterInfoTag(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1001:
|
case 1001:
|
||||||
ret = new DefineExternalImage(sis, pos, length);
|
ret = new DefineExternalImage(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1002:
|
case 1002:
|
||||||
ret = new FontTextureInfo(sis, pos, length);
|
ret = new FontTextureInfo(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1003:
|
case 1003:
|
||||||
ret = new DefineExternalGradient(sis, pos, length);
|
ret = new DefineExternalGradient(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1004:
|
case 1004:
|
||||||
ret = new DefineGradientMap(sis, pos, length);
|
ret = new DefineGradientMap(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1005:
|
case 1005:
|
||||||
ret = new DefineCompactedFont(sis, pos, length);
|
ret = new DefineCompactedFont(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1006:
|
case 1006:
|
||||||
ret = new DefineExternalSound(sis, pos, length);
|
ret = new DefineExternalSound(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1007:
|
case 1007:
|
||||||
ret = new DefineExternalStreamSound(sis, pos, length);
|
ret = new DefineExternalStreamSound(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1008:
|
case 1008:
|
||||||
ret = new DefineSubImage(sis, pos, length);
|
ret = new DefineSubImage(sis, data);
|
||||||
break;
|
break;
|
||||||
case 1009:
|
case 1009:
|
||||||
ret = new DefineExternalImage2(sis, pos, length);
|
ret = new DefineExternalImage2(sis, data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = new UnknownTag(swf, tag.getId(), pos, length);
|
ret = new UnknownTag(swf, tag.getId(), data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = new UnknownTag(swf, tag.getId(), pos, length);
|
ret = new UnknownTag(swf, tag.getId(), data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.SEVERE, "Error during tag reading", ex);
|
logger.log(Level.SEVERE, "Error during tag reading", ex);
|
||||||
ret = new TagStub(swf, tag.getId(), "ErrorTag", pos, length, null);
|
ret = new TagStub(swf, tag.getId(), "ErrorTag", data, null);
|
||||||
}
|
}
|
||||||
ret.forceWriteAsLong = tag.forceWriteAsLong;
|
ret.forceWriteAsLong = tag.forceWriteAsLong;
|
||||||
ret.setTimelined(tag.getTimelined());
|
ret.setTimelined(tag.getTimelined());
|
||||||
@@ -1413,7 +1413,8 @@ public class SWFInputStream implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
int headerLength = readLong ? 6 : 2;
|
int headerLength = readLong ? 6 : 2;
|
||||||
SWFInputStream tagDataStream = getLimitedStream((int) tagLength);
|
SWFInputStream tagDataStream = getLimitedStream((int) tagLength);
|
||||||
TagStub tagStub = new TagStub(swf, tagID, "Unresolved", pos, (int) (tagLength + headerLength), tagDataStream);
|
ByteArrayRange dataRange = new ByteArrayRange(swf.uncompressedData, (int) pos, (int) (tagLength + headerLength));
|
||||||
|
TagStub tagStub = new TagStub(swf, tagID, "Unresolved", dataRange, tagDataStream);
|
||||||
Tag ret = tagStub;
|
Tag ret = tagStub;
|
||||||
ret.forceWriteAsLong = readLong;
|
ret.forceWriteAsLong = readLong;
|
||||||
skipBytes((int) tagLength);
|
skipBytes((int) tagLength);
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ import java.io.ByteArrayOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.zip.Deflater;
|
import java.util.zip.Deflater;
|
||||||
import java.util.zip.DeflaterOutputStream;
|
import java.util.zip.DeflaterOutputStream;
|
||||||
|
|
||||||
@@ -415,20 +414,12 @@ public class SWFOutputStream extends OutputStream {
|
|||||||
* Writes list of Tag values to the stream
|
* Writes list of Tag values to the stream
|
||||||
*
|
*
|
||||||
* @param tags List of tag values
|
* @param tags List of tag values
|
||||||
* @param tagPositions
|
|
||||||
* @param tagLengths
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public void writeTags(List<Tag> tags, Map<Tag, Long> tagPositions, Map<Tag, Integer> tagLengths) throws IOException {
|
public void writeTags(List<Tag> tags) throws IOException {
|
||||||
for (Tag tag : tags) {
|
for (Tag tag : tags) {
|
||||||
long pos = getPos();
|
|
||||||
tag.writeTag(this);
|
tag.writeTag(this);
|
||||||
int length = (int) (getPos() - pos);
|
|
||||||
tagPositions.put(tag, pos);
|
|
||||||
tagLengths.put(tag, length);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: honfika: update tag position and lengths. Currently the 2nd save fails
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -76,7 +76,6 @@ public class ActionListReader {
|
|||||||
* ActionEndFlag(=0) or end of the stream.
|
* ActionEndFlag(=0) or end of the stream.
|
||||||
*
|
*
|
||||||
* @param listeners
|
* @param listeners
|
||||||
* @param containerSWFOffset
|
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param version
|
* @param version
|
||||||
* @param ip
|
* @param ip
|
||||||
@@ -87,13 +86,13 @@ public class ActionListReader {
|
|||||||
* @throws java.lang.InterruptedException
|
* @throws java.lang.InterruptedException
|
||||||
* @throws java.util.concurrent.TimeoutException
|
* @throws java.util.concurrent.TimeoutException
|
||||||
*/
|
*/
|
||||||
public static List<Action> readActionListTimeout(final List<DisassemblyListener> listeners, final long containerSWFOffset, final SWFInputStream sis, final int version, final int ip, final int endIp, final String path) throws IOException, InterruptedException, TimeoutException {
|
public static List<Action> readActionListTimeout(final List<DisassemblyListener> listeners, final SWFInputStream sis, final int version, final int ip, final int endIp, final String path) throws IOException, InterruptedException, TimeoutException {
|
||||||
try {
|
try {
|
||||||
return CancellableWorker.call(new Callable<List<Action>>() {
|
return CancellableWorker.call(new Callable<List<Action>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Action> call() throws IOException, InterruptedException {
|
public List<Action> call() throws IOException, InterruptedException {
|
||||||
return readActionList(listeners, containerSWFOffset, sis, version, ip, endIp, path);
|
return readActionList(listeners, sis, version, ip, endIp, path);
|
||||||
}
|
}
|
||||||
}, Configuration.decompilationTimeoutSingleMethod.get(), TimeUnit.SECONDS);
|
}, Configuration.decompilationTimeoutSingleMethod.get(), TimeUnit.SECONDS);
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
@@ -114,7 +113,6 @@ public class ActionListReader {
|
|||||||
* ActionEndFlag(=0) or end of the stream.
|
* ActionEndFlag(=0) or end of the stream.
|
||||||
*
|
*
|
||||||
* @param listeners
|
* @param listeners
|
||||||
* @param containerSWFOffset
|
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param version
|
* @param version
|
||||||
* @param ip
|
* @param ip
|
||||||
@@ -124,7 +122,7 @@ public class ActionListReader {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws java.lang.InterruptedException
|
* @throws java.lang.InterruptedException
|
||||||
*/
|
*/
|
||||||
public static List<Action> readActionList(List<DisassemblyListener> listeners, long containerSWFOffset, SWFInputStream sis, int version, int ip, int endIp, String path) throws IOException, InterruptedException {
|
public static List<Action> readActionList(List<DisassemblyListener> listeners, SWFInputStream sis, int version, int ip, int endIp, String path) throws IOException, InterruptedException {
|
||||||
boolean deobfuscate = Configuration.autoDeobfuscate.get();
|
boolean deobfuscate = Configuration.autoDeobfuscate.get();
|
||||||
|
|
||||||
ConstantPool cpool = new ConstantPool();
|
ConstantPool cpool = new ConstantPool();
|
||||||
@@ -132,7 +130,7 @@ public class ActionListReader {
|
|||||||
// List of the actions. N. item contains the action which starts in offset N.
|
// List of the actions. N. item contains the action which starts in offset N.
|
||||||
List<Action> actionMap = new ArrayList<>();
|
List<Action> actionMap = new ArrayList<>();
|
||||||
List<Long> nextOffsets = new ArrayList<>();
|
List<Long> nextOffsets = new ArrayList<>();
|
||||||
Action entryAction = readActionListAtPos(listeners, containerSWFOffset, cpool,
|
Action entryAction = readActionListAtPos(listeners, cpool,
|
||||||
sis, actionMap, nextOffsets,
|
sis, actionMap, nextOffsets,
|
||||||
ip, ip, endIp, version, path, false, new ArrayList<Long>());
|
ip, ip, endIp, version, path, false, new ArrayList<Long>());
|
||||||
|
|
||||||
@@ -193,7 +191,7 @@ public class ActionListReader {
|
|||||||
|
|
||||||
if (deobfuscate) {
|
if (deobfuscate) {
|
||||||
try {
|
try {
|
||||||
actions = deobfuscateActionList(listeners, containerSWFOffset, actions, version, ip, path);
|
actions = deobfuscateActionList(listeners, actions, version, ip, path);
|
||||||
updateActionLengths(actions, version);
|
updateActionLengths(actions, version);
|
||||||
removeZeroJumps(actions, version);
|
removeZeroJumps(actions, version);
|
||||||
} catch (OutOfMemoryError | StackOverflowError | TranslateException ex) {
|
} catch (OutOfMemoryError | StackOverflowError | TranslateException ex) {
|
||||||
@@ -210,7 +208,6 @@ public class ActionListReader {
|
|||||||
* ActionEndFlag(=0) or end of the stream.
|
* ActionEndFlag(=0) or end of the stream.
|
||||||
*
|
*
|
||||||
* @param listeners
|
* @param listeners
|
||||||
* @param containerSWFOffset
|
|
||||||
* @param actions
|
* @param actions
|
||||||
* @param version
|
* @param version
|
||||||
* @param ip
|
* @param ip
|
||||||
@@ -219,7 +216,7 @@ public class ActionListReader {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws java.lang.InterruptedException
|
* @throws java.lang.InterruptedException
|
||||||
*/
|
*/
|
||||||
public static List<Action> deobfuscateActionList(List<DisassemblyListener> listeners, long containerSWFOffset, List<Action> actions, int version, int ip, String path) throws IOException, InterruptedException {
|
public static List<Action> deobfuscateActionList(List<DisassemblyListener> listeners, List<Action> actions, int version, int ip, String path) throws IOException, InterruptedException {
|
||||||
if (actions.isEmpty()) {
|
if (actions.isEmpty()) {
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
@@ -260,7 +257,7 @@ public class ActionListReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deobfustaceActionListAtPosRecursive(listeners, new ArrayList<GraphTargetItem>(), new HashMap<Long, List<GraphSourceItemContainer>>(), containerSWFOffset, localData, stack, cpool, actionMap, ip, retdups, ip, endIp, path, new HashMap<Integer, Integer>(), false, new HashMap<Integer, HashMap<String, GraphTargetItem>>(), version, 0, maxRecursionLevel);
|
deobfustaceActionListAtPosRecursive(listeners, new ArrayList<GraphTargetItem>(), new HashMap<Long, List<GraphSourceItemContainer>>(), localData, stack, cpool, actionMap, ip, retdups, ip, endIp, path, new HashMap<Integer, Integer>(), false, new HashMap<Integer, HashMap<String, GraphTargetItem>>(), version, 0, maxRecursionLevel);
|
||||||
|
|
||||||
if (!retdups.isEmpty()) {
|
if (!retdups.isEmpty()) {
|
||||||
for (int i = 0; i < ip; i++) {
|
for (int i = 0; i < ip; i++) {
|
||||||
@@ -286,7 +283,7 @@ public class ActionListReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = Action.removeNops(0, ret, version, 0, path);
|
ret = Action.removeNops(0, ret, version, path);
|
||||||
List<Action> reta = new ArrayList<>();
|
List<Action> reta = new ArrayList<>();
|
||||||
for (Object o : ret) {
|
for (Object o : ret) {
|
||||||
if (o instanceof Action) {
|
if (o instanceof Action) {
|
||||||
@@ -591,7 +588,7 @@ public class ActionListReader {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Action readActionListAtPos(List<DisassemblyListener> listeners, long containerSWFOffset, ConstantPool cpool,
|
private static Action readActionListAtPos(List<DisassemblyListener> listeners, ConstantPool cpool,
|
||||||
SWFInputStream sis, List<Action> actions, List<Long> nextOffsets,
|
SWFInputStream sis, List<Action> actions, List<Long> nextOffsets,
|
||||||
long ip, long startIp, long endIp, int version, String path, boolean indeterminate, List<Long> visitedContainers) throws IOException {
|
long ip, long startIp, long endIp, int version, String path, boolean indeterminate, List<Long> visitedContainers) throws IOException {
|
||||||
|
|
||||||
@@ -646,7 +643,6 @@ public class ActionListReader {
|
|||||||
listeners.get(i).progress(AppStrings.translate("disassemblingProgress.reading"), pos, length);
|
listeners.get(i).progress(AppStrings.translate("disassemblingProgress.reading"), pos, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
a.containerSWFOffset = containerSWFOffset;
|
|
||||||
a.setAddress(ip, version, false);
|
a.setAddress(ip, version, false);
|
||||||
|
|
||||||
if (a instanceof ActionPush && cpool != null) {
|
if (a instanceof ActionPush && cpool != null) {
|
||||||
@@ -677,7 +673,7 @@ public class ActionListReader {
|
|||||||
if (size != 0) {
|
if (size != 0) {
|
||||||
long ip2 = ip + actionLengthWithHeader;
|
long ip2 = ip + actionLengthWithHeader;
|
||||||
//long endIp2 = ip + actionLengthWithHeader + size;
|
//long endIp2 = ip + actionLengthWithHeader + size;
|
||||||
readActionListAtPos(listeners, containerSWFOffset, cpool,
|
readActionListAtPos(listeners, cpool,
|
||||||
sis, actions, nextOffsets,
|
sis, actions, nextOffsets,
|
||||||
ip2, startIp, endIp, version, newPath, indeterminate, visitedContainers);
|
ip2, startIp, endIp, version, newPath, indeterminate, visitedContainers);
|
||||||
actionLengthWithHeader += size;
|
actionLengthWithHeader += size;
|
||||||
@@ -706,7 +702,7 @@ public class ActionListReader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void deobfustaceActionListAtPosRecursive(List<DisassemblyListener> listeners, List<GraphTargetItem> output, HashMap<Long, List<GraphSourceItemContainer>> containers, long containerSWFOffset, ActionLocalData localData, Stack<GraphTargetItem> stack, ConstantPool cpool, List<Action> actions, int ip, List<Action> ret, int startIp, int endip, String path, Map<Integer, Integer> visited, boolean indeterminate, Map<Integer, HashMap<String, GraphTargetItem>> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException {
|
private static void deobfustaceActionListAtPosRecursive(List<DisassemblyListener> listeners, List<GraphTargetItem> output, HashMap<Long, List<GraphSourceItemContainer>> containers, ActionLocalData localData, Stack<GraphTargetItem> stack, ConstantPool cpool, List<Action> actions, int ip, List<Action> ret, int startIp, int endip, String path, Map<Integer, Integer> visited, boolean indeterminate, Map<Integer, HashMap<String, GraphTargetItem>> decisionStates, int version, int recursionLevel, int maxRecursionLevel) throws IOException, InterruptedException {
|
||||||
boolean debugMode = false;
|
boolean debugMode = false;
|
||||||
boolean decideBranch = false;
|
boolean decideBranch = false;
|
||||||
|
|
||||||
@@ -879,7 +875,7 @@ public class ActionListReader {
|
|||||||
} else {
|
} else {
|
||||||
localData2 = localData;
|
localData2 = localData;
|
||||||
}
|
}
|
||||||
deobfustaceActionListAtPosRecursive(listeners, output2, containers, containerSWFOffset, localData2, new Stack<GraphTargetItem>(), cpool, actions, (int) endAddr, ret, startIp, (int) (endAddr + size), path + (cntName == null ? "" : "/" + cntName), visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel);
|
deobfustaceActionListAtPosRecursive(listeners, output2, containers, localData2, new Stack<GraphTargetItem>(), cpool, actions, (int) endAddr, ret, startIp, (int) (endAddr + size), path + (cntName == null ? "" : "/" + cntName), visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel);
|
||||||
output2s.add(output2);
|
output2s.add(output2);
|
||||||
endAddr += size;
|
endAddr += size;
|
||||||
}
|
}
|
||||||
@@ -939,7 +935,7 @@ public class ActionListReader {
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Stack<GraphTargetItem> substack = (Stack<GraphTargetItem>) stack.clone();
|
Stack<GraphTargetItem> substack = (Stack<GraphTargetItem>) stack.clone();
|
||||||
deobfustaceActionListAtPosRecursive(listeners, output, containers, containerSWFOffset, prepareLocalBranch(localData), substack, cpool, actions, ip + actionLen + aif.getJumpOffset(), ret, startIp, endip, path, visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel);
|
deobfustaceActionListAtPosRecursive(listeners, output, containers, prepareLocalBranch(localData), substack, cpool, actions, ip + actionLen + aif.getJumpOffset(), ret, startIp, endip, path, visited, indeterminate, decisionStates, version, recursionLevel + 1, maxRecursionLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newip > -1) {
|
if (newip > -1) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -42,7 +42,7 @@ public class DumpInfo {
|
|||||||
|
|
||||||
public List<DumpInfo> childInfos = new ArrayList<>();
|
public List<DumpInfo> childInfos = new ArrayList<>();
|
||||||
|
|
||||||
public DumpInfo(String name, String type, Object value, long startByte, int lengthBytes) {
|
public DumpInfo(String name, String type, Object value, long startByte, long lengthBytes) {
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2014 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.dumpview;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class DumpInfoSwfNode extends DumpInfo {
|
||||||
|
|
||||||
|
private final SWF swf;
|
||||||
|
|
||||||
|
public DumpInfoSwfNode(SWF swf, String name, String type, Object value, long startByte, long lengthBytes) {
|
||||||
|
super(name, type, value, startByte, lengthBytes);
|
||||||
|
this.swf = swf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SWF getSwf() {
|
||||||
|
return swf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DumpInfoSwfNode getSwfNode(DumpInfo dumpInfo) {
|
||||||
|
while (!(dumpInfo instanceof DumpInfoSwfNode)) {
|
||||||
|
dumpInfo = dumpInfo.parent;
|
||||||
|
}
|
||||||
|
return (DumpInfoSwfNode) dumpInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,6 @@ import javax.swing.table.AbstractTableModel;
|
|||||||
import javax.swing.table.DefaultTableCellRenderer;
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
import javax.swing.table.JTableHeader;
|
import javax.swing.table.JTableHeader;
|
||||||
import javax.swing.table.TableColumn;
|
import javax.swing.table.TableColumn;
|
||||||
import javax.swing.table.TableColumnModel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -41,6 +40,8 @@ public class HexView extends JTable {
|
|||||||
private byte[] data;
|
private byte[] data;
|
||||||
private final String[] highlightColorsStr = new String[]{/*"EEEEEE", */"29AEC2", "9AC88C", "DF5F80", "EEA32E", "FFD200", "5E9B4C", "D3E976", "A3AEC2"};
|
private final String[] highlightColorsStr = new String[]{/*"EEEEEE", */"29AEC2", "9AC88C", "DF5F80", "EEA32E", "FFD200", "5E9B4C", "D3E976", "A3AEC2"};
|
||||||
private final Color[] highlightColors;
|
private final Color[] highlightColors;
|
||||||
|
private Color bgColor = Color.decode("#F7F7F7");
|
||||||
|
private Color bgColorAlternate = Color.decode("#EDEDED");
|
||||||
|
|
||||||
public class HighlightCellRenderer extends DefaultTableCellRenderer {
|
public class HighlightCellRenderer extends DefaultTableCellRenderer {
|
||||||
|
|
||||||
@@ -48,9 +49,9 @@ public class HexView extends JTable {
|
|||||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
|
||||||
|
|
||||||
JLabel l = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
|
JLabel l = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
|
||||||
if (highlightStarts != null) {
|
int level = -1;
|
||||||
|
if (col > 0 && highlightStarts != null) {
|
||||||
int idx = row * bytesInRow + ((col > bytesInRow) ? (col - bytesInRow - 1) : (col - 1));
|
int idx = row * bytesInRow + ((col > bytesInRow) ? (col - bytesInRow - 1) : (col - 1));
|
||||||
int level = -1;
|
|
||||||
for (int i = 0; i < highlightStarts.length; i++) {
|
for (int i = 0; i < highlightStarts.length; i++) {
|
||||||
if (highlightStarts[i] <= idx && highlightEnds[i] >= idx) {
|
if (highlightStarts[i] <= idx && highlightEnds[i] >= idx) {
|
||||||
level++;
|
level++;
|
||||||
@@ -58,12 +59,14 @@ public class HexView extends JTable {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (level > -1) {
|
|
||||||
l.setBackground(highlightColors[level % highlightColors.length]);
|
|
||||||
} else {
|
|
||||||
l.setBackground(Color.white);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (level > -1) {
|
||||||
|
l.setBackground(highlightColors[level % highlightColors.length]);
|
||||||
|
} else {
|
||||||
|
l.setBackground(row % 2 == 0 ? bgColor : bgColorAlternate);
|
||||||
|
}
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,17 +134,20 @@ public class HexView extends JTable {
|
|||||||
|
|
||||||
setShowHorizontalLines(false);
|
setShowHorizontalLines(false);
|
||||||
setShowVerticalLines(false);
|
setShowVerticalLines(false);
|
||||||
|
setRowSelectionAllowed(false);
|
||||||
|
setColumnSelectionAllowed(false);
|
||||||
|
|
||||||
HighlightCellRenderer cellRenderer = new HighlightCellRenderer();
|
HighlightCellRenderer cellRenderer = new HighlightCellRenderer();
|
||||||
TableColumnModel columnModel = getColumnModel();
|
TableColumn column = columnModel.getColumn(0);
|
||||||
columnModel.getColumn(0).setMaxWidth(80);
|
column.setMaxWidth(80);
|
||||||
|
//column.setCellRenderer(cellRenderer);
|
||||||
for (int i = 0; i < bytesInRow; i++) {
|
for (int i = 0; i < bytesInRow; i++) {
|
||||||
TableColumn column = columnModel.getColumn(i + 1);
|
column = columnModel.getColumn(i + 1);
|
||||||
column.setMaxWidth(25);
|
column.setMaxWidth(25);
|
||||||
column.setCellRenderer(cellRenderer);
|
column.setCellRenderer(cellRenderer);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < bytesInRow; i++) {
|
for (int i = 0; i < bytesInRow; i++) {
|
||||||
TableColumn column = columnModel.getColumn(i + bytesInRow + 1);
|
column = columnModel.getColumn(i + bytesInRow + 1);
|
||||||
column.setMaxWidth(10);
|
column.setMaxWidth(10);
|
||||||
column.setCellRenderer(cellRenderer);
|
column.setCellRenderer(cellRenderer);
|
||||||
}
|
}
|
||||||
@@ -163,24 +169,18 @@ public class HexView extends JTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void scrollToByte(long byteNum) {
|
public void scrollToByte(long byteNum) {
|
||||||
// HACK to scroll current selection to visible
|
|
||||||
int row = (int) (byteNum / bytesInRow);
|
int row = (int) (byteNum / bytesInRow);
|
||||||
|
|
||||||
final int pageSize = (int) (getParent().getSize().getHeight() / getRowHeight());
|
//final int pageSize = (int) (getParent().getSize().getHeight() / getRowHeight());
|
||||||
|
|
||||||
int byteCount = data.length;
|
|
||||||
int rowCount = byteCount / bytesInRow;
|
|
||||||
if (byteCount % bytesInRow != 0) {
|
|
||||||
rowCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
int row2 = Math.min(row + pageSize - 2, rowCount - 1);
|
|
||||||
getSelectionModel().setSelectionInterval(row2, row2);
|
|
||||||
scrollRectToVisible(new Rectangle(getCellRect(row2, 0, true)));
|
|
||||||
|
|
||||||
getSelectionModel().setSelectionInterval(row, row);
|
getSelectionModel().setSelectionInterval(row, row);
|
||||||
scrollRectToVisible(new Rectangle(getCellRect(row, 0, true)));
|
scrollRectToVisible(new Rectangle(getCellRect(row, 0, true)));
|
||||||
// END HACK
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void scrollToByte(long[] byteNumStarts, long[] byteNumEnds) {
|
||||||
|
for (int i = 0; i < byteNumStarts.length; i++) {
|
||||||
|
scrollToByte(byteNumStarts[i]);
|
||||||
|
scrollToByte(byteNumEnds[i]);
|
||||||
|
scrollToByte(byteNumStarts[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,12 +357,14 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
|||||||
deobfuscationCommandButton.setEnabled(hasAbc);*/
|
deobfuscationCommandButton.setEnabled(hasAbc);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAs(SWF swf, SaveFileMode mode) {
|
private boolean saveAs(SWF swf, SaveFileMode mode) {
|
||||||
if (Main.saveFileDialog(swf, mode)) {
|
if (Main.saveFileDialog(swf, mode)) {
|
||||||
swf.fileTitle = null;
|
swf.fileTitle = null;
|
||||||
mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : ""));
|
mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : ""));
|
||||||
saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null);
|
saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -481,17 +483,19 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
|||||||
case ACTION_SAVE: {
|
case ACTION_SAVE: {
|
||||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||||
SWFNode snode = ((TagTreeModel) mainFrame.panel.tagTree.getModel()).getSwfNode(swf);
|
SWFNode snode = ((TagTreeModel) mainFrame.panel.tagTree.getModel()).getSwfNode(swf);
|
||||||
|
boolean saved = false;
|
||||||
if (snode.binaryData != null) {
|
if (snode.binaryData != null) {
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
swf.saveTo(baos);
|
swf.saveTo(baos);
|
||||||
snode.binaryData.binaryData = baos.toByteArray();
|
snode.binaryData.binaryData = baos.toByteArray();
|
||||||
snode.binaryData.setModified(true);
|
snode.binaryData.setModified(true);
|
||||||
|
saved = true;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
|
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
|
||||||
}
|
}
|
||||||
} else if (swf.file == null) {
|
} else if (swf.file == null) {
|
||||||
saveAs(swf, SaveFileMode.SAVEAS);
|
saved = saveAs(swf, SaveFileMode.SAVEAS);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Main.saveFile(swf, swf.file);
|
Main.saveFile(swf, swf.file);
|
||||||
@@ -500,13 +504,16 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener {
|
|||||||
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
|
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
swf.clearModified();
|
if (saved) {
|
||||||
|
swf.clearModified();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_SAVE_AS: {
|
case ACTION_SAVE_AS: {
|
||||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||||
saveAs(swf, SaveFileMode.SAVEAS);
|
if (saveAs(swf, SaveFileMode.SAVEAS)) {
|
||||||
swf.clearModified();
|
swf.clearModified();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_SAVE_AS_EXE: {
|
case ACTION_SAVE_AS_EXE: {
|
||||||
|
|||||||
@@ -538,12 +538,14 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
|
|||||||
deobfuscationCommandButton.setEnabled(hasAbc);
|
deobfuscationCommandButton.setEnabled(hasAbc);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAs(SWF swf, SaveFileMode mode) {
|
private boolean saveAs(SWF swf, SaveFileMode mode) {
|
||||||
if (Main.saveFileDialog(swf, mode)) {
|
if (Main.saveFileDialog(swf, mode)) {
|
||||||
swf.fileTitle = null;
|
swf.fileTitle = null;
|
||||||
mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : ""));
|
mainFrame.setTitle(ApplicationInfo.applicationVerName + (Configuration.displayFileName.get() ? " - " + swf.getFileTitle() : ""));
|
||||||
saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null);
|
saveCommandButton.setEnabled(mainFrame.panel.getCurrentSwf() != null);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -672,32 +674,38 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
|
|||||||
case ACTION_SAVE: {
|
case ACTION_SAVE: {
|
||||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||||
SWFNode snode = ((TagTreeModel) mainFrame.panel.tagTree.getModel()).getSwfNode(swf);
|
SWFNode snode = ((TagTreeModel) mainFrame.panel.tagTree.getModel()).getSwfNode(swf);
|
||||||
|
boolean saved = false;
|
||||||
if (snode.binaryData != null) {
|
if (snode.binaryData != null) {
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
try {
|
try {
|
||||||
swf.saveTo(baos);
|
swf.saveTo(baos);
|
||||||
snode.binaryData.binaryData = baos.toByteArray();
|
snode.binaryData.binaryData = baos.toByteArray();
|
||||||
snode.binaryData.setModified(true);
|
snode.binaryData.setModified(true);
|
||||||
|
saved = true;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
|
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, "Cannot save SWF", ex);
|
||||||
}
|
}
|
||||||
} else if (swf.file == null) {
|
} else if (swf.file == null) {
|
||||||
saveAs(swf, SaveFileMode.SAVEAS);
|
saved = saveAs(swf, SaveFileMode.SAVEAS);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
Main.saveFile(swf, swf.file);
|
Main.saveFile(swf, swf.file);
|
||||||
|
saved = true;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(MainFrameRibbonMenu.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
|
View.showMessageDialog(null, translate("error.file.save"), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
swf.clearModified();
|
if (saved) {
|
||||||
|
swf.clearModified();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_SAVE_AS: {
|
case ACTION_SAVE_AS: {
|
||||||
SWF swf = mainFrame.panel.getCurrentSwf();
|
SWF swf = mainFrame.panel.getCurrentSwf();
|
||||||
saveAs(swf, SaveFileMode.SAVEAS);
|
if (saveAs(swf, SaveFileMode.SAVEAS)) {
|
||||||
swf.clearModified();
|
swf.clearModified();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_SAVE_AS_EXE: {
|
case ACTION_SAVE_AS_EXE: {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.abc.types.traits.Trait;
|
|||||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
|
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
|
||||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||||
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||||
|
import com.jpexs.decompiler.flash.dumpview.DumpInfoSwfNode;
|
||||||
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
|
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
|
||||||
import com.jpexs.decompiler.flash.exporters.FontExporter;
|
import com.jpexs.decompiler.flash.exporters.FontExporter;
|
||||||
import com.jpexs.decompiler.flash.exporters.ImageExporter;
|
import com.jpexs.decompiler.flash.exporters.ImageExporter;
|
||||||
@@ -59,6 +60,9 @@ import com.jpexs.decompiler.flash.gui.abc.ClassesListTreeModel;
|
|||||||
import com.jpexs.decompiler.flash.gui.abc.DeobfuscationDialog;
|
import com.jpexs.decompiler.flash.gui.abc.DeobfuscationDialog;
|
||||||
import com.jpexs.decompiler.flash.gui.abc.treenodes.TreeElement;
|
import com.jpexs.decompiler.flash.gui.abc.treenodes.TreeElement;
|
||||||
import com.jpexs.decompiler.flash.gui.action.ActionPanel;
|
import com.jpexs.decompiler.flash.gui.action.ActionPanel;
|
||||||
|
import com.jpexs.decompiler.flash.gui.dumpview.DumpTree;
|
||||||
|
import com.jpexs.decompiler.flash.gui.dumpview.DumpTreeModel;
|
||||||
|
import com.jpexs.decompiler.flash.gui.dumpview.DumpViewPanel;
|
||||||
import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel;
|
import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel;
|
||||||
import com.jpexs.decompiler.flash.gui.timeline.TimelineFrame;
|
import com.jpexs.decompiler.flash.gui.timeline.TimelineFrame;
|
||||||
import com.jpexs.decompiler.flash.gui.treenodes.SWFBundleNode;
|
import com.jpexs.decompiler.flash.gui.treenodes.SWFBundleNode;
|
||||||
@@ -96,7 +100,6 @@ import com.jpexs.decompiler.flash.tags.Tag;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||||
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
|
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
|
||||||
import com.jpexs.decompiler.flash.tags.base.ButtonTag;
|
import com.jpexs.decompiler.flash.tags.base.ButtonTag;
|
||||||
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
|
||||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||||
import com.jpexs.decompiler.flash.tags.base.Container;
|
import com.jpexs.decompiler.flash.tags.base.Container;
|
||||||
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
|
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
|
||||||
@@ -182,17 +185,13 @@ import javax.swing.JColorChooser;
|
|||||||
import javax.swing.JFileChooser;
|
import javax.swing.JFileChooser;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JMenu;
|
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JPopupMenu;
|
|
||||||
import javax.swing.JProgressBar;
|
import javax.swing.JProgressBar;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JSplitPane;
|
import javax.swing.JSplitPane;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
import javax.swing.JTree;
|
|
||||||
import javax.swing.SwingConstants;
|
import javax.swing.SwingConstants;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
@@ -204,7 +203,6 @@ import javax.swing.filechooser.FileFilter;
|
|||||||
import javax.swing.plaf.basic.BasicTreeUI;
|
import javax.swing.plaf.basic.BasicTreeUI;
|
||||||
import javax.swing.tree.TreeModel;
|
import javax.swing.tree.TreeModel;
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
import javax.swing.tree.TreeSelectionModel;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -247,6 +245,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
private final PreviewPanel previewPanel;
|
private final PreviewPanel previewPanel;
|
||||||
private DumpViewPanel dumpViewPanel;
|
private DumpViewPanel dumpViewPanel;
|
||||||
private final JPanel treePanel;
|
private final JPanel treePanel;
|
||||||
|
private TreePanelMode treePanelMode;
|
||||||
private AbortRetryIgnoreHandler errorHandler = new GuiAbortRetryIgnoreHandler();
|
private AbortRetryIgnoreHandler errorHandler = new GuiAbortRetryIgnoreHandler();
|
||||||
private CancellableWorker setSourceWorker;
|
private CancellableWorker setSourceWorker;
|
||||||
public TreeNode oldNode;
|
public TreeNode oldNode;
|
||||||
@@ -255,12 +254,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
|
|
||||||
public static final String ACTION_SELECT_BKCOLOR = "SELECTCOLOR";
|
public static final String ACTION_SELECT_BKCOLOR = "SELECTCOLOR";
|
||||||
public static final String ACTION_REPLACE = "REPLACE";
|
public static final String ACTION_REPLACE = "REPLACE";
|
||||||
private static final String ACTION_RAW_EDIT = "RAWEDIT";
|
|
||||||
private static final String ACTION_JUMP_TO_CHARACTER = "JUMPTOCHARACTER";
|
|
||||||
private static final String ACTION_REMOVE_ITEM = "REMOVEITEM";
|
|
||||||
private static final String ACTION_REMOVE_ITEM_WITH_DEPENDENCIES = "REMOVEITEMWITHDEPENDENCIES";
|
|
||||||
private static final String ACTION_CLOSE_SWF = "CLOSESWF";
|
|
||||||
private static final String ACTION_EXPAND_RECURSIVE = "EXPANDRECURSIVE";
|
|
||||||
|
|
||||||
// play morph shape in 2 second(s)
|
// play morph shape in 2 second(s)
|
||||||
public static final int MORPH_SHAPE_ANIMATION_LENGTH = 2;
|
public static final int MORPH_SHAPE_ANIMATION_LENGTH = 2;
|
||||||
@@ -311,146 +304,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
statusPanel.setWorkStatus(s, worker);
|
statusPanel.setWorkStatus(s, worker);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createContextMenu() {
|
|
||||||
final JPopupMenu contextPopupMenu = new JPopupMenu();
|
|
||||||
|
|
||||||
final JMenuItem expandRecursiveMenuItem = new JMenuItem(translate("contextmenu.expandAll"));
|
|
||||||
expandRecursiveMenuItem.addActionListener(this);
|
|
||||||
expandRecursiveMenuItem.setActionCommand(ACTION_EXPAND_RECURSIVE);
|
|
||||||
contextPopupMenu.add(expandRecursiveMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem removeMenuItem = new JMenuItem(translate("contextmenu.remove"));
|
|
||||||
removeMenuItem.addActionListener(this);
|
|
||||||
removeMenuItem.setActionCommand(ACTION_REMOVE_ITEM);
|
|
||||||
contextPopupMenu.add(removeMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem removeWithDependenciesMenuItem = new JMenuItem(translate("contextmenu.removeWithDependencies"));
|
|
||||||
removeWithDependenciesMenuItem.addActionListener(this);
|
|
||||||
removeWithDependenciesMenuItem.setActionCommand(ACTION_REMOVE_ITEM_WITH_DEPENDENCIES);
|
|
||||||
contextPopupMenu.add(removeWithDependenciesMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem exportSelectionMenuItem = new JMenuItem(translate("menu.file.export.selection"));
|
|
||||||
exportSelectionMenuItem.setActionCommand(MainFrameRibbonMenu.ACTION_EXPORT_SEL);
|
|
||||||
exportSelectionMenuItem.addActionListener(this);
|
|
||||||
contextPopupMenu.add(exportSelectionMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem replaceSelectionMenuItem = new JMenuItem(translate("button.replace"));
|
|
||||||
replaceSelectionMenuItem.setActionCommand(ACTION_REPLACE);
|
|
||||||
replaceSelectionMenuItem.addActionListener(this);
|
|
||||||
contextPopupMenu.add(replaceSelectionMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem rawEditMenuItem = new JMenuItem(translate("contextmenu.rawEdit"));
|
|
||||||
rawEditMenuItem.setActionCommand(ACTION_RAW_EDIT);
|
|
||||||
rawEditMenuItem.addActionListener(this);
|
|
||||||
rawEditMenuItem.setVisible(false);
|
|
||||||
contextPopupMenu.add(rawEditMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem jumpToCharacterMenuItem = new JMenuItem(translate("contextmenu.jumpToCharacter"));
|
|
||||||
jumpToCharacterMenuItem.setActionCommand(ACTION_JUMP_TO_CHARACTER);
|
|
||||||
jumpToCharacterMenuItem.addActionListener(this);
|
|
||||||
jumpToCharacterMenuItem.setVisible(false);
|
|
||||||
contextPopupMenu.add(jumpToCharacterMenuItem);
|
|
||||||
|
|
||||||
final JMenuItem closeSelectionMenuItem = new JMenuItem(translate("contextmenu.closeSwf"));
|
|
||||||
closeSelectionMenuItem.setActionCommand(ACTION_CLOSE_SWF);
|
|
||||||
closeSelectionMenuItem.addActionListener(this);
|
|
||||||
contextPopupMenu.add(closeSelectionMenuItem);
|
|
||||||
|
|
||||||
final JMenu moveTagMenu = new JMenu(translate("contextmenu.moveTag"));
|
|
||||||
contextPopupMenu.add(moveTagMenu);
|
|
||||||
|
|
||||||
tagTree.addMouseListener(new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(MouseEvent e) {
|
|
||||||
if (SwingUtilities.isRightMouseButton(e)) {
|
|
||||||
|
|
||||||
int row = tagTree.getClosestRowForLocation(e.getX(), e.getY());
|
|
||||||
int[] selectionRows = tagTree.getSelectionRows();
|
|
||||||
if (!Helper.contains(selectionRows, row)) {
|
|
||||||
tagTree.setSelectionRow(row);
|
|
||||||
}
|
|
||||||
|
|
||||||
TreePath[] paths = tagTree.getSelectionPaths();
|
|
||||||
if (paths == null || paths.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boolean allSelectedIsTagOrFrame = true;
|
|
||||||
for (TreePath treePath : paths) {
|
|
||||||
TreeNode treeNode = (TreeNode) treePath.getLastPathComponent();
|
|
||||||
|
|
||||||
TreeItem tag = treeNode.getItem();
|
|
||||||
if (!(tag instanceof Tag) && !(tag instanceof FrameNodeItem)) {
|
|
||||||
allSelectedIsTagOrFrame = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
replaceSelectionMenuItem.setVisible(false);
|
|
||||||
closeSelectionMenuItem.setVisible(false);
|
|
||||||
moveTagMenu.setVisible(false);
|
|
||||||
expandRecursiveMenuItem.setVisible(false);
|
|
||||||
|
|
||||||
if (paths.length == 1) {
|
|
||||||
TreeNode treeNode = (TreeNode) paths[0].getLastPathComponent();
|
|
||||||
|
|
||||||
TreeItem item = ((TreeNode) treeNode).getItem();
|
|
||||||
|
|
||||||
if (item instanceof ImageTag && ((ImageTag) item).importSupported()) {
|
|
||||||
replaceSelectionMenuItem.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item instanceof DefineBinaryDataTag) {
|
|
||||||
replaceSelectionMenuItem.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item instanceof DefineSoundTag) {
|
|
||||||
replaceSelectionMenuItem.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (treeNode instanceof SWFNode) {
|
|
||||||
closeSelectionMenuItem.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item instanceof Tag && swfs.size() > 1) {
|
|
||||||
final Tag tag = (Tag) item;
|
|
||||||
moveTagMenu.removeAll();
|
|
||||||
for (SWFList targetSwfList : swfs) {
|
|
||||||
for (final SWF targetSwf : targetSwfList) {
|
|
||||||
if (targetSwf != tag.getSwf()) {
|
|
||||||
JMenuItem swfItem = new JMenuItem(targetSwf.getShortFileName());
|
|
||||||
swfItem.addActionListener(new ActionListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent ae) {
|
|
||||||
tag.getSwf().tags.remove(tag);
|
|
||||||
tag.setSwf(targetSwf);
|
|
||||||
targetSwf.tags.add(tag);
|
|
||||||
refreshTree();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
moveTagMenu.add(swfItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
moveTagMenu.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
TreeModel model = tagTree.getModel();
|
|
||||||
expandRecursiveMenuItem.setVisible(model.getChildCount(treeNode) > 0);
|
|
||||||
|
|
||||||
jumpToCharacterMenuItem.setVisible(item instanceof CharacterIdTag && !(item instanceof CharacterTag));
|
|
||||||
|
|
||||||
rawEditMenuItem.setVisible(item instanceof Tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
removeMenuItem.setVisible(allSelectedIsTagOrFrame);
|
|
||||||
exportSelectionMenuItem.setEnabled(hasExportableNodes());
|
|
||||||
contextPopupMenu.show(e.getComponent(), e.getX(), e.getY());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private JPanel createWelcomePanel() {
|
private JPanel createWelcomePanel() {
|
||||||
JPanel welcomePanel = new JPanel();
|
JPanel welcomePanel = new JPanel();
|
||||||
welcomePanel.setLayout(new BoxLayout(welcomePanel, BoxLayout.Y_AXIS));
|
welcomePanel.setLayout(new BoxLayout(welcomePanel, BoxLayout.Y_AXIS));
|
||||||
@@ -530,7 +383,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
cl2.show(detailPanel, DETAILCARDEMPTYPANEL);
|
cl2.show(detailPanel, DETAILCARDEMPTYPANEL);
|
||||||
|
|
||||||
UIManager.getDefaults().put("TreeUI", BasicTreeUI.class.getName());
|
UIManager.getDefaults().put("TreeUI", BasicTreeUI.class.getName());
|
||||||
tagTree = new TagTree((TagTreeModel) null);
|
tagTree = new TagTree((TagTreeModel) null, this);
|
||||||
tagTree.addTreeSelectionListener(this);
|
tagTree.addTreeSelectionListener(this);
|
||||||
|
|
||||||
DragSource dragSource = DragSource.getDefaultDragSource();
|
DragSource dragSource = DragSource.getDefaultDragSource();
|
||||||
@@ -612,10 +465,11 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
createContextMenu();
|
tagTree.createContextMenu(swfs);
|
||||||
|
|
||||||
dumpTree = new DumpTree((DumpTreeModel) null);
|
dumpTree = new DumpTree((DumpTreeModel) null, this);
|
||||||
dumpTree.addTreeSelectionListener(this);
|
dumpTree.addTreeSelectionListener(this);
|
||||||
|
dumpTree.createContextMenu();
|
||||||
|
|
||||||
statusPanel = new MainFrameStatusPanel(this);
|
statusPanel = new MainFrameStatusPanel(this);
|
||||||
add(statusPanel, BorderLayout.SOUTH);
|
add(statusPanel, BorderLayout.SOUTH);
|
||||||
@@ -1034,19 +888,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TagNode> getSelectedNodes() {
|
|
||||||
List<TagNode> ret = new ArrayList<>();
|
|
||||||
TreePath[] tps = tagTree.getSelectionPaths();
|
|
||||||
if (tps == null) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
for (TreePath tp : tps) {
|
|
||||||
TagNode te = (TagNode) tp.getLastPathComponent();
|
|
||||||
ret.add(te);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renameIdentifier(SWF swf, String identifier) throws InterruptedException {
|
public void renameIdentifier(SWF swf, String identifier) throws InterruptedException {
|
||||||
String oldName = identifier;
|
String oldName = identifier;
|
||||||
String newName = View.showInputDialog(translate("rename.enternew"), oldName);
|
String newName = View.showInputDialog(translate("rename.enternew"), oldName);
|
||||||
@@ -1094,48 +935,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TreeNode> getSelected(JTree tree) {
|
|
||||||
TreeSelectionModel tsm = tree.getSelectionModel();
|
|
||||||
TreePath[] tps = tsm.getSelectionPaths();
|
|
||||||
List<TreeNode> ret = new ArrayList<>();
|
|
||||||
if (tps == null) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (TreePath tp : tps) {
|
|
||||||
TreeNode treeNode = (TreeNode) tp.getLastPathComponent();
|
|
||||||
ret.add(treeNode);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TreeNode> getAllSubs(JTree tree, TreeNode o) {
|
|
||||||
TagTreeModel tm = (TagTreeModel) tree.getModel();
|
|
||||||
List<TreeNode> ret = new ArrayList<>();
|
|
||||||
for (int i = 0; i < tm.getChildCount(o); i++) {
|
|
||||||
TreeNode c = tm.getChild(o, i);
|
|
||||||
ret.add(c);
|
|
||||||
ret.addAll(getAllSubs(tree, c));
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TreeNode> getAllSelected(TagTree tree) {
|
|
||||||
TreeSelectionModel tsm = tree.getSelectionModel();
|
|
||||||
TreePath[] tps = tsm.getSelectionPaths();
|
|
||||||
List<TreeNode> ret = new ArrayList<>();
|
|
||||||
if (tps == null) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (TreePath tp : tps) {
|
|
||||||
TreeNode treeNode = (TreeNode) tp.getLastPathComponent();
|
|
||||||
ret.add(treeNode);
|
|
||||||
ret.addAll(getAllSubs(tree, treeNode));
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TreeNode> getASTreeNodes(TagTree tree) {
|
public List<TreeNode> getASTreeNodes(TagTree tree) {
|
||||||
List<TreeNode> result = new ArrayList<>();
|
List<TreeNode> result = new ArrayList<>();
|
||||||
TagTreeModel tm = (TagTreeModel) tree.getModel();
|
TagTreeModel tm = (TagTreeModel) tree.getModel();
|
||||||
@@ -1165,68 +964,10 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
}
|
}
|
||||||
private SearchDialog searchDialog;
|
private SearchDialog searchDialog;
|
||||||
|
|
||||||
public boolean hasExportableNodes() {
|
|
||||||
return !getSelection(getCurrentSwf()).isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<Object> getSelection(SWF swf) {
|
|
||||||
List<Object> ret = new ArrayList<>();
|
|
||||||
List<TreeNode> sel = getAllSelected(tagTree);
|
|
||||||
for (TreeNode d : sel) {
|
|
||||||
if (d.getItem().getSwf() != swf) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (d instanceof ContainerNode) {
|
|
||||||
ContainerNode n = (ContainerNode) d;
|
|
||||||
TreeNodeType nodeType = TagTree.getTreeNodeType(n.getItem());
|
|
||||||
if (nodeType == TreeNodeType.IMAGE) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.SHAPE) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.MORPH_SHAPE) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.AS) {
|
|
||||||
ret.add(n);
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.MOVIE) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.SOUND) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.BINARY_DATA) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.TEXT) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
if (nodeType == TreeNodeType.FONT) {
|
|
||||||
ret.add((Tag) n.getItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (d instanceof FrameNode) {
|
|
||||||
FrameNode fn = (FrameNode) d;
|
|
||||||
if (!fn.scriptsNode) {
|
|
||||||
ret.add(d.getItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (d instanceof TreeElement) {
|
|
||||||
if (((TreeElement) d).isLeaf()) {
|
|
||||||
TreeElement treeElement = (TreeElement) d;
|
|
||||||
ret.add((ScriptPack) treeElement.getItem());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<File> exportSelection(AbortRetryIgnoreHandler handler, String selFile, ExportDialog export) throws IOException {
|
public List<File> exportSelection(AbortRetryIgnoreHandler handler, String selFile, ExportDialog export) throws IOException {
|
||||||
|
|
||||||
List<File> ret = new ArrayList<>();
|
List<File> ret = new ArrayList<>();
|
||||||
List<TreeNode> sel = getAllSelected(tagTree);
|
List<TreeNode> sel = tagTree.getAllSelected(tagTree);
|
||||||
|
|
||||||
for (SWFList swfList : swfs) {
|
for (SWFList swfList : swfs) {
|
||||||
for (SWF swf : swfList) {
|
for (SWF swf : swfList) {
|
||||||
@@ -1371,16 +1112,24 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeNode treeNode = (TreeNode) tagTree.getLastSelectedPathComponent();
|
if (treePanelMode == TreePanelMode.TAG_TREE) {
|
||||||
if (treeNode == null) {
|
TreeNode treeNode = (TreeNode) tagTree.getLastSelectedPathComponent();
|
||||||
return swfs.get(0).get(0);
|
if (treeNode == null) {
|
||||||
}
|
return swfs.get(0).get(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (treeNode instanceof SWFBundleNode) {
|
if (treeNode instanceof SWFBundleNode) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return treeNode.getItem().getSwf();
|
return treeNode.getItem().getSwf();
|
||||||
|
} else if (treePanelMode == TreePanelMode.DUMP_TREE) {
|
||||||
|
DumpInfo dumpInfo = (DumpInfo) dumpTree.getLastSelectedPathComponent();
|
||||||
|
|
||||||
|
return DumpInfoSwfNode.getSwfNode(dumpInfo).getSwf();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearCache() {
|
private void clearCache() {
|
||||||
@@ -1849,7 +1598,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
public void export(final boolean onlySel) {
|
public void export(final boolean onlySel) {
|
||||||
|
|
||||||
final SWF swf = getCurrentSwf();
|
final SWF swf = getCurrentSwf();
|
||||||
List<Object> sel = getSelection(swf);
|
List<Object> sel = tagTree.getSelection(swf);
|
||||||
if (!onlySel) {
|
if (!onlySel) {
|
||||||
sel = null;
|
sel = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -2085,6 +1834,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
showCard(CARDEMPTYPANEL);
|
showCard(CARDEMPTYPANEL);
|
||||||
TreeItem treeItem = tagTree.getCurrentTreeItem();
|
TreeItem treeItem = tagTree.getCurrentTreeItem();
|
||||||
View.refreshTree(tagTree, new TagTreeModel(mainFrame, swfs));
|
View.refreshTree(tagTree, new TagTreeModel(mainFrame, swfs));
|
||||||
|
View.refreshTree(dumpTree, new DumpTreeModel(swfs));
|
||||||
if (treeItem != null) {
|
if (treeItem != null) {
|
||||||
setTreeItem(treeItem);
|
setTreeItem(treeItem);
|
||||||
}
|
}
|
||||||
@@ -2238,7 +1988,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
try {
|
try {
|
||||||
SWF swf = it.getSwf();
|
SWF swf = it.getSwf();
|
||||||
if (it instanceof DefineBitsTag) {
|
if (it instanceof DefineBitsTag) {
|
||||||
DefineBitsJPEG2Tag jpeg2Tag = new DefineBitsJPEG2Tag(swf, it.getPos(), it.getOriginalLength(), it.getCharacterId(), data);
|
DefineBitsJPEG2Tag jpeg2Tag = new DefineBitsJPEG2Tag(swf, it.getOriginalRange(), it.getCharacterId(), data);
|
||||||
jpeg2Tag.setModified(true);
|
jpeg2Tag.setModified(true);
|
||||||
swf.tags.set(swf.tags.indexOf(it), jpeg2Tag);
|
swf.tags.set(swf.tags.indexOf(it), jpeg2Tag);
|
||||||
swf.updateCharacters();
|
swf.updateCharacters();
|
||||||
@@ -2274,74 +2024,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_RAW_EDIT: {
|
|
||||||
TreeItem item = tagTree.getCurrentTreeItem();
|
|
||||||
if (item == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
showCard(CARDPREVIEWPANEL);
|
|
||||||
previewPanel.showGenericTagPanel((Tag) item);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ACTION_JUMP_TO_CHARACTER: {
|
|
||||||
TreeItem item = tagTree.getCurrentTreeItem();
|
|
||||||
if (item == null || !(item instanceof CharacterIdTag)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CharacterIdTag characterIdTag = (CharacterIdTag) item;
|
|
||||||
setTreeItem(item.getSwf().characters.get(characterIdTag.getCharacterId()));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ACTION_EXPAND_RECURSIVE: {
|
|
||||||
TreePath path = tagTree.getSelectionPath();
|
|
||||||
if (path == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
View.expandTreeNodesRecursive(tagTree, path, true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ACTION_REMOVE_ITEM:
|
|
||||||
case ACTION_REMOVE_ITEM_WITH_DEPENDENCIES:
|
|
||||||
List<TreeNode> sel = getSelected(tagTree);
|
|
||||||
|
|
||||||
List<Tag> tagsToRemove = new ArrayList<>();
|
|
||||||
for (TreeNode o : sel) {
|
|
||||||
TreeItem tag = o.getItem();
|
|
||||||
if (tag instanceof Tag) {
|
|
||||||
tagsToRemove.add((Tag) tag);
|
|
||||||
} else if (tag instanceof FrameNodeItem) {
|
|
||||||
FrameNodeItem frameNode = (FrameNodeItem) tag;
|
|
||||||
Frame frame = frameNode.getParent().getTimeline().frames.get(frameNode.getFrame() - 1);
|
|
||||||
if (frame.showFrameTag != null) {
|
|
||||||
tagsToRemove.add(frame.showFrameTag);
|
|
||||||
} else {
|
|
||||||
// this should be the last frame, so remove the inner tags
|
|
||||||
tagsToRemove.addAll(frame.innerTags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean removeDependencies = e.getActionCommand().equals(ACTION_REMOVE_ITEM_WITH_DEPENDENCIES);
|
|
||||||
if (tagsToRemove.size() == 1) {
|
|
||||||
Tag tag = tagsToRemove.get(0);
|
|
||||||
if (View.showConfirmDialog(this, translate("message.confirm.remove").replace("%item%", tag.toString()), translate("message.confirm"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
|
|
||||||
tag.getSwf().removeTag(tag, removeDependencies);
|
|
||||||
refreshTree();
|
|
||||||
}
|
|
||||||
} else if (tagsToRemove.size() > 1) {
|
|
||||||
if (View.showConfirmDialog(this, translate("message.confirm.removemultiple").replace("%count%", Integer.toString(tagsToRemove.size())), translate("message.confirm"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
|
|
||||||
for (Tag tag : tagsToRemove) {
|
|
||||||
tag.getSwf().removeTag(tag, removeDependencies);
|
|
||||||
}
|
|
||||||
refreshTree();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ACTION_CLOSE_SWF: {
|
|
||||||
Main.closeFile(getCurrentSwfList());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (Main.isWorking()) {
|
if (Main.isWorking()) {
|
||||||
return;
|
return;
|
||||||
@@ -2382,8 +2064,8 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
private void dumpTreeValueChanged(TreeSelectionEvent e) {
|
private void dumpTreeValueChanged(TreeSelectionEvent e) {
|
||||||
DumpInfo dumpInfo = (DumpInfo) e.getPath().getLastPathComponent();
|
DumpInfo dumpInfo = (DumpInfo) e.getPath().getLastPathComponent();
|
||||||
|
|
||||||
// todo honfika: support multiple swf
|
|
||||||
dumpViewPanel.setData(swfs.get(0).swfs.get(0).uncompressedData, dumpInfo);
|
dumpViewPanel.setData(DumpInfoSwfNode.getSwfNode(dumpInfo).getSwf().uncompressedData, dumpInfo);
|
||||||
dumpViewPanel.revalidate();
|
dumpViewPanel.revalidate();
|
||||||
showCard(CARDDUMPVIEW);
|
showCard(CARDDUMPVIEW);
|
||||||
}
|
}
|
||||||
@@ -2438,8 +2120,10 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
treePanel.removeAll();
|
treePanel.removeAll();
|
||||||
if (show) {
|
if (show) {
|
||||||
treePanel.add(new JScrollPane(dumpTree), BorderLayout.CENTER);
|
treePanel.add(new JScrollPane(dumpTree), BorderLayout.CENTER);
|
||||||
|
treePanelMode = TreePanelMode.DUMP_TREE;
|
||||||
} else {
|
} else {
|
||||||
treePanel.add(new JScrollPane(tagTree), BorderLayout.CENTER);
|
treePanel.add(new JScrollPane(tagTree), BorderLayout.CENTER);
|
||||||
|
treePanelMode = TreePanelMode.TAG_TREE;
|
||||||
}
|
}
|
||||||
treePanel.revalidate();
|
treePanel.revalidate();
|
||||||
}
|
}
|
||||||
@@ -2619,13 +2303,18 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
|||||||
previewPanel.setParametersPanelVisible(false);
|
previewPanel.setParametersPanelVisible(false);
|
||||||
}
|
}
|
||||||
} else if (tagObj instanceof Tag) {
|
} else if (tagObj instanceof Tag) {
|
||||||
showCard(CARDPREVIEWPANEL);
|
showGenericTag((Tag) tagObj);
|
||||||
previewPanel.showGenericTagPanel((Tag) tagObj);
|
|
||||||
} else {
|
} else {
|
||||||
showCard(CARDEMPTYPANEL);
|
showCard(CARDEMPTYPANEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showGenericTag(Tag tag) {
|
||||||
|
|
||||||
|
showCard(CARDPREVIEWPANEL);
|
||||||
|
previewPanel.showGenericTagPanel(tag);
|
||||||
|
}
|
||||||
|
|
||||||
private void showFontTag(FontTag ft) {
|
private void showFontTag(FontTag ft) {
|
||||||
|
|
||||||
previewPanel.showFontPanel(ft);
|
previewPanel.showFontPanel(ft);
|
||||||
|
|||||||
@@ -683,8 +683,8 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
|||||||
List<Action> actions;
|
List<Action> actions;
|
||||||
DoActionTag doa;
|
DoActionTag doa;
|
||||||
|
|
||||||
doa = new DoActionTag(swf, 0, 0);
|
doa = new DoActionTag(swf, null);
|
||||||
actions = ASMParser.parse(0, 0, false,
|
actions = ASMParser.parse(0, false,
|
||||||
"ConstantPool \"_root\" \"my_sound\" \"Sound\" \"my_define_sound\" \"attachSound\"\n"
|
"ConstantPool \"_root\" \"my_sound\" \"Sound\" \"my_define_sound\" \"attachSound\"\n"
|
||||||
+ "Push \"_root\"\n"
|
+ "Push \"_root\"\n"
|
||||||
+ "GetVariable\n"
|
+ "GetVariable\n"
|
||||||
@@ -703,7 +703,7 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
|||||||
doa.writeTag(sos2);
|
doa.writeTag(sos2);
|
||||||
new ShowFrameTag(swf).writeTag(sos2);
|
new ShowFrameTag(swf).writeTag(sos2);
|
||||||
|
|
||||||
actions = ASMParser.parse(0, 0, false,
|
actions = ASMParser.parse(0, false,
|
||||||
"ConstantPool \"_root\" \"my_sound\" \"Sound\" \"my_define_sound\" \"attachSound\" \"start\"\n"
|
"ConstantPool \"_root\" \"my_sound\" \"Sound\" \"my_define_sound\" \"attachSound\" \"start\"\n"
|
||||||
+ "StopSounds\n"
|
+ "StopSounds\n"
|
||||||
+ "Push \"_root\"\n"
|
+ "Push \"_root\"\n"
|
||||||
@@ -730,7 +730,7 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
|||||||
doa.writeTag(sos2);
|
doa.writeTag(sos2);
|
||||||
new ShowFrameTag(swf).writeTag(sos2);
|
new ShowFrameTag(swf).writeTag(sos2);
|
||||||
|
|
||||||
actions = ASMParser.parse(0, 0, false,
|
actions = ASMParser.parse(0, false,
|
||||||
"ConstantPool \"_root\" \"my_sound\" \"Sound\" \"my_define_sound\" \"attachSound\" \"onSoundComplete\" \"start\" \"execParam\"\n"
|
"ConstantPool \"_root\" \"my_sound\" \"Sound\" \"my_define_sound\" \"attachSound\" \"onSoundComplete\" \"start\" \"execParam\"\n"
|
||||||
+ "StopSounds\n"
|
+ "StopSounds\n"
|
||||||
+ "Push \"_root\"\n"
|
+ "Push \"_root\"\n"
|
||||||
@@ -774,7 +774,7 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
|||||||
doa.writeTag(sos2);
|
doa.writeTag(sos2);
|
||||||
new ShowFrameTag(swf).writeTag(sos2);
|
new ShowFrameTag(swf).writeTag(sos2);
|
||||||
|
|
||||||
actions = ASMParser.parse(0, 0, false,
|
actions = ASMParser.parse(0, false,
|
||||||
"StopSounds\n"
|
"StopSounds\n"
|
||||||
+ "Stop", swf.version, false);
|
+ "Stop", swf.version, false);
|
||||||
doa.setActions(actions);
|
doa.setActions(actions);
|
||||||
|
|||||||
@@ -1,304 +1,614 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2010-2014 JPEXS
|
* Copyright (C) 2010-2014 JPEXS
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package com.jpexs.decompiler.flash.gui;
|
package com.jpexs.decompiler.flash.gui;
|
||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
import com.jpexs.decompiler.flash.abc.ScriptPack;
|
import com.jpexs.decompiler.flash.abc.ScriptPack;
|
||||||
import com.jpexs.decompiler.flash.gui.treenodes.TagTreeRoot;
|
import com.jpexs.decompiler.flash.gui.abc.treenodes.TreeElement;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
|
import com.jpexs.decompiler.flash.gui.treenodes.SWFNode;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag;
|
import com.jpexs.decompiler.flash.gui.treenodes.TagTreeRoot;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag;
|
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG4Tag;
|
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBitsLossless2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG3Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBitsLosslessTag;
|
import com.jpexs.decompiler.flash.tags.DefineBitsJPEG4Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineBitsTag;
|
import com.jpexs.decompiler.flash.tags.DefineBitsLossless2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineButton2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineBitsLosslessTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineButtonTag;
|
import com.jpexs.decompiler.flash.tags.DefineBitsTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineEditTextTag;
|
import com.jpexs.decompiler.flash.tags.DefineButton2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineFont2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineButtonTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineFont3Tag;
|
import com.jpexs.decompiler.flash.tags.DefineEditTextTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineFont4Tag;
|
import com.jpexs.decompiler.flash.tags.DefineFont2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineFontTag;
|
import com.jpexs.decompiler.flash.tags.DefineFont3Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineMorphShape2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineFont4Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineMorphShapeTag;
|
import com.jpexs.decompiler.flash.tags.DefineFontTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineShape2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineMorphShape2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineShape3Tag;
|
import com.jpexs.decompiler.flash.tags.DefineMorphShapeTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineShape4Tag;
|
import com.jpexs.decompiler.flash.tags.DefineShape2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineShapeTag;
|
import com.jpexs.decompiler.flash.tags.DefineShape3Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineSoundTag;
|
import com.jpexs.decompiler.flash.tags.DefineShape4Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
|
import com.jpexs.decompiler.flash.tags.DefineShapeTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineText2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineSoundTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineTextTag;
|
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
|
||||||
import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag;
|
import com.jpexs.decompiler.flash.tags.DefineText2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
|
import com.jpexs.decompiler.flash.tags.DefineTextTag;
|
||||||
import com.jpexs.decompiler.flash.tags.SoundStreamHead2Tag;
|
import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag;
|
||||||
import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag;
|
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
|
||||||
import com.jpexs.decompiler.flash.tags.Tag;
|
import com.jpexs.decompiler.flash.tags.SoundStreamHead2Tag;
|
||||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag;
|
||||||
import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont;
|
import com.jpexs.decompiler.flash.tags.Tag;
|
||||||
import com.jpexs.decompiler.flash.treeitems.AS2PackageNodeItem;
|
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||||
import com.jpexs.decompiler.flash.treeitems.AS3PackageNodeItem;
|
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
||||||
import com.jpexs.decompiler.flash.treeitems.FrameNodeItem;
|
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||||
import com.jpexs.decompiler.flash.treeitems.SWFList;
|
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||||
import com.jpexs.decompiler.flash.treeitems.StringItem;
|
import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont;
|
||||||
import com.jpexs.decompiler.flash.treeitems.TreeElementItem;
|
import com.jpexs.decompiler.flash.timeline.Frame;
|
||||||
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
import com.jpexs.decompiler.flash.treeitems.AS2PackageNodeItem;
|
||||||
import com.jpexs.decompiler.flash.treenodes.TreeNode;
|
import com.jpexs.decompiler.flash.treeitems.AS3PackageNodeItem;
|
||||||
import java.awt.Color;
|
import com.jpexs.decompiler.flash.treeitems.FrameNodeItem;
|
||||||
import java.awt.Component;
|
import com.jpexs.decompiler.flash.treeitems.SWFList;
|
||||||
import java.awt.Font;
|
import com.jpexs.decompiler.flash.treeitems.StringItem;
|
||||||
import java.awt.Graphics;
|
import com.jpexs.decompiler.flash.treeitems.TreeElementItem;
|
||||||
import java.util.ArrayList;
|
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
||||||
import java.util.List;
|
import com.jpexs.decompiler.flash.treenodes.ContainerNode;
|
||||||
import javax.swing.JComponent;
|
import com.jpexs.decompiler.flash.treenodes.FrameNode;
|
||||||
import javax.swing.JTree;
|
import com.jpexs.decompiler.flash.treenodes.TreeNode;
|
||||||
import javax.swing.plaf.basic.BasicLabelUI;
|
import com.jpexs.helpers.Helper;
|
||||||
import javax.swing.plaf.basic.BasicTreeUI;
|
import java.awt.Color;
|
||||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
import java.awt.Component;
|
||||||
|
import java.awt.Font;
|
||||||
/**
|
import java.awt.Graphics;
|
||||||
*
|
import java.awt.event.ActionEvent;
|
||||||
* @author JPEXS
|
import java.awt.event.ActionListener;
|
||||||
*/
|
import java.awt.event.MouseAdapter;
|
||||||
public class TagTree extends JTree {
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.util.ArrayList;
|
||||||
public class TagTreeCellRenderer extends DefaultTreeCellRenderer {
|
import java.util.List;
|
||||||
|
import javax.swing.JComponent;
|
||||||
@Override
|
import javax.swing.JMenu;
|
||||||
public Component getTreeCellRendererComponent(
|
import javax.swing.JMenuItem;
|
||||||
JTree tree,
|
import javax.swing.JOptionPane;
|
||||||
Object value,
|
import javax.swing.JPopupMenu;
|
||||||
boolean sel,
|
import javax.swing.JTree;
|
||||||
boolean expanded,
|
import javax.swing.SwingUtilities;
|
||||||
boolean leaf,
|
import javax.swing.plaf.basic.BasicLabelUI;
|
||||||
int row,
|
import javax.swing.plaf.basic.BasicTreeUI;
|
||||||
boolean hasFocus) {
|
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||||
|
import javax.swing.tree.TreeModel;
|
||||||
super.getTreeCellRendererComponent(
|
import javax.swing.tree.TreePath;
|
||||||
tree, value, sel,
|
import javax.swing.tree.TreeSelectionModel;
|
||||||
expanded, leaf, row,
|
|
||||||
hasFocus);
|
/**
|
||||||
TreeNode treeNode = (TreeNode) value;
|
*
|
||||||
TreeItem val = treeNode.getItem();
|
* @author JPEXS
|
||||||
TreeNodeType type = getTreeNodeType(val);
|
*/
|
||||||
if (type != null) {
|
public class TagTree extends JTree implements ActionListener {
|
||||||
if (type == TreeNodeType.FOLDER && expanded) {
|
|
||||||
type = TreeNodeType.FOLDER_OPEN;
|
private static final String ACTION_RAW_EDIT = "RAWEDIT";
|
||||||
}
|
private static final String ACTION_JUMP_TO_CHARACTER = "JUMPTOCHARACTER";
|
||||||
String itemName = type.toString();
|
private static final String ACTION_REMOVE_ITEM = "REMOVEITEM";
|
||||||
if (type == TreeNodeType.FOLDER || type == TreeNodeType.FOLDER_OPEN) {
|
private static final String ACTION_REMOVE_ITEM_WITH_DEPENDENCIES = "REMOVEITEMWITHDEPENDENCIES";
|
||||||
if (val instanceof StringItem) {
|
private static final String ACTION_CLOSE_SWF = "CLOSESWF";
|
||||||
StringItem si = (StringItem) val;
|
private static final String ACTION_EXPAND_RECURSIVE = "EXPANDRECURSIVE";
|
||||||
if (!TagTreeRoot.FOLDER_ROOT.equals(si.getName())) {
|
|
||||||
itemName = "folder" + si.getName();
|
private final MainPanel mainPanel;
|
||||||
}
|
|
||||||
}
|
public class TagTreeCellRenderer extends DefaultTreeCellRenderer {
|
||||||
}
|
|
||||||
String tagTypeStr = itemName.toLowerCase().replace("_", "");
|
@Override
|
||||||
setIcon(View.getIcon(tagTypeStr + "16"));
|
public Component getTreeCellRendererComponent(
|
||||||
}
|
JTree tree,
|
||||||
|
Object value,
|
||||||
Font font = getFont();
|
boolean sel,
|
||||||
boolean isModified = false;
|
boolean expanded,
|
||||||
if (treeNode instanceof TreeNode) {
|
boolean leaf,
|
||||||
if (treeNode.getItem() instanceof Tag) {
|
int row,
|
||||||
Tag tag = (Tag) treeNode.getItem();
|
boolean hasFocus) {
|
||||||
if (tag.isModified()) {
|
|
||||||
isModified = true;
|
super.getTreeCellRendererComponent(
|
||||||
}
|
tree, value, sel,
|
||||||
}
|
expanded, leaf, row,
|
||||||
}
|
hasFocus);
|
||||||
|
TreeNode treeNode = (TreeNode) value;
|
||||||
if (isModified) {
|
TreeItem val = treeNode.getItem();
|
||||||
font = font.deriveFont(Font.BOLD);
|
TreeNodeType type = getTreeNodeType(val);
|
||||||
} else {
|
if (type != null) {
|
||||||
font = font.deriveFont(Font.PLAIN);
|
if (type == TreeNodeType.FOLDER && expanded) {
|
||||||
}
|
type = TreeNodeType.FOLDER_OPEN;
|
||||||
setFont(font);
|
}
|
||||||
|
String itemName = type.toString();
|
||||||
setUI(new BasicLabelUI());
|
if (type == TreeNodeType.FOLDER || type == TreeNodeType.FOLDER_OPEN) {
|
||||||
setOpaque(false);
|
if (val instanceof StringItem) {
|
||||||
//setBackground(Color.green);
|
StringItem si = (StringItem) val;
|
||||||
setBackgroundNonSelectionColor(Color.white);
|
if (!TagTreeRoot.FOLDER_ROOT.equals(si.getName())) {
|
||||||
//setBackgroundSelectionColor(Color.ORANGE);
|
itemName = "folder" + si.getName();
|
||||||
|
}
|
||||||
return this;
|
}
|
||||||
}
|
}
|
||||||
}
|
String tagTypeStr = itemName.toLowerCase().replace("_", "");
|
||||||
|
setIcon(View.getIcon(tagTypeStr + "16"));
|
||||||
TagTree(TagTreeModel treeModel) {
|
}
|
||||||
super(treeModel);
|
|
||||||
setCellRenderer(new TagTreeCellRenderer());
|
Font font = getFont();
|
||||||
setRootVisible(false);
|
boolean isModified = false;
|
||||||
setBackground(Color.white);
|
if (treeNode instanceof TreeNode) {
|
||||||
setUI(new BasicTreeUI() {
|
if (treeNode.getItem() instanceof Tag) {
|
||||||
@Override
|
Tag tag = (Tag) treeNode.getItem();
|
||||||
public void paint(Graphics g, JComponent c) {
|
if (tag.isModified()) {
|
||||||
setHashColor(Color.gray);
|
isModified = true;
|
||||||
super.paint(g, c);
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
if (isModified) {
|
||||||
public static TreeNodeType getTreeNodeType(TreeItem t) {
|
font = font.deriveFont(Font.BOLD);
|
||||||
if ((t instanceof DefineFontTag)
|
} else {
|
||||||
|| (t instanceof DefineFont2Tag)
|
font = font.deriveFont(Font.PLAIN);
|
||||||
|| (t instanceof DefineFont3Tag)
|
}
|
||||||
|| (t instanceof DefineFont4Tag)
|
setFont(font);
|
||||||
|| (t instanceof DefineCompactedFont)) {
|
|
||||||
return TreeNodeType.FONT;
|
setUI(new BasicLabelUI());
|
||||||
}
|
setOpaque(false);
|
||||||
if ((t instanceof DefineTextTag)
|
//setBackground(Color.green);
|
||||||
|| (t instanceof DefineText2Tag)
|
setBackgroundNonSelectionColor(Color.white);
|
||||||
|| (t instanceof DefineEditTextTag)) {
|
//setBackgroundSelectionColor(Color.ORANGE);
|
||||||
return TreeNodeType.TEXT;
|
|
||||||
}
|
return this;
|
||||||
|
}
|
||||||
if ((t instanceof DefineBitsTag)
|
}
|
||||||
|| (t instanceof DefineBitsJPEG2Tag)
|
|
||||||
|| (t instanceof DefineBitsJPEG3Tag)
|
TagTree(TagTreeModel treeModel, MainPanel mainPanel) {
|
||||||
|| (t instanceof DefineBitsJPEG4Tag)
|
super(treeModel);
|
||||||
|| (t instanceof DefineBitsLosslessTag)
|
this.mainPanel = mainPanel;
|
||||||
|| (t instanceof DefineBitsLossless2Tag)) {
|
setCellRenderer(new TagTreeCellRenderer());
|
||||||
return TreeNodeType.IMAGE;
|
setRootVisible(false);
|
||||||
}
|
setBackground(Color.white);
|
||||||
if ((t instanceof DefineShapeTag)
|
setUI(new BasicTreeUI() {
|
||||||
|| (t instanceof DefineShape2Tag)
|
@Override
|
||||||
|| (t instanceof DefineShape3Tag)
|
public void paint(Graphics g, JComponent c) {
|
||||||
|| (t instanceof DefineShape4Tag)) {
|
setHashColor(Color.gray);
|
||||||
return TreeNodeType.SHAPE;
|
super.paint(g, c);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
if ((t instanceof DefineMorphShapeTag) || (t instanceof DefineMorphShape2Tag)) {
|
}
|
||||||
return TreeNodeType.MORPH_SHAPE;
|
|
||||||
}
|
public static TreeNodeType getTreeNodeType(TreeItem t) {
|
||||||
|
if ((t instanceof DefineFontTag)
|
||||||
if (t instanceof DefineSpriteTag) {
|
|| (t instanceof DefineFont2Tag)
|
||||||
return TreeNodeType.SPRITE;
|
|| (t instanceof DefineFont3Tag)
|
||||||
}
|
|| (t instanceof DefineFont4Tag)
|
||||||
if ((t instanceof DefineButtonTag) || (t instanceof DefineButton2Tag)) {
|
|| (t instanceof DefineCompactedFont)) {
|
||||||
return TreeNodeType.BUTTON;
|
return TreeNodeType.FONT;
|
||||||
}
|
}
|
||||||
if (t instanceof ASMSource) {
|
if ((t instanceof DefineTextTag)
|
||||||
return TreeNodeType.AS;
|
|| (t instanceof DefineText2Tag)
|
||||||
}
|
|| (t instanceof DefineEditTextTag)) {
|
||||||
if (t instanceof ScriptPack) {
|
return TreeNodeType.TEXT;
|
||||||
return TreeNodeType.AS;
|
}
|
||||||
}
|
|
||||||
if (t instanceof AS2PackageNodeItem) {
|
if ((t instanceof DefineBitsTag)
|
||||||
return TreeNodeType.PACKAGE;
|
|| (t instanceof DefineBitsJPEG2Tag)
|
||||||
}
|
|| (t instanceof DefineBitsJPEG3Tag)
|
||||||
if (t instanceof AS3PackageNodeItem) {
|
|| (t instanceof DefineBitsJPEG4Tag)
|
||||||
return TreeNodeType.PACKAGE;
|
|| (t instanceof DefineBitsLosslessTag)
|
||||||
}
|
|| (t instanceof DefineBitsLossless2Tag)) {
|
||||||
if (t instanceof FrameNodeItem) {
|
return TreeNodeType.IMAGE;
|
||||||
return TreeNodeType.FRAME;
|
}
|
||||||
}
|
if ((t instanceof DefineShapeTag)
|
||||||
if (t instanceof ShowFrameTag) {
|
|| (t instanceof DefineShape2Tag)
|
||||||
return TreeNodeType.SHOW_FRAME;
|
|| (t instanceof DefineShape3Tag)
|
||||||
}
|
|| (t instanceof DefineShape4Tag)) {
|
||||||
|
return TreeNodeType.SHAPE;
|
||||||
if (t instanceof DefineVideoStreamTag) {
|
}
|
||||||
return TreeNodeType.MOVIE;
|
|
||||||
}
|
if ((t instanceof DefineMorphShapeTag) || (t instanceof DefineMorphShape2Tag)) {
|
||||||
|
return TreeNodeType.MORPH_SHAPE;
|
||||||
if ((t instanceof DefineSoundTag) || (t instanceof SoundStreamHeadTag) || (t instanceof SoundStreamHead2Tag)) {
|
}
|
||||||
return TreeNodeType.SOUND;
|
|
||||||
}
|
if (t instanceof DefineSpriteTag) {
|
||||||
|
return TreeNodeType.SPRITE;
|
||||||
if (t instanceof DefineBinaryDataTag) {
|
}
|
||||||
return TreeNodeType.BINARY_DATA;
|
if ((t instanceof DefineButtonTag) || (t instanceof DefineButton2Tag)) {
|
||||||
}
|
return TreeNodeType.BUTTON;
|
||||||
|
}
|
||||||
if (t instanceof SWF) {
|
if (t instanceof ASMSource) {
|
||||||
return TreeNodeType.FLASH;
|
return TreeNodeType.AS;
|
||||||
}
|
}
|
||||||
|
if (t instanceof ScriptPack) {
|
||||||
if (t instanceof SWFList) {
|
return TreeNodeType.AS;
|
||||||
SWFList slist = (SWFList) t;
|
}
|
||||||
if (slist.name != null) {
|
if (t instanceof AS2PackageNodeItem) {
|
||||||
if (slist.name.toLowerCase().endsWith(".zip")) {
|
return TreeNodeType.PACKAGE;
|
||||||
return TreeNodeType.BUNDLE_ZIP;
|
}
|
||||||
}
|
if (t instanceof AS3PackageNodeItem) {
|
||||||
if (slist.name.toLowerCase().endsWith(".swc")) {
|
return TreeNodeType.PACKAGE;
|
||||||
return TreeNodeType.BUNDLE_SWC;
|
}
|
||||||
} else {
|
if (t instanceof FrameNodeItem) {
|
||||||
return TreeNodeType.BUNDLE_BINARY;
|
return TreeNodeType.FRAME;
|
||||||
}
|
}
|
||||||
}
|
if (t instanceof ShowFrameTag) {
|
||||||
}
|
return TreeNodeType.SHOW_FRAME;
|
||||||
|
}
|
||||||
if (t instanceof Tag) {
|
|
||||||
return TreeNodeType.OTHER_TAG;
|
if (t instanceof DefineVideoStreamTag) {
|
||||||
}
|
return TreeNodeType.MOVIE;
|
||||||
|
}
|
||||||
/*if(t instanceof StringNode){
|
|
||||||
StringNode sn=(StringNode)t;
|
if ((t instanceof DefineSoundTag) || (t instanceof SoundStreamHeadTag) || (t instanceof SoundStreamHead2Tag)) {
|
||||||
String name = sn.getItem().getName();
|
return TreeNodeType.SOUND;
|
||||||
if(name!=null){
|
}
|
||||||
switch(name){
|
|
||||||
case TagTreeModel.FOLDER_BINARY_DATA:
|
if (t instanceof DefineBinaryDataTag) {
|
||||||
break;
|
return TreeNodeType.BINARY_DATA;
|
||||||
case TagTreeModel.FOLDER_BUTTONS:
|
}
|
||||||
break;
|
|
||||||
case TagTreeModel.FOLDER_FONTS:
|
if (t instanceof SWF) {
|
||||||
break;
|
return TreeNodeType.FLASH;
|
||||||
case TagTreeModel.FOLDER_FRAMES:
|
}
|
||||||
break;
|
|
||||||
case TagTreeModel.FOLDER_IMAGES:
|
if (t instanceof SWFList) {
|
||||||
break;
|
SWFList slist = (SWFList) t;
|
||||||
case TagTreeModel.FOLDER_MORPHSHAPES:
|
if (slist.name != null) {
|
||||||
break;
|
if (slist.name.toLowerCase().endsWith(".zip")) {
|
||||||
case TagTreeModel.FOLDER_MOVIES:
|
return TreeNodeType.BUNDLE_ZIP;
|
||||||
break;
|
}
|
||||||
case TagTreeModel.FOLDER_OTHERS:
|
if (slist.name.toLowerCase().endsWith(".swc")) {
|
||||||
break;
|
return TreeNodeType.BUNDLE_SWC;
|
||||||
case TagTreeModel.FOLDER_SCRIPTS:
|
} else {
|
||||||
break;
|
return TreeNodeType.BUNDLE_BINARY;
|
||||||
case TagTreeModel.FOLDER_SHAPES:
|
}
|
||||||
break;
|
}
|
||||||
case TagTreeModel.FOLDER_SOUNDS:
|
}
|
||||||
break;
|
|
||||||
case TagTreeModel.FOLDER_SPRITES:
|
if (t instanceof Tag) {
|
||||||
break;
|
return TreeNodeType.OTHER_TAG;
|
||||||
case TagTreeModel.FOLDER_TEXTS:
|
}
|
||||||
break;
|
|
||||||
}
|
return TreeNodeType.FOLDER;
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
return TreeNodeType.FOLDER;
|
public void createContextMenu(final List<SWFList> swfs) {
|
||||||
}
|
final JPopupMenu contextPopupMenu = new JPopupMenu();
|
||||||
|
|
||||||
public List<TreeElementItem> getTagsWithType(List<TreeElementItem> list, TreeNodeType type) {
|
final JMenuItem expandRecursiveMenuItem = new JMenuItem(mainPanel.translate("contextmenu.expandAll"));
|
||||||
List<TreeElementItem> ret = new ArrayList<>();
|
expandRecursiveMenuItem.addActionListener(this);
|
||||||
for (TreeElementItem item : list) {
|
expandRecursiveMenuItem.setActionCommand(ACTION_EXPAND_RECURSIVE);
|
||||||
TreeNodeType ttype = getTreeNodeType(item);
|
contextPopupMenu.add(expandRecursiveMenuItem);
|
||||||
if (type == ttype) {
|
|
||||||
ret.add(item);
|
final JMenuItem removeMenuItem = new JMenuItem(mainPanel.translate("contextmenu.remove"));
|
||||||
}
|
removeMenuItem.addActionListener(this);
|
||||||
}
|
removeMenuItem.setActionCommand(ACTION_REMOVE_ITEM);
|
||||||
return ret;
|
contextPopupMenu.add(removeMenuItem);
|
||||||
}
|
|
||||||
|
final JMenuItem removeWithDependenciesMenuItem = new JMenuItem(mainPanel.translate("contextmenu.removeWithDependencies"));
|
||||||
public TreeItem getCurrentTreeItem() {
|
removeWithDependenciesMenuItem.addActionListener(this);
|
||||||
TreeNode treeNode = (TreeNode) getLastSelectedPathComponent();
|
removeWithDependenciesMenuItem.setActionCommand(ACTION_REMOVE_ITEM_WITH_DEPENDENCIES);
|
||||||
if (treeNode == null) {
|
contextPopupMenu.add(removeWithDependenciesMenuItem);
|
||||||
return null;
|
|
||||||
}
|
final JMenuItem exportSelectionMenuItem = new JMenuItem(mainPanel.translate("menu.file.export.selection"));
|
||||||
return treeNode.getItem();
|
exportSelectionMenuItem.setActionCommand(MainFrameRibbonMenu.ACTION_EXPORT_SEL);
|
||||||
}
|
exportSelectionMenuItem.addActionListener(this);
|
||||||
}
|
contextPopupMenu.add(exportSelectionMenuItem);
|
||||||
|
|
||||||
|
final JMenuItem replaceSelectionMenuItem = new JMenuItem(mainPanel.translate("button.replace"));
|
||||||
|
replaceSelectionMenuItem.setActionCommand(MainPanel.ACTION_REPLACE);
|
||||||
|
replaceSelectionMenuItem.addActionListener(mainPanel);
|
||||||
|
contextPopupMenu.add(replaceSelectionMenuItem);
|
||||||
|
|
||||||
|
final JMenuItem rawEditMenuItem = new JMenuItem(mainPanel.translate("contextmenu.rawEdit"));
|
||||||
|
rawEditMenuItem.setActionCommand(ACTION_RAW_EDIT);
|
||||||
|
rawEditMenuItem.addActionListener(this);
|
||||||
|
rawEditMenuItem.setVisible(false);
|
||||||
|
contextPopupMenu.add(rawEditMenuItem);
|
||||||
|
|
||||||
|
final JMenuItem jumpToCharacterMenuItem = new JMenuItem(mainPanel.translate("contextmenu.jumpToCharacter"));
|
||||||
|
jumpToCharacterMenuItem.setActionCommand(ACTION_JUMP_TO_CHARACTER);
|
||||||
|
jumpToCharacterMenuItem.addActionListener(this);
|
||||||
|
jumpToCharacterMenuItem.setVisible(false);
|
||||||
|
contextPopupMenu.add(jumpToCharacterMenuItem);
|
||||||
|
|
||||||
|
final JMenuItem closeSelectionMenuItem = new JMenuItem(mainPanel.translate("contextmenu.closeSwf"));
|
||||||
|
closeSelectionMenuItem.setActionCommand(ACTION_CLOSE_SWF);
|
||||||
|
closeSelectionMenuItem.addActionListener(this);
|
||||||
|
contextPopupMenu.add(closeSelectionMenuItem);
|
||||||
|
|
||||||
|
final JMenu moveTagMenu = new JMenu(mainPanel.translate("contextmenu.moveTag"));
|
||||||
|
contextPopupMenu.add(moveTagMenu);
|
||||||
|
|
||||||
|
addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
if (SwingUtilities.isRightMouseButton(e)) {
|
||||||
|
|
||||||
|
int row = getClosestRowForLocation(e.getX(), e.getY());
|
||||||
|
int[] selectionRows = getSelectionRows();
|
||||||
|
if (!Helper.contains(selectionRows, row)) {
|
||||||
|
setSelectionRow(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
TreePath[] paths = getSelectionPaths();
|
||||||
|
if (paths == null || paths.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean allSelectedIsTagOrFrame = true;
|
||||||
|
for (TreePath treePath : paths) {
|
||||||
|
TreeNode treeNode = (TreeNode) treePath.getLastPathComponent();
|
||||||
|
|
||||||
|
TreeItem tag = treeNode.getItem();
|
||||||
|
if (!(tag instanceof Tag) && !(tag instanceof FrameNodeItem)) {
|
||||||
|
allSelectedIsTagOrFrame = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
replaceSelectionMenuItem.setVisible(false);
|
||||||
|
closeSelectionMenuItem.setVisible(false);
|
||||||
|
moveTagMenu.setVisible(false);
|
||||||
|
expandRecursiveMenuItem.setVisible(false);
|
||||||
|
|
||||||
|
if (paths.length == 1) {
|
||||||
|
TreeNode treeNode = (TreeNode) paths[0].getLastPathComponent();
|
||||||
|
|
||||||
|
TreeItem item = ((TreeNode) treeNode).getItem();
|
||||||
|
|
||||||
|
if (item instanceof ImageTag && ((ImageTag) item).importSupported()) {
|
||||||
|
replaceSelectionMenuItem.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item instanceof DefineBinaryDataTag) {
|
||||||
|
replaceSelectionMenuItem.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item instanceof DefineSoundTag) {
|
||||||
|
replaceSelectionMenuItem.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (treeNode instanceof SWFNode) {
|
||||||
|
closeSelectionMenuItem.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item instanceof Tag && swfs.size() > 1) {
|
||||||
|
final Tag tag = (Tag) item;
|
||||||
|
moveTagMenu.removeAll();
|
||||||
|
for (SWFList targetSwfList : swfs) {
|
||||||
|
for (final SWF targetSwf : targetSwfList) {
|
||||||
|
if (targetSwf != tag.getSwf()) {
|
||||||
|
JMenuItem swfItem = new JMenuItem(targetSwf.getShortFileName());
|
||||||
|
swfItem.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent ae) {
|
||||||
|
tag.getSwf().tags.remove(tag);
|
||||||
|
tag.setSwf(targetSwf);
|
||||||
|
targetSwf.tags.add(tag);
|
||||||
|
mainPanel.refreshTree();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
moveTagMenu.add(swfItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moveTagMenu.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
TreeModel model = getModel();
|
||||||
|
expandRecursiveMenuItem.setVisible(model.getChildCount(treeNode) > 0);
|
||||||
|
|
||||||
|
jumpToCharacterMenuItem.setVisible(item instanceof CharacterIdTag && !(item instanceof CharacterTag));
|
||||||
|
|
||||||
|
rawEditMenuItem.setVisible(item instanceof Tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
removeMenuItem.setVisible(allSelectedIsTagOrFrame);
|
||||||
|
exportSelectionMenuItem.setEnabled(hasExportableNodes());
|
||||||
|
contextPopupMenu.show(e.getComponent(), e.getX(), e.getY());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
switch (e.getActionCommand()) {
|
||||||
|
case ACTION_RAW_EDIT: {
|
||||||
|
TreeItem item = getCurrentTreeItem();
|
||||||
|
if (item == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mainPanel.showGenericTag((Tag) item);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_JUMP_TO_CHARACTER: {
|
||||||
|
TreeItem item = getCurrentTreeItem();
|
||||||
|
if (item == null || !(item instanceof CharacterIdTag)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CharacterIdTag characterIdTag = (CharacterIdTag) item;
|
||||||
|
mainPanel.setTreeItem(item.getSwf().characters.get(characterIdTag.getCharacterId()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_EXPAND_RECURSIVE: {
|
||||||
|
TreePath path = getSelectionPath();
|
||||||
|
if (path == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
View.expandTreeNodesRecursive(this, path, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_REMOVE_ITEM:
|
||||||
|
case ACTION_REMOVE_ITEM_WITH_DEPENDENCIES:
|
||||||
|
List<TreeNode> sel = getSelected(this);
|
||||||
|
|
||||||
|
List<Tag> tagsToRemove = new ArrayList<>();
|
||||||
|
for (TreeNode o : sel) {
|
||||||
|
TreeItem tag = o.getItem();
|
||||||
|
if (tag instanceof Tag) {
|
||||||
|
tagsToRemove.add((Tag) tag);
|
||||||
|
} else if (tag instanceof FrameNodeItem) {
|
||||||
|
FrameNodeItem frameNode = (FrameNodeItem) tag;
|
||||||
|
Frame frame = frameNode.getParent().getTimeline().frames.get(frameNode.getFrame() - 1);
|
||||||
|
if (frame.showFrameTag != null) {
|
||||||
|
tagsToRemove.add(frame.showFrameTag);
|
||||||
|
} else {
|
||||||
|
// this should be the last frame, so remove the inner tags
|
||||||
|
tagsToRemove.addAll(frame.innerTags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean removeDependencies = e.getActionCommand().equals(ACTION_REMOVE_ITEM_WITH_DEPENDENCIES);
|
||||||
|
if (tagsToRemove.size() == 1) {
|
||||||
|
Tag tag = tagsToRemove.get(0);
|
||||||
|
if (View.showConfirmDialog(this, mainPanel.translate("message.confirm.remove").replace("%item%", tag.toString()), mainPanel.translate("message.confirm"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
|
||||||
|
tag.getSwf().removeTag(tag, removeDependencies);
|
||||||
|
mainPanel.refreshTree();
|
||||||
|
}
|
||||||
|
} else if (tagsToRemove.size() > 1) {
|
||||||
|
if (View.showConfirmDialog(this, mainPanel.translate("message.confirm.removemultiple").replace("%count%", Integer.toString(tagsToRemove.size())), mainPanel.translate("message.confirm"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
|
||||||
|
for (Tag tag : tagsToRemove) {
|
||||||
|
tag.getSwf().removeTag(tag, removeDependencies);
|
||||||
|
}
|
||||||
|
mainPanel.refreshTree();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_CLOSE_SWF: {
|
||||||
|
Main.closeFile(mainPanel.getCurrentSwfList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasExportableNodes() {
|
||||||
|
return !getSelection(mainPanel.getCurrentSwf()).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TreeNode> getAllSubs(JTree tree, TreeNode o) {
|
||||||
|
TagTreeModel tm = (TagTreeModel) tree.getModel();
|
||||||
|
List<TreeNode> ret = new ArrayList<>();
|
||||||
|
for (int i = 0; i < tm.getChildCount(o); i++) {
|
||||||
|
TreeNode c = tm.getChild(o, i);
|
||||||
|
ret.add(c);
|
||||||
|
ret.addAll(getAllSubs(tree, c));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TreeNode> getAllSelected(TagTree tree) {
|
||||||
|
TreeSelectionModel tsm = tree.getSelectionModel();
|
||||||
|
TreePath[] tps = tsm.getSelectionPaths();
|
||||||
|
List<TreeNode> ret = new ArrayList<>();
|
||||||
|
if (tps == null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (TreePath tp : tps) {
|
||||||
|
TreeNode treeNode = (TreeNode) tp.getLastPathComponent();
|
||||||
|
ret.add(treeNode);
|
||||||
|
ret.addAll(getAllSubs(tree, treeNode));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TreeNode> getSelected(JTree tree) {
|
||||||
|
TreeSelectionModel tsm = tree.getSelectionModel();
|
||||||
|
TreePath[] tps = tsm.getSelectionPaths();
|
||||||
|
List<TreeNode> ret = new ArrayList<>();
|
||||||
|
if (tps == null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (TreePath tp : tps) {
|
||||||
|
TreeNode treeNode = (TreeNode) tp.getLastPathComponent();
|
||||||
|
ret.add(treeNode);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Object> getSelection(SWF swf) {
|
||||||
|
List<Object> ret = new ArrayList<>();
|
||||||
|
List<TreeNode> sel = getAllSelected(this);
|
||||||
|
for (TreeNode d : sel) {
|
||||||
|
if (d.getItem().getSwf() != swf) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (d instanceof ContainerNode) {
|
||||||
|
ContainerNode n = (ContainerNode) d;
|
||||||
|
TreeNodeType nodeType = TagTree.getTreeNodeType(n.getItem());
|
||||||
|
if (nodeType == TreeNodeType.IMAGE) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.SHAPE) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.MORPH_SHAPE) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.AS) {
|
||||||
|
ret.add(n);
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.MOVIE) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.SOUND) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.BINARY_DATA) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.TEXT) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
if (nodeType == TreeNodeType.FONT) {
|
||||||
|
ret.add((Tag) n.getItem());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (d instanceof FrameNode) {
|
||||||
|
FrameNode fn = (FrameNode) d;
|
||||||
|
if (!fn.scriptsNode) {
|
||||||
|
ret.add(d.getItem());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (d instanceof TreeElement) {
|
||||||
|
if (((TreeElement) d).isLeaf()) {
|
||||||
|
TreeElement treeElement = (TreeElement) d;
|
||||||
|
ret.add((ScriptPack) treeElement.getItem());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TreeElementItem> getTagsWithType(List<TreeElementItem> list, TreeNodeType type) {
|
||||||
|
List<TreeElementItem> ret = new ArrayList<>();
|
||||||
|
for (TreeElementItem item : list) {
|
||||||
|
TreeNodeType ttype = getTreeNodeType(item);
|
||||||
|
if (type == ttype) {
|
||||||
|
ret.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TreeItem getCurrentTreeItem() {
|
||||||
|
TreeNode treeNode = (TreeNode) getLastSelectedPathComponent();
|
||||||
|
if (treeNode == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return treeNode.getItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2014 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.gui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public enum TreePanelMode {
|
||||||
|
|
||||||
|
TAG_TREE, DUMP_TREE
|
||||||
|
}
|
||||||
@@ -733,7 +733,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene
|
|||||||
if (text.trim().startsWith("#hexdata")) {
|
if (text.trim().startsWith("#hexdata")) {
|
||||||
src.setActionBytes(Helper.getBytesFromHexaText(text));
|
src.setActionBytes(Helper.getBytesFromHexaText(text));
|
||||||
} else {
|
} else {
|
||||||
src.setActions(ASMParser.parse(0, src.getPos(), true, text, src.getSwf().version, false));
|
src.setActions(ASMParser.parse(0, true, text, src.getSwf().version, false));
|
||||||
}
|
}
|
||||||
src.setModified();
|
src.setModified();
|
||||||
setSource(this.src, false);
|
setSource(this.src, false);
|
||||||
|
|||||||
@@ -0,0 +1,171 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2014 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.gui.dumpview;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||||
|
import com.jpexs.decompiler.flash.dumpview.DumpInfoSwfNode;
|
||||||
|
import com.jpexs.decompiler.flash.gui.Main;
|
||||||
|
import com.jpexs.decompiler.flash.gui.MainPanel;
|
||||||
|
import com.jpexs.decompiler.flash.gui.View;
|
||||||
|
import com.jpexs.helpers.Helper;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Component;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JMenuItem;
|
||||||
|
import javax.swing.JPopupMenu;
|
||||||
|
import javax.swing.JTree;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.plaf.basic.BasicLabelUI;
|
||||||
|
import javax.swing.plaf.basic.BasicTreeUI;
|
||||||
|
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||||
|
import javax.swing.tree.TreeModel;
|
||||||
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class DumpTree extends JTree implements ActionListener {
|
||||||
|
|
||||||
|
private static final String ACTION_CLOSE_SWF = "CLOSESWF";
|
||||||
|
private static final String ACTION_EXPAND_RECURSIVE = "EXPANDRECURSIVE";
|
||||||
|
|
||||||
|
private final MainPanel mainPanel;
|
||||||
|
|
||||||
|
public class DumpTreeCellRenderer extends DefaultTreeCellRenderer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getTreeCellRendererComponent(
|
||||||
|
JTree tree,
|
||||||
|
Object value,
|
||||||
|
boolean sel,
|
||||||
|
boolean expanded,
|
||||||
|
boolean leaf,
|
||||||
|
int row,
|
||||||
|
boolean hasFocus) {
|
||||||
|
|
||||||
|
super.getTreeCellRendererComponent(
|
||||||
|
tree, value, sel,
|
||||||
|
expanded, leaf, row,
|
||||||
|
hasFocus);
|
||||||
|
|
||||||
|
//DumpInfo dumpInfo = (DumpInfo) value;
|
||||||
|
setUI(new BasicLabelUI());
|
||||||
|
setOpaque(false);
|
||||||
|
setBackgroundNonSelectionColor(Color.white);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DumpTree(DumpTreeModel treeModel, MainPanel mainPanel) {
|
||||||
|
super(treeModel);
|
||||||
|
this.mainPanel = mainPanel;
|
||||||
|
setCellRenderer(new DumpTreeCellRenderer());
|
||||||
|
setRootVisible(false);
|
||||||
|
setBackground(Color.white);
|
||||||
|
setUI(new BasicTreeUI() {
|
||||||
|
@Override
|
||||||
|
public void paint(Graphics g, JComponent c) {
|
||||||
|
setHashColor(Color.gray);
|
||||||
|
super.paint(g, c);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createContextMenu() {
|
||||||
|
final JPopupMenu contextPopupMenu = new JPopupMenu();
|
||||||
|
|
||||||
|
final JMenuItem expandRecursiveMenuItem = new JMenuItem(mainPanel.translate("contextmenu.expandAll"));
|
||||||
|
expandRecursiveMenuItem.addActionListener(this);
|
||||||
|
expandRecursiveMenuItem.setActionCommand(ACTION_EXPAND_RECURSIVE);
|
||||||
|
contextPopupMenu.add(expandRecursiveMenuItem);
|
||||||
|
|
||||||
|
final JMenuItem closeSelectionMenuItem = new JMenuItem(mainPanel.translate("contextmenu.closeSwf"));
|
||||||
|
closeSelectionMenuItem.setActionCommand(ACTION_CLOSE_SWF);
|
||||||
|
closeSelectionMenuItem.addActionListener(this);
|
||||||
|
contextPopupMenu.add(closeSelectionMenuItem);
|
||||||
|
|
||||||
|
addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
if (SwingUtilities.isRightMouseButton(e)) {
|
||||||
|
|
||||||
|
int row = getClosestRowForLocation(e.getX(), e.getY());
|
||||||
|
int[] selectionRows = getSelectionRows();
|
||||||
|
if (!Helper.contains(selectionRows, row)) {
|
||||||
|
setSelectionRow(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
TreePath[] paths = getSelectionPaths();
|
||||||
|
if (paths == null || paths.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
closeSelectionMenuItem.setVisible(false);
|
||||||
|
expandRecursiveMenuItem.setVisible(false);
|
||||||
|
|
||||||
|
if (paths.length == 1) {
|
||||||
|
DumpInfo treeNode = (DumpInfo) paths[0].getLastPathComponent();
|
||||||
|
|
||||||
|
if (treeNode instanceof DumpInfoSwfNode) {
|
||||||
|
closeSelectionMenuItem.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
TreeModel model = getModel();
|
||||||
|
expandRecursiveMenuItem.setVisible(model.getChildCount(treeNode) > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
contextPopupMenu.show(e.getComponent(), e.getX(), e.getY());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
switch (e.getActionCommand()) {
|
||||||
|
case ACTION_EXPAND_RECURSIVE: {
|
||||||
|
TreePath path = getSelectionPath();
|
||||||
|
if (path == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
View.expandTreeNodesRecursive(this, path, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_CLOSE_SWF: {
|
||||||
|
Main.closeFile(mainPanel.getCurrentSwfList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setModel(TreeModel tm) {
|
||||||
|
super.setModel(tm);
|
||||||
|
if (tm != null) {
|
||||||
|
int rowCount = tm.getChildCount(tm.getRoot());
|
||||||
|
for (int i = rowCount - 1; i >= 0; i--) {
|
||||||
|
expandRow(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2014 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.gui.dumpview;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||||
|
import com.jpexs.decompiler.flash.treeitems.SWFList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.event.TreeModelListener;
|
||||||
|
import javax.swing.tree.TreeModel;
|
||||||
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class DumpTreeModel implements TreeModel {
|
||||||
|
|
||||||
|
private final DumpInfo root;
|
||||||
|
|
||||||
|
public DumpTreeModel(List<SWFList> swfs) {
|
||||||
|
DumpInfo root = new DumpInfo("root", "", null, 0, 0);
|
||||||
|
for (SWFList swfList : swfs) {
|
||||||
|
for (SWF swf : swfList) {
|
||||||
|
swf.dumpInfo.name = swf.getFileTitle();
|
||||||
|
root.childInfos.add(swf.dumpInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.root = root;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getRoot() {
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getChild(Object o, int i) {
|
||||||
|
return ((DumpInfo) o).childInfos.get(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getChildCount(Object o) {
|
||||||
|
return ((DumpInfo) o).childInfos.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isLeaf(Object o) {
|
||||||
|
return ((DumpInfo) o).childInfos.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void valueForPathChanged(TreePath tp, Object o) {
|
||||||
|
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIndexOfChild(Object o, Object o1) {
|
||||||
|
return ((DumpInfo) o).childInfos.indexOf(o1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addTreeModelListener(TreeModelListener tl) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeTreeModelListener(TreeModelListener tl) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2014 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.gui.dumpview;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||||
|
import com.jpexs.decompiler.flash.gui.HexView;
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class DumpViewPanel extends JPanel {
|
||||||
|
|
||||||
|
private final JLabel dumpViewLabel;
|
||||||
|
private final HexView dumpViewHexTable;
|
||||||
|
|
||||||
|
public DumpViewPanel() {
|
||||||
|
super(new BorderLayout());
|
||||||
|
|
||||||
|
dumpViewLabel = new JLabel();
|
||||||
|
dumpViewLabel.setMinimumSize(new Dimension(100, 20));
|
||||||
|
add(dumpViewLabel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
dumpViewHexTable = new HexView();
|
||||||
|
add(new JScrollPane(dumpViewHexTable), BorderLayout.CENTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getEndIndex(DumpInfo dumpInfo) {
|
||||||
|
int end = (int) dumpInfo.startByte;
|
||||||
|
if (dumpInfo.lengthBytes != 0) {
|
||||||
|
end += dumpInfo.lengthBytes;
|
||||||
|
} else {
|
||||||
|
int bits = dumpInfo.startBit + dumpInfo.lengthBits;
|
||||||
|
end += bits / 8;
|
||||||
|
if (bits % 8 != 0) {
|
||||||
|
end++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return end - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(byte[] data, DumpInfo dumpInfo) {
|
||||||
|
List<DumpInfo> dumpInfos = new ArrayList<>();
|
||||||
|
DumpInfo di = dumpInfo;
|
||||||
|
while (di.parent != null) {
|
||||||
|
dumpInfos.add(di);
|
||||||
|
di = di.parent;
|
||||||
|
}
|
||||||
|
long[] highlightStarts = new long[dumpInfos.size()];
|
||||||
|
long[] highlightEnds = new long[dumpInfos.size()];
|
||||||
|
for (int i = 0; i < dumpInfos.size(); i++) {
|
||||||
|
DumpInfo di2 = dumpInfos.get(highlightStarts.length - i - 1);
|
||||||
|
highlightStarts[i] = di2.startByte;
|
||||||
|
highlightEnds[i] = getEndIndex(di2);
|
||||||
|
}
|
||||||
|
dumpViewHexTable.setData(data, highlightStarts, highlightEnds);
|
||||||
|
|
||||||
|
if (dumpInfo.lengthBytes != 0 || dumpInfo.lengthBits != 0) {
|
||||||
|
int selectionStart = (int) dumpInfo.startByte;
|
||||||
|
int selectionEnd = getEndIndex(dumpInfo);
|
||||||
|
|
||||||
|
dumpViewHexTable.scrollToByte(highlightStarts, highlightEnds);
|
||||||
|
|
||||||
|
setLabelText("startByte: " + dumpInfo.startByte
|
||||||
|
+ " startBit: " + dumpInfo.startBit
|
||||||
|
+ " lengthBytes: " + dumpInfo.lengthBytes
|
||||||
|
+ " lengthBits: " + dumpInfo.lengthBits
|
||||||
|
+ " selectionStart: " + selectionStart
|
||||||
|
+ " selectionEnd: " + selectionEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabelText(String text) {
|
||||||
|
dumpViewLabel.setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -84,12 +85,11 @@ public class CSMTextSettingsTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public CSMTextSettingsTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public CSMTextSettingsTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "CSMTextSettings", pos, length);
|
super(sis.getSwf(), ID, "CSMTextSettings", data);
|
||||||
textID = sis.readUI16("textID");
|
textID = sis.readUI16("textID");
|
||||||
useFlashType = (int) sis.readUB(2, "useFlashType");
|
useFlashType = (int) sis.readUB(2, "useFlashType");
|
||||||
gridFit = (int) sis.readUB(3, "gridFit");
|
gridFit = (int) sis.readUB(3, "gridFit");
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
|||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -57,12 +58,11 @@ public class DebugIDTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DebugIDTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DebugIDTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DebugID", pos, length);
|
super(sis.getSwf(), ID, "DebugID", data);
|
||||||
debugId = sis.readBytesEx(16, "debugId");
|
debugId = sis.readBytesEx(16, "debugId");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -58,8 +59,8 @@ public class DefineBinaryDataTag extends CharacterTag {
|
|||||||
return baos.toByteArray();
|
return baos.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBinaryDataTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBinaryDataTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBinaryData", pos, length);
|
super(sis.getSwf(), ID, "DefineBinaryData", data);
|
||||||
tag = sis.readUI16("tag");
|
tag = sis.readUI16("tag");
|
||||||
reserved = sis.readUI32("reserved");
|
reserved = sis.readUI32("reserved");
|
||||||
binaryData = sis.readBytesEx(sis.available(), "binaryData");
|
binaryData = sis.readBytesEx(sis.available(), "binaryData");
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.tags.base.AloneTag;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -68,14 +69,14 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBitsJPEG2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBitsJPEG2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBitsJPEG2", pos, length);
|
super(sis.getSwf(), ID, "DefineBitsJPEG2", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
imageData = sis.readBytesEx(sis.available(), "imageData");
|
imageData = sis.readBytesEx(sis.available(), "imageData");
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBitsJPEG2Tag(SWF swf, long pos, int length, int characterID, byte[] imageData) throws IOException {
|
public DefineBitsJPEG2Tag(SWF swf, ByteArrayRange data, int characterID, byte[] imageData) throws IOException {
|
||||||
super(swf, ID, "DefineBitsJPEG2", pos, length);
|
super(swf, ID, "DefineBitsJPEG2", data);
|
||||||
this.characterID = characterID;
|
this.characterID = characterID;
|
||||||
this.imageData = imageData;
|
this.imageData = imageData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.tags.base.AloneTag;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -107,8 +108,8 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBitsJPEG3Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBitsJPEG3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBitsJPEG3", pos, length);
|
super(sis.getSwf(), ID, "DefineBitsJPEG3", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
long alphaDataOffset = sis.readUI32("alphaDataOffset");
|
long alphaDataOffset = sis.readUI32("alphaDataOffset");
|
||||||
imageData = sis.readBytesEx(alphaDataOffset, "imageData");
|
imageData = sis.readBytesEx(alphaDataOffset, "imageData");
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.tags.base.AloneTag;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -133,12 +134,11 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineBitsJPEG4Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBitsJPEG4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBitsJPEG4", pos, length);
|
super(sis.getSwf(), ID, "DefineBitsJPEG4", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
long alphaDataOffset = sis.readUI32("alphaDataOffset");
|
long alphaDataOffset = sis.readUI32("alphaDataOffset");
|
||||||
deblockParam = sis.readUI16("deblockParam");
|
deblockParam = sis.readUI16("deblockParam");
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.types.ARGB;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -107,8 +108,8 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
|
|||||||
setModified(true);
|
setModified(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBitsLossless2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBitsLossless2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBitsLossless2", pos, length);
|
super(sis.getSwf(), ID, "DefineBitsLossless2", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
bitmapFormat = sis.readUI8("bitmapFormat");
|
bitmapFormat = sis.readUI8("bitmapFormat");
|
||||||
bitmapWidth = sis.readUI16("bitmapWidth");
|
bitmapWidth = sis.readUI16("bitmapWidth");
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.types.RGB;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -181,8 +182,8 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
|
|||||||
decompressed = true;
|
decompressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBitsLosslessTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBitsLosslessTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBitsLossless", pos, length);
|
super(sis.getSwf(), ID, "DefineBitsLossless", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
bitmapFormat = sis.readUI8("bitmapFormat");
|
bitmapFormat = sis.readUI8("bitmapFormat");
|
||||||
bitmapWidth = sis.readUI16("bitmapWidth");
|
bitmapWidth = sis.readUI16("bitmapWidth");
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -54,8 +55,8 @@ public class DefineBitsTag extends ImageTag {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineBitsTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineBitsTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineBits", pos, length);
|
super(sis.getSwf(), ID, "DefineBits", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
jpegData = sis.readBytesEx(sis.available(), "jpegData");
|
jpegData = sis.readBytesEx(sis.available(), "jpegData");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import com.jpexs.decompiler.flash.types.MATRIX;
|
|||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Cache;
|
import com.jpexs.helpers.Cache;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -97,12 +98,11 @@ public class DefineButton2Tag extends ButtonTag implements Container {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineButton2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineButton2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineButton2", pos, length);
|
super(sis.getSwf(), ID, "DefineButton2", data);
|
||||||
buttonId = sis.readUI16("buttonId");
|
buttonId = sis.readUI16("buttonId");
|
||||||
reserved = (int) sis.readUB(7, "reserved");
|
reserved = (int) sis.readUB(7, "reserved");
|
||||||
trackAsMenu = sis.readUB(1, "trackAsMenu") == 1;
|
trackAsMenu = sis.readUB(1, "trackAsMenu") == 1;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.CXFORM;
|
import com.jpexs.decompiler.flash.types.CXFORM;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -59,12 +60,11 @@ public class DefineButtonCxformTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineButtonCxformTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineButtonCxformTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineButtonCxform", pos, length);
|
super(sis.getSwf(), ID, "DefineButtonCxform", data);
|
||||||
buttonId = sis.readUI16("buttonId");
|
buttonId = sis.readUI16("buttonId");
|
||||||
buttonColorTransform = sis.readCXFORM("buttonColorTransform");
|
buttonColorTransform = sis.readCXFORM("buttonColorTransform");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -99,12 +100,11 @@ public class DefineButtonSoundTag extends CharacterIdTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineButtonSoundTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineButtonSoundTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineButtonSound", pos, length);
|
super(sis.getSwf(), ID, "DefineButtonSound", data);
|
||||||
buttonId = sis.readUI16("buttonId");
|
buttonId = sis.readUI16("buttonId");
|
||||||
buttonSoundChar0 = sis.readUI16("buttonSoundChar0");
|
buttonSoundChar0 = sis.readUI16("buttonSoundChar0");
|
||||||
if (buttonSoundChar0 != 0) {
|
if (buttonSoundChar0 != 0) {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.jpexs.decompiler.flash.types.MATRIX;
|
|||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Cache;
|
import com.jpexs.helpers.Cache;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
@@ -95,12 +96,11 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineButtonTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineButtonTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineButton", pos, length);
|
super(sis.getSwf(), ID, "DefineButton", data);
|
||||||
buttonId = sis.readUI16("buttonId");
|
buttonId = sis.readUI16("buttonId");
|
||||||
characters = sis.readBUTTONRECORDList(false, "characters");
|
characters = sis.readBUTTONRECORDList(false, "characters");
|
||||||
hdrSize = sis.getPos();
|
hdrSize = sis.getPos();
|
||||||
@@ -144,7 +144,7 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
|
|||||||
if (actions == null) {
|
if (actions == null) {
|
||||||
actions = getActions();
|
actions = getActions();
|
||||||
}
|
}
|
||||||
return Action.actionsToString(listeners, 0, actions, null, swf.version, exportMode, writer, getDataPos() + hdrSize, toString()/*FIXME?*/);
|
return Action.actionsToString(listeners, 0, actions, null, swf.version, exportMode, writer, toString()/*FIXME?*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,13 +170,13 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
|
|||||||
SWFInputStream rri;
|
SWFInputStream rri;
|
||||||
if (actionBytes == null) {
|
if (actionBytes == null) {
|
||||||
prevLength = (int) (getDataPos() + hdrSize);
|
prevLength = (int) (getDataPos() + hdrSize);
|
||||||
rri = new SWFInputStream(swf, swf.uncompressedData);
|
rri = new SWFInputStream(swf, getOriginalRange().array);
|
||||||
rri.seek(prevLength);
|
rri.seek(prevLength);
|
||||||
} else {
|
} else {
|
||||||
prevLength = 0;
|
prevLength = 0;
|
||||||
rri = new SWFInputStream(swf, actionBytes);
|
rri = new SWFInputStream(swf, actionBytes);
|
||||||
}
|
}
|
||||||
List<Action> list = ActionListReader.readActionListTimeout(listeners, getDataPos() + hdrSize - prevLength, rri, getVersion(), prevLength, -1, toString()/*FIXME?*/);
|
List<Action> list = ActionListReader.readActionListTimeout(listeners, rri, getVersion(), prevLength, -1, toString()/*FIXME?*/);
|
||||||
return list;
|
return list;
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import com.jpexs.decompiler.flash.types.RGBA;
|
|||||||
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -695,12 +696,11 @@ public class DefineEditTextTag extends TextTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineEditTextTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineEditTextTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineEditText", pos, length);
|
super(sis.getSwf(), ID, "DefineEditText", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
bounds = sis.readRECT("bounds");
|
bounds = sis.readRECT("bounds");
|
||||||
hasText = sis.readUB(1, "hasText") == 1;
|
hasText = sis.readUB(1, "hasText") == 1;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -185,19 +186,18 @@ public class DefineFont2Tag extends FontTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DefineFont2Tag(SWF swf) throws IOException {
|
public DefineFont2Tag(SWF swf) throws IOException {
|
||||||
super(swf, ID, "DefineFont2", 0, 0);
|
super(swf, ID, "DefineFont2", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineFont2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFont2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFont2", pos, length);
|
super(sis.getSwf(), ID, "DefineFont2", data);
|
||||||
fontId = sis.readUI16("fontId");
|
fontId = sis.readUI16("fontId");
|
||||||
fontFlagsHasLayout = sis.readUB(1, "fontFlagsHasLayout") == 1;
|
fontFlagsHasLayout = sis.readUB(1, "fontFlagsHasLayout") == 1;
|
||||||
fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1;
|
fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
@@ -110,8 +111,8 @@ public class DefineFont3Tag extends FontTag {
|
|||||||
return codeTable.indexOf((int) c);
|
return codeTable.indexOf((int) c);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineFont3Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFont3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFont3", pos, length);
|
super(sis.getSwf(), ID, "DefineFont3", data);
|
||||||
fontId = sis.readUI16("fontId");
|
fontId = sis.readUI16("fontId");
|
||||||
fontFlagsHasLayout = sis.readUB(1, "fontFlagsHasLayout") == 1;
|
fontFlagsHasLayout = sis.readUB(1, "fontFlagsHasLayout") == 1;
|
||||||
fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1;
|
fontFlagsShiftJIS = sis.readUB(1, "fontFlagsShiftJIS") == 1;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -46,8 +47,8 @@ public class DefineFont4Tag extends CharacterTag {
|
|||||||
return fontID;
|
return fontID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineFont4Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFont4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFont4", pos, length);
|
super(sis.getSwf(), ID, "DefineFont4", data);
|
||||||
fontID = sis.readUI16("fontID");
|
fontID = sis.readUI16("fontID");
|
||||||
reserved = (int) sis.readUB(5, "reserved");
|
reserved = (int) sis.readUB(5, "reserved");
|
||||||
fontFlagsHasFontData = sis.readUB(1, "fontFlagsHasFontData") == 1;
|
fontFlagsHasFontData = sis.readUB(1, "fontFlagsHasFontData") == 1;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.types.ZONERECORD;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -42,8 +43,8 @@ public class DefineFontAlignZonesTag extends Tag {
|
|||||||
public List<ZONERECORD> zoneTable;
|
public List<ZONERECORD> zoneTable;
|
||||||
public static final int ID = 73;
|
public static final int ID = 73;
|
||||||
|
|
||||||
public DefineFontAlignZonesTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFontAlignZonesTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFontAlignZones", pos, length);
|
super(sis.getSwf(), ID, "DefineFontAlignZones", data);
|
||||||
fontID = sis.readUI16("fontID");
|
fontID = sis.readUI16("fontID");
|
||||||
CSMTableHint = (int) sis.readUB(2, "CSMTableHint");
|
CSMTableHint = (int) sis.readUB(2, "CSMTableHint");
|
||||||
reserved = (int) sis.readUB(6, "reserved");
|
reserved = (int) sis.readUB(6, "reserved");
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.LANGCODE;
|
import com.jpexs.decompiler.flash.types.LANGCODE;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -88,12 +89,11 @@ public class DefineFontInfo2Tag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineFontInfo2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFontInfo2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFontInfo2", pos, length);
|
super(sis.getSwf(), ID, "DefineFontInfo2", data);
|
||||||
fontID = sis.readUI16("fontID");
|
fontID = sis.readUI16("fontID");
|
||||||
int fontNameLen = sis.readUI8("fontNameLen");
|
int fontNameLen = sis.readUI8("fontNameLen");
|
||||||
if (swf.version >= 6) {
|
if (swf.version >= 6) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -89,12 +90,11 @@ public class DefineFontInfoTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineFontInfoTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFontInfoTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFontInfo", pos, length);
|
super(sis.getSwf(), ID, "DefineFontInfo", data);
|
||||||
fontId = sis.readUI16("fontId");
|
fontId = sis.readUI16("fontId");
|
||||||
int fontNameLen = sis.readUI8("fontNameLen");
|
int fontNameLen = sis.readUI8("fontNameLen");
|
||||||
if (swf.version >= 6) {
|
if (swf.version >= 6) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class DefineFontNameTag extends Tag {
|
public class DefineFontNameTag extends Tag {
|
||||||
@@ -29,8 +30,8 @@ public class DefineFontNameTag extends Tag {
|
|||||||
public String fontCopyright;
|
public String fontCopyright;
|
||||||
public static final int ID = 88;
|
public static final int ID = 88;
|
||||||
|
|
||||||
public DefineFontNameTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFontNameTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFontName", pos, length);
|
super(sis.getSwf(), ID, "DefineFontName", data);
|
||||||
fontId = sis.readUI16("fontId");
|
fontId = sis.readUI16("fontId");
|
||||||
fontName = sis.readString("fontName");
|
fontName = sis.readString("fontName");
|
||||||
fontCopyright = sis.readString("fontCopyright");
|
fontCopyright = sis.readString("fontCopyright");
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.types.SHAPE;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -136,12 +137,11 @@ public class DefineFontTag extends FontTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineFontTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineFontTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineFont", pos, length);
|
super(sis.getSwf(), ID, "DefineFont", data);
|
||||||
fontId = sis.readUI16("fontId");
|
fontId = sis.readUI16("fontId");
|
||||||
int firstOffset = sis.readUI16("firstOffset");
|
int firstOffset = sis.readUI16("firstOffset");
|
||||||
int nGlyphs = firstOffset / 2;
|
int nGlyphs = firstOffset / 2;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
|
|||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -148,12 +149,11 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineMorphShape2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineMorphShape2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineMorphShape2", pos, length);
|
super(sis.getSwf(), ID, "DefineMorphShape2", data);
|
||||||
characterId = sis.readUI16("characterId");
|
characterId = sis.readUI16("characterId");
|
||||||
startBounds = sis.readRECT("startBounds");
|
startBounds = sis.readRECT("startBounds");
|
||||||
endBounds = sis.readRECT("endBounds");
|
endBounds = sis.readRECT("endBounds");
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
|
|||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -126,12 +127,11 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineMorphShapeTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineMorphShapeTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineMorphShape", pos, length);
|
super(sis.getSwf(), ID, "DefineMorphShape", data);
|
||||||
characterId = sis.readUI16("characterId");
|
characterId = sis.readUI16("characterId");
|
||||||
startBounds = sis.readRECT("startBounds");
|
startBounds = sis.readRECT("startBounds");
|
||||||
endBounds = sis.readRECT("endBounds");
|
endBounds = sis.readRECT("endBounds");
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -35,8 +36,8 @@ public class DefineScalingGridTag extends Tag {
|
|||||||
public RECT splitter;
|
public RECT splitter;
|
||||||
public static final int ID = 78;
|
public static final int ID = 78;
|
||||||
|
|
||||||
public DefineScalingGridTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineScalingGridTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineScalingGrid", pos, length);
|
super(sis.getSwf(), ID, "DefineScalingGrid", data);
|
||||||
characterId = sis.readUI16("characterId");
|
characterId = sis.readUI16("characterId");
|
||||||
splitter = sis.readRECT("splitter");
|
splitter = sis.readRECT("splitter");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -78,12 +79,11 @@ public class DefineSceneAndFrameLabelDataTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineSceneAndFrameLabelDataTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineSceneAndFrameLabelDataTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineSceneAndFrameLabelData", pos, length);
|
super(sis.getSwf(), ID, "DefineSceneAndFrameLabelData", data);
|
||||||
int sceneCount = (int) sis.readEncodedU32("sceneCount");
|
int sceneCount = (int) sis.readEncodedU32("sceneCount");
|
||||||
sceneOffsets = new long[sceneCount];
|
sceneOffsets = new long[sceneCount];
|
||||||
sceneNames = new String[sceneCount];
|
sceneNames = new String[sceneCount];
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -67,8 +68,8 @@ public class DefineShape2Tag extends ShapeTag {
|
|||||||
return shapeBounds;
|
return shapeBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineShape2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineShape2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineShape2", pos, length);
|
super(sis.getSwf(), ID, "DefineShape2", data);
|
||||||
shapeId = sis.readUI16("shapeId");
|
shapeId = sis.readUI16("shapeId");
|
||||||
shapeBounds = sis.readRECT("shapeBounds");
|
shapeBounds = sis.readRECT("shapeBounds");
|
||||||
shapes = sis.readSHAPEWITHSTYLE(2, false, "shapes");
|
shapes = sis.readSHAPEWITHSTYLE(2, false, "shapes");
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -67,8 +68,8 @@ public class DefineShape3Tag extends ShapeTag {
|
|||||||
return shapeId;
|
return shapeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineShape3Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineShape3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineShape3", pos, length);
|
super(sis.getSwf(), ID, "DefineShape3", data);
|
||||||
shapeId = sis.readUI16("shapeId");
|
shapeId = sis.readUI16("shapeId");
|
||||||
shapeBounds = sis.readRECT("shapeBounds");
|
shapeBounds = sis.readRECT("shapeBounds");
|
||||||
shapes = sis.readSHAPEWITHSTYLE(3, false, "shapes");
|
shapes = sis.readSHAPEWITHSTYLE(3, false, "shapes");
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.types.RECT;
|
|||||||
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -75,8 +76,8 @@ public class DefineShape4Tag extends ShapeTag {
|
|||||||
return shapeBounds;
|
return shapeBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineShape4Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineShape4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineShape4", pos, length);
|
super(sis.getSwf(), ID, "DefineShape4", data);
|
||||||
shapeId = sis.readUI16("shapeId");
|
shapeId = sis.readUI16("shapeId");
|
||||||
shapeBounds = sis.readRECT("shapeBounds");
|
shapeBounds = sis.readRECT("shapeBounds");
|
||||||
edgeBounds = sis.readRECT("edgeBounds");
|
edgeBounds = sis.readRECT("edgeBounds");
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -64,8 +65,8 @@ public class DefineShapeTag extends ShapeTag {
|
|||||||
return shapeBounds;
|
return shapeBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefineShapeTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineShapeTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineShape", pos, length);
|
super(sis.getSwf(), ID, "DefineShape", data);
|
||||||
shapeId = sis.readUI16("shapeId");
|
shapeId = sis.readUI16("shapeId");
|
||||||
shapeBounds = sis.readRECT("shapeBounds");
|
shapeBounds = sis.readRECT("shapeBounds");
|
||||||
shapes = sis.readSHAPEWITHSTYLE(1, false, "shapes");
|
shapes = sis.readSHAPEWITHSTYLE(1, false, "shapes");
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
|||||||
import com.jpexs.decompiler.flash.types.sound.MP3FRAME;
|
import com.jpexs.decompiler.flash.types.sound.MP3FRAME;
|
||||||
import com.jpexs.decompiler.flash.types.sound.MP3SOUNDDATA;
|
import com.jpexs.decompiler.flash.types.sound.MP3SOUNDDATA;
|
||||||
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
|
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -96,12 +97,11 @@ public class DefineSoundTag extends CharacterTag implements SoundTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineSoundTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineSoundTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineSound", pos, length);
|
super(sis.getSwf(), ID, "DefineSound", data);
|
||||||
soundId = sis.readUI16("soundId");
|
soundId = sis.readUI16("soundId");
|
||||||
soundFormat = (int) sis.readUB(4, "soundFormat");
|
soundFormat = (int) sis.readUB(4, "soundFormat");
|
||||||
soundRate = (int) sis.readUB(2, "soundRate");
|
soundRate = (int) sis.readUB(2, "soundRate");
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import com.jpexs.decompiler.flash.types.ColorTransform;
|
|||||||
import com.jpexs.decompiler.flash.types.MATRIX;
|
import com.jpexs.decompiler.flash.types.MATRIX;
|
||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Cache;
|
import com.jpexs.helpers.Cache;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
@@ -50,7 +51,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -193,16 +193,15 @@ public class DefineSpriteTag extends CharacterTag implements Container, Drawable
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param level
|
* @param level
|
||||||
* @param pos
|
|
||||||
* @param parallel
|
* @param parallel
|
||||||
* @param skipUnusualTags
|
* @param skipUnusualTags
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @throws java.lang.InterruptedException
|
* @throws java.lang.InterruptedException
|
||||||
*/
|
*/
|
||||||
public DefineSpriteTag(SWFInputStream sis, int level, long pos, int length, boolean parallel, boolean skipUnusualTags) throws IOException, InterruptedException {
|
public DefineSpriteTag(SWFInputStream sis, int level, ByteArrayRange data, boolean parallel, boolean skipUnusualTags) throws IOException, InterruptedException {
|
||||||
super(sis.getSwf(), ID, "DefineSprite", pos, length);
|
super(sis.getSwf(), ID, "DefineSprite", data);
|
||||||
spriteId = sis.readUI16("spriteId");
|
spriteId = sis.readUI16("spriteId");
|
||||||
frameCount = sis.readUI16("frameCount");
|
frameCount = sis.readUI16("frameCount");
|
||||||
List<Tag> subTags = sis.readTagList(this, level + 1, parallel, skipUnusualTags, true, swf.gfx);
|
List<Tag> subTags = sis.readTagList(this, level + 1, parallel, skipUnusualTags, true, swf.gfx);
|
||||||
@@ -230,9 +229,7 @@ public class DefineSpriteTag extends CharacterTag implements Container, Drawable
|
|||||||
try {
|
try {
|
||||||
sos.writeUI16(spriteId);
|
sos.writeUI16(spriteId);
|
||||||
sos.writeUI16(frameCount);
|
sos.writeUI16(frameCount);
|
||||||
Map<Tag, Long> tagPositions = new HashMap<>();
|
sos.writeTags(subTags);
|
||||||
Map<Tag, Integer> tagLengths = new HashMap<>();
|
|
||||||
sos.writeTags(subTags, tagPositions, tagLengths);
|
|
||||||
if (hasEndTag) {
|
if (hasEndTag) {
|
||||||
sos.writeUI16(0);
|
sos.writeUI16(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import com.jpexs.decompiler.flash.types.RECT;
|
|||||||
import com.jpexs.decompiler.flash.types.RGBA;
|
import com.jpexs.decompiler.flash.types.RGBA;
|
||||||
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -460,12 +461,11 @@ public class DefineText2Tag extends TextTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineText2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineText2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineText2", pos, length);
|
super(sis.getSwf(), ID, "DefineText2", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
textBounds = sis.readRECT("textBounds");
|
textBounds = sis.readRECT("textBounds");
|
||||||
textMatrix = sis.readMatrix("textMatrix");
|
textMatrix = sis.readMatrix("textMatrix");
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import com.jpexs.decompiler.flash.types.RECT;
|
|||||||
import com.jpexs.decompiler.flash.types.RGB;
|
import com.jpexs.decompiler.flash.types.RGB;
|
||||||
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -425,7 +426,7 @@ public class DefineTextTag extends TextTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DefineTextTag(SWF swf, int characterID, RECT textBounds, MATRIX textMatrix, List<TEXTRECORD> textRecords) {
|
public DefineTextTag(SWF swf, int characterID, RECT textBounds, MATRIX textMatrix, List<TEXTRECORD> textRecords) {
|
||||||
super(swf, ID, "DefineText", 0, 0);
|
super(swf, ID, "DefineText", null);
|
||||||
this.characterID = characterID;
|
this.characterID = characterID;
|
||||||
this.textBounds = textBounds;
|
this.textBounds = textBounds;
|
||||||
this.textMatrix = textMatrix;
|
this.textMatrix = textMatrix;
|
||||||
@@ -471,12 +472,11 @@ public class DefineTextTag extends TextTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineTextTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineTextTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineText", pos, length);
|
super(sis.getSwf(), ID, "DefineText", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
textBounds = sis.readRECT("textBounds");
|
textBounds = sis.readRECT("textBounds");
|
||||||
textMatrix = sis.readMatrix("textMatrix");
|
textMatrix = sis.readMatrix("textMatrix");
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -99,12 +100,11 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineVideoStreamTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineVideoStreamTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineVideoStream", pos, length);
|
super(sis.getSwf(), ID, "DefineVideoStream", data);
|
||||||
characterID = sis.readUI16("characterID");
|
characterID = sis.readUI16("characterID");
|
||||||
numFrames = sis.readUI16("numFrames");
|
numFrames = sis.readUI16("numFrames");
|
||||||
width = sis.readUI16("width");
|
width = sis.readUI16("width");
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -66,12 +67,11 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DoABCDefineTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DoABCDefineTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DoABCDefine", pos, length);
|
super(sis.getSwf(), ID, "DoABCDefine", data);
|
||||||
flags = sis.readUI32("flags");
|
flags = sis.readUI32("flags");
|
||||||
name = sis.readString("name");
|
name = sis.readString("name");
|
||||||
abc = new ABC(sis, swf, this);
|
abc = new ABC(sis, swf, this);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
|
|||||||
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
|
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
|
||||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -53,12 +54,11 @@ public class DoABCTag extends Tag implements ABCContainerTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DoABCTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DoABCTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DoABC", pos, length);
|
super(sis.getSwf(), ID, "DoABC", data);
|
||||||
abc = new ABC(sis, swf, this);
|
abc = new ABC(sis, swf, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
|
|||||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -50,25 +51,23 @@ public class DoActionTag extends Tag implements ASMSource {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws java.io.IOException
|
* @throws java.io.IOException
|
||||||
*/
|
*/
|
||||||
public DoActionTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DoActionTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DoAction", pos, length);
|
super(sis.getSwf(), ID, "DoAction", data);
|
||||||
//do not load actionBytes. Disassebler will use the original SWF stream in this case
|
//do not store actionBytes. Disassebler will use the original SWF stream in this case
|
||||||
//actionBytes = sis.readBytesEx(sis.available());
|
sis.readBytesEx(sis.available(), "actionBytes");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param swf
|
* @param swf
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
*/
|
*/
|
||||||
public DoActionTag(SWF swf, long pos, int length) {
|
public DoActionTag(SWF swf, ByteArrayRange data) {
|
||||||
super(swf, ID, "DoAction", pos, length);
|
super(swf, ID, "DoAction", data);
|
||||||
actionBytes = new byte[0];
|
actionBytes = new byte[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +94,7 @@ public class DoActionTag extends Tag implements ASMSource {
|
|||||||
if (actions == null) {
|
if (actions == null) {
|
||||||
actions = getActions();
|
actions = getActions();
|
||||||
}
|
}
|
||||||
return Action.actionsToString(listeners, 0, actions, null, swf.version, exportMode, writer, getDataPos(), toString()/*FIXME?*/);
|
return Action.actionsToString(listeners, 0, actions, null, swf.version, exportMode, writer, toString()/*FIXME?*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -125,13 +124,13 @@ public class DoActionTag extends Tag implements ASMSource {
|
|||||||
SWFInputStream rri;
|
SWFInputStream rri;
|
||||||
if (actionBytes == null) {
|
if (actionBytes == null) {
|
||||||
prevLength = (int) getDataPos();
|
prevLength = (int) getDataPos();
|
||||||
rri = new SWFInputStream(swf, swf.uncompressedData);
|
rri = new SWFInputStream(swf, getOriginalRange().array);
|
||||||
rri.seek(prevLength);
|
rri.seek(prevLength);
|
||||||
} else {
|
} else {
|
||||||
prevLength = 0;
|
prevLength = 0;
|
||||||
rri = new SWFInputStream(swf, actionBytes);
|
rri = new SWFInputStream(swf, actionBytes);
|
||||||
}
|
}
|
||||||
List<Action> list = ActionListReader.readActionListTimeout(listeners, getDataPos() - prevLength, rri, getVersion(), prevLength, -1, toString()/*FIXME?*/);
|
List<Action> list = ActionListReader.readActionListTimeout(listeners, rri, getVersion(), prevLength, -1, toString()/*FIXME?*/);
|
||||||
return list;
|
return list;
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -55,15 +56,14 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DoInitActionTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public DoInitActionTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DoInitAction", pos, length);
|
super(sis.getSwf(), ID, "DoInitAction", data);
|
||||||
spriteId = sis.readUI16("spriteId");
|
spriteId = sis.readUI16("spriteId");
|
||||||
//actions = sis.readActionList();
|
//do not store actionBytes. Disassebler will use the original SWF stream in this case
|
||||||
actionBytes = sis.readBytesEx(sis.available(), "actionBytes");
|
sis.readBytesEx(sis.available(), "actionBytes");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -108,7 +108,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
|||||||
if (actions == null) {
|
if (actions == null) {
|
||||||
actions = getActions();
|
actions = getActions();
|
||||||
}
|
}
|
||||||
return Action.actionsToString(listeners, 0, actions, null, swf.version, exportMode, writer, getDataPos() + 2, toString()/*FIXME?*/);
|
return Action.actionsToString(listeners, 0, actions, null, swf.version, exportMode, writer, toString()/*FIXME?*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -118,13 +118,13 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
|||||||
SWFInputStream rri;
|
SWFInputStream rri;
|
||||||
if (actionBytes == null) {
|
if (actionBytes == null) {
|
||||||
prevLength = (int) (getDataPos() + 2);
|
prevLength = (int) (getDataPos() + 2);
|
||||||
rri = new SWFInputStream(swf, swf.uncompressedData);
|
rri = new SWFInputStream(swf, getOriginalRange().array);
|
||||||
rri.seek(prevLength);
|
rri.seek(prevLength);
|
||||||
} else {
|
} else {
|
||||||
prevLength = 0;
|
prevLength = 0;
|
||||||
rri = new SWFInputStream(swf, actionBytes);
|
rri = new SWFInputStream(swf, actionBytes);
|
||||||
}
|
}
|
||||||
List<Action> list = ActionListReader.readActionListTimeout(listeners, getDataPos() + 2 - prevLength, rri, getVersion(), prevLength, -1, toString()/*FIXME?*/);
|
List<Action> list = ActionListReader.readActionListTimeout(listeners, rri, getVersion(), prevLength, -1, toString()/*FIXME?*/);
|
||||||
return list;
|
return list;
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
throw ex;
|
throw ex;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -64,12 +65,11 @@ public class EnableDebugger2Tag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public EnableDebugger2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public EnableDebugger2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "EnableDebugger2", pos, length);
|
super(sis.getSwf(), ID, "EnableDebugger2", data);
|
||||||
reserved = sis.readUI16("reserved");
|
reserved = sis.readUI16("reserved");
|
||||||
passwordHash = sis.readString("passwordHash");
|
passwordHash = sis.readString("passwordHash");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -58,12 +59,11 @@ public class EnableDebuggerTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public EnableDebuggerTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public EnableDebuggerTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "EnableDebugger", pos, length);
|
super(sis.getSwf(), ID, "EnableDebugger", data);
|
||||||
passwordHash = sis.readString("passwordHash");
|
passwordHash = sis.readString("passwordHash");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Optional;
|
import com.jpexs.decompiler.flash.types.annotations.Optional;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -67,12 +68,11 @@ public class EnableTelemetryTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public EnableTelemetryTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public EnableTelemetryTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "", pos, length);
|
super(sis.getSwf(), ID, "", data);
|
||||||
reserved = (int) sis.readUB(16, "reserved");
|
reserved = (int) sis.readUB(16, "reserved");
|
||||||
if (sis.available() > 0) {
|
if (sis.available() > 0) {
|
||||||
passwordHash = sis.readBytesEx(32, "passwordHash");
|
passwordHash = sis.readBytesEx(32, "passwordHash");
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.jpexs.decompiler.flash.tags;
|
package com.jpexs.decompiler.flash.tags;
|
||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,16 +42,15 @@ public class EndTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param swf
|
* @param swf
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public EndTag(SWF swf, long pos, int length) throws IOException {
|
public EndTag(SWF swf, ByteArrayRange data) throws IOException {
|
||||||
super(swf, ID, "End", pos, length);
|
super(swf, ID, "End", data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EndTag(SWF swf) {
|
public EndTag(SWF swf) {
|
||||||
super(swf, ID, "End", 0, 0);
|
super(swf, ID, "End", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -47,7 +48,7 @@ public class ExportAssetsTag extends Tag {
|
|||||||
public static final int ID = 56;
|
public static final int ID = 56;
|
||||||
|
|
||||||
public ExportAssetsTag(SWF swf) {
|
public ExportAssetsTag(SWF swf) {
|
||||||
super(swf, ID, "ExportAssets", 0, 0);
|
super(swf, ID, "ExportAssets", null);
|
||||||
tags = new ArrayList<>();
|
tags = new ArrayList<>();
|
||||||
names = new ArrayList<>();
|
names = new ArrayList<>();
|
||||||
}
|
}
|
||||||
@@ -56,12 +57,11 @@ public class ExportAssetsTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public ExportAssetsTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public ExportAssetsTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "ExportAssets", pos, length);
|
super(sis.getSwf(), ID, "ExportAssets", data);
|
||||||
int count = sis.readUI16("count");
|
int count = sis.readUI16("count");
|
||||||
tags = new ArrayList<>();
|
tags = new ArrayList<>();
|
||||||
names = new ArrayList<>();
|
names = new ArrayList<>();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -45,11 +46,11 @@ public class FileAttributesTag extends Tag {
|
|||||||
public static final int ID = 69;
|
public static final int ID = 69;
|
||||||
|
|
||||||
public FileAttributesTag(SWF swf) {
|
public FileAttributesTag(SWF swf) {
|
||||||
super(swf, ID, "FileAttributes", 0, 0);
|
super(swf, ID, "FileAttributes", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileAttributesTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public FileAttributesTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "FileAttributes", pos, length);
|
super(sis.getSwf(), ID, "FileAttributes", data);
|
||||||
reserved1 = sis.readUB(1, "reserved1") == 1; // reserved
|
reserved1 = sis.readUB(1, "reserved1") == 1; // reserved
|
||||||
// UB[1] == 0 (reserved)
|
// UB[1] == 0 (reserved)
|
||||||
useDirectBlit = sis.readUB(1, "useDirectBlit") != 0;
|
useDirectBlit = sis.readUB(1, "useDirectBlit") != 0;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,8 +37,8 @@ public class FrameLabelTag extends Tag {
|
|||||||
return namedAnchor;
|
return namedAnchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FrameLabelTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public FrameLabelTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "FrameLabel", pos, length);
|
super(sis.getSwf(), ID, "FrameLabel", data);
|
||||||
name = sis.readString("name");
|
name = sis.readString("name");
|
||||||
if (sis.available() > 0) {
|
if (sis.available() > 0) {
|
||||||
if (sis.readUI8("namedAnchor") == 1) {
|
if (sis.readUI8("namedAnchor") == 1) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.types.BasicType;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -59,12 +60,11 @@ public class ImportAssets2Tag extends Tag implements ImportTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public ImportAssets2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public ImportAssets2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "ImportAssets2", pos, length);
|
super(sis.getSwf(), ID, "ImportAssets2", data);
|
||||||
tags = new ArrayList<>();
|
tags = new ArrayList<>();
|
||||||
names = new ArrayList<>();
|
names = new ArrayList<>();
|
||||||
url = sis.readString("url");
|
url = sis.readString("url");
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.tags.base.ImportTag;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -52,12 +53,11 @@ public class ImportAssetsTag extends Tag implements ImportTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public ImportAssetsTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public ImportAssetsTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "ImportAssets", pos, length);
|
super(sis.getSwf(), ID, "ImportAssets", data);
|
||||||
tags = new ArrayList<>();
|
tags = new ArrayList<>();
|
||||||
names = new ArrayList<>();
|
names = new ArrayList<>();
|
||||||
url = sis.readString("url");
|
url = sis.readString("url");
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class JPEGTablesTag extends Tag {
|
public class JPEGTablesTag extends Tag {
|
||||||
@@ -26,8 +27,8 @@ public class JPEGTablesTag extends Tag {
|
|||||||
@Internal
|
@Internal
|
||||||
public byte[] jpegData;
|
public byte[] jpegData;
|
||||||
|
|
||||||
public JPEGTablesTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public JPEGTablesTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "JPEGTables", pos, length);
|
super(sis.getSwf(), ID, "JPEGTables", data);
|
||||||
jpegData = sis.readBytesEx(sis.available(), "jpegData");
|
jpegData = sis.readBytesEx(sis.available(), "jpegData");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Multiline;
|
import com.jpexs.decompiler.flash.types.annotations.Multiline;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -29,8 +30,8 @@ public class MetadataTag extends Tag {
|
|||||||
public String xmlMetadata;
|
public String xmlMetadata;
|
||||||
public static final int ID = 77;
|
public static final int ID = 77;
|
||||||
|
|
||||||
public MetadataTag(SWFInputStream sis, long pos, int length) {
|
public MetadataTag(SWFInputStream sis, ByteArrayRange data) {
|
||||||
super(sis.getSwf(), ID, "Metadata", pos, length);
|
super(sis.getSwf(), ID, "Metadata", data);
|
||||||
try {
|
try {
|
||||||
xmlMetadata = sis.readString("xmlMetadata");
|
xmlMetadata = sis.readString("xmlMetadata");
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -191,7 +192,7 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlaceObject2Tag(SWF swf, boolean placeFlagHasClipActions, boolean placeFlagHasClipDepth, boolean placeFlagHasName, boolean placeFlagHasRatio, boolean placeFlagHasColorTransform, boolean placeFlagHasMatrix, boolean placeFlagHasCharacter, boolean placeFlagMove, int depth, int characterId, MATRIX matrix, CXFORMWITHALPHA colorTransform, int ratio, String name, int clipDepth, CLIPACTIONS clipActions) {
|
public PlaceObject2Tag(SWF swf, boolean placeFlagHasClipActions, boolean placeFlagHasClipDepth, boolean placeFlagHasName, boolean placeFlagHasRatio, boolean placeFlagHasColorTransform, boolean placeFlagHasMatrix, boolean placeFlagHasCharacter, boolean placeFlagMove, int depth, int characterId, MATRIX matrix, CXFORMWITHALPHA colorTransform, int ratio, String name, int clipDepth, CLIPACTIONS clipActions) {
|
||||||
super(swf, ID, "PlaceObject2", 0, 0);
|
super(swf, ID, "PlaceObject2", null);
|
||||||
this.placeFlagHasClipActions = placeFlagHasClipActions;
|
this.placeFlagHasClipActions = placeFlagHasClipActions;
|
||||||
this.placeFlagHasClipDepth = placeFlagHasClipDepth;
|
this.placeFlagHasClipDepth = placeFlagHasClipDepth;
|
||||||
this.placeFlagHasName = placeFlagHasName;
|
this.placeFlagHasName = placeFlagHasName;
|
||||||
@@ -214,12 +215,11 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public PlaceObject2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public PlaceObject2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "PlaceObject2", pos, length);
|
super(sis.getSwf(), ID, "PlaceObject2", data);
|
||||||
placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
|
placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
|
||||||
placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
|
placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
|
||||||
placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
|
placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import com.jpexs.decompiler.flash.types.annotations.Internal;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -298,12 +299,11 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public PlaceObject3Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public PlaceObject3Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "PlaceObject3", pos, length);
|
super(sis.getSwf(), ID, "PlaceObject3", data);
|
||||||
placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
|
placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
|
||||||
placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
|
placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
|
||||||
placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
|
placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import com.jpexs.decompiler.flash.types.annotations.Internal;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -299,12 +300,11 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public PlaceObject4Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public PlaceObject4Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "PlaceObject4", pos, length);
|
super(sis.getSwf(), ID, "PlaceObject4", data);
|
||||||
placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
|
placeFlagHasClipActions = sis.readUB(1, "placeFlagHasClipActions") == 1;
|
||||||
placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
|
placeFlagHasClipDepth = sis.readUB(1, "placeFlagHasClipDepth") == 1;
|
||||||
placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
|
placeFlagHasName = sis.readUB(1, "placeFlagHasName") == 1;
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.jpexs.decompiler.flash.types.RGBA;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Optional;
|
import com.jpexs.decompiler.flash.types.annotations.Optional;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
import com.jpexs.decompiler.flash.types.filters.FILTER;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -100,12 +101,11 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public PlaceObjectTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public PlaceObjectTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "PlaceObject", pos, length);
|
super(sis.getSwf(), ID, "PlaceObject", data);
|
||||||
characterId = sis.readUI16("characterId");
|
characterId = sis.readUI16("characterId");
|
||||||
depth = sis.readUI16("depth");
|
depth = sis.readUI16("depth");
|
||||||
matrix = sis.readMatrix("matrix");
|
matrix = sis.readMatrix("matrix");
|
||||||
@@ -115,7 +115,7 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlaceObjectTag(SWF swf, int characterId, int depth, MATRIX matrix, CXFORM colorTransform) {
|
public PlaceObjectTag(SWF swf, int characterId, int depth, MATRIX matrix, CXFORM colorTransform) {
|
||||||
super(swf, ID, "PlaceObject", 0, 0);
|
super(swf, ID, "PlaceObject", null);
|
||||||
this.characterId = characterId;
|
this.characterId = characterId;
|
||||||
this.depth = depth;
|
this.depth = depth;
|
||||||
this.matrix = matrix;
|
this.matrix = matrix;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
|||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -44,8 +45,8 @@ public class ProductInfoTag extends Tag {
|
|||||||
public long compilationDateHigh;
|
public long compilationDateHigh;
|
||||||
public static final int ID = 41;
|
public static final int ID = 41;
|
||||||
|
|
||||||
public ProductInfoTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public ProductInfoTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "ProductInfo", pos, length);
|
super(sis.getSwf(), ID, "ProductInfo", data);
|
||||||
/*
|
/*
|
||||||
* 0: Unknown
|
* 0: Unknown
|
||||||
* 1: Macromedia Flex for J2EE
|
* 1: Macromedia Flex for J2EE
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -58,12 +59,11 @@ public class ProtectTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public ProtectTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public ProtectTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "Protect", pos, length);
|
super(sis.getSwf(), ID, "Protect", data);
|
||||||
if (sis.available() > 0) {
|
if (sis.available() > 0) {
|
||||||
passwordHash = sis.readString("passwordHash");
|
passwordHash = sis.readString("passwordHash");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
|
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class RemoveObject2Tag extends Tag implements RemoveTag {
|
public class RemoveObject2Tag extends Tag implements RemoveTag {
|
||||||
@@ -28,8 +29,8 @@ public class RemoveObject2Tag extends Tag implements RemoveTag {
|
|||||||
public int depth;
|
public int depth;
|
||||||
public static final int ID = 28;
|
public static final int ID = 28;
|
||||||
|
|
||||||
public RemoveObject2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public RemoveObject2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "RemoveObject2", pos, length);
|
super(sis.getSwf(), ID, "RemoveObject2", data);
|
||||||
depth = sis.readUI16("depth");
|
depth = sis.readUI16("depth");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
|
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -67,12 +68,11 @@ public class RemoveObjectTag extends CharacterIdTag implements RemoveTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public RemoveObjectTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public RemoveObjectTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "RemoveObject", pos, length);
|
super(sis.getSwf(), ID, "RemoveObject", data);
|
||||||
characterId = sis.readUI16("characterId");
|
characterId = sis.readUI16("characterId");
|
||||||
depth = sis.readUI16("depth");
|
depth = sis.readUI16("depth");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
|||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -34,8 +35,8 @@ public class ScriptLimitsTag extends Tag {
|
|||||||
|
|
||||||
public static final int ID = 65;
|
public static final int ID = 65;
|
||||||
|
|
||||||
public ScriptLimitsTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public ScriptLimitsTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "ScriptLimits", pos, length);
|
super(sis.getSwf(), ID, "ScriptLimits", data);
|
||||||
maxRecursionDepth = sis.readUI16("maxRecursionDepth");
|
maxRecursionDepth = sis.readUI16("maxRecursionDepth");
|
||||||
scriptTimeoutSeconds = sis.readUI16("scriptTimeoutSeconds");
|
scriptTimeoutSeconds = sis.readUI16("scriptTimeoutSeconds");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWF;
|
|||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.RGB;
|
import com.jpexs.decompiler.flash.types.RGB;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -28,13 +29,13 @@ public class SetBackgroundColorTag extends Tag {
|
|||||||
public RGB backgroundColor;
|
public RGB backgroundColor;
|
||||||
public static final int ID = 9;
|
public static final int ID = 9;
|
||||||
|
|
||||||
public SetBackgroundColorTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public SetBackgroundColorTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "SetBackgroundColor", pos, length);
|
super(sis.getSwf(), ID, "SetBackgroundColor", data);
|
||||||
backgroundColor = sis.readRGB("backgroundColor");
|
backgroundColor = sis.readRGB("backgroundColor");
|
||||||
}
|
}
|
||||||
|
|
||||||
public SetBackgroundColorTag(SWF swf, RGB backgroundColor) {
|
public SetBackgroundColorTag(SWF swf, RGB backgroundColor) {
|
||||||
super(swf, ID, "SetBackgroundColor", 0, 0);
|
super(swf, ID, "SetBackgroundColor", null);
|
||||||
this.backgroundColor = backgroundColor;
|
this.backgroundColor = backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
|||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -65,12 +66,11 @@ public class SetTabIndexTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public SetTabIndexTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public SetTabIndexTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "SetTabIndex", pos, length);
|
super(sis.getSwf(), ID, "SetTabIndex", data);
|
||||||
depth = sis.readUI16("depth");
|
depth = sis.readUI16("depth");
|
||||||
tabIndex = sis.readUI16("tabIndex");
|
tabIndex = sis.readUI16("tabIndex");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.jpexs.decompiler.flash.tags;
|
package com.jpexs.decompiler.flash.tags;
|
||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -51,15 +52,14 @@ public class ShowFrameTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param swf
|
* @param swf
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
*/
|
*/
|
||||||
public ShowFrameTag(SWF swf, long pos, int length) {
|
public ShowFrameTag(SWF swf, ByteArrayRange data) {
|
||||||
super(swf, ID, "ShowFrame", pos, length);
|
super(swf, ID, "ShowFrame", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShowFrameTag(SWF swf) {
|
public ShowFrameTag(SWF swf) {
|
||||||
super(swf, ID, "ShowFrame", 0, 0);
|
super(swf, ID, "ShowFrame", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNestedTagType(int tagTypeId) {
|
public static boolean isNestedTagType(int tagTypeId) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,12 +37,11 @@ public class SoundStreamBlockTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public SoundStreamBlockTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public SoundStreamBlockTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "SoundStreamBlock", pos, length);
|
super(sis.getSwf(), ID, "SoundStreamBlock", data);
|
||||||
//all data is streamSoundData
|
//all data is streamSoundData
|
||||||
streamSoundData = sis.readBytesEx(sis.available(), "streamSoundData");
|
streamSoundData = sis.readBytesEx(sis.available(), "streamSoundData");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.types.annotations.Internal;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
|
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -137,12 +138,11 @@ public class SoundStreamHead2Tag extends CharacterIdTag implements SoundStreamHe
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public SoundStreamHead2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public SoundStreamHead2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "SoundStreamHead2", pos, length);
|
super(sis.getSwf(), ID, "SoundStreamHead2", data);
|
||||||
reserved = (int) sis.readUB(4, "reserved");
|
reserved = (int) sis.readUB(4, "reserved");
|
||||||
playBackSoundRate = (int) sis.readUB(2, "playBackSoundRate");
|
playBackSoundRate = (int) sis.readUB(2, "playBackSoundRate");
|
||||||
playBackSoundSize = sis.readUB(1, "playBackSoundSize") == 1;
|
playBackSoundSize = sis.readUB(1, "playBackSoundSize") == 1;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.jpexs.decompiler.flash.types.annotations.Internal;
|
|||||||
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
import com.jpexs.decompiler.flash.types.annotations.Reserved;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
|
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -130,12 +131,11 @@ public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHea
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public SoundStreamHeadTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public SoundStreamHeadTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "SoundStreamHead", pos, length);
|
super(sis.getSwf(), ID, "SoundStreamHead", data);
|
||||||
reserved = (int) sis.readUB(4, "reserved");
|
reserved = (int) sis.readUB(4, "reserved");
|
||||||
playBackSoundRate = (int) sis.readUB(2, "playBackSoundRate");
|
playBackSoundRate = (int) sis.readUB(2, "playBackSoundRate");
|
||||||
playBackSoundSize = sis.readUB(1, "playBackSoundSize") == 1;
|
playBackSoundSize = sis.readUB(1, "playBackSoundSize") == 1;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -55,12 +56,11 @@ public class StartSound2Tag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public StartSound2Tag(SWFInputStream sis, long pos, int length) throws IOException {
|
public StartSound2Tag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "StartSound2", pos, length);
|
super(sis.getSwf(), ID, "StartSound2", data);
|
||||||
soundClassName = sis.readString("soundClassName");
|
soundClassName = sis.readString("soundClassName");
|
||||||
soundInfo = sis.readSOUNDINFO("soundInfo");
|
soundInfo = sis.readSOUNDINFO("soundInfo");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
import com.jpexs.decompiler.flash.types.SOUNDINFO;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -59,12 +60,11 @@ public class StartSoundTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public StartSoundTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public StartSoundTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "StartSound", pos, length);
|
super(sis.getSwf(), ID, "StartSound", data);
|
||||||
soundId = sis.readUI16("soundId");
|
soundId = sis.readUI16("soundId");
|
||||||
soundInfo = sis.readSOUNDINFO("soundInfo");
|
soundInfo = sis.readSOUNDINFO("soundInfo");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream;
|
|||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -34,8 +35,8 @@ public class SymbolClassTag extends Tag {
|
|||||||
public String[] names;
|
public String[] names;
|
||||||
public static final int ID = 76;
|
public static final int ID = 76;
|
||||||
|
|
||||||
public SymbolClassTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public SymbolClassTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "SymbolClass", pos, length);
|
super(sis.getSwf(), ID, "SymbolClass", data);
|
||||||
int numSymbols = sis.readUI16("numSymbols");
|
int numSymbols = sis.readUI16("numSymbols");
|
||||||
tags = new int[numSymbols];
|
tags = new int[numSymbols];
|
||||||
names = new String[numSymbols];
|
names = new String[numSymbols];
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.jpexs.decompiler.flash.tags.gfx.ExporterInfoTag;
|
|||||||
import com.jpexs.decompiler.flash.tags.gfx.FontTextureInfo;
|
import com.jpexs.decompiler.flash.tags.gfx.FontTextureInfo;
|
||||||
import com.jpexs.decompiler.flash.timeline.Timelined;
|
import com.jpexs.decompiler.flash.timeline.Timelined;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -56,16 +57,6 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
|||||||
*/
|
*/
|
||||||
@Internal
|
@Internal
|
||||||
public boolean forceWriteAsLong = false;
|
public boolean forceWriteAsLong = false;
|
||||||
/**
|
|
||||||
* Original position in the SWF file
|
|
||||||
*/
|
|
||||||
@Internal
|
|
||||||
private final long pos;
|
|
||||||
/**
|
|
||||||
* Original tag length
|
|
||||||
*/
|
|
||||||
@Internal
|
|
||||||
private final int length;
|
|
||||||
protected String tagName;
|
protected String tagName;
|
||||||
@Internal
|
@Internal
|
||||||
protected transient SWF swf;
|
protected transient SWF swf;
|
||||||
@@ -73,6 +64,11 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
|||||||
protected transient Timelined timelined;
|
protected transient Timelined timelined;
|
||||||
@Internal
|
@Internal
|
||||||
private boolean modified;
|
private boolean modified;
|
||||||
|
/**
|
||||||
|
* Original tag data
|
||||||
|
*/
|
||||||
|
@Internal
|
||||||
|
private final ByteArrayRange originalData;
|
||||||
|
|
||||||
public String getTagName() {
|
public String getTagName() {
|
||||||
return tagName;
|
return tagName;
|
||||||
@@ -119,19 +115,17 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
|||||||
* @param swf The SWF
|
* @param swf The SWF
|
||||||
* @param id Tag type identifier
|
* @param id Tag type identifier
|
||||||
* @param name Tag name
|
* @param name Tag name
|
||||||
* @param pos Original position in the SWF file
|
* @param data Original tag data
|
||||||
* @param length Original tag length
|
|
||||||
*/
|
*/
|
||||||
public Tag(SWF swf, int id, String name, long pos, int length) {
|
public Tag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.tagName = name;
|
this.tagName = name;
|
||||||
this.pos = pos;
|
this.originalData = data;
|
||||||
this.length = length;
|
|
||||||
this.swf = swf;
|
this.swf = swf;
|
||||||
if (swf == null) {
|
if (swf == null) {
|
||||||
throw new Error("swf parameter cannot be null.");
|
throw new Error("swf parameter cannot be null.");
|
||||||
}
|
}
|
||||||
if (pos == 0) { // it is tag build by constructor
|
if (data == null) { // it is tag build by constructor
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,7 +330,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
|||||||
sos.write(newHeaderData);
|
sos.write(newHeaderData);
|
||||||
sos.write(newData);
|
sos.write(newData);
|
||||||
} else {
|
} else {
|
||||||
sos.write(swf.uncompressedData, (int) pos, length);
|
sos.write(originalData.array, originalData.pos, originalData.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,24 +353,24 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
|||||||
return getOriginalData();
|
return getOriginalData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getOriginalLength() {
|
public final ByteArrayRange getOriginalRange() {
|
||||||
return length;
|
return originalData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final byte[] getOriginalData() {
|
public final byte[] getOriginalData() {
|
||||||
// todo honfika: do not copy data
|
// todo honfika: do not copy data
|
||||||
int dataLength = getOriginalDataLength();
|
int dataLength = getOriginalDataLength();
|
||||||
byte[] data = new byte[dataLength];
|
byte[] data = new byte[dataLength];
|
||||||
System.arraycopy(swf.uncompressedData, (int) (pos + length - dataLength), data, 0, dataLength);
|
System.arraycopy(originalData.array, (int) (originalData.pos + originalData.length - dataLength), data, 0, dataLength);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getOriginalDataLength() {
|
public final int getOriginalDataLength() {
|
||||||
return length - (isLongOriginal() ? 6 : 2);
|
return originalData.length - (isLongOriginal() ? 6 : 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isLongOriginal() {
|
private final boolean isLongOriginal() {
|
||||||
int shortLength = swf.uncompressedData[(int) pos] & 0x003F;
|
int shortLength = originalData.array[(int) originalData.pos] & 0x003F;
|
||||||
return shortLength == 0x3f;
|
return shortLength == 0x3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,11 +383,11 @@ public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getPos() {
|
public long getPos() {
|
||||||
return pos;
|
return originalData.pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getDataPos() {
|
public long getDataPos() {
|
||||||
return pos + (isLongOriginal() ? 6 : 2);
|
return originalData.pos + (isLongOriginal() ? 6 : 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModified(boolean value) {
|
public void setModified(boolean value) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags;
|
|||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
import com.jpexs.decompiler.flash.SWFInputStream;
|
import com.jpexs.decompiler.flash.SWFInputStream;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -33,13 +34,12 @@ public class TagStub extends Tag {
|
|||||||
*
|
*
|
||||||
* @param swf
|
* @param swf
|
||||||
* @param id
|
* @param id
|
||||||
* @param length
|
* @param data
|
||||||
* @param name
|
* @param name
|
||||||
* @param pos
|
|
||||||
* @param sis
|
* @param sis
|
||||||
*/
|
*/
|
||||||
public TagStub(SWF swf, int id, String name, long pos, int length, SWFInputStream sis) {
|
public TagStub(SWF swf, int id, String name, ByteArrayRange data, SWFInputStream sis) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
dataStream = sis;
|
dataStream = sis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.jpexs.decompiler.flash.tags;
|
package com.jpexs.decompiler.flash.tags;
|
||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -24,8 +25,8 @@ import com.jpexs.decompiler.flash.SWF;
|
|||||||
*/
|
*/
|
||||||
public class UnknownTag extends Tag {
|
public class UnknownTag extends Tag {
|
||||||
|
|
||||||
public UnknownTag(SWF swf, int id, long pos, int length) {
|
public UnknownTag(SWF swf, int id, ByteArrayRange data) {
|
||||||
super(swf, id, "Unknown", pos, length);
|
super(swf, id, "Unknown", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWFInputStream;
|
|||||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||||
import com.jpexs.decompiler.flash.types.BasicType;
|
import com.jpexs.decompiler.flash.types.BasicType;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -61,12 +62,11 @@ public class VideoFrameTag extends Tag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public VideoFrameTag(SWFInputStream sis, long pos, int length) throws IOException {
|
public VideoFrameTag(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "VideoFrame", pos, length);
|
super(sis.getSwf(), ID, "VideoFrame", data);
|
||||||
streamID = sis.readUI16("streamID");
|
streamID = sis.readUI16("streamID");
|
||||||
frameNum = sis.readUI16("frameNum");
|
frameNum = sis.readUI16("frameNum");
|
||||||
videoData = sis.readBytesEx(sis.available(), "videoData"); //TODO: Parse video packets
|
videoData = sis.readBytesEx(sis.available(), "videoData"); //TODO: Parse video packets
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ public interface ASMSource extends TreeItem {
|
|||||||
|
|
||||||
public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer);
|
public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer);
|
||||||
|
|
||||||
public long getPos();
|
|
||||||
|
|
||||||
public void addDisassemblyListener(DisassemblyListener listener);
|
public void addDisassemblyListener(DisassemblyListener listener);
|
||||||
|
|
||||||
public void removeDisassemblyListener(DisassemblyListener listener);
|
public void removeDisassemblyListener(DisassemblyListener listener);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.timeline.DepthState;
|
|||||||
import com.jpexs.decompiler.flash.timeline.Timelined;
|
import com.jpexs.decompiler.flash.timeline.Timelined;
|
||||||
import com.jpexs.decompiler.flash.types.BUTTONRECORD;
|
import com.jpexs.decompiler.flash.types.BUTTONRECORD;
|
||||||
import com.jpexs.decompiler.flash.types.ColorTransform;
|
import com.jpexs.decompiler.flash.types.ColorTransform;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -42,8 +43,8 @@ public abstract class ButtonTag extends CharacterTag implements DrawableTag, Tim
|
|||||||
public static int FRAME_DOWN = 2;
|
public static int FRAME_DOWN = 2;
|
||||||
public static int FRAME_HITTEST = 3;
|
public static int FRAME_HITTEST = 3;
|
||||||
|
|
||||||
public ButtonTag(SWF swf, int id, String name, long pos, int length) {
|
public ButtonTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract List<BUTTONRECORD> getRecords();
|
public abstract List<BUTTONRECORD> getRecords();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SWF;
|
|||||||
import com.jpexs.decompiler.flash.tags.ExportAssetsTag;
|
import com.jpexs.decompiler.flash.tags.ExportAssetsTag;
|
||||||
import com.jpexs.decompiler.flash.tags.Tag;
|
import com.jpexs.decompiler.flash.tags.Tag;
|
||||||
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
import com.jpexs.decompiler.flash.types.annotations.Internal;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -29,8 +30,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public abstract class CharacterIdTag extends Tag {
|
public abstract class CharacterIdTag extends Tag {
|
||||||
|
|
||||||
public CharacterIdTag(SWF swf, int id, String name, long pos, int length) {
|
public CharacterIdTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract int getCharacterId();
|
public abstract int getCharacterId();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.jpexs.decompiler.flash.tags.base;
|
package com.jpexs.decompiler.flash.tags.base;
|
||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -24,7 +25,7 @@ import com.jpexs.decompiler.flash.SWF;
|
|||||||
*/
|
*/
|
||||||
public abstract class CharacterTag extends CharacterIdTag {
|
public abstract class CharacterTag extends CharacterIdTag {
|
||||||
|
|
||||||
public CharacterTag(SWF swf, int id, String name, long pos, int length) {
|
public CharacterTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.jpexs.decompiler.flash.types.RECT;
|
|||||||
import com.jpexs.decompiler.flash.types.SHAPE;
|
import com.jpexs.decompiler.flash.types.SHAPE;
|
||||||
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
import com.jpexs.decompiler.flash.types.TEXTRECORD;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
@@ -55,8 +56,8 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable
|
|||||||
|
|
||||||
protected final int previewSize = 500;
|
protected final int previewSize = 500;
|
||||||
|
|
||||||
public FontTag(SWF swf, int id, String name, long pos, int length) {
|
public FontTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract int getFontId();
|
public abstract int getFontId();
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.jpexs.decompiler.flash.tags.base;
|
package com.jpexs.decompiler.flash.tags.base;
|
||||||
|
|
||||||
import com.jpexs.decompiler.flash.SWF;
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -28,8 +29,8 @@ import java.io.InputStream;
|
|||||||
*/
|
*/
|
||||||
public abstract class ImageTag extends CharacterTag {
|
public abstract class ImageTag extends CharacterTag {
|
||||||
|
|
||||||
public ImageTag(SWF swf, int id, String name, long pos, int length) {
|
public ImageTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract InputStream getImageData();
|
public abstract InputStream getImageData();
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.exporters.shape.SVGShapeExporter;
|
|||||||
import com.jpexs.decompiler.flash.timeline.DepthState;
|
import com.jpexs.decompiler.flash.timeline.DepthState;
|
||||||
import com.jpexs.decompiler.flash.types.ColorTransform;
|
import com.jpexs.decompiler.flash.types.ColorTransform;
|
||||||
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -36,8 +37,8 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public abstract class ShapeTag extends CharacterTag implements BoundedTag, DrawableTag {
|
public abstract class ShapeTag extends CharacterTag implements BoundedTag, DrawableTag {
|
||||||
|
|
||||||
public ShapeTag(SWF swf, int id, String name, long pos, int length) {
|
public ShapeTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract SHAPEWITHSTYLE getShapes();
|
public abstract SHAPEWITHSTYLE getShapes();
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
|
|||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import com.jpexs.helpers.SerializableImage;
|
import com.jpexs.helpers.SerializableImage;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
@@ -67,8 +68,8 @@ import org.w3c.dom.Element;
|
|||||||
*/
|
*/
|
||||||
public abstract class TextTag extends CharacterTag implements BoundedTag, DrawableTag {
|
public abstract class TextTag extends CharacterTag implements BoundedTag, DrawableTag {
|
||||||
|
|
||||||
public TextTag(SWF swf, int id, String name, long pos, int length) {
|
public TextTag(SWF swf, int id, String name, ByteArrayRange data) {
|
||||||
super(swf, id, name, pos, length);
|
super(swf, id, name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract MATRIX getTextMatrix();
|
public abstract MATRIX getTextMatrix();
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.CurvedEdgeRecord;
|
|||||||
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
|
||||||
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
|
||||||
|
import com.jpexs.helpers.ByteArrayRange;
|
||||||
import com.jpexs.helpers.Helper;
|
import com.jpexs.helpers.Helper;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -84,12 +85,11 @@ public final class DefineCompactedFont extends FontTag implements DrawableTag {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param sis
|
* @param sis
|
||||||
* @param length
|
* @param data
|
||||||
* @param pos
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public DefineCompactedFont(SWFInputStream sis, long pos, int length) throws IOException {
|
public DefineCompactedFont(SWFInputStream sis, ByteArrayRange data) throws IOException {
|
||||||
super(sis.getSwf(), ID, "DefineCompactedFont", pos, length);
|
super(sis.getSwf(), ID, "DefineCompactedFont", data);
|
||||||
|
|
||||||
fontId = sis.readUI16("fontId");
|
fontId = sis.readUI16("fontId");
|
||||||
fonts = new ArrayList<>();
|
fonts = new ArrayList<>();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user