basic dump view

This commit is contained in:
honfika
2014-06-21 20:36:55 +02:00
parent 6232a141b7
commit a0804e2cb9
112 changed files with 2082 additions and 1954 deletions

View File

@@ -1,85 +1,85 @@
/*
* Copyright (C) 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;
import com.jpexs.helpers.SwfHeaderStreamSearch;
import com.jpexs.helpers.streams.SeekableInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
*
* @author JPEXS
*/
public class BinarySWFBundle implements SWFBundle {
private final SWFSearch search;
public BinarySWFBundle(InputStream is, boolean noCheck, SearchMode searchMode) {
search = new SWFSearch(new SwfHeaderStreamSearch(is), noCheck, searchMode);
search.process();
}
@Override
public int length() {
return search.length();
}
@Override
public Set<String> getKeys() {
Set<String> ret = new HashSet<>();
for (Long address : search.getAddresses()) {
ret.add("[" + address + "]");
}
return ret;
}
@Override
public SeekableInputStream getSWF(String key) {
if (!key.startsWith("[")) {
return null;
}
if (!key.endsWith("]")) {
return null;
}
key = key.substring(1, key.length() - 1);
try {
int address = Integer.parseInt(key);
return search.get(null, address);
} catch (IOException | NumberFormatException iex) {
return null;
}
}
@Override
public Map<String, SeekableInputStream> getAll() {
Map<String, SeekableInputStream> ret = new HashMap<>();
for (String key : getKeys()) {
ret.put(key, getSWF(key));
}
return ret;
}
@Override
public String getExtension() {
return "bin";
}
}
/*
* Copyright (C) 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;
import com.jpexs.helpers.SwfHeaderStreamSearch;
import com.jpexs.helpers.streams.SeekableInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
*
* @author JPEXS
*/
public class BinarySWFBundle implements SWFBundle {
private final SWFSearch search;
public BinarySWFBundle(InputStream is, boolean noCheck, SearchMode searchMode) throws IOException {
search = new SWFSearch(new SwfHeaderStreamSearch(is), noCheck, searchMode);
search.process();
}
@Override
public int length() {
return search.length();
}
@Override
public Set<String> getKeys() {
Set<String> ret = new HashSet<>();
for (Long address : search.getAddresses()) {
ret.add("[" + address + "]");
}
return ret;
}
@Override
public SeekableInputStream getSWF(String key) {
if (!key.startsWith("[")) {
return null;
}
if (!key.endsWith("]")) {
return null;
}
key = key.substring(1, key.length() - 1);
try {
int address = Integer.parseInt(key);
return search.get(null, address);
} catch (IOException | NumberFormatException iex) {
return null;
}
}
@Override
public Map<String, SeekableInputStream> getAll() {
Map<String, SeekableInputStream> ret = new HashMap<>();
for (String key : getKeys()) {
ret.put(key, getSWF(key));
}
return ret;
}
@Override
public String getExtension() {
return "bin";
}
}

View File

@@ -52,6 +52,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionNewObject;
import com.jpexs.decompiler.flash.action.swf5.ActionSetMember;
import com.jpexs.decompiler.flash.action.swf7.ActionDefineFunction2;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
import com.jpexs.decompiler.flash.ecma.Null;
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
import com.jpexs.decompiler.flash.exporters.FontExporter;
@@ -90,6 +91,7 @@ import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag;
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
import com.jpexs.decompiler.flash.tags.SymbolClassTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.TagStub;
import com.jpexs.decompiler.flash.tags.VideoFrameTag;
import com.jpexs.decompiler.flash.tags.base.ASMSource;
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
@@ -268,6 +270,8 @@ public final class SWF implements TreeItem, Timelined {
public static final double unitDivisor = 20;
private Timeline timeline;
public DumpInfo dumpInfo;
public void updateCharacters() {
characters.clear();
@@ -304,7 +308,7 @@ public final class SWF implements TreeItem, Timelined {
Tag t = tags.get(i);
if (t instanceof DefineSpriteTag) {
if (!isSpriteValid((DefineSpriteTag) t, new ArrayList<Integer>())) {
tags.set(i, new Tag(this, t.getId(), "InvalidSprite", t.getPos(), t.getOriginalLength()));
tags.set(i, new TagStub(this, t.getId(), "InvalidSprite", t.getPos(), t.getOriginalLength(), null));
}
}
}
@@ -503,14 +507,17 @@ public final class SWF implements TreeItem, Timelined {
public SWF(InputStream is, ProgressListener listener, boolean parallelRead, boolean checkOnly) throws IOException, InterruptedException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SWFHeader header = decompress(is, baos, true);
version = header.version;
fileSize = header.fileSize;
gfx = header.gfx;
compression = header.compression;
uncompressedData = baos.toByteArray();
SWFInputStream sis = new SWFInputStream(this, uncompressedData);
sis.read(new byte[8], 0, 8); // skip the header
dumpInfo = new DumpInfo("rootswf", "", null, 0, 0);
sis.dumpInfo = dumpInfo;
sis.readBytesEx(3); // skip siganture
version = sis.readUI8();
fileSize = sis.readUI32();
sis.dumpInfo.lengthBytes = fileSize;
if (listener != null) {
sis.addPercentListener(listener);
}
@@ -520,7 +527,7 @@ public final class SWF implements TreeItem, Timelined {
sis.readUI8(); //tmpFirstByetOfFrameRate
frameRate = sis.readUI8();
frameCount = sis.readUI16();
List<Tag> tags = sis.readTagList(this, this, 0, parallelRead, true, !checkOnly, gfx);
List<Tag> tags = sis.readTagList(this, 0, parallelRead, true, !checkOnly, gfx);
if (tags.get(tags.size() - 1).getId() == EndTag.ID) {
hasEndTag = true;
tags.remove(tags.size() - 1);
@@ -705,7 +712,7 @@ public final class SWF implements TreeItem, Timelined {
}
int version = hdr[3];
SWFInputStream sis = new SWFInputStream(null, Arrays.copyOfRange(hdr, 4, 8), 4);
SWFInputStream sis = new SWFInputStream(null, Arrays.copyOfRange(hdr, 4, 8), 4, 4);
long fileSize = sis.readUI32();
SWFHeader header = new SWFHeader();
header.version = version;
@@ -730,8 +737,8 @@ public final class SWF implements TreeItem, Timelined {
sis.readUI32(); // compressed LZMA data size = compressed SWF - 17 byte,
// where 17 = 8 byte header + this 4 byte + 5 bytes decoder properties
int propertiesSize = 5;
byte[] lzmaProperties = new byte[propertiesSize];
if (sis.read(lzmaProperties, 0, propertiesSize) != propertiesSize) {
byte[] lzmaProperties = sis.readBytes(propertiesSize);
if (lzmaProperties.length != propertiesSize) {
throw new IOException("LZMA:input .lzma file is too short");
}
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();

File diff suppressed because it is too large Load Diff

View File

@@ -1,192 +0,0 @@
/*
* 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;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.timeline.Timelined;
import com.jpexs.decompiler.flash.types.BUTTONCONDACTION;
import com.jpexs.decompiler.flash.types.BUTTONRECORD;
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
import com.jpexs.decompiler.flash.types.CXFORM;
import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA;
import com.jpexs.decompiler.flash.types.KERNINGRECORD;
import com.jpexs.decompiler.flash.types.LANGCODE;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.MORPHFILLSTYLEARRAY;
import com.jpexs.decompiler.flash.types.MORPHLINESTYLEARRAY;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.SHAPE;
import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.SOUNDINFO;
import com.jpexs.decompiler.flash.types.TEXTRECORD;
import com.jpexs.decompiler.flash.types.ZONERECORD;
import com.jpexs.decompiler.flash.types.filters.FILTER;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
*
* @author JPEXS
*/
public class SWFLimitedInputStream {
private SWFInputStream sis;
private long limit;
public SWF swf;
public SWFLimitedInputStream(SWF swf, SWFInputStream sis, long limit) {
this.swf = swf;
this.limit = limit;
this.sis = sis;
}
public int available() throws IOException {
return sis.available();
}
public long readUB(int nBits) throws IOException {
return sis.readUB(nBits);
}
public int readUI8() throws IOException {
return sis.readUI8();
}
public int readUI16() throws IOException {
return sis.readUI16();
}
public long readUI32() throws IOException {
return sis.readUI32();
}
public int readSI16() throws IOException {
return sis.readSI16();
}
public long readEncodedU32() throws IOException {
return sis.readEncodedU32();
}
public float readFLOAT() throws IOException {
return sis.readFLOAT();
}
public byte[] readBytesEx(long count) throws IOException {
return sis.readBytesEx(count);
}
public byte[] readBytesZlib(long count) throws IOException {
return sis.readBytesZlib(count);
}
public String readString() throws IOException {
return sis.readString();
}
public MATRIX readMatrix() throws IOException {
return sis.readMatrix();
}
public List<Tag> readTagList(SWF swf, Timelined timelined, int level, boolean parallel, boolean skipUnusualTags, boolean parseTags, boolean gfx) throws IOException, InterruptedException {
return sis.readTagList(swf, timelined, level, parallel, skipUnusualTags, parseTags, gfx);
}
public List<BUTTONRECORD> readBUTTONRECORDList(boolean inDefineButton2) throws IOException {
return sis.readBUTTONRECORDList(inDefineButton2);
}
public List<BUTTONCONDACTION> readBUTTONCONDACTIONList(SWF swf, Tag tag) throws IOException {
return sis.readBUTTONCONDACTIONList(swf, tag);
}
public CLIPACTIONS readCLIPACTIONS(SWF swf, Tag tag) throws IOException {
return sis.readCLIPACTIONS(swf, tag);
}
public CXFORM readCXFORM() throws IOException {
return sis.readCXFORM();
}
public CXFORMWITHALPHA readCXFORMWITHALPHA() throws IOException {
return sis.readCXFORMWITHALPHA();
}
public List<FILTER> readFILTERLIST() throws IOException {
return sis.readFILTERLIST();
}
public LANGCODE readLANGCODE() throws IOException {
return sis.readLANGCODE();
}
public MORPHFILLSTYLEARRAY readMORPHFILLSTYLEARRAY() throws IOException {
return sis.readMORPHFILLSTYLEARRAY();
}
public MORPHLINESTYLEARRAY readMORPHLINESTYLEARRAY(int morphShapeNum) throws IOException {
return sis.readMORPHLINESTYLEARRAY(morphShapeNum);
}
public RGB readRGB() throws IOException {
return sis.readRGB();
}
public RGBA readRGBA() throws IOException {
return sis.readRGBA();
}
public SHAPE readSHAPE(int shapeNum, boolean morphShape) throws IOException {
return sis.readSHAPE(shapeNum, morphShape);
}
public SHAPEWITHSTYLE readSHAPEWITHSTYLE(int shapeNum, boolean morphShape) throws IOException {
return sis.readSHAPEWITHSTYLE(shapeNum, morphShape);
}
public KERNINGRECORD readKERNINGRECORD(boolean fontFlagsWideCodes) throws IOException {
return sis.readKERNINGRECORD(fontFlagsWideCodes);
}
public TEXTRECORD readTEXTRECORD(boolean inDefineText2, int glyphBits, int advanceBits) throws IOException {
return sis.readTEXTRECORD(inDefineText2, glyphBits, advanceBits);
}
public RECT readRECT() throws IOException {
return sis.readRECT();
}
public SOUNDINFO readSOUNDINFO() throws IOException {
return sis.readSOUNDINFO();
}
public ZONERECORD readZONERECORD() throws IOException {
return sis.readZONERECORD();
}
public long getPos() {
return sis.getPos();
}
public InputStream getBaseStream() {
return sis.getBaseStream();
}
}

View File

@@ -427,6 +427,8 @@ public class SWFOutputStream extends OutputStream {
tagPositions.put(tag, pos);
tagLengths.put(tag, length);
}
// todo: honfika: update tag position and lengths. Currently the 2nd save fails
}
/**

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc;
import com.jpexs.decompiler.flash.EventListener;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Deobfuscation;
import com.jpexs.decompiler.flash.abc.avm2.ConstantPool;
@@ -58,7 +59,6 @@ import com.jpexs.decompiler.flash.tags.ABCContainerTag;
import com.jpexs.helpers.utf8.Utf8PrintWriter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
@@ -336,10 +336,10 @@ public class ABC {
}
}
public ABC(InputStream is, SWF swf, ABCContainerTag tag) throws IOException {
public ABC(SWFInputStream is, SWF swf, ABCContainerTag tag) throws IOException {
this.swf = swf;
this.parentTag = tag;
ABCInputStream ais = new ABCInputStream(is);
ABCInputStream ais = new ABCInputStream(is.getBaseStream());
minor_version = ais.readU16();
major_version = ais.readU16();
logger.log(Level.FINE, "ABC minor_version: {0}, major_version: {1}", new Object[]{minor_version, major_version});

View File

@@ -77,7 +77,7 @@ public class ActionPush extends Action {
super(0x96, actionLength);
int type;
values = new ArrayList<>();
sis = new SWFInputStream(sis.swf, sis.readBytesEx(actionLength));
sis = new SWFInputStream(sis.getSwf(), sis.readBytesEx(actionLength));
try {
while (sis.available() > 0) {
type = sis.readUI8();

View File

@@ -90,6 +90,10 @@ public class Configuration {
@ConfigurationCategory("display")
public static final ConfigurationItem<Boolean> internalFlashViewer = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("display")
public static final ConfigurationItem<Boolean> dumpView = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("ui")
public static final ConfigurationItem<Boolean> gotoMainClassOnStartup = null;

View File

@@ -16,6 +16,9 @@
*/
package com.jpexs.decompiler.flash.dumpview;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author JPEXS
@@ -23,28 +26,45 @@ package com.jpexs.decompiler.flash.dumpview;
public class DumpInfo {
public String name;
public String type;
public Object previewValue;
public int startByte;
public long startByte;
public int startBit;
public int lengthBytes;
public long lengthBytes;
public int lengthBits;
public DumpInfo(int startByte, int lengthBytes) {
public DumpInfo parent;
public List<DumpInfo> childInfos = new ArrayList<>();
public DumpInfo(String name, String type, Object value, long startByte, int lengthBytes) {
this.name = name;
this.type = type;
this.previewValue = value;
this.startByte = startByte;
this.lengthBytes = lengthBytes;
}
public DumpInfo(int startByte, int startBit, int lengthBytes, int lengthBits) {
public DumpInfo(String name, String type, Object value, long startByte, int startBit, long lengthBytes, int lengthBits) {
this.name = name;
this.type = type;
this.previewValue = value;
this.startByte = startByte;
this.lengthBytes = lengthBytes;
this.startBit = startBit;
this.lengthBits = lengthBits;
}
@Override
public String toString() {
String value = previewValue == null ? "" : previewValue.toString();
return name + "(" + type + ")" + (value.isEmpty() ? "" : " = " + value);
}
}

View File

@@ -1,28 +0,0 @@
/*
* 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 java.util.List;
/**
*
* @author JPEXS
*/
public interface Dumpable {
public List<DumpInfo> getNeededCharacters();
}

View File

@@ -1,39 +0,0 @@
/*
* 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;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
/**
*
* @author JPEXS
*/
public class DumpableItem implements TreeItem {
private final SWF swf;
public DumpableItem(SWF swf) {
this.swf = swf;
}
@Override
public SWF getSwf() {
return swf;
}
}

View File

@@ -1,36 +0,0 @@
/*
* 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.treenodes.TreeNode;
/**
*
* @author JPEXS
*/
public class DumpableNode extends TreeNode {
public DumpableNode(DumpableItem item) {
super(item);
}
@Override
public DumpableItem getItem() {
return (DumpableItem) item;
}
}

View File

@@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.exporters;
import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler;
import com.jpexs.decompiler.flash.RetryTask;
import com.jpexs.decompiler.flash.RunnableIOEx;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.exporters.modes.SoundExportMode;
import com.jpexs.decompiler.flash.exporters.settings.SoundExportSettings;
import com.jpexs.decompiler.flash.flv.AUDIODATA;
@@ -139,7 +141,9 @@ public class SoundExporter {
}
}
} else {
fmt.createWav(st.getRawSoundData(), fos);
byte[] soundData = st.getRawSoundData();
SWF swf = ((Tag) st).getSwf();
fmt.createWav(new SWFInputStream(swf, soundData), fos);
}
}

View File

@@ -0,0 +1,75 @@
/*
* 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;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JTree;
import javax.swing.plaf.basic.BasicLabelUI;
import javax.swing.plaf.basic.BasicTreeUI;
import javax.swing.tree.DefaultTreeCellRenderer;
/**
*
* @author JPEXS
*/
public class DumpTree extends JTree {
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;
}
}
DumpTree(DumpTreeModel treeModel) {
super(treeModel);
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);
}
});
}
}

View File

@@ -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;
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) {
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -86,6 +86,7 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
static final String ACTION_GOTO_DOCUMENT_CLASS = "GOTODOCUMENTCLASS";
static final String ACTION_PARALLEL_SPEED_UP = "PARALLELSPEEDUP";
static final String ACTION_INTERNAL_VIEWER_SWITCH = "INTERNALVIEWERSWITCH";
static final String ACTION_DUMP_VIEW_SWITCH = "DUMPVIEWSWITCH";
static final String ACTION_SEARCH = "SEARCH";
static final String ACTION_TIMELINE = "TIMELINE";
static final String ACTION_AUTO_DEOBFUSCATE = "AUTODEOBFUSCATE";
@@ -122,6 +123,7 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
private JCheckBox miAutoDeobfuscation;
private JCheckBox miInternalViewer;
private JCheckBox miDumpView;
private JCheckBox miParallelSpeedUp;
private JCheckBox miAssociate;
private JCheckBox miDecompile;
@@ -425,6 +427,11 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
miAutoRenameIdentifiers.setActionCommand(ACTION_AUTO_RENAME_IDENTIFIERS);
miAutoRenameIdentifiers.addActionListener(this);
miDumpView = new JCheckBox(translate("menu.settings.dumpView"));
miDumpView.setSelected(Configuration.dumpView.get());
miDumpView.setActionCommand(ACTION_DUMP_VIEW_SWITCH);
miDumpView.addActionListener(this);
settingsBand.addRibbonComponent(new JRibbonComponent(miAutoDeobfuscation));
settingsBand.addRibbonComponent(new JRibbonComponent(miInternalViewer));
settingsBand.addRibbonComponent(new JRibbonComponent(miParallelSpeedUp));
@@ -435,6 +442,7 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
settingsBand.addRibbonComponent(new JRibbonComponent(miCacheDisk));
settingsBand.addRibbonComponent(new JRibbonComponent(miGotoMainClassOnStartup));
settingsBand.addRibbonComponent(new JRibbonComponent(miAutoRenameIdentifiers));
settingsBand.addRibbonComponent(new JRibbonComponent(miDumpView));
JRibbonBand languageBand = new JRibbonBand(translate("menu.language"), null);
List<RibbonBandResizePolicy> languageBandResizePolicies = getIconBandResizePolicies(languageBand);
@@ -610,6 +618,10 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener {
Configuration.internalFlashViewer.set(miInternalViewer.isSelected());
mainFrame.panel.reload(true);
break;
case ACTION_DUMP_VIEW_SWITCH:
Configuration.internalFlashViewer.set(miDumpView.isSelected());
mainFrame.panel.showDumpView(miDumpView.isSelected());
break;
case ACTION_SEARCH:
mainFrame.panel.searchAs();
break;

View File

@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.ScriptPack;
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.dumpview.DumpInfo;
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
import com.jpexs.decompiler.flash.exporters.FontExporter;
import com.jpexs.decompiler.flash.exporters.ImageExporter;
@@ -221,14 +222,18 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
private final JProgressBar progressBar = new JProgressBar(0, 100);
private DeobfuscationDialog deobfuscationDialog;
public TagTree tagTree;
public DumpTree dumpTree;
private final FlashPlayerPanel flashPanel;
private final JPanel contentPanel;
private final JPanel displayPanel;
private JPanel folderPreviewPanel;
private JPanel dumpViewPanel;
private JLabel dumpViewLabel; // very very simple dump view, todo: hexview with virtual scrolling
private boolean isWelcomeScreen = true;
private static final String CARDPREVIEWPANEL = "Preview card";
private static final String CARDFOLDERPREVIEWPANEL = "Folder preview card";
private static final String CARDEMPTYPANEL = "Empty card";
private static final String CARDDUMPVIEW = "Dump view";
private static final String CARDACTIONSCRIPTPANEL = "ActionScript card";
private static final String CARDACTIONSCRIPT3PANEL = "ActionScript3 card";
private static final String DETAILCARDAS3NAVIGATOR = "Traits list";
@@ -242,6 +247,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
private JTextField filterField = new MyTextField("");
private JPanel searchPanel;
private PreviewPanel previewPanel;
private JPanel treePanel;
private AbortRetryIgnoreHandler errorHandler = new GuiAbortRetryIgnoreHandler();
private CancellableWorker setSourceWorker;
public TreeNode oldNode;
@@ -494,6 +500,16 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
return folderPreviewCard;
}
private JPanel createDumpPreviewCard() {
JPanel dumpViewCard = new JPanel(new BorderLayout());
dumpViewPanel = new JPanel(new WrapLayout(FlowLayout.LEFT));
dumpViewLabel = new JLabel();
dumpViewPanel.add(dumpViewLabel);
dumpViewCard.add(new JScrollPane(dumpViewPanel), BorderLayout.CENTER);
return dumpViewCard;
}
public String translate(String key) {
return mainFrame.translate(key);
}
@@ -603,6 +619,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
createContextMenu();
dumpTree = new DumpTree((DumpTreeModel) null);
dumpTree.addTreeSelectionListener(this);
statusPanel = new MainFrameStatusPanel(this);
add(statusPanel, BorderLayout.SOUTH);
@@ -611,6 +630,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
previewPanel = new PreviewPanel(this, flashPanel);
displayPanel.add(previewPanel, CARDPREVIEWPANEL);
displayPanel.add(createFolderPreviewCard(), CARDFOLDERPREVIEWPANEL);
displayPanel.add(createDumpPreviewCard(), CARDDUMPVIEW);
displayPanel.add(new JPanel(), CARDEMPTYPANEL);
showCard(CARDEMPTYPANEL);
@@ -629,9 +649,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
}
});
searchPanel.add(closeSearchButton, BorderLayout.EAST);
JPanel pan1 = new JPanel(new BorderLayout());
pan1.add(new JScrollPane(tagTree), BorderLayout.CENTER);
pan1.add(searchPanel, BorderLayout.SOUTH);
treePanel = new JPanel(new BorderLayout());
showDumpView(Configuration.dumpView.get());
treePanel.add(searchPanel, BorderLayout.SOUTH);
filterField.addActionListener(this);
@@ -659,7 +679,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
});
//displayPanel.setBorder(BorderFactory.createLineBorder(Color.black));
splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, pan1, detailPanel);
splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, treePanel, detailPanel);
splitPane1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, splitPane2, displayPanel);
welcomePanel = createWelcomePanel();
@@ -719,6 +739,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
swf.isAS3 = hasAbc;
tagTree.setModel(new TagTreeModel(mainFrame, swfs));
dumpTree.setModel(new DumpTreeModel(swfs));
if (hasAbc) {
if (abcPanel == null) {
@@ -2363,8 +2384,25 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
cl.show(displayPanel, card);
}
private void dumpTreeValueChanged(TreeSelectionEvent e) {
showCard(CARDDUMPVIEW);
DumpInfo dumpInfo = (DumpInfo) e.getPath().getLastPathComponent();
if (dumpInfo.lengthBytes != 0 || dumpInfo.lengthBits != 0) {
// todo
dumpViewLabel.setText("startByte: " + dumpInfo.startByte +
" startBit: " + dumpInfo.startBit +
" lengthBytes: " + dumpInfo.lengthBytes +
" lengthBits: " + dumpInfo.lengthBits);
}
}
@Override
public void valueChanged(TreeSelectionEvent e) {
Object source = e.getSource();
if (source == dumpTree) {
dumpTreeValueChanged(e);
return;
}
TreeNode treeNode = (TreeNode) e.getPath().getLastPathComponent();
TreeItem treeItem = treeNode.getItem();
if (!(treeItem instanceof SWFList)) {
@@ -2404,6 +2442,16 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
return mainMenu.isInternalFlashViewerSelected();
}
public void showDumpView(boolean show) {
treePanel.removeAll();
if (show) {
treePanel.add(new JScrollPane(dumpTree), BorderLayout.CENTER);
} else {
treePanel.add(new JScrollPane(tagTree), BorderLayout.CENTER);
}
treePanel.revalidate();
}
public void reload(boolean forceReload) {
TreeNode treeNode = (TreeNode) tagTree.getLastSelectedPathComponent();
if (treeNode == null) {

View File

@@ -16,7 +16,10 @@
*/
package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.gui.player.MediaDisplay;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.SoundTag;
import com.jpexs.helpers.SoundPlayer;
import java.awt.Color;
@@ -67,7 +70,9 @@ public class SoundTagPlayer implements MediaDisplay {
this.tag = tag;
this.loops = loops;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
tag.getSoundFormat().createWav(tag.getRawSoundData(), baos);
byte[] soundData = tag.getRawSoundData();
SWF swf = ((Tag) tag).getSwf();
tag.getSoundFormat().createWav(new SWFInputStream(swf, soundData), baos);
player = new SoundPlayer(new ByteArrayInputStream(baos.toByteArray()));
}

View File

@@ -486,3 +486,5 @@ abc.action.find-declaration = Find declaration
contextmenu.rawEdit = Raw edit
contextmenu.jumpToCharacter = Jump to character
menu.settings.dumpView = Dump view

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
@@ -88,8 +88,8 @@ public class CSMTextSettingsTag extends Tag {
* @param pos
* @throws IOException
*/
public CSMTextSettingsTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "CSMTextSettings", pos, length);
public CSMTextSettingsTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "CSMTextSettings", pos, length);
textID = sis.readUI16();
useFlashType = (int) sis.readUB(2);
gridFit = (int) sis.readUB(3);

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -61,8 +61,8 @@ public class DebugIDTag extends Tag {
* @param pos
* @throws IOException
*/
public DebugIDTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DebugID", pos, length);
public DebugIDTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DebugID", pos, length);
debugId = sis.readBytesEx(16);
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -58,8 +58,8 @@ public class DefineBinaryDataTag extends CharacterTag {
return baos.toByteArray();
}
public DefineBinaryDataTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBinaryData", pos, length);
public DefineBinaryDataTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBinaryData", pos, length);
tag = sis.readUI16();
reserved = sis.readUI32();
binaryData = sis.readBytesEx(sis.available());

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.AloneTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
@@ -68,8 +68,8 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag {
return null;
}
public DefineBitsJPEG2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBitsJPEG2", pos, length);
public DefineBitsJPEG2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBitsJPEG2", pos, length);
characterID = sis.readUI16();
imageData = sis.readBytesEx(sis.available());
}

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.AloneTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
@@ -107,8 +107,8 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
return null;
}
public DefineBitsJPEG3Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBitsJPEG3", pos, length);
public DefineBitsJPEG3Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBitsJPEG3", pos, length);
characterID = sis.readUI16();
long alphaDataOffset = sis.readUI32();
imageData = sis.readBytesEx(alphaDataOffset);

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.AloneTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
@@ -137,8 +137,8 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
* @param pos
* @throws IOException
*/
public DefineBitsJPEG4Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBitsJPEG4", pos, length);
public DefineBitsJPEG4Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBitsJPEG4", pos, length);
characterID = sis.readUI16();
long alphaDataOffset = sis.readUI32();
deblockParam = sis.readUI16();

View File

@@ -17,7 +17,6 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.AloneTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
@@ -108,8 +107,8 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
setModified(true);
}
public DefineBitsLossless2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBitsLossless2", pos, length);
public DefineBitsLossless2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBitsLossless2", pos, length);
characterID = sis.readUI16();
bitmapFormat = sis.readUI8();
bitmapWidth = sis.readUI16();

View File

@@ -17,7 +17,6 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.AloneTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
@@ -182,8 +181,8 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
decompressed = true;
}
public DefineBitsLosslessTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBitsLossless", pos, length);
public DefineBitsLosslessTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBitsLossless", pos, length);
characterID = sis.readUI16();
bitmapFormat = sis.readUI8();
bitmapWidth = sis.readUI16();

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -54,8 +54,8 @@ public class DefineBitsTag extends ImageTag {
return true;
}
public DefineBitsTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineBits", pos, length);
public DefineBitsTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineBits", pos, length);
characterID = sis.readUI16();
jpegData = sis.readBytesEx(sis.available());
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -101,8 +101,8 @@ public class DefineButton2Tag extends ButtonTag implements Container {
* @param pos
* @throws IOException
*/
public DefineButton2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineButton2", pos, length);
public DefineButton2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineButton2", pos, length);
buttonId = sis.readUI16();
reserved = (int) sis.readUB(7);
trackAsMenu = sis.readUB(1) == 1;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.CXFORM;
@@ -63,8 +63,8 @@ public class DefineButtonCxformTag extends Tag {
* @param pos
* @throws IOException
*/
public DefineButtonCxformTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineButtonCxform", pos, length);
public DefineButtonCxformTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineButtonCxform", pos, length);
buttonId = sis.readUI16();
buttonColorTransform = sis.readCXFORM();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -103,8 +103,8 @@ public class DefineButtonSoundTag extends CharacterIdTag {
* @param pos
* @throws IOException
*/
public DefineButtonSoundTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineButtonSound", pos, length);
public DefineButtonSoundTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineButtonSound", pos, length);
buttonId = sis.readUI16();
buttonSoundChar0 = sis.readUI16();
if (buttonSoundChar0 != 0) {

View File

@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.DisassemblyListener;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.action.Action;
@@ -100,8 +99,8 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
* @param pos
* @throws IOException
*/
public DefineButtonTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineButton", pos, length);
public DefineButtonTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineButton", pos, length);
buttonId = sis.readUI16();
characters = sis.readBUTTONRECORDList(false);
hdrSize = sis.getPos();

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
@@ -699,8 +699,8 @@ public class DefineEditTextTag extends TextTag {
* @param pos
* @throws IOException
*/
public DefineEditTextTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineEditText", pos, length);
public DefineEditTextTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineEditText", pos, length);
characterID = sis.readUI16();
bounds = sis.readRECT();
hasText = sis.readUB(1) == 1;

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -196,8 +196,8 @@ public class DefineFont2Tag extends FontTag {
* @param pos
* @throws IOException
*/
public DefineFont2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFont2", pos, length);
public DefineFont2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFont2", pos, length);
fontId = sis.readUI16();
fontFlagsHasLayout = sis.readUB(1) == 1;
fontFlagsShiftJIS = sis.readUB(1) == 1;

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -110,8 +110,8 @@ public class DefineFont3Tag extends FontTag {
return codeTable.indexOf((int) c);
}
public DefineFont3Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFont3", pos, length);
public DefineFont3Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFont3", pos, length);
fontId = sis.readUI16();
fontFlagsHasLayout = sis.readUB(1) == 1;
fontFlagsShiftJIS = sis.readUB(1) == 1;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -46,8 +46,8 @@ public class DefineFont4Tag extends CharacterTag {
return fontID;
}
public DefineFont4Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFont4", pos, length);
public DefineFont4Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFont4", pos, length);
fontID = sis.readUI16();
reserved = (int) sis.readUB(5);
fontFlagsHasFontData = sis.readUB(1) == 1;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.ZONERECORD;
@@ -42,8 +42,8 @@ public class DefineFontAlignZonesTag extends Tag {
public List<ZONERECORD> zoneTable;
public static final int ID = 73;
public DefineFontAlignZonesTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFontAlignZones", pos, length);
public DefineFontAlignZonesTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFontAlignZones", pos, length);
fontID = sis.readUI16();
CSMTableHint = (int) sis.readUB(2);
reserved = (int) sis.readUB(6);

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.LANGCODE;
@@ -92,8 +92,8 @@ public class DefineFontInfo2Tag extends Tag {
* @param pos
* @throws IOException
*/
public DefineFontInfo2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFontInfo2", pos, length);
public DefineFontInfo2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFontInfo2", pos, length);
fontID = sis.readUI16();
int fontNameLen = sis.readUI8();
if (swf.version >= 6) {

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
@@ -93,8 +93,8 @@ public class DefineFontInfoTag extends Tag {
* @param pos
* @throws IOException
*/
public DefineFontInfoTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFontInfo", pos, length);
public DefineFontInfoTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFontInfo", pos, length);
fontId = sis.readUI16();
int fontNameLen = sis.readUI8();
if (swf.version >= 6) {

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import java.io.IOException;
@@ -29,8 +29,8 @@ public class DefineFontNameTag extends Tag {
public String fontCopyright;
public static final int ID = 88;
public DefineFontNameTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFontName", pos, length);
public DefineFontNameTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFontName", pos, length);
fontId = sis.readUI16();
fontName = sis.readString();
fontCopyright = sis.readString();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -140,8 +140,8 @@ public class DefineFontTag extends FontTag {
* @param pos
* @throws IOException
*/
public DefineFontTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineFont", pos, length);
public DefineFontTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineFont", pos, length);
fontId = sis.readUI16();
int firstOffset = sis.readUI16();
int nGlyphs = firstOffset / 2;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
@@ -152,8 +152,8 @@ public class DefineMorphShape2Tag extends CharacterTag implements MorphShapeTag
* @param pos
* @throws IOException
*/
public DefineMorphShape2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineMorphShape2", pos, length);
public DefineMorphShape2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineMorphShape2", pos, length);
characterId = sis.readUI16();
startBounds = sis.readRECT();
endBounds = sis.readRECT();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
@@ -130,8 +130,8 @@ public class DefineMorphShapeTag extends CharacterTag implements MorphShapeTag {
* @param pos
* @throws IOException
*/
public DefineMorphShapeTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineMorphShape", pos, length);
public DefineMorphShapeTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineMorphShape", pos, length);
characterId = sis.readUI16();
startBounds = sis.readRECT();
endBounds = sis.readRECT();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
@@ -35,8 +35,8 @@ public class DefineScalingGridTag extends Tag {
public RECT splitter;
public static final int ID = 78;
public DefineScalingGridTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineScalingGrid", pos, length);
public DefineScalingGridTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineScalingGrid", pos, length);
characterId = sis.readUI16();
splitter = sis.readRECT();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
@@ -82,8 +82,8 @@ public class DefineSceneAndFrameLabelDataTag extends Tag {
* @param pos
* @throws IOException
*/
public DefineSceneAndFrameLabelDataTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineSceneAndFrameLabelData", pos, length);
public DefineSceneAndFrameLabelDataTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineSceneAndFrameLabelData", pos, length);
int sceneCount = (int) sis.readEncodedU32();
sceneOffsets = new long[sceneCount];
sceneNames = new String[sceneCount];

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
@@ -67,8 +67,8 @@ public class DefineShape2Tag extends ShapeTag {
return shapeBounds;
}
public DefineShape2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineShape2", pos, length);
public DefineShape2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineShape2", pos, length);
shapeId = sis.readUI16();
shapeBounds = sis.readRECT();
shapes = sis.readSHAPEWITHSTYLE(2, false);

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
@@ -67,8 +67,8 @@ public class DefineShape3Tag extends ShapeTag {
return shapeId;
}
public DefineShape3Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineShape3", pos, length);
public DefineShape3Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineShape3", pos, length);
shapeId = sis.readUI16();
shapeBounds = sis.readRECT();
shapes = sis.readSHAPEWITHSTYLE(3, false);

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.RECT;
@@ -75,8 +75,8 @@ public class DefineShape4Tag extends ShapeTag {
return shapeBounds;
}
public DefineShape4Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineShape4", pos, length);
public DefineShape4Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineShape4", pos, length);
shapeId = sis.readUI16();
shapeBounds = sis.readRECT();
edgeBounds = sis.readRECT();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -64,8 +64,8 @@ public class DefineShapeTag extends ShapeTag {
return shapeBounds;
}
public DefineShapeTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineShape", pos, length);
public DefineShapeTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineShape", pos, length);
shapeId = sis.readUI16();
shapeBounds = sis.readRECT();
shapes = sis.readSHAPEWITHSTYLE(1, false);

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.tags.base.SoundTag;
@@ -100,8 +100,8 @@ public class DefineSoundTag extends CharacterTag implements SoundTag {
* @param pos
* @throws IOException
*/
public DefineSoundTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineSound", pos, length);
public DefineSoundTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineSound", pos, length);
soundId = sis.readUI16();
soundFormat = (int) sis.readUB(4);
soundRate = (int) sis.readUB(2);
@@ -235,7 +235,7 @@ public class DefineSoundTag extends CharacterTag implements SoundTag {
}
}
try {
MP3SOUNDDATA snd = new MP3SOUNDDATA(swf, mp3data, true);
MP3SOUNDDATA snd = new MP3SOUNDDATA(new SWFInputStream(swf, mp3data), true);
if (!snd.frames.isEmpty()) {
MP3FRAME fr = snd.frames.get(0);
newSoundRate = fr.getSamplingRate();

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -201,11 +201,11 @@ public class DefineSpriteTag extends CharacterTag implements Container, Drawable
* @throws IOException
* @throws java.lang.InterruptedException
*/
public DefineSpriteTag(SWFLimitedInputStream sis, int level, long pos, int length, boolean parallel, boolean skipUnusualTags) throws IOException, InterruptedException {
super(sis.swf, ID, "DefineSprite", pos, length);
public DefineSpriteTag(SWFInputStream sis, int level, long pos, int length, boolean parallel, boolean skipUnusualTags) throws IOException, InterruptedException {
super(sis.getSwf(), ID, "DefineSprite", pos, length);
spriteId = sis.readUI16();
frameCount = sis.readUI16();
List<Tag> subTags = sis.readTagList(swf, this, level + 1, parallel, skipUnusualTags, true, swf.gfx);
List<Tag> subTags = sis.readTagList(this, level + 1, parallel, skipUnusualTags, true, swf.gfx);
if (subTags.get(subTags.size() - 1).getId() == EndTag.ID) {
hasEndTag = true;
subTags.remove(subTags.size() - 1);

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
@@ -464,8 +464,8 @@ public class DefineText2Tag extends TextTag {
* @param pos
* @throws IOException
*/
public DefineText2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineText2", pos, length);
public DefineText2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineText2", pos, length);
characterID = sis.readUI16();
textBounds = sis.readRECT();
textMatrix = sis.readMatrix();

View File

@@ -18,7 +18,7 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.AppStrings;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
@@ -475,8 +475,8 @@ public class DefineTextTag extends TextTag {
* @param pos
* @throws IOException
*/
public DefineTextTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineText", pos, length);
public DefineTextTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineText", pos, length);
characterID = sis.readUI16();
textBounds = sis.readRECT();
textMatrix = sis.readMatrix();

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
@@ -103,8 +103,8 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag {
* @param pos
* @throws IOException
*/
public DefineVideoStreamTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineVideoStream", pos, length);
public DefineVideoStreamTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineVideoStream", pos, length);
characterID = sis.readUI16();
numFrames = sis.readUI16();
width = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
@@ -70,11 +70,11 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag {
* @param pos
* @throws IOException
*/
public DoABCDefineTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DoABCDefine", pos, length);
public DoABCDefineTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DoABCDefine", pos, length);
flags = sis.readUI32();
name = sis.readString();
abc = new ABC(sis.getBaseStream(), swf, this);
abc = new ABC(sis, swf, this);
}
/**

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
@@ -57,9 +57,9 @@ public class DoABCTag extends Tag implements ABCContainerTag {
* @param pos
* @throws IOException
*/
public DoABCTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DoABC", pos, length);
abc = new ABC(sis.getBaseStream(), swf, this);
public DoABCTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DoABC", pos, length);
abc = new ABC(sis, swf, this);
}
/**

View File

@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.DisassemblyListener;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionListReader;
import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode;
@@ -55,8 +54,8 @@ public class DoActionTag extends Tag implements ASMSource {
* @param pos
* @throws java.io.IOException
*/
public DoActionTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DoAction", pos, length);
public DoActionTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DoAction", pos, length);
//do not load actionBytes. Disassebler will use the original SWF stream in this case
//actionBytes = sis.readBytesEx(sis.available());
}

View File

@@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.DisassemblyListener;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.action.ActionListReader;
@@ -60,8 +59,8 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
* @param pos
* @throws IOException
*/
public DoInitActionTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DoInitAction", pos, length);
public DoInitActionTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DoInitAction", pos, length);
spriteId = sis.readUI16();
//actions = sis.readActionList();
actionBytes = sis.readBytesEx(sis.available());

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
@@ -68,8 +68,8 @@ public class EnableDebugger2Tag extends Tag {
* @param pos
* @throws IOException
*/
public EnableDebugger2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "EnableDebugger2", pos, length);
public EnableDebugger2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "EnableDebugger2", pos, length);
reserved = sis.readUI16();
passwordHash = sis.readString();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -62,8 +62,8 @@ public class EnableDebuggerTag extends Tag {
* @param pos
* @throws IOException
*/
public EnableDebuggerTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "EnableDebugger", pos, length);
public EnableDebuggerTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "EnableDebugger", pos, length);
passwordHash = sis.readString();
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.Optional;
@@ -71,8 +71,8 @@ public class EnableTelemetryTag extends Tag {
* @param pos
* @throws IOException
*/
public EnableTelemetryTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "", pos, length);
public EnableTelemetryTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "", pos, length);
reserved = (int) sis.readUB(16);
if (sis.available() > 0) {
passwordHash = sis.readBytesEx(32);

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
@@ -60,8 +60,8 @@ public class ExportAssetsTag extends Tag {
* @param pos
* @throws IOException
*/
public ExportAssetsTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "ExportAssets", pos, length);
public ExportAssetsTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "ExportAssets", pos, length);
int count = sis.readUI16();
tags = new ArrayList<>();
names = new ArrayList<>();

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
@@ -48,8 +48,8 @@ public class FileAttributesTag extends Tag {
super(swf, ID, "FileAttributes", 0, 0);
}
public FileAttributesTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "FileAttributes", pos, length);
public FileAttributesTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "FileAttributes", pos, length);
reserved1 = sis.readUB(1) == 1; // reserved
// UB[1] == 0 (reserved)
useDirectBlit = sis.readUB(1) != 0;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -36,8 +36,8 @@ public class FrameLabelTag extends Tag {
return namedAnchor;
}
public FrameLabelTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "FrameLabel", pos, length);
public FrameLabelTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "FrameLabel", pos, length);
name = sis.readString();
if (sis.available() > 0) {
if (sis.readUI8() == 1) {

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.ImportTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -63,8 +63,8 @@ public class ImportAssets2Tag extends Tag implements ImportTag {
* @param pos
* @throws IOException
*/
public ImportAssets2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "ImportAssets2", pos, length);
public ImportAssets2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "ImportAssets2", pos, length);
tags = new ArrayList<>();
names = new ArrayList<>();
url = sis.readString();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.ImportTag;
import com.jpexs.decompiler.flash.types.BasicType;
@@ -56,8 +56,8 @@ public class ImportAssetsTag extends Tag implements ImportTag {
* @param pos
* @throws IOException
*/
public ImportAssetsTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "ImportAssets", pos, length);
public ImportAssetsTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "ImportAssets", pos, length);
tags = new ArrayList<>();
names = new ArrayList<>();
url = sis.readString();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import java.io.IOException;
@@ -26,8 +26,8 @@ public class JPEGTablesTag extends Tag {
@Internal
public byte[] jpegData;
public JPEGTablesTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "JPEGTables", pos, length);
public JPEGTablesTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "JPEGTables", pos, length);
jpegData = sis.readBytesEx(sis.available());
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.annotations.Multiline;
import java.io.ByteArrayOutputStream;
@@ -29,8 +29,8 @@ public class MetadataTag extends Tag {
public String xmlMetadata;
public static final int ID = 77;
public MetadataTag(SWFLimitedInputStream sis, long pos, int length) {
super(sis.swf, ID, "Metadata", pos, length);
public MetadataTag(SWFInputStream sis, long pos, int length) {
super(sis.getSwf(), ID, "Metadata", pos, length);
try {
xmlMetadata = sis.readString();
} catch (IOException ex) {

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -218,8 +218,8 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO
* @param pos
* @throws IOException
*/
public PlaceObject2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "PlaceObject2", pos, length);
public PlaceObject2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "PlaceObject2", pos, length);
placeFlagHasClipActions = sis.readUB(1) == 1;
placeFlagHasClipDepth = sis.readUB(1) == 1;
placeFlagHasName = sis.readUB(1) == 1;

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.EndOfStreamException;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -302,8 +302,8 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO
* @param pos
* @throws IOException
*/
public PlaceObject3Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "PlaceObject3", pos, length);
public PlaceObject3Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "PlaceObject3", pos, length);
placeFlagHasClipActions = sis.readUB(1) == 1;
placeFlagHasClipDepth = sis.readUB(1) == 1;
placeFlagHasName = sis.readUB(1) == 1;

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.EndOfStreamException;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.abc.CopyOutputStream;
import com.jpexs.decompiler.flash.configuration.Configuration;
@@ -303,8 +303,8 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO
* @param pos
* @throws IOException
*/
public PlaceObject4Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "PlaceObject4", pos, length);
public PlaceObject4Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "PlaceObject4", pos, length);
placeFlagHasClipActions = sis.readUB(1) == 1;
placeFlagHasClipDepth = sis.readUB(1) == 1;
placeFlagHasName = sis.readUB(1) == 1;

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag;
@@ -104,8 +104,8 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag
* @param pos
* @throws IOException
*/
public PlaceObjectTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "PlaceObject", pos, length);
public PlaceObjectTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "PlaceObject", pos, length);
characterId = sis.readUI16();
depth = sis.readUI16();
matrix = sis.readMatrix();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -44,8 +44,8 @@ public class ProductInfoTag extends Tag {
public long compilationDateHigh;
public static final int ID = 41;
public ProductInfoTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "ProductInfo", pos, length);
public ProductInfoTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "ProductInfo", pos, length);
/*
* 0: Unknown
* 1: Macromedia Flex for J2EE

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -62,8 +62,8 @@ public class ProtectTag extends Tag {
* @param pos
* @throws IOException
*/
public ProtectTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "Protect", pos, length);
public ProtectTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "Protect", pos, length);
if (sis.available() > 0) {
passwordHash = sis.readString();
} else {

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -28,8 +28,8 @@ public class RemoveObject2Tag extends Tag implements RemoveTag {
public int depth;
public static final int ID = 28;
public RemoveObject2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "RemoveObject2", pos, length);
public RemoveObject2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "RemoveObject2", pos, length);
depth = sis.readUI16();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
@@ -71,8 +71,8 @@ public class RemoveObjectTag extends CharacterIdTag implements RemoveTag {
* @param pos
* @throws IOException
*/
public RemoveObjectTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "RemoveObject", pos, length);
public RemoveObjectTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "RemoveObject", pos, length);
characterId = sis.readUI16();
depth = sis.readUI16();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -34,8 +34,8 @@ public class ScriptLimitsTag extends Tag {
public static final int ID = 65;
public ScriptLimitsTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "ScriptLimits", pos, length);
public ScriptLimitsTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "ScriptLimits", pos, length);
maxRecursionDepth = sis.readUI16();
scriptTimeoutSeconds = sis.readUI16();
}

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.RGB;
import java.io.ByteArrayOutputStream;
@@ -28,8 +28,8 @@ public class SetBackgroundColorTag extends Tag {
public RGB backgroundColor;
public static final int ID = 9;
public SetBackgroundColorTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "SetBackgroundColor", pos, length);
public SetBackgroundColorTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "SetBackgroundColor", pos, length);
backgroundColor = sis.readRGB();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -69,8 +69,8 @@ public class SetTabIndexTag extends Tag {
* @param pos
* @throws IOException
*/
public SetTabIndexTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "SetTabIndex", pos, length);
public SetTabIndexTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "SetTabIndex", pos, length);
depth = sis.readUI16();
tabIndex = sis.readUI16();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import java.io.IOException;
@@ -40,8 +40,8 @@ public class SoundStreamBlockTag extends Tag {
* @param pos
* @throws IOException
*/
public SoundStreamBlockTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "SoundStreamBlock", pos, length);
public SoundStreamBlockTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "SoundStreamBlock", pos, length);
//all data is streamSoundData
streamSoundData = sis.readBytesEx(sis.available());
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
@@ -141,8 +141,8 @@ public class SoundStreamHead2Tag extends CharacterIdTag implements SoundStreamHe
* @param pos
* @throws IOException
*/
public SoundStreamHead2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "SoundStreamHead2", pos, length);
public SoundStreamHead2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "SoundStreamHead2", pos, length);
reserved = (int) sis.readUB(4);
playBackSoundRate = (int) sis.readUB(2);
playBackSoundSize = sis.readUB(1) == 1;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
import com.jpexs.decompiler.flash.tags.base.Container;
@@ -134,8 +134,8 @@ public class SoundStreamHeadTag extends CharacterIdTag implements SoundStreamHea
* @param pos
* @throws IOException
*/
public SoundStreamHeadTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "SoundStreamHead", pos, length);
public SoundStreamHeadTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "SoundStreamHead", pos, length);
reserved = (int) sis.readUB(4);
playBackSoundRate = (int) sis.readUB(2);
playBackSoundSize = sis.readUB(1) == 1;

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.SOUNDINFO;
import java.io.ByteArrayOutputStream;
@@ -59,8 +59,8 @@ public class StartSound2Tag extends Tag {
* @param pos
* @throws IOException
*/
public StartSound2Tag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "StartSound2", pos, length);
public StartSound2Tag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "StartSound2", pos, length);
soundClassName = sis.readString();
soundInfo = sis.readSOUNDINFO();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.SOUNDINFO;
@@ -63,8 +63,8 @@ public class StartSoundTag extends Tag {
* @param pos
* @throws IOException
*/
public StartSoundTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "StartSound", pos, length);
public StartSoundTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "StartSound", pos, length);
soundId = sis.readUI16();
soundInfo = sis.readSOUNDINFO();
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
@@ -34,8 +34,8 @@ public class SymbolClassTag extends Tag {
public String[] names;
public static final int ID = 76;
public SymbolClassTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "SymbolClass", pos, length);
public SymbolClassTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "SymbolClass", pos, length);
int numSymbols = sis.readUI16();
tags = new int[numSymbols];
names = new String[numSymbols];

View File

@@ -44,7 +44,7 @@ import java.util.Set;
/**
* Represents Tag inside SWF file
*/
public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializable {
public abstract class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializable {
/**
* Identifier of tag type
@@ -213,7 +213,6 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializ
StartSound2Tag.ID,
StartSoundTag.ID,
SymbolClassTag.ID,
TagStub.ID,
VideoFrameTag.ID,
DefineCompactedFont.ID,
DefineExternalGradient.ID,
@@ -339,8 +338,6 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializ
} else {
sos.write(swf.uncompressedData, (int) pos, length);
}
//todo: honfika: update pos and length during save
}
/**

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWF;
import java.io.IOException;
import com.jpexs.decompiler.flash.SWFInputStream;
/**
*
@@ -26,28 +26,24 @@ import java.io.IOException;
*/
public class TagStub extends Tag {
public static final int ID = -1; //TODO: Enter correct ID
/**
* Gets data bytes
*
* @return Bytes of data
*/
@Override
public byte[] getData() {
return getOriginalData();
}
private SWFInputStream dataStream;
/**
* Constructor
*
* @param swf
* @param id
* @param length
* @param name
* @param pos
* @throws IOException
* @param sis
*/
public TagStub(SWF swf, long pos, int length) throws IOException {
super(swf, ID, "" /*TODO:Insert name here*/, pos, length);
public TagStub(SWF swf, int id, String name, long pos, int length, SWFInputStream sis) {
super(swf, id, name, pos, length);
dataStream = sis;
}
public SWFInputStream getDataStream() {
return dataStream;
}
}

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.types.BasicType;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
@@ -65,8 +65,8 @@ public class VideoFrameTag extends Tag {
* @param pos
* @throws IOException
*/
public VideoFrameTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "VideoFrame", pos, length);
public VideoFrameTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "VideoFrame", pos, length);
streamID = sis.readUI16();
frameNum = sis.readUI16();
videoData = sis.readBytesEx(sis.available()); //TODO: Parse video packets

View File

@@ -17,7 +17,7 @@
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.DefineFont2Tag;
import com.jpexs.decompiler.flash.tags.Tag;
@@ -88,8 +88,8 @@ public final class DefineCompactedFont extends FontTag implements DrawableTag {
* @param pos
* @throws IOException
*/
public DefineCompactedFont(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineCompactedFont", pos, length);
public DefineCompactedFont(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineCompactedFont", pos, length);
fontId = sis.readUI16();
fonts = new ArrayList<>();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -69,8 +69,8 @@ public class DefineExternalGradient extends Tag {
* @param pos
* @throws IOException
*/
public DefineExternalGradient(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineExternalGradient", pos, length);
public DefineExternalGradient(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineExternalGradient", pos, length);
gradientId = sis.readUI16();
bitmapsFormat = sis.readUI16();
gradientSize = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -71,8 +71,8 @@ public class DefineExternalImage extends Tag {
* @param pos
* @throws IOException
*/
public DefineExternalImage(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineExternalImage", pos, length);
public DefineExternalImage(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineExternalImage", pos, length);
characterId = sis.readUI16();
bitmapFormat = sis.readUI16();
targetWidth = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -79,8 +79,8 @@ public class DefineExternalImage2 extends Tag {
* @param pos
* @throws IOException
*/
public DefineExternalImage2(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineExternalImage2", pos, length);
public DefineExternalImage2(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineExternalImage2", pos, length);
characterId = sis.readUI32();
bitmapFormat = sis.readUI16();
targetWidth = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -79,8 +79,8 @@ public class DefineExternalSound extends Tag {
* @param pos
* @throws IOException
*/
public DefineExternalSound(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineExternalSound", pos, length);
public DefineExternalSound(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineExternalSound", pos, length);
characterId = sis.readUI16();
soundFormat = sis.readUI16();
bits = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -77,8 +77,8 @@ public class DefineExternalStreamSound extends Tag {
* @param pos
* @throws IOException
*/
public DefineExternalStreamSound(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineExternalStreamSound", pos, length);
public DefineExternalStreamSound(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineExternalStreamSound", pos, length);
soundFormat = sis.readUI16();
bits = sis.readUI16();
channels = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -61,8 +61,8 @@ public class DefineGradientMap extends Tag {
* @param pos
* @throws IOException
*/
public DefineGradientMap(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineGradientMap", pos, length);
public DefineGradientMap(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineGradientMap", pos, length);
int numGradients = sis.readUI16();
indices = new int[numGradients];
for (int i = 0; i < numGradients; i++) {

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -68,8 +68,8 @@ public class DefineSubImage extends Tag {
* @param pos
* @throws IOException
*/
public DefineSubImage(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "DefineSubImage", pos, length);
public DefineSubImage(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "DefineSubImage", pos, length);
characterId = sis.readUI16();
imageCharacterId = sis.readUI16();
x1 = sis.readUI16();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import java.io.ByteArrayOutputStream;
@@ -87,8 +87,8 @@ public class ExporterInfoTag extends Tag {
* @param pos
* @throws IOException
*/
public ExporterInfoTag(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "ExporterInfo", pos, length);
public ExporterInfoTag(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "ExporterInfo", pos, length);
this.version = sis.readUI16();
if (this.version >= 0x10a) {
flags = sis.readUI32();

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.tags.gfx;
import com.jpexs.decompiler.flash.SWFLimitedInputStream;
import com.jpexs.decompiler.flash.SWFInputStream;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.types.gfx.FONTINFO;
@@ -89,8 +89,8 @@ public class FontTextureInfo extends Tag {
* @param pos
* @throws IOException
*/
public FontTextureInfo(SWFLimitedInputStream sis, long pos, int length) throws IOException {
super(sis.swf, ID, "FontTextureInfo", pos, length);
public FontTextureInfo(SWFInputStream sis, long pos, int length) throws IOException {
super(sis.getSwf(), ID, "FontTextureInfo", pos, length);
textureID = sis.readUI32();
textureFormat = sis.readUI16();
int fileNameLen = sis.readUI8();

View File

@@ -200,7 +200,7 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem, S
@Override
public List<Action> getActions() throws InterruptedException {
try {
List<Action> list = ActionListReader.readActionListTimeout(listeners, getPos() + hdrPos, new SWFInputStream(swf, actionBytes, 0), swf.version, 0, -1, toString()/*FIXME?*/);
List<Action> list = ActionListReader.readActionListTimeout(listeners, getPos() + hdrPos, new SWFInputStream(swf, actionBytes), swf.version, 0, -1, toString()/*FIXME?*/);
return list;
} catch (InterruptedException ex) {
throw ex;

Some files were not shown because too many files have changed in this diff Show More