mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 16:30:47 +00:00
array definitions was inconsistent, now everywhere "Type[] variableName", using StringBuilder => little bit faster, test fixed (missing parameters)
This commit is contained in:
@@ -183,7 +183,7 @@ public class SWF {
|
||||
/**
|
||||
* LZMA Properties
|
||||
*/
|
||||
public byte lzmaProperties[];
|
||||
public byte[] lzmaProperties;
|
||||
public FileAttributesTag fileAttributes;
|
||||
|
||||
/**
|
||||
@@ -230,7 +230,7 @@ public class SWF {
|
||||
os.write('W');
|
||||
os.write('S');
|
||||
os.write(version);
|
||||
byte data[] = baos.toByteArray();
|
||||
byte[] data = baos.toByteArray();
|
||||
sos = new SWFOutputStream(os, version);
|
||||
sos.writeUI32(data.length + 8);
|
||||
|
||||
@@ -252,7 +252,7 @@ public class SWF {
|
||||
enc.SetEndMarkerMode(true);
|
||||
enc.Code(new ByteArrayInputStream(data), baos, -1, -1, null);
|
||||
data = baos.toByteArray();
|
||||
byte udata[] = new byte[4];
|
||||
byte[] udata = new byte[4];
|
||||
udata[0] = (byte) (data.length & 0xFF);
|
||||
udata[1] = (byte) ((data.length >> 8) & 0xFF);
|
||||
udata[2] = (byte) ((data.length >> 16) & 0xFF);
|
||||
@@ -297,7 +297,7 @@ public class SWF {
|
||||
* @throws IOException
|
||||
*/
|
||||
public SWF(InputStream is, ProgressListener listener, boolean parallelRead, boolean checkOnly) throws IOException {
|
||||
byte hdr[] = new byte[3];
|
||||
byte[] hdr = new byte[3];
|
||||
is.read(hdr);
|
||||
String shdr = new String(hdr, "utf-8");
|
||||
if ((!shdr.equals("FWS")) && (!shdr.equals("CWS")) && (!shdr.equals("ZWS"))) {
|
||||
@@ -424,7 +424,7 @@ public class SWF {
|
||||
*/
|
||||
public static boolean fws2cws(InputStream fis, OutputStream fos) {
|
||||
try {
|
||||
byte swfHead[] = new byte[8];
|
||||
byte[] swfHead = new byte[8];
|
||||
fis.read(swfHead);
|
||||
|
||||
if (swfHead[0] != 'F') {
|
||||
@@ -451,7 +451,7 @@ public class SWF {
|
||||
|
||||
public static boolean decompress(InputStream fis, OutputStream fos) {
|
||||
try {
|
||||
byte hdr[] = new byte[3];
|
||||
byte[] hdr = new byte[3];
|
||||
fis.read(hdr);
|
||||
String shdr = new String(hdr, "utf-8");
|
||||
if (shdr.equals("CWS")) {
|
||||
@@ -478,7 +478,7 @@ public class SWF {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
sis.readUI32(); //outSize
|
||||
int propertiesSize = 5;
|
||||
byte lzmaProperties[] = new byte[propertiesSize];
|
||||
byte[] lzmaProperties = new byte[propertiesSize];
|
||||
if (sis.read(lzmaProperties, 0, propertiesSize) != propertiesSize) {
|
||||
throw new IOException("LZMA:input .lzma file is too short");
|
||||
}
|
||||
@@ -737,7 +737,7 @@ public class SWF {
|
||||
if (path == null) {
|
||||
path = "";
|
||||
}
|
||||
String pathParts[];
|
||||
String[] pathParts;
|
||||
if (path.contains(".")) {
|
||||
pathParts = path.split("\\.");
|
||||
} else {
|
||||
@@ -856,7 +856,7 @@ public class SWF {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasErrorHeader(byte data[]) {
|
||||
public static boolean hasErrorHeader(byte[] data) {
|
||||
if (data.length > 4) {
|
||||
if ((data[0] & 0xff) == 0xff) {
|
||||
if ((data[1] & 0xff) == 0xd9) {
|
||||
@@ -939,7 +939,7 @@ public class SWF {
|
||||
if ((shead.getSoundFormat() == DefineSoundTag.FORMAT_ADPCM) && wave) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
for (int b = 0; b < blocks.size(); b++) {
|
||||
byte data[] = blocks.get(b).getData(SWF.DEFAULT_VERSION);
|
||||
byte[] data = blocks.get(b).getData(SWF.DEFAULT_VERSION);
|
||||
baos.write(data);
|
||||
}
|
||||
fos = new ByteArrayOutputStream();
|
||||
@@ -947,7 +947,7 @@ public class SWF {
|
||||
} else if ((shead.getSoundFormat() == DefineSoundTag.FORMAT_MP3) && mp3) {
|
||||
fos = new ByteArrayOutputStream();
|
||||
for (int b = 0; b < blocks.size(); b++) {
|
||||
byte data[] = blocks.get(b).getData(SWF.DEFAULT_VERSION);
|
||||
byte[] data = blocks.get(b).getData(SWF.DEFAULT_VERSION);
|
||||
fos.write(data, 4, data.length - 4);
|
||||
}
|
||||
} else {
|
||||
@@ -957,7 +957,7 @@ public class SWF {
|
||||
|
||||
int ms = (int) (1000.0f / ((float) frameRate));
|
||||
for (int b = 0; b < blocks.size(); b++) {
|
||||
byte data[] = blocks.get(b).getData(SWF.DEFAULT_VERSION);
|
||||
byte[] data = blocks.get(b).getData(SWF.DEFAULT_VERSION);
|
||||
if (shead.getSoundFormat() == 2) { //MP3
|
||||
data = Arrays.copyOfRange(data, 4, data.length);
|
||||
}
|
||||
@@ -975,16 +975,16 @@ public class SWF {
|
||||
}
|
||||
}
|
||||
|
||||
private static void createWavFromAdpcm(OutputStream fos, int soundRate, int soundSize, int soundType, byte data[]) throws IOException {
|
||||
private static void createWavFromAdpcm(OutputStream fos, int soundRate, int soundSize, int soundType, byte[] data) throws IOException {
|
||||
try {
|
||||
byte pcmData[] = AdpcmDecoder.decode(data, soundType == 1 ? true : false);
|
||||
byte[] pcmData = AdpcmDecoder.decode(data, soundType == 1 ? true : false);
|
||||
|
||||
ByteArrayOutputStream subChunk1Data = new ByteArrayOutputStream();
|
||||
int audioFormat = 1; //PCM
|
||||
writeLE(subChunk1Data, audioFormat, 2);
|
||||
int numChannels = soundType == 1 ? 2 : 1;
|
||||
writeLE(subChunk1Data, numChannels, 2);
|
||||
int rateMap[] = {5512, 11025, 22050, 44100};
|
||||
int[] rateMap = {5512, 11025, 22050, 44100};
|
||||
int sampleRate = rateMap[soundRate];
|
||||
writeLE(subChunk1Data, sampleRate, 4);
|
||||
int bitsPerSample = soundSize == 1 ? 16 : 8;
|
||||
@@ -996,7 +996,7 @@ public class SWF {
|
||||
|
||||
ByteArrayOutputStream chunks = new ByteArrayOutputStream();
|
||||
chunks.write("fmt ".getBytes("utf-8"));
|
||||
byte subChunk1DataBytes[] = subChunk1Data.toByteArray();
|
||||
byte[] subChunk1DataBytes = subChunk1Data.toByteArray();
|
||||
writeLE(chunks, subChunk1DataBytes.length, 4);
|
||||
chunks.write(subChunk1DataBytes);
|
||||
|
||||
@@ -1006,7 +1006,7 @@ public class SWF {
|
||||
chunks.write(pcmData);
|
||||
|
||||
fos.write("RIFF".getBytes("utf-8"));
|
||||
byte chunkBytes[] = chunks.toByteArray();
|
||||
byte[] chunkBytes = chunks.toByteArray();
|
||||
writeLE(fos, 4 + chunkBytes.length, 4);
|
||||
fos.write("WAVE".getBytes("utf-8"));
|
||||
fos.write(chunkBytes);
|
||||
@@ -1773,7 +1773,7 @@ public class SWF {
|
||||
if (deobfuscated.containsKey(pkg)) {
|
||||
return deobfuscated.get(pkg);
|
||||
}
|
||||
String parts[] = null;
|
||||
String[] parts = null;
|
||||
if (pkg.contains(".")) {
|
||||
parts = pkg.split("\\.");
|
||||
} else {
|
||||
@@ -1919,7 +1919,7 @@ public class SWF {
|
||||
DoInitActionTag dia = (DoInitActionTag) t;
|
||||
String exportName = dia.getExportName();
|
||||
final String pkgPrefix = "__Packages.";
|
||||
String classNameParts[] = null;
|
||||
String[] classNameParts = null;
|
||||
if ((exportName != null) && exportName.startsWith(pkgPrefix)) {
|
||||
String className = exportName.substring(pkgPrefix.length());
|
||||
if (className.contains(".")) {
|
||||
@@ -2132,7 +2132,7 @@ public class SWF {
|
||||
|
||||
private static class CachedImage implements Serializable {
|
||||
|
||||
private int data[];
|
||||
private int[] data;
|
||||
private int width;
|
||||
private int height;
|
||||
private int type;
|
||||
|
||||
@@ -345,7 +345,7 @@ public class SWFInputStream extends InputStream {
|
||||
}
|
||||
|
||||
private long readLong() throws IOException {
|
||||
byte readBuffer[] = readBytes(8);
|
||||
byte[] readBuffer = readBytes(8);
|
||||
return (((long) readBuffer[3] << 56)
|
||||
+ ((long) (readBuffer[2] & 255) << 48)
|
||||
+ ((long) (readBuffer[1] & 255) << 40)
|
||||
@@ -412,7 +412,7 @@ public class SWFInputStream extends InputStream {
|
||||
if (count <= 0) {
|
||||
return new byte[0];
|
||||
}
|
||||
byte ret[] = new byte[(int) count];
|
||||
byte[] ret = new byte[(int) count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
ret[i] = (byte) readEx();
|
||||
}
|
||||
@@ -420,10 +420,10 @@ public class SWFInputStream extends InputStream {
|
||||
}
|
||||
|
||||
public byte[] readBytesZlib(long count) throws IOException {
|
||||
byte data[] = readBytes(count);
|
||||
byte[] data = readBytes(count);
|
||||
InflaterInputStream dis = new InflaterInputStream(new ByteArrayInputStream(data));
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte buf[] = new byte[4096];
|
||||
byte[] buf = new byte[4096];
|
||||
int c = 0;
|
||||
while ((c = dis.read(buf)) > 0) {
|
||||
baos.write(buf, 0, c);
|
||||
@@ -738,7 +738,7 @@ public class SWFInputStream extends InputStream {
|
||||
public static Tag resolveTag(SWF swf, Tag tag, int version, int level, boolean parallel, boolean skipUnusualTags) {
|
||||
Tag ret;
|
||||
|
||||
byte data[] = tag.getData(version);
|
||||
byte[] data = tag.getData(version);
|
||||
long pos = tag.getPos();
|
||||
try {
|
||||
switch (tag.getId()) {
|
||||
@@ -1022,10 +1022,10 @@ public class SWFInputStream extends InputStream {
|
||||
tagLength = readSI32();
|
||||
readLong = true;
|
||||
}
|
||||
byte data[] = readBytes((int) tagLength);
|
||||
byte[] data = readBytes((int) tagLength);
|
||||
Tag ret = new Tag(swf, tagID, "Unknown", data, pos);
|
||||
ret.forceWriteAsLong = readLong;
|
||||
byte dataNew[] = ret.getData(version);
|
||||
byte[] dataNew = ret.getData(version);
|
||||
|
||||
int ignoreFirst = 0;
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
|
||||
@@ -193,7 +193,7 @@ public class SWFOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
private void writeLong(long value) throws IOException {
|
||||
byte writeBuffer[] = new byte[8];
|
||||
byte[] writeBuffer = new byte[8];
|
||||
writeBuffer[3] = (byte) (value >>> 56);
|
||||
writeBuffer[2] = (byte) (value >>> 48);
|
||||
writeBuffer[1] = (byte) (value >>> 40);
|
||||
@@ -371,7 +371,7 @@ public class SWFOutputStream extends OutputStream {
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] getTagHeader(Tag tag, byte data[], int version) {
|
||||
public static byte[] getTagHeader(Tag tag, byte[] data, int version) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try {
|
||||
|
||||
@@ -399,7 +399,7 @@ public class SWFOutputStream extends OutputStream {
|
||||
* @throws IOException
|
||||
*/
|
||||
public void writeTag(Tag tag) throws IOException {
|
||||
byte data[] = tag.getData(version);
|
||||
byte[] data = tag.getData(version);
|
||||
write(getTagHeader(tag, data, version));
|
||||
write(data);
|
||||
}
|
||||
@@ -672,7 +672,7 @@ public class SWFOutputStream extends OutputStream {
|
||||
}
|
||||
sos.write(value.actionBytes);
|
||||
}
|
||||
byte data[] = baos.toByteArray();
|
||||
byte[] data = baos.toByteArray();
|
||||
writeUI32(data.length); //actionRecordSize
|
||||
write(data);
|
||||
}
|
||||
@@ -1014,7 +1014,7 @@ public class SWFOutputStream extends OutputStream {
|
||||
sos.writeUB(1, value.condOverDownToIddle ? 1 : 0);
|
||||
sos.write(value.actionBytes);
|
||||
}
|
||||
byte data[] = baos.toByteArray();
|
||||
byte[] data = baos.toByteArray();
|
||||
if (isLast) {
|
||||
writeUI16(0);
|
||||
} else {
|
||||
@@ -1628,7 +1628,7 @@ public class SWFOutputStream extends OutputStream {
|
||||
writeUI16(value.range);
|
||||
}
|
||||
|
||||
public void writeBytesZlib(byte data[]) throws IOException {
|
||||
public void writeBytesZlib(byte[] data) throws IOException {
|
||||
DeflaterOutputStream deflater = new DeflaterOutputStream(this, new Deflater(9));
|
||||
deflater.write(data);
|
||||
deflater.finish();
|
||||
|
||||
@@ -50,14 +50,14 @@ public class ABC {
|
||||
public int major_version = 0;
|
||||
public int minor_version = 0;
|
||||
public ConstantPool constants;
|
||||
public MethodInfo method_info[];
|
||||
public MetadataInfo metadata_info[];
|
||||
public InstanceInfo instance_info[];
|
||||
public ClassInfo class_info[];
|
||||
public ScriptInfo script_info[];
|
||||
public MethodBody bodies[];
|
||||
private int bodyIdxFromMethodIdx[];
|
||||
public long stringOffsets[];
|
||||
public MethodInfo[] method_info;
|
||||
public MetadataInfo[] metadata_info;
|
||||
public InstanceInfo[] instance_info;
|
||||
public ClassInfo[] class_info;
|
||||
public ScriptInfo[] script_info;
|
||||
public MethodBody[] bodies;
|
||||
private int[] bodyIdxFromMethodIdx;
|
||||
public long[] stringOffsets;
|
||||
public static final String IDENT_STRING = " ";
|
||||
public static final int MINORwithDECIMAL = 17;
|
||||
protected HashSet<EventListener> listeners = new HashSet<>();
|
||||
@@ -375,11 +375,11 @@ public class ABC {
|
||||
for (int i = 0; i < metadata_count; i++) {
|
||||
int name_index = ais.readU30();
|
||||
int values_count = ais.readU30();
|
||||
int keys[] = new int[values_count];
|
||||
int[] keys = new int[values_count];
|
||||
for (int v = 0; v < values_count; v++) {
|
||||
keys[v] = ais.readU30();
|
||||
}
|
||||
int values[] = new int[values_count];
|
||||
int[] values = new int[values_count];
|
||||
for (int v = 0; v < values_count; v++) {
|
||||
values[v] = ais.readU30();
|
||||
}
|
||||
@@ -531,7 +531,7 @@ public class ABC {
|
||||
aos.writeU30(bodies[i].max_regs);
|
||||
aos.writeU30(bodies[i].init_scope_depth);
|
||||
aos.writeU30(bodies[i].max_scope_depth);
|
||||
byte codeBytes[] = bodies[i].code.getBytes();
|
||||
byte[] codeBytes = bodies[i].code.getBytes();
|
||||
aos.writeU30(codeBytes.length);
|
||||
aos.write(codeBytes);
|
||||
aos.writeU30(bodies[i].exceptions.length);
|
||||
@@ -601,7 +601,7 @@ public class ABC {
|
||||
}
|
||||
|
||||
public static String addTabs(String s, int tabs) {
|
||||
String parts[] = s.split("\r\n");
|
||||
String[] parts = s.split("\r\n");
|
||||
if (!s.contains("\r\n")) {
|
||||
parts = s.split("\n");
|
||||
}
|
||||
@@ -899,7 +899,7 @@ public class ABC {
|
||||
if (namesMap.containsKey(s)) {
|
||||
newName = constants.constant_string[strIndex] = namesMap.get(s);
|
||||
} else {
|
||||
String parts[] = null;
|
||||
String[] parts = null;
|
||||
if (s.contains(".")) {
|
||||
parts = s.split("\\.");
|
||||
} else {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ABCInputStream extends InputStream {
|
||||
if (bufferOs == null) {
|
||||
return new byte[0];
|
||||
}
|
||||
byte ret[] = bufferOs.toByteArray();
|
||||
byte[] ret = bufferOs.toByteArray();
|
||||
bufferOs.reset();
|
||||
return ret;
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class ABCInputStream extends InputStream {
|
||||
}
|
||||
|
||||
public final long readLong() throws IOException {
|
||||
byte readBuffer[] = safeRead(8);
|
||||
byte[] readBuffer = safeRead(8);
|
||||
return (((long) readBuffer[7] << 56)
|
||||
+ ((long) (readBuffer[6] & 255) << 48)
|
||||
+ ((long) (readBuffer[5] & 255) << 40)
|
||||
@@ -182,7 +182,7 @@ public class ABCInputStream extends InputStream {
|
||||
}
|
||||
|
||||
private byte[] safeRead(int count) throws IOException {
|
||||
byte ret[] = new byte[count];
|
||||
byte[] ret = new byte[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
ret[i] = (byte) read();
|
||||
}
|
||||
@@ -238,7 +238,7 @@ public class ABCInputStream extends InputStream {
|
||||
public MethodInfo readMethodInfo() throws IOException {
|
||||
int param_count = readU30();
|
||||
int ret_type = readU30();
|
||||
int param_types[] = new int[param_count];
|
||||
int[] param_types = new int[param_count];
|
||||
for (int i = 0; i < param_count; i++) {
|
||||
param_types[i] = readU30();
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public class ABCInputStream extends InputStream {
|
||||
|
||||
//// 1=need_arguments, 2=need_activation, 4=need_rest 8=has_optional (16=ignore_rest, 32=explicit,) 64=setsdxns, 128=has_paramnames
|
||||
|
||||
ValueKind optional[] = new ValueKind[0];
|
||||
ValueKind[] optional = new ValueKind[0];
|
||||
if ((flags & 8) == 8) { //if has_optional
|
||||
int optional_count = readU30();
|
||||
optional = new ValueKind[optional_count];
|
||||
@@ -256,7 +256,7 @@ public class ABCInputStream extends InputStream {
|
||||
}
|
||||
}
|
||||
|
||||
int param_names[] = new int[param_count];
|
||||
int[] param_names = new int[param_count];
|
||||
if ((flags & 128) == 128) { //if has_paramnames
|
||||
for (int i = 0; i < param_count; i++) {
|
||||
param_names[i] = readU30();
|
||||
@@ -335,7 +335,7 @@ public class ABCInputStream extends InputStream {
|
||||
}
|
||||
|
||||
public byte[] readBytes(int count) throws IOException {
|
||||
byte ret[] = new byte[count];
|
||||
byte[] ret = new byte[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
ret[i] = (byte) read();
|
||||
}
|
||||
@@ -343,7 +343,7 @@ public class ABCInputStream extends InputStream {
|
||||
}
|
||||
|
||||
public Decimal readDecimal() throws IOException {
|
||||
byte data[] = readBytes(16);
|
||||
byte[] data = readBytes(16);
|
||||
return new Decimal(data);
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ public class ABCInputStream extends InputStream {
|
||||
|
||||
public String readString() throws IOException {
|
||||
int length = readU30();
|
||||
byte b[] = safeRead(length);
|
||||
byte[] b = safeRead(length);
|
||||
String r = new String(b, "UTF-8");
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ABCOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
public void writeLong(long value) throws IOException {
|
||||
byte writeBuffer[] = new byte[8];
|
||||
byte[] writeBuffer = new byte[8];
|
||||
writeBuffer[7] = (byte) (value >>> 56);
|
||||
writeBuffer[6] = (byte) (value >>> 48);
|
||||
writeBuffer[5] = (byte) (value >>> 40);
|
||||
@@ -144,7 +144,7 @@ public class ABCOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
public void writeString(String s) throws IOException {
|
||||
byte sbytes[] = s.getBytes("UTF-8");
|
||||
byte[] sbytes = s.getBytes("UTF-8");
|
||||
writeU30(sbytes.length);
|
||||
write(sbytes);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CopyOutputStream extends OutputStream {
|
||||
private InputStream is;
|
||||
private long pos = 0;
|
||||
private int TEMPSIZE = 5;
|
||||
private int temp[] = new int[TEMPSIZE];
|
||||
private int[] temp = new int[TEMPSIZE];
|
||||
private int tempPos = 0;
|
||||
public int ignoreFirst = 0;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ScriptPack {
|
||||
if (packageName.equals("")) {
|
||||
return "";
|
||||
}
|
||||
String pathParts[];
|
||||
String[] pathParts;
|
||||
if (packageName.contains(".")) {
|
||||
pathParts = packageName.split("\\.");
|
||||
} else {
|
||||
|
||||
@@ -113,7 +113,7 @@ public class AVM2Code implements Serializable {
|
||||
public static final int DAT_DECIMAL_INDEX = OPT_U30 + 0x11;
|
||||
public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x12;
|
||||
public static final int DAT_DECIMAL_PARAMS = OPT_U30 + 0x13;
|
||||
public static InstructionDefinition instructionSet[] = new InstructionDefinition[]{
|
||||
public static InstructionDefinition[] instructionSet = new InstructionDefinition[]{
|
||||
new AddIns(),
|
||||
new InstructionDefinition(0x9b, "add_d", new int[]{}) {
|
||||
@Override
|
||||
@@ -557,11 +557,11 @@ public class AVM2Code implements Serializable {
|
||||
}
|
||||
};
|
||||
//endoflist
|
||||
public static InstructionDefinition instructionSetByCode[] = buildInstructionSetByCode();
|
||||
public static InstructionDefinition[] instructionSetByCode = buildInstructionSetByCode();
|
||||
public boolean hideTemporaryRegisters = true;
|
||||
|
||||
private static InstructionDefinition[] buildInstructionSetByCode() {
|
||||
InstructionDefinition result[] = new InstructionDefinition[256];
|
||||
InstructionDefinition[] result = new InstructionDefinition[256];
|
||||
for (InstructionDefinition id : instructionSet) {
|
||||
if (result[id.instructionCode] != null) {
|
||||
Logger.getLogger(AVM2Code.class.getName()).log(Level.WARNING, "Duplicate OPCODE for instruction {0} {1}", new Object[]{result[id.instructionCode], id});
|
||||
@@ -627,7 +627,7 @@ public class AVM2Code implements Serializable {
|
||||
int instructionCode = ais.read();
|
||||
InstructionDefinition instr = instructionSetByCode[instructionCode];
|
||||
if (instr != null) {
|
||||
int actualOperands[];
|
||||
int[] actualOperands;
|
||||
if (instructionCode == 0x1b) { //switch
|
||||
int firstOperand = ais.readS24();
|
||||
int case_count = ais.readU30();
|
||||
@@ -673,7 +673,7 @@ public class AVM2Code implements Serializable {
|
||||
return getBytes(null);
|
||||
}
|
||||
|
||||
public byte[] getBytes(byte origBytes[]) {
|
||||
public byte[] getBytes(byte[] origBytes) {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
OutputStream cos;
|
||||
@@ -721,7 +721,7 @@ public class AVM2Code implements Serializable {
|
||||
|
||||
public String toASMSource(ConstantPool constants, MethodBody body, List<Integer> outputMap, boolean hex, boolean highlight) {
|
||||
invalidateCache();
|
||||
StringBuffer ret = new StringBuffer();
|
||||
StringBuilder ret = new StringBuilder();
|
||||
String t = "";
|
||||
for (int e = 0; e < body.exceptions.length; e++) {
|
||||
ret.append("exception " + e + " m[" + body.exceptions[e].name_index + "]\"" + Helper.escapeString(body.exceptions[e].getVarName(constants, new ArrayList<String>())) + "\" "
|
||||
@@ -932,7 +932,7 @@ public class AVM2Code implements Serializable {
|
||||
return pos2adr(fixIPAfterDebugLine(adr2pos(addr)));
|
||||
}
|
||||
|
||||
public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, Stack<GraphTargetItem> scopeStack, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, int start, int end, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, boolean visited[], HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) throws ConvertException {
|
||||
public ConvertOutput toSourceOutput(String path, GraphPart part, boolean processJumps, boolean isStatic, int scriptIndex, int classIndex, java.util.HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, Stack<GraphTargetItem> scopeStack, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, int start, int end, HashMap<Integer, String> localRegNames, List<String> fullyQualifiedNames, boolean[] visited, HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) throws ConvertException {
|
||||
boolean debugMode = DEBUG_MODE;
|
||||
if (debugMode) {
|
||||
System.out.println("OPEN SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString());
|
||||
@@ -1189,7 +1189,7 @@ public class AVM2Code implements Serializable {
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
public String toSource(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, HashMap<Integer, String> localRegNames, Stack<GraphTargetItem> scopeStack, boolean isStaticInitializer, List<String> fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) {
|
||||
public String toSource(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, HashMap<Integer, String> localRegNames, Stack<GraphTargetItem> scopeStack, boolean isStaticInitializer, List<String> fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) {
|
||||
return toSource(path, isStatic, scriptIndex, classIndex, abc, constants, method_info, body, false, true, localRegNames, scopeStack, isStaticInitializer, fullyQualifiedNames, initTraits, staticOperation, localRegAssigmentIps, refs);
|
||||
}
|
||||
|
||||
@@ -1260,7 +1260,7 @@ public class AVM2Code implements Serializable {
|
||||
ignoredIns = new ArrayList<>();
|
||||
}
|
||||
|
||||
public String toSource(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, boolean hilighted, boolean replaceIndents, HashMap<Integer, String> localRegNames, Stack<GraphTargetItem> scopeStack, boolean isStaticInitializer, List<String> fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) {
|
||||
public String toSource(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo[] method_info, MethodBody body, boolean hilighted, boolean replaceIndents, HashMap<Integer, String> localRegNames, Stack<GraphTargetItem> scopeStack, boolean isStaticInitializer, List<String> fullyQualifiedNames, Traits initTraits, int staticOperation, HashMap<Integer, Integer> localRegAssigmentIps, HashMap<Integer, List<Integer>> refs) {
|
||||
initToSource();
|
||||
List<GraphTargetItem> list;
|
||||
String s;
|
||||
@@ -1329,7 +1329,7 @@ public class AVM2Code implements Serializable {
|
||||
}
|
||||
}
|
||||
//Declarations
|
||||
boolean declaredRegisters[] = new boolean[regCount];
|
||||
boolean[] declaredRegisters = new boolean[regCount];
|
||||
for (int b = 0; b < declaredRegisters.length; b++) {
|
||||
declaredRegisters[b] = false;
|
||||
}
|
||||
@@ -1714,7 +1714,7 @@ public class AVM2Code implements Serializable {
|
||||
return refs;
|
||||
}
|
||||
|
||||
private int visitCodeTrap(int ip, int visited[], AVM2Instruction prev, AVM2Instruction prev2) {
|
||||
private int visitCodeTrap(int ip, int[] visited, AVM2Instruction prev, AVM2Instruction prev2) {
|
||||
int ret = 0;
|
||||
while (ip < visited.length) {
|
||||
visited[ip]++;
|
||||
@@ -1837,7 +1837,7 @@ public class AVM2Code implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public void restoreControlFlow(int ip, HashMap<Integer, List<Integer>> refs, int visited2[], HashMap<Integer, List<Object>> appended) throws ConvertException {
|
||||
public void restoreControlFlow(int ip, HashMap<Integer, List<Integer>> refs, int[] visited2, HashMap<Integer, List<Object>> appended) throws ConvertException {
|
||||
List<Object> buf = new ArrayList<>();
|
||||
boolean cont = false;
|
||||
int continueip = 0;
|
||||
@@ -1930,7 +1930,7 @@ public class AVM2Code implements Serializable {
|
||||
private void restoreControlFlowPass(ConstantPool constants, MethodBody body, boolean secondpass) {
|
||||
try {
|
||||
HashMap<Integer, List<Integer>> refs;
|
||||
int visited2[] = new int[code.size()];
|
||||
int[] visited2 = new int[code.size()];
|
||||
refs = visitCode(body);
|
||||
HashMap<Integer, List<Object>> appended = new HashMap<>();
|
||||
/*if (secondpass) {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CodeStats {
|
||||
public int maxlocal = 0;
|
||||
public boolean has_set_dxns = false;
|
||||
public boolean has_activation = false;
|
||||
public InstructionStats instructionStats[];
|
||||
public InstructionStats[] instructionStats;
|
||||
|
||||
public String toString(boolean highlight, ABC abc, List<String> fullyQualifiedNames) {
|
||||
String ret = "Stats: maxstack=" + maxstack + ", maxscope=" + maxscope + ", maxlocal=" + maxlocal + "\r\n";
|
||||
|
||||
@@ -30,15 +30,15 @@ import java.util.logging.Logger;
|
||||
|
||||
public class ConstantPool {
|
||||
|
||||
public long constant_int[];
|
||||
public long constant_uint[];
|
||||
public double constant_double[];
|
||||
public long[] constant_int;
|
||||
public long[] constant_uint;
|
||||
public double[] constant_double;
|
||||
/* Only for some minor versions */
|
||||
public Decimal constant_decimal[];
|
||||
public String constant_string[];
|
||||
public Namespace constant_namespace[];
|
||||
public NamespaceSet constant_namespace_set[];
|
||||
public Multiname constant_multiname[];
|
||||
public Decimal[] constant_decimal;
|
||||
public String[] constant_string;
|
||||
public Namespace[] constant_namespace;
|
||||
public NamespaceSet[] constant_namespace_set;
|
||||
public Multiname[] constant_multiname;
|
||||
|
||||
public int addInt(long value) {
|
||||
constant_int = Arrays.copyOf(constant_int, constant_int.length + 1);
|
||||
|
||||
@@ -43,9 +43,9 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
|
||||
public static final long serialVersionUID = 1L;
|
||||
public InstructionDefinition definition;
|
||||
public int operands[];
|
||||
public int[] operands;
|
||||
public long offset;
|
||||
public byte bytes[];
|
||||
public byte[] bytes;
|
||||
public String comment;
|
||||
public boolean ignored = false;
|
||||
public String labelname;
|
||||
@@ -96,7 +96,7 @@ public class AVM2Instruction implements Serializable, GraphSourceItem {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer s = new StringBuffer();
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append(definition.instructionName);
|
||||
for (int i = 0; i < operands.length; i++) {
|
||||
s.append(" ");
|
||||
|
||||
+2
-2
@@ -45,11 +45,11 @@ public class InstructionDefinition implements Serializable {
|
||||
protected String hilighOffset(String text, long offset) {
|
||||
return Highlighting.hilighOffset(text, offset);
|
||||
}
|
||||
public int operands[];
|
||||
public int[] operands;
|
||||
public String instructionName = "";
|
||||
public int instructionCode = 0;
|
||||
|
||||
public InstructionDefinition(int instructionCode, String instructionName, int operands[]) {
|
||||
public InstructionDefinition(int instructionCode, String instructionName, int[] operands) {
|
||||
this.instructionCode = instructionCode;
|
||||
this.instructionName = instructionName;
|
||||
this.operands = operands;
|
||||
|
||||
@@ -278,7 +278,7 @@ public class ASM3Parser {
|
||||
}
|
||||
}
|
||||
|
||||
int operands[] = new int[operandsList.size()];
|
||||
int[] operands = new int[operandsList.size()];
|
||||
for (int i = 0; i < operandsList.size(); i++) {
|
||||
operands[i] = operandsList.get(i);
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ package com.jpexs.decompiler.flash.abc.types;
|
||||
*/
|
||||
public class Decimal {
|
||||
|
||||
public byte data[];
|
||||
public byte[] data;
|
||||
|
||||
public Decimal(byte data[]) {
|
||||
public Decimal(byte[] data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class InstanceInfo {
|
||||
public int super_index;
|
||||
public int flags; // 1 = sealed, 0 = dynamic, 2 = final, 4 = interface, 8 = ProtectedNs
|
||||
public int protectedNS; //if flags & 8
|
||||
public int interfaces[];
|
||||
public int[] interfaces;
|
||||
public int iinit_index; // MethodInfo - constructor
|
||||
public Traits instance_traits;
|
||||
public static final int CLASS_SEALED = 1; //not dynamic
|
||||
|
||||
@@ -22,8 +22,8 @@ import com.jpexs.helpers.Helper;
|
||||
public class MetadataInfo {
|
||||
|
||||
public int name_index;
|
||||
public int keys[];
|
||||
public int values[];
|
||||
public int[] keys;
|
||||
public int[] values;
|
||||
|
||||
public MetadataInfo(int name_index, int[] keys, int[] values) {
|
||||
this.name_index = name_index;
|
||||
|
||||
@@ -47,9 +47,9 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
public int max_regs;
|
||||
public int init_scope_depth;
|
||||
public int max_scope_depth;
|
||||
public byte codeBytes[];
|
||||
public byte[] codeBytes;
|
||||
public AVM2Code code;
|
||||
public ABCException exceptions[] = new ABCException[0];
|
||||
public ABCException[] exceptions = new ABCException[0];
|
||||
public Traits traits = new Traits();
|
||||
|
||||
public List<Integer> getExceptionEntries() {
|
||||
@@ -108,7 +108,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public String toString(final String path, boolean pcode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final ConstantPool constants, final MethodInfo method_info[], final Stack<GraphTargetItem> scopeStack, final boolean isStaticInitializer, final boolean hilight, final boolean replaceIndents, final List<String> fullyQualifiedNames, final Traits initTraits) {
|
||||
public String toString(final String path, boolean pcode, final boolean isStatic, final int scriptIndex, final int classIndex, final ABC abc, final ConstantPool constants, final MethodInfo[] method_info, final Stack<GraphTargetItem> scopeStack, final boolean isStaticInitializer, final boolean hilight, final boolean replaceIndents, final List<String> fullyQualifiedNames, final Traits initTraits) {
|
||||
if (debugMode) {
|
||||
System.err.println("Decompiling " + path);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
return s;
|
||||
}
|
||||
|
||||
public String toSource(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo method_info[], Stack<GraphTargetItem> scopeStack, boolean isStaticInitializer, boolean hilight, boolean replaceIndents, List<String> fullyQualifiedNames, Traits initTraits) {
|
||||
public String toSource(String path, boolean isStatic, int scriptIndex, int classIndex, ABC abc, ConstantPool constants, MethodInfo[] method_info, Stack<GraphTargetItem> scopeStack, boolean isStaticInitializer, boolean hilight, boolean replaceIndents, List<String> fullyQualifiedNames, Traits initTraits) {
|
||||
AVM2Code deobfuscated = null;
|
||||
MethodBody b = (MethodBody) Helper.deepCopy(this);
|
||||
deobfuscated = b.code;
|
||||
|
||||
@@ -25,13 +25,13 @@ import java.util.List;
|
||||
|
||||
public class MethodInfo {
|
||||
|
||||
public int param_types[];
|
||||
public int[] param_types;
|
||||
public int ret_type;
|
||||
public int name_index; //0=no name
|
||||
// 1=need_arguments, 2=need_activation, 4=need_rest 8=has_optional 16=ignore_rest, 32=explicit, 64=setsdxns, 128=has_paramnames
|
||||
public int flags;
|
||||
public ValueKind optional[];
|
||||
public int paramNames[];
|
||||
public ValueKind[] optional;
|
||||
public int[] paramNames;
|
||||
private MethodBody body;
|
||||
|
||||
public void setFlagSetsdxns() {
|
||||
@@ -156,7 +156,7 @@ public class MethodInfo {
|
||||
return (flags & 128) == 128;
|
||||
}
|
||||
|
||||
public MethodInfo(int param_types[], int ret_type, int name_index, int flags, ValueKind optional[], int paramNames[]) {
|
||||
public MethodInfo(int[] param_types, int ret_type, int name_index, int flags, ValueKind[] optional, int[] paramNames) {
|
||||
this.param_types = param_types;
|
||||
this.ret_type = ret_type;
|
||||
this.name_index = name_index;
|
||||
|
||||
@@ -32,8 +32,8 @@ public class Multiname {
|
||||
public static final int MULTINAMEL = 0x1b;
|
||||
public static final int MULTINAMELA = 0x1c;
|
||||
public static final int TYPENAME = 0x1d;
|
||||
private static final int multinameKinds[] = new int[]{QNAME, QNAMEA, MULTINAME, MULTINAMEA, RTQNAME, RTQNAMEA, MULTINAMEL, RTQNAMEL, RTQNAMELA, MULTINAMELA, TYPENAME};
|
||||
private static final String multinameKindNames[] = new String[]{"Qname", "QnameA", "Multiname", "MultinameA", "RTQname", "RTQnameA", "MultinameL", "RTQnameL", "RTQnameLA", "MultinameLA", "TypeName"};
|
||||
private static final int[] multinameKinds = new int[]{QNAME, QNAMEA, MULTINAME, MULTINAMEA, RTQNAME, RTQNAMEA, MULTINAMEL, RTQNAMEL, RTQNAMELA, MULTINAMELA, TYPENAME};
|
||||
private static final String[] multinameKindNames = new String[]{"Qname", "QnameA", "Multiname", "MultinameA", "RTQname", "RTQnameA", "MultinameL", "RTQnameL", "RTQnameLA", "MultinameLA", "TypeName"};
|
||||
public int kind = -1;
|
||||
public int name_index = -1;
|
||||
public int namespace_index = -1;
|
||||
|
||||
@@ -28,9 +28,9 @@ public class Namespace {
|
||||
public static final int KIND_PROTECTED = 24;
|
||||
public static final int KIND_EXPLICIT = 25;
|
||||
public static final int KIND_STATIC_PROTECTED = 26;
|
||||
public static final int nameSpaceKinds[] = new int[]{KIND_NAMESPACE, KIND_PRIVATE, KIND_PACKAGE, KIND_PACKAGE_INTERNAL, KIND_PROTECTED, KIND_EXPLICIT, KIND_STATIC_PROTECTED};
|
||||
public static final String nameSpaceKindNames[] = new String[]{"Namespace", "PrivateNamespace", "PackageNamespace", "PackageInternalNamespace", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNamespace"};
|
||||
public static final String namePrefixes[] = new String[]{"", "private", "public", "", "protected", "explicit", "protected"};
|
||||
public static final int[] nameSpaceKinds = new int[]{KIND_NAMESPACE, KIND_PRIVATE, KIND_PACKAGE, KIND_PACKAGE_INTERNAL, KIND_PROTECTED, KIND_EXPLICIT, KIND_STATIC_PROTECTED};
|
||||
public static final String[] nameSpaceKindNames = new String[]{"Namespace", "PrivateNamespace", "PackageNamespace", "PackageInternalNamespace", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNamespace"};
|
||||
public static final String[] namePrefixes = new String[]{"", "private", "public", "", "protected", "explicit", "protected"};
|
||||
public int kind;
|
||||
public int name_index;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool;
|
||||
|
||||
public class NamespaceSet {
|
||||
|
||||
public int namespaces[];
|
||||
public int[] namespaces;
|
||||
|
||||
public String toString(ConstantPool constants) {
|
||||
String s = "";
|
||||
|
||||
@@ -37,8 +37,8 @@ public class ValueKind {
|
||||
public static final int CONSTANT_ExplicitNamespace = 0x19;// Namespace
|
||||
public static final int CONSTANT_StaticProtectedNs = 0x1A;// Namespace
|
||||
public static final int CONSTANT_PrivateNs = 0x05;// namespace
|
||||
private static final int optionalKinds[] = new int[]{0x03, 0x04, 0x06, 0x02, 0x01, 0x0B, 0x0A, 0x0C, 0x00, 0x08, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x05};
|
||||
private static final String optionalKindNames[] = new String[]{"Int", "UInt", "Double", "Decimal", "Utf8", "True", "False", "Null", "Undefined", "Namespace", "PackageNamespace", "PackageInternalNs", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNs", "PrivateNs"};
|
||||
private static final int[] optionalKinds = new int[]{0x03, 0x04, 0x06, 0x02, 0x01, 0x0B, 0x0A, 0x0C, 0x00, 0x08, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x05};
|
||||
private static final String[] optionalKindNames = new String[]{"Int", "UInt", "Double", "Decimal", "Utf8", "True", "False", "Null", "Undefined", "Namespace", "PackageNamespace", "PackageInternalNs", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNs", "PrivateNs"};
|
||||
public int value_index;
|
||||
public int value_kind;
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ public abstract class Trait implements Serializable {
|
||||
public int name_index;
|
||||
public int kindType;
|
||||
public int kindFlags;
|
||||
public int metadata[] = new int[0];
|
||||
public int[] metadata = new int[0];
|
||||
public long fileOffset;
|
||||
public byte bytes[];
|
||||
public byte[] bytes;
|
||||
public static final int ATTR_Final = 0x1;
|
||||
public static final int ATTR_Override = 0x2;
|
||||
public static final int ATTR_Metadata = 0x4;
|
||||
|
||||
@@ -135,7 +135,7 @@ public class TraitSlotConst extends Trait implements TraitWithSlot {
|
||||
if (valueStr != null) {
|
||||
ret += " = ";
|
||||
int befLen = ret.length();
|
||||
String valueStrParts[] = valueStr.split("\r\n");
|
||||
String[] valueStrParts = valueStr.split("\r\n");
|
||||
boolean first = true;
|
||||
for (int i = 0; i < valueStrParts.length; i++) {
|
||||
if (valueStrParts[i].equals("")) {
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.logging.Logger;
|
||||
|
||||
public class Traits implements Serializable {
|
||||
|
||||
public Trait traits[] = new Trait[0];
|
||||
public Trait[] traits = new Trait[0];
|
||||
|
||||
public int removeTraps(int scriptIndex, int classIndex, boolean isStatic, ABC abc, String path) {
|
||||
int ret = 0;
|
||||
@@ -98,7 +98,7 @@ public class Traits implements Serializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
public String call() {
|
||||
String plus;
|
||||
if (makePackages) {
|
||||
plus = trait.convertPackaged(path, abcTags, abc, isStatic, pcode, scriptIndex, classIndex, highlighting, fullyQualifiedNames, parallel);
|
||||
@@ -123,25 +123,43 @@ public class Traits implements Serializable {
|
||||
}
|
||||
|
||||
public String convert(String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, boolean pcode, boolean makePackages, int scriptIndex, int classIndex, boolean highlighting, List<String> fullyQualifiedNames, boolean parallel) {
|
||||
String s = "";
|
||||
ExecutorService executor = Executors.newFixedThreadPool(parallel ? 20 : 1);
|
||||
List<Future<String>> futureResults = new ArrayList<>();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
ExecutorService executor = null;
|
||||
List<Future<String>> futureResults = null;
|
||||
List<TraitConvertTask> traitConvertTasks = null;
|
||||
|
||||
if (parallel) {
|
||||
executor = Executors.newFixedThreadPool(20);
|
||||
futureResults = new ArrayList<>();
|
||||
} else {
|
||||
traitConvertTasks = new ArrayList<>();
|
||||
}
|
||||
pcode = true;
|
||||
for (int t = 0; t < traits.length; t++) {
|
||||
Future<String> future = executor.submit(new TraitConvertTask(traits[t], makePackages, path, abcTags, abc, isStatic, pcode, scriptIndex, classIndex, highlighting, fullyQualifiedNames, t, parallel));
|
||||
futureResults.add(future);
|
||||
TraitConvertTask task = new TraitConvertTask(traits[t], makePackages, path, abcTags, abc, isStatic, pcode, scriptIndex, classIndex, highlighting, fullyQualifiedNames, t, parallel);
|
||||
if (parallel) {
|
||||
Future<String> future = executor.submit(task);
|
||||
futureResults.add(future);
|
||||
} else {
|
||||
traitConvertTasks.add(task);
|
||||
}
|
||||
}
|
||||
|
||||
for (int f = 0; f < futureResults.size(); f++) {
|
||||
int taskCount = parallel ? futureResults.size() : traitConvertTasks.size();
|
||||
for (int f = 0; f < taskCount; f++) {
|
||||
if (f > 0) {
|
||||
s += "\r\n\r\n";
|
||||
sb.append("\r\n\r\n");
|
||||
}
|
||||
try {
|
||||
s += futureResults.get(f).get();
|
||||
String taskResult = parallel ? futureResults.get(f).get() : traitConvertTasks.get(f).call();
|
||||
sb.append(taskResult);
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
Logger.getLogger(Traits.class.getName()).log(Level.SEVERE, "Error during traits converting", ex);
|
||||
}
|
||||
}
|
||||
executor.shutdown();
|
||||
return s;
|
||||
if (parallel) {
|
||||
executor.shutdown();
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -139,7 +139,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
onFalse = generateToActionList(localData, onFalseCmds);
|
||||
}
|
||||
}
|
||||
byte onTrueBytes[] = Action.actionsToBytes(onTrue, false, SWF.DEFAULT_VERSION);
|
||||
byte[] onTrueBytes = Action.actionsToBytes(onTrue, false, SWF.DEFAULT_VERSION);
|
||||
int onTrueLen = onTrueBytes.length;
|
||||
|
||||
ActionIf ifaif = new ActionIf(0);
|
||||
@@ -157,7 +157,7 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
onTrueLen += ajmp.getBytes(SWF.DEFAULT_VERSION).length;
|
||||
}
|
||||
ifaif.setJumpOffset(onTrueLen);
|
||||
byte onFalseBytes[] = Action.actionsToBytes(onFalse, false, SWF.DEFAULT_VERSION);
|
||||
byte[] onFalseBytes = Action.actionsToBytes(onFalse, false, SWF.DEFAULT_VERSION);
|
||||
int onFalseLen = onFalseBytes.length;
|
||||
if (ajmp != null) {
|
||||
ajmp.setJumpOffset(onFalseLen);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ActionGetURL extends Action {
|
||||
|
||||
public ActionGetURL(int actionLength, SWFInputStream sis, int version) throws IOException {
|
||||
super(0x83, actionLength);
|
||||
//byte data[] = sis.readBytes(actionLength);
|
||||
//byte[] data = sis.readBytes(actionLength);
|
||||
//sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
urlString = sis.readString();
|
||||
targetString = sis.readString();
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ActionGoToLabel extends Action {
|
||||
|
||||
public ActionGoToLabel(int actionLength, SWFInputStream sis, int version) throws IOException {
|
||||
super(0x8C, actionLength);
|
||||
//byte data[] = sis.readBytes(actionLength);
|
||||
//byte[] data = sis.readBytes(actionLength);
|
||||
//sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
label = sis.readString();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ActionSetTarget extends Action {
|
||||
|
||||
public ActionSetTarget(int actionLength, SWFInputStream sis, int version) throws IOException {
|
||||
super(0x8B, actionLength);
|
||||
//byte data[] = sis.readBytes(actionLength);
|
||||
//byte[] data = sis.readBytes(actionLength);
|
||||
//sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
targetName = sis.readString();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
public ActionDefineFunction(int actionLength, SWFInputStream sis, ReReadableInputStream rri, int version) throws IOException {
|
||||
super(0x9B, actionLength);
|
||||
this.version = version;
|
||||
//byte data[]=sis.readBytes(actionLength);
|
||||
//byte[] data=sis.readBytes(actionLength);
|
||||
//sis=new SWFInputStream(new ByteArrayInputStream(data),version);
|
||||
long startPos = sis.getPos();
|
||||
functionName = sis.readString();
|
||||
@@ -117,7 +117,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta
|
||||
for (String s : paramNames) {
|
||||
sos.writeString(s);
|
||||
}
|
||||
//byte codeBytes[] = Action.actionsToBytes(code, false, version);
|
||||
//byte[] codeBytes = Action.actionsToBytes(code, false, version);
|
||||
sos.writeUI16(codeSize); //codeBytes.length);
|
||||
sos.close();
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont
|
||||
sos.writeUI8(paramRegisters.get(i));
|
||||
sos.writeString(paramNames.get(i));
|
||||
}
|
||||
//byte codeBytes[] = Action.actionsToBytes(code, false, version);
|
||||
//byte[] codeBytes = Action.actionsToBytes(code, false, version);
|
||||
sos.writeUI16(codeSize);//codeBytes.length);
|
||||
sos.close();
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class FLVOutputStream extends OutputStream {
|
||||
public void writeTag(FLVTAG tag) throws IOException {
|
||||
long posBefore = getPos();
|
||||
writeUI8(tag.tagType);
|
||||
byte data[] = tag.data.getBytes();
|
||||
byte[] data = tag.data.getBytes();
|
||||
writeUI24(data.length);
|
||||
writeUI24(tag.timeStamp & 0xffffff);
|
||||
writeUI8((int) ((tag.timeStamp >> 24) & 0xff));
|
||||
@@ -149,7 +149,7 @@ public class FLVOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
private void writeLong(long value) throws IOException {
|
||||
byte writeBuffer[] = new byte[8];
|
||||
byte[] writeBuffer = new byte[8];
|
||||
writeBuffer[3] = (byte) (value >>> 56);
|
||||
writeBuffer[2] = (byte) (value >>> 48);
|
||||
writeBuffer[1] = (byte) (value >>> 40);
|
||||
|
||||
@@ -20,7 +20,7 @@ import javax.swing.JPanel;
|
||||
public class ExportDialog extends AppDialog {
|
||||
|
||||
boolean cancelled = false;
|
||||
String options[][] = {
|
||||
String[][] options = {
|
||||
{translate("shapes.svg")},
|
||||
{translate("texts.plain"), translate("texts.formatted")},
|
||||
{translate("images.pngjpeg")},
|
||||
@@ -28,7 +28,7 @@ public class ExportDialog extends AppDialog {
|
||||
{translate("sounds.mp3wavflv"), translate("sounds.flv")},
|
||||
{translate("actionscript.as"), translate("actionscript.pcode")}
|
||||
};
|
||||
String optionNames[] = {
|
||||
String[] optionNames = {
|
||||
translate("shapes"),
|
||||
translate("texts"),
|
||||
translate("images"),
|
||||
@@ -42,7 +42,7 @@ public class ExportDialog extends AppDialog {
|
||||
public static final int OPTION_MOVIES = 3;
|
||||
public static final int OPTION_SOUNDS = 4;
|
||||
public static final int OPTION_ACTIONSCRIPT = 5;
|
||||
private JComboBox combos[];
|
||||
private JComboBox[] combos;
|
||||
|
||||
public int getOption(int index) {
|
||||
return combos[index].getSelectedIndex();
|
||||
@@ -61,7 +61,7 @@ public class ExportDialog extends AppDialog {
|
||||
cnt.setLayout(new BorderLayout());
|
||||
JPanel comboPanel = new JPanel(null);
|
||||
combos = new JComboBox[optionNames.length];
|
||||
JLabel labels[] = new JLabel[optionNames.length];
|
||||
JLabel[] labels = new JLabel[optionNames.length];
|
||||
int labWidth = 0;
|
||||
for (int i = 0; i < optionNames.length; i++) {
|
||||
labels[i] = new JLabel(optionNames[i]);
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ImagePanel extends JPanel implements ActionListener, FlashDisplay {
|
||||
}
|
||||
}
|
||||
|
||||
public void setImage(byte data[]) {
|
||||
public void setImage(byte[] data) {
|
||||
setBackground(View.swfBackgroundColor);
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
|
||||
@@ -107,7 +107,7 @@ public class Main {
|
||||
}
|
||||
loadFromMemoryFrame.setVisible(true);
|
||||
}
|
||||
private static String commandlineConfigBoolean[] = new String[]{
|
||||
private static String[] commandlineConfigBoolean = new String[]{
|
||||
"decompile",
|
||||
"parallelSpeedUp",
|
||||
"internalFlashViewer",
|
||||
@@ -482,7 +482,7 @@ public class Main {
|
||||
}
|
||||
String license = "/*\r\n * Copyright (C) {year} {author}\r\n * \r\n * This program is free software: you can redistribute it and/or modify\r\n * it under the terms of the GNU General Public License as published by\r\n * the Free Software Foundation, either version 3 of the License, or\r\n * (at your option) any later version.\r\n * \r\n * This program is distributed in the hope that it will be useful,\r\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r\n * GNU General Public License for more details.\r\n * \r\n * You should have received a copy of the GNU General Public License\r\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\r\n */";
|
||||
|
||||
File files[] = dir.listFiles();
|
||||
File[] files = dir.listFiles();
|
||||
for (File f : files) {
|
||||
if (f.isDirectory()) {
|
||||
updateLicenseInDir(f);
|
||||
@@ -864,7 +864,7 @@ public class Main {
|
||||
if (args.length < pos + 4) {
|
||||
badArguments();
|
||||
}
|
||||
String validExportFormats[] = new String[]{
|
||||
String[] validExportFormats = new String[]{
|
||||
"as",
|
||||
"pcode",
|
||||
"image",
|
||||
@@ -1040,7 +1040,7 @@ public class Main {
|
||||
}
|
||||
|
||||
private static void setConfigurations(String cfgStr) {
|
||||
String cfgs[];
|
||||
String[] cfgs;
|
||||
if (cfgStr.contains(",")) {
|
||||
cfgs = cfgStr.split(",");
|
||||
} else {
|
||||
@@ -1048,7 +1048,7 @@ public class Main {
|
||||
}
|
||||
|
||||
for (String c : cfgs) {
|
||||
String cp[];
|
||||
String[] cp;
|
||||
if (c.contains("=")) {
|
||||
cp = c.split("=");
|
||||
} else {
|
||||
|
||||
@@ -298,7 +298,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
@Override
|
||||
public int handle(Throwable thrown) {
|
||||
synchronized (MainFrame.class) {
|
||||
String options[] = new String[]{translate("button.abort"), translate("button.retry"), translate("button.ignore")};
|
||||
String[] options = new String[]{translate("button.abort"), translate("button.retry"), translate("button.ignore")};
|
||||
return View.showOptionDialog(null, translate("error.occured").replace("%error%", thrown.getLocalizedMessage()), translate("error"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, "");
|
||||
}
|
||||
}
|
||||
@@ -901,7 +901,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
files = exportSelection(errorHandler, tempDir, export);
|
||||
files.clear();
|
||||
|
||||
File fs[] = ftemp.listFiles();
|
||||
File[] fs = ftemp.listFiles();
|
||||
for (File f : fs) {
|
||||
files.add(f);
|
||||
}
|
||||
@@ -1116,7 +1116,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
final JPanel fontPanel = new JPanel();
|
||||
final JPanel fontParams2 = new JPanel();
|
||||
fontParams2.setLayout(null);
|
||||
final Component ctable[][] = new Component[][]{
|
||||
final Component[][] ctable = new Component[][]{
|
||||
{new JLabel(translate("font.name")), fontNameLabel = new JLabel(translate("value.unknown"))},
|
||||
{new JLabel(translate("font.isbold")), fontIsBoldLabel = new JLabel(translate("value.unknown"))},
|
||||
{new JLabel(translate("font.isitalic")), fontIsItalicLabel = new JLabel(translate("value.unknown"))},
|
||||
@@ -1133,7 +1133,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
|
||||
final int borderLeft = 10;
|
||||
|
||||
final int maxws[] = new int[ctable[0].length];
|
||||
final int[] maxws = new int[ctable[0].length];
|
||||
for (int x = 0; x < ctable[0].length; x++) {
|
||||
int maxw = 0;
|
||||
for (int y = 0; y < ctable.length; y++) {
|
||||
@@ -1778,7 +1778,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
|
||||
public List<TagNode> getSelectedNodes() {
|
||||
List<TagNode> ret = new ArrayList<>();
|
||||
TreePath tps[] = tagTree.getSelectionPaths();
|
||||
TreePath[] tps = tagTree.getSelectionPaths();
|
||||
if (tps == null) {
|
||||
return ret;
|
||||
}
|
||||
@@ -1938,7 +1938,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
|
||||
public List<Object> getSelected(JTree tree) {
|
||||
TreeSelectionModel tsm = tree.getSelectionModel();
|
||||
TreePath tps[] = tsm.getSelectionPaths();
|
||||
TreePath[] tps = tsm.getSelectionPaths();
|
||||
List<Object> ret = new ArrayList<>();
|
||||
if (tps == null) {
|
||||
return ret;
|
||||
@@ -1964,7 +1964,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
|
||||
public List<Object> getAllSelected(JTree tree) {
|
||||
TreeSelectionModel tsm = tree.getSelectionModel();
|
||||
TreePath tps[] = tsm.getSelectionPaths();
|
||||
TreePath[] tps = tsm.getSelectionPaths();
|
||||
List<Object> ret = new ArrayList<>();
|
||||
if (tps == null) {
|
||||
return ret;
|
||||
@@ -2438,7 +2438,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
if (returnVal == JFileChooser.APPROVE_OPTION) {
|
||||
Configuration.setConfig("lastOpenDir", Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
|
||||
File selfile = Helper.fixDialogFile(fc.getSelectedFile());
|
||||
byte data[] = Helper.readFile(selfile.getAbsolutePath());
|
||||
byte[] data = Helper.readFile(selfile.getAbsolutePath());
|
||||
try {
|
||||
it.setImage(data);
|
||||
swf.clearImageCache();
|
||||
@@ -3315,7 +3315,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel
|
||||
}//not showframe
|
||||
|
||||
sos2.writeTag(new EndTag(null));
|
||||
byte data[] = baos.toByteArray();
|
||||
byte[] data = baos.toByteArray();
|
||||
|
||||
sos.writeUI32(sos.getPos() + data.length + 4);
|
||||
sos.write(data);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
|
||||
|
||||
JComboBox<Language> languageCombobox = new JComboBox<>();
|
||||
public String languageCode = null;
|
||||
private String languages[] = new String[]{"en", "cs", "zh", "de", "es", "hu", "nl", "pt", "ru", "sv", "uk"};
|
||||
private String[] languages = new String[]{"en", "cs", "zh", "de", "es", "hu", "nl", "pt", "ru", "sv", "uk"};
|
||||
|
||||
public SelectLanguageDialog() {
|
||||
setSize(350, 130);
|
||||
|
||||
@@ -227,7 +227,7 @@ public class View {
|
||||
}
|
||||
|
||||
public static int showOptionDialog(final Component parentComponent, final Object message, final String title, final int optionType, final int messageType, final Icon icon, final Object[] options, final Object initialValue) {
|
||||
final int ret[] = new int[1];
|
||||
final int[] ret = new int[1];
|
||||
execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -271,7 +271,7 @@ public class View {
|
||||
}
|
||||
|
||||
public static String showInputDialog(final Object message, final Object initialSelection) {
|
||||
final String ret[] = new String[1];
|
||||
final String[] ret = new String[1];
|
||||
execInEventDispatch(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ClassesListTree extends JTree implements TreeSelectionListener {
|
||||
public List<ScriptPack> getSelectedScripts() {
|
||||
TreeSelectionModel tsm = getSelectionModel();
|
||||
final List<ScriptPack> selectedScripts = new ArrayList<>();
|
||||
TreePath tps[] = tsm.getSelectionPaths();
|
||||
TreePath[] tps = tsm.getSelectionPaths();
|
||||
if (tps == null) {
|
||||
return selectedScripts;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class MethodBodyParamsPanel extends JPanel implements ChangeListener {
|
||||
setLayout(null);
|
||||
this.abcPanel = abcPanel;
|
||||
|
||||
JComponent cmps[][] = new JComponent[][]{
|
||||
JComponent[][] cmps = new JComponent[][]{
|
||||
{maxStackLabel = new JLabel(translate("abc.detail.body.params.maxstack"), SwingConstants.RIGHT), maxStackField = new MyFormattedTextField(NumberFormat.getNumberInstance())},
|
||||
{localCountLabel = new JLabel(translate("abc.detail.body.params.localregcount"), SwingConstants.RIGHT), localCountField = new MyFormattedTextField(NumberFormat.getNumberInstance())},
|
||||
{initScopeDepthLabel = new JLabel(translate("abc.detail.body.params.minscope"), SwingConstants.RIGHT), initScopeDepthField = new MyFormattedTextField(NumberFormat.getNumberInstance())},
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class DecimalTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Value"};
|
||||
private static final Class classes[] = new Class[]{Long.class, String.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Value"};
|
||||
private static final Class[] classes = new Class[]{Long.class, String.class};
|
||||
|
||||
public DecimalTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class DoubleTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Value"};
|
||||
private static final Class classes[] = new Class[]{Long.class, String.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Value"};
|
||||
private static final Class[] classes = new Class[]{Long.class, String.class};
|
||||
|
||||
public DoubleTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class IntTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Value"};
|
||||
private static final Class classes[] = new Class[]{Long.class, Long.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Value"};
|
||||
private static final Class[] classes = new Class[]{Long.class, Long.class};
|
||||
|
||||
public IntTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -24,8 +24,8 @@ import javax.swing.table.TableModel;
|
||||
public class MultinameTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Kind", "Name", "Namespace", "NamespaceSet"};
|
||||
private static final Class classes[] = new Class[]{Long.class, String.class, String.class, String.class, String.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Kind", "Name", "Namespace", "NamespaceSet"};
|
||||
private static final Class[] classes = new Class[]{Long.class, String.class, String.class, String.class, String.class};
|
||||
|
||||
public MultinameTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class NamespaceSetTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "NameSpaces"};
|
||||
private static final Class classes[] = new Class[]{Long.class, String.class, String.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "NameSpaces"};
|
||||
private static final Class[] classes = new Class[]{Long.class, String.class, String.class};
|
||||
|
||||
public NamespaceSetTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class NamespaceTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Kind", "Name"};
|
||||
private static final Class classes[] = new Class[]{Long.class, String.class, String.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Kind", "Name"};
|
||||
private static final Class[] classes = new Class[]{Long.class, String.class, String.class};
|
||||
|
||||
public NamespaceTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class StringTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Value"};
|
||||
private static final Class classes[] = new Class[]{Long.class, String.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Value"};
|
||||
private static final Class[] classes = new Class[]{Long.class, String.class};
|
||||
|
||||
public StringTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -23,8 +23,8 @@ import javax.swing.table.TableModel;
|
||||
public class UIntTableModel implements TableModel {
|
||||
|
||||
private ABC abc;
|
||||
private static final String columnNames[] = new String[]{"Index", "Value"};
|
||||
private static final Class classes[] = new Class[]{Long.class, Long.class};
|
||||
private static final String[] columnNames = new String[]{"Index", "Value"};
|
||||
private static final Class[] classes = new Class[]{Long.class, Long.class};
|
||||
|
||||
public UIntTableModel(ABC abc) {
|
||||
this.abc = abc;
|
||||
|
||||
@@ -227,7 +227,7 @@ public class FlashPlayerPanel extends Panel implements FlashDisplay {
|
||||
public boolean isPlaying() {
|
||||
IntByReference ibr = new IntByReference();
|
||||
Kernel32.INSTANCE.WriteFile(pipe, new byte[]{CMD_PLAYING}, 1, ibr, null);
|
||||
byte res[] = new byte[1];
|
||||
byte[] res = new byte[1];
|
||||
if (Kernel32.INSTANCE.ReadFile(pipe, res, res.length, ibr, null)) {
|
||||
return res[0] == 1;
|
||||
} else {
|
||||
|
||||
@@ -346,7 +346,7 @@ public class ProxyFrame extends AppFrame implements ActionListener, CatchedListe
|
||||
}
|
||||
if (!listModel.contains(url)) {
|
||||
try {
|
||||
byte hdr[] = new byte[3];
|
||||
byte[] hdr = new byte[3];
|
||||
data.read(hdr);
|
||||
String shdr = new String(hdr);
|
||||
if ((swfOnly) && ((!shdr.equals("FWS")) && (!shdr.equals("CWS")))) {
|
||||
@@ -356,7 +356,7 @@ public class ProxyFrame extends AppFrame implements ActionListener, CatchedListe
|
||||
File f = new File(Main.tempFile(url));
|
||||
try (FileOutputStream fos = new FileOutputStream(f)) {
|
||||
fos.write(hdr);
|
||||
byte buf[] = new byte[2048];
|
||||
byte[] buf = new byte[2048];
|
||||
int count;
|
||||
while ((count = data.read(buf)) > 0) {
|
||||
fos.write(buf, 0, count);
|
||||
|
||||
@@ -228,7 +228,7 @@ public class Highlighting implements Serializable {
|
||||
|
||||
private static List<Highlighting> getSpecificHighlights(String texts, String txtOpen, String txtClose, String txtEnd) {
|
||||
List<Highlighting> ret = new ArrayList<>();
|
||||
StringBuffer text = new StringBuffer(texts);
|
||||
StringBuilder text = new StringBuilder(texts);
|
||||
int pos = 0;
|
||||
while (true) {
|
||||
int openpos = text.indexOf(txtOpen);
|
||||
|
||||
@@ -71,7 +71,7 @@ public class CSMTextSettingsTag extends Tag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public CSMTextSettingsTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public CSMTextSettingsTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "CSMTextSettings", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
textID = sis.readUI16();
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.io.OutputStream;
|
||||
*/
|
||||
public class DebugIDTag extends Tag {
|
||||
|
||||
public byte debugId[];
|
||||
public byte[] debugId;
|
||||
public static final int ID = 63;
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ public class DebugIDTag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DebugIDTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DebugIDTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DebugID", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
debugId = sis.readBytes(16);
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.io.OutputStream;
|
||||
public class DefineBinaryDataTag extends CharacterTag {
|
||||
|
||||
public int tag;
|
||||
public byte binaryData[];
|
||||
public byte[] binaryData;
|
||||
public long reserved;
|
||||
public static final int ID = 87;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class DefineBinaryDataTag extends CharacterTag {
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
public DefineBinaryDataTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBinaryDataTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBinaryData", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
tag = sis.readUI16();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag {
|
||||
return null;
|
||||
}
|
||||
|
||||
public DefineBitsJPEG2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBitsJPEG2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBitsJPEG2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
@@ -62,7 +62,7 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImage(byte data[]) {
|
||||
public void setImage(byte[] data) {
|
||||
imageData = data;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ import javax.imageio.ImageIO;
|
||||
public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
|
||||
|
||||
public int characterID;
|
||||
public byte imageData[];
|
||||
public byte bitmapAlphaData[];
|
||||
public byte[] imageData;
|
||||
public byte[] bitmapAlphaData;
|
||||
public static final int ID = 35;
|
||||
|
||||
@Override
|
||||
@@ -45,11 +45,11 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImage(byte data[]) {
|
||||
public void setImage(byte[] data) {
|
||||
imageData = data;
|
||||
if (ImageTag.getImageFormat(data).equals("jpg")) {
|
||||
BufferedImage image = getImage(new ArrayList<Tag>());
|
||||
byte ba[] = new byte[image.getWidth() * image.getHeight()];
|
||||
byte[] ba = new byte[image.getWidth() * image.getHeight()];
|
||||
for (int i = 0; i < ba.length; i++) {
|
||||
ba[i] = (byte) 255;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag {
|
||||
return null;
|
||||
}
|
||||
|
||||
public DefineBitsJPEG3Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBitsJPEG3Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBitsJPEG3", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -41,8 +41,8 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
|
||||
|
||||
public int characterID;
|
||||
public int deblockParam;
|
||||
public byte imageData[];
|
||||
public byte bitmapAlphaData[];
|
||||
public byte[] imageData;
|
||||
public byte[] bitmapAlphaData;
|
||||
public static final int ID = 90;
|
||||
|
||||
@Override
|
||||
@@ -60,11 +60,11 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImage(byte data[]) {
|
||||
public void setImage(byte[] data) {
|
||||
imageData = data;
|
||||
if (ImageTag.getImageFormat(data).equals("jpg")) {
|
||||
BufferedImage image = getImage(new ArrayList<Tag>());
|
||||
byte ba[] = new byte[image.getWidth() * image.getHeight()];
|
||||
byte[] ba = new byte[image.getWidth() * image.getHeight()];
|
||||
for (int i = 0; i < ba.length; i++) {
|
||||
ba[i] = (byte) 255;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineBitsJPEG4Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBitsJPEG4Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBitsJPEG4", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -41,7 +41,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
|
||||
public int bitmapWidth;
|
||||
public int bitmapHeight;
|
||||
public int bitmapColorTableSize;
|
||||
public byte zlibBitmapData[]; //TODO: Parse ALPHACOLORMAPDATA,ALPHABITMAPDATA
|
||||
public byte[] zlibBitmapData; //TODO: Parse ALPHACOLORMAPDATA,ALPHABITMAPDATA
|
||||
public static final int FORMAT_8BIT_COLORMAPPED = 3;
|
||||
public static final int FORMAT_32BIT_ARGB = 5;
|
||||
public static final int ID = 36;
|
||||
@@ -52,7 +52,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImage(byte data[]) throws IOException {
|
||||
public void setImage(byte[] data) throws IOException {
|
||||
BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
|
||||
ALPHABITMAPDATA bitmapData = new ALPHABITMAPDATA();
|
||||
bitmapFormat = DefineBitsLosslessTag.FORMAT_24BIT_RGB;
|
||||
@@ -90,7 +90,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag {
|
||||
decompressed = false;
|
||||
}
|
||||
|
||||
public DefineBitsLossless2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBitsLossless2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBitsLossless2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
|
||||
public int bitmapWidth;
|
||||
public int bitmapHeight;
|
||||
public int bitmapColorTableSize;
|
||||
public byte zlibBitmapData[]; //TODO: Parse COLORMAPDATA,BITMAPDATA
|
||||
public byte[] zlibBitmapData; //TODO: Parse COLORMAPDATA,BITMAPDATA
|
||||
public static final int FORMAT_8BIT_COLORMAPPED = 3;
|
||||
public static final int FORMAT_15BIT_RGB = 4;
|
||||
public static final int FORMAT_24BIT_RGB = 5;
|
||||
@@ -53,7 +53,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
|
||||
public static final int ID = 20;
|
||||
|
||||
@Override
|
||||
public void setImage(byte data[]) throws IOException {
|
||||
public void setImage(byte[] data) throws IOException {
|
||||
BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
|
||||
bitmapFormat = FORMAT_24BIT_RGB;
|
||||
bitmapWidth = image.getWidth();
|
||||
@@ -155,7 +155,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag {
|
||||
decompressed = true;
|
||||
}
|
||||
|
||||
public DefineBitsLosslessTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBitsLosslessTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBitsLossless", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -31,12 +31,12 @@ import javax.imageio.ImageIO;
|
||||
public class DefineBitsTag extends ImageTag {
|
||||
|
||||
public int characterID;
|
||||
public byte jpegData[];
|
||||
public byte[] jpegData;
|
||||
private JPEGTablesTag jtt = null;
|
||||
public static final int ID = 6;
|
||||
|
||||
@Override
|
||||
public void setImage(byte data[]) {
|
||||
public void setImage(byte[] data) {
|
||||
throw new UnsupportedOperationException("Set image is not supported for DefineBits");
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DefineBitsTag extends ImageTag {
|
||||
return false;
|
||||
}
|
||||
|
||||
public DefineBitsTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineBitsTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineBits", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
@@ -68,7 +68,7 @@ public class DefineBitsTag extends ImageTag {
|
||||
getJPEGTables(tags);
|
||||
if ((jtt != null)) {
|
||||
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
|
||||
byte jttdata[] = jtt.getData(10);
|
||||
byte[] jttdata = jtt.getData(10);
|
||||
if (jttdata.length != 0) {
|
||||
baos.write(jttdata, SWF.hasErrorHeader(jttdata) ? 4 : 0, jttdata.length - (SWF.hasErrorHeader(jttdata) ? 6 : 2));
|
||||
baos.write(jpegData, SWF.hasErrorHeader(jpegData) ? 6 : 2, jpegData.length - (SWF.hasErrorHeader(jttdata) ? 6 : 2));
|
||||
|
||||
@@ -92,7 +92,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineButton2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineButton2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineButton2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
buttonId = sis.readUI16();
|
||||
@@ -132,7 +132,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
|
||||
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
|
||||
OutputStream os2 = baos2;
|
||||
byte origbrdata[] = null;
|
||||
byte[] origbrdata = null;
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
SWFInputStream sis = new SWFInputStream(bais, version);
|
||||
int len = sis.readUI16();
|
||||
@@ -144,7 +144,7 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded
|
||||
try (SWFOutputStream sos2 = new SWFOutputStream(os2, version)) {
|
||||
sos2.writeBUTTONRECORDList(characters, true);
|
||||
}
|
||||
byte brdata[] = baos2.toByteArray();
|
||||
byte[] brdata = baos2.toByteArray();
|
||||
if (Configuration.DEBUG_COPY) {
|
||||
if (origbrdata != null) {
|
||||
if (origbrdata.length != brdata.length) {
|
||||
|
||||
@@ -62,7 +62,7 @@ public class DefineButtonCxformTag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineButtonCxformTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineButtonCxformTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineButtonCxform", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
buttonId = sis.readUI16();
|
||||
|
||||
@@ -90,7 +90,7 @@ public class DefineButtonSoundTag extends CharacterTag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineButtonSoundTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineButtonSoundTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineButtonSound", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
buttonId = sis.readUI16();
|
||||
|
||||
@@ -91,7 +91,7 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineButtonTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineButtonTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineButton", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
buttonId = sis.readUI16();
|
||||
@@ -165,7 +165,7 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int prevLength = 0;
|
||||
if (previousTag != null) {
|
||||
byte prevData[] = previousTag.getData(version);
|
||||
byte[] prevData = previousTag.getData(version);
|
||||
baos.write(prevData);
|
||||
prevLength = prevData.length;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ public class DefineEditTextTag extends TextTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineEditTextTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineEditTextTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineEditText", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -59,7 +59,7 @@ public class DefineFont2Tag extends FontTag {
|
||||
public int fontLeading;
|
||||
public List<Integer> fontAdvanceTable;
|
||||
public List<RECT> fontBoundsTable;
|
||||
public KERNINGRECORD fontKerningTable[];
|
||||
public KERNINGRECORD[] fontKerningTable;
|
||||
public static final int ID = 48;
|
||||
|
||||
@Override
|
||||
@@ -114,7 +114,7 @@ public class DefineFont2Tag extends FontTag {
|
||||
offsetTable.add((glyphShapeTable.size() + 1/*CodeTableOffset*/) * (fontFlagsWideOffsets ? 4 : 2) + sos3.getPos());
|
||||
sos3.writeSHAPE(glyphShapeTable.get(i), 1);
|
||||
}
|
||||
byte baGlyphShapes[] = baosGlyphShapes.toByteArray();
|
||||
byte[] baGlyphShapes = baosGlyphShapes.toByteArray();
|
||||
for (Long offset : offsetTable) {
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset);
|
||||
@@ -170,7 +170,7 @@ public class DefineFont2Tag extends FontTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineFont2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFont2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFont2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontId = sis.readUI16();
|
||||
|
||||
@@ -50,7 +50,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
public LANGCODE languageCode;
|
||||
public String fontName;
|
||||
public int numGlyphs;
|
||||
//public long offsetTable[];
|
||||
//public long[] offsetTable];
|
||||
public List<SHAPE> glyphShapeTable;
|
||||
public List<Integer> codeTable;
|
||||
public int fontAscent;
|
||||
@@ -58,7 +58,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
public int fontLeading;
|
||||
public List<Integer> fontAdvanceTable;
|
||||
public List<RECT> fontBoundsTable;
|
||||
public KERNINGRECORD fontKerningTable[];
|
||||
public KERNINGRECORD[] fontKerningTable;
|
||||
public static final int ID = 75;
|
||||
|
||||
@Override
|
||||
@@ -90,7 +90,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
return codeTable.indexOf((Integer) (int) c);
|
||||
}
|
||||
|
||||
public DefineFont3Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFont3Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFont3", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontId = sis.readUI16();
|
||||
@@ -189,7 +189,7 @@ public class DefineFont3Tag extends FontTag {
|
||||
offsetTable.add((glyphShapeTable.size() + 1/*CodeTableOffset*/) * (fontFlagsWideOffsets ? 4 : 2) + sos3.getPos());
|
||||
sos3.writeSHAPE(glyphShapeTable.get(i), 1);
|
||||
}
|
||||
byte baGlyphShapes[] = baosGlyphShapes.toByteArray();
|
||||
byte[] baGlyphShapes = baosGlyphShapes.toByteArray();
|
||||
for (Long offset : offsetTable) {
|
||||
if (fontFlagsWideOffsets) {
|
||||
sos.writeUI32(offset);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DefineFont4Tag extends CharacterTag {
|
||||
public boolean fontFlagsItalic;
|
||||
public boolean fontFlagsBold;
|
||||
public String fontName;
|
||||
public byte fontData[];
|
||||
public byte[] fontData;
|
||||
public static final int ID = 91;
|
||||
|
||||
@Override
|
||||
@@ -40,7 +40,7 @@ public class DefineFont4Tag extends CharacterTag {
|
||||
return fontID;
|
||||
}
|
||||
|
||||
public DefineFont4Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFont4Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFont4", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontID = sis.readUI16();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class DefineFontAlignZonesTag extends Tag {
|
||||
public List<ZONERECORD> zoneTable;
|
||||
public static final int ID = 73;
|
||||
|
||||
public DefineFontAlignZonesTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFontAlignZonesTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFontAlignZones", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontID = sis.readUI16();
|
||||
|
||||
@@ -84,7 +84,7 @@ public class DefineFontInfo2Tag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineFontInfo2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFontInfo2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFontInfo2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontID = sis.readUI16();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class DefineFontInfoTag extends Tag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineFontInfoTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFontInfoTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFontInfo", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontId = sis.readUI16();
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DefineFontNameTag extends Tag {
|
||||
public String fontCopyright;
|
||||
public static final int ID = 88;
|
||||
|
||||
public DefineFontNameTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFontNameTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFontName", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontId = sis.readUI16();
|
||||
|
||||
@@ -138,7 +138,7 @@ public class DefineFontTag extends FontTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineFontTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineFontTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineFont", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
fontId = sis.readUI16();
|
||||
|
||||
@@ -117,7 +117,7 @@ public class DefineMorphShape2Tag extends CharacterTag implements BoundedTag, Mo
|
||||
sos2.writeMORPHFILLSTYLEARRAY(morphFillStyles, 2);
|
||||
sos2.writeMORPHLINESTYLEARRAY(morphLineStyles, 2);
|
||||
sos2.writeSHAPE(startEdges, 1);
|
||||
byte ba2[] = baos2.toByteArray();
|
||||
byte[] ba2 = baos2.toByteArray();
|
||||
sos.writeUI32(ba2.length);
|
||||
sos.write(ba2);
|
||||
sos.writeSHAPE(endEdges, 1);
|
||||
@@ -134,7 +134,7 @@ public class DefineMorphShape2Tag extends CharacterTag implements BoundedTag, Mo
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineMorphShape2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineMorphShape2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineMorphShape2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterId = sis.readUI16();
|
||||
|
||||
@@ -98,7 +98,7 @@ public class DefineMorphShapeTag extends CharacterTag implements BoundedTag, Mor
|
||||
sos2.writeMORPHFILLSTYLEARRAY(morphFillStyles, 1);
|
||||
sos2.writeMORPHLINESTYLEARRAY(morphLineStyles, 1);
|
||||
sos2.writeSHAPE(startEdges, 1);
|
||||
byte d[] = baos2.toByteArray();
|
||||
byte[] d = baos2.toByteArray();
|
||||
sos.writeUI32(d.length);
|
||||
sos.write(d);
|
||||
sos.writeSHAPE(endEdges, 1);
|
||||
@@ -116,7 +116,7 @@ public class DefineMorphShapeTag extends CharacterTag implements BoundedTag, Mor
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineMorphShapeTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineMorphShapeTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineMorphShape", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterId = sis.readUI16();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class DefineScalingGridTag extends Tag {
|
||||
private RECT splitter;
|
||||
public static final int ID = 78;
|
||||
|
||||
public DefineScalingGridTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineScalingGridTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineScalingGrid", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterId = sis.readUI16();
|
||||
|
||||
@@ -31,10 +31,10 @@ import java.io.OutputStream;
|
||||
*/
|
||||
public class DefineSceneAndFrameLabelDataTag extends Tag {
|
||||
|
||||
public long sceneOffsets[];
|
||||
public String sceneNames[];
|
||||
public long frameNums[];
|
||||
public String frameNames[];
|
||||
public long[] sceneOffsets;
|
||||
public String[] sceneNames;
|
||||
public long[] frameNums;
|
||||
public String[] frameNames;
|
||||
public static final int ID = 86;
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ public class DefineSceneAndFrameLabelDataTag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineSceneAndFrameLabelDataTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineSceneAndFrameLabelDataTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineSceneAndFrameLabelData", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
int sceneCount = (int) sis.readEncodedU32();
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DefineShape2Tag extends CharacterTag implements BoundedTag, ShapeTa
|
||||
return shapeBounds;
|
||||
}
|
||||
|
||||
public DefineShape2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineShape2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineShape2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
shapeId = sis.readUI16();
|
||||
|
||||
@@ -81,7 +81,7 @@ public class DefineShape3Tag extends CharacterTag implements BoundedTag, ShapeTa
|
||||
return shapeId;
|
||||
}
|
||||
|
||||
public DefineShape3Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineShape3Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineShape3", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
shapeId = sis.readUI16();
|
||||
|
||||
@@ -85,7 +85,7 @@ public class DefineShape4Tag extends CharacterTag implements BoundedTag, ShapeTa
|
||||
return shapeBounds;
|
||||
}
|
||||
|
||||
public DefineShape4Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineShape4Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineShape4", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
shapeId = sis.readUI16();
|
||||
|
||||
@@ -61,7 +61,7 @@ public class DefineShapeTag extends CharacterTag implements BoundedTag, ShapeTag
|
||||
return shapeBounds;
|
||||
}
|
||||
|
||||
public DefineShapeTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineShapeTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineShape", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
shapeId = sis.readUI16();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class DefineSoundTag extends CharacterTag {
|
||||
public int soundSize;
|
||||
public int soundType;
|
||||
public long soundSampleCount;
|
||||
public byte soundData[];
|
||||
public byte[] soundData;
|
||||
public static final int ID = 14;
|
||||
|
||||
@Override
|
||||
@@ -85,7 +85,7 @@ public class DefineSoundTag extends CharacterTag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineSoundTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineSoundTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineSound", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
soundId = sis.readUI16();
|
||||
|
||||
@@ -192,7 +192,7 @@ public class DefineSpriteTag extends CharacterTag implements Container, BoundedT
|
||||
* @param skipUnusualTags
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineSpriteTag(SWF swf, byte data[], int version, int level, long pos, boolean parallel, boolean skipUnusualTags) throws IOException {
|
||||
public DefineSpriteTag(SWF swf, byte[] data, int version, int level, long pos, boolean parallel, boolean skipUnusualTags) throws IOException {
|
||||
super(swf, ID, "DefineSprite", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version, pos);
|
||||
spriteId = sis.readUI16();
|
||||
|
||||
@@ -439,7 +439,7 @@ public class DefineText2Tag extends TextTag implements DrawableTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineText2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineText2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineText2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -443,7 +443,7 @@ public class DefineTextTag extends TextTag implements DrawableTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineTextTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineTextTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineText", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class DefineVideoStreamTag extends CharacterTag implements BoundedTag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public DefineVideoStreamTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DefineVideoStreamTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DefineVideoStream", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
characterID = sis.readUI16();
|
||||
|
||||
@@ -65,7 +65,7 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DoABCDefineTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DoABCDefineTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DoABCDefine", data, pos);
|
||||
InputStream is = new ByteArrayInputStream(data);
|
||||
SWFInputStream sis = new SWFInputStream(is, version);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class DoABCTag extends Tag implements ABCContainerTag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DoABCTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DoABCTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DoABC", data, pos);
|
||||
InputStream is = new ByteArrayInputStream(data);
|
||||
abc = new ABC(is);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class DoActionTag extends Tag implements ASMSource {
|
||||
* @param version SWF version
|
||||
* @param pos
|
||||
*/
|
||||
public DoActionTag(SWF swf, byte data[], int version, long pos) {
|
||||
public DoActionTag(SWF swf, byte[] data, int version, long pos) {
|
||||
super(swf, ID, "DoAction", data, pos);
|
||||
actionBytes = data;
|
||||
}
|
||||
@@ -109,10 +109,10 @@ public class DoActionTag extends Tag implements ASMSource {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int prevLength = 0;
|
||||
if (previousTag != null) {
|
||||
byte prevData[] = previousTag.getData(version);
|
||||
byte[] prevData = previousTag.getData(version);
|
||||
baos.write(prevData);
|
||||
prevLength = prevData.length;
|
||||
byte header[] = SWFOutputStream.getTagHeader(this, data, version);
|
||||
byte[] header = SWFOutputStream.getTagHeader(this, data, version);
|
||||
baos.write(header);
|
||||
prevLength += header.length;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public DoInitActionTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public DoInitActionTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "DoInitAction", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
spriteId = sis.readUI16();
|
||||
@@ -115,13 +115,13 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int prevLength = 0;
|
||||
if (previousTag != null) {
|
||||
byte prevData[] = previousTag.getData(version);
|
||||
byte[] prevData = previousTag.getData(version);
|
||||
baos.write(prevData);
|
||||
prevLength = prevData.length;
|
||||
baos.write(0);
|
||||
baos.write(0);
|
||||
prevLength += 2;
|
||||
byte header[] = SWFOutputStream.getTagHeader(this, data, version);
|
||||
byte[] header = SWFOutputStream.getTagHeader(this, data, version);
|
||||
baos.write(header);
|
||||
prevLength += header.length;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
if ((expName == null) || expName.equals("")) {
|
||||
return super.toString();
|
||||
}
|
||||
String pathParts[];
|
||||
String[] pathParts;
|
||||
if (expName.contains(".")) {
|
||||
pathParts = expName.split("\\.");
|
||||
} else {
|
||||
@@ -188,7 +188,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource {
|
||||
if ((expName == null) || expName.equals("")) {
|
||||
return super.toString();
|
||||
}
|
||||
String pathParts[];
|
||||
String[] pathParts;
|
||||
if (expName.contains(".")) {
|
||||
pathParts = expName.split("\\.");
|
||||
} else {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class EnableDebugger2Tag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public EnableDebugger2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public EnableDebugger2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "EnableDebugger2", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
reserved = sis.readUI16();
|
||||
|
||||
@@ -64,7 +64,7 @@ public class EnableDebuggerTag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public EnableDebuggerTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public EnableDebuggerTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "EnableDebugger", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
passwordHash = sis.readString();
|
||||
|
||||
@@ -33,7 +33,7 @@ public class EnableTelemetryTag extends Tag {
|
||||
|
||||
public static final int ID = 93;
|
||||
public int reserved;
|
||||
public byte passwordHash[];
|
||||
public byte[] passwordHash;
|
||||
|
||||
/**
|
||||
* Gets data bytes
|
||||
@@ -65,7 +65,7 @@ public class EnableTelemetryTag extends Tag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public EnableTelemetryTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public EnableTelemetryTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
reserved = (int) sis.readUB(16);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class EndTag extends Tag {
|
||||
* @param pos
|
||||
* @throws IOException
|
||||
*/
|
||||
public EndTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public EndTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "End", data, pos);
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ExportAssetsTag extends Tag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public ExportAssetsTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public ExportAssetsTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "ExportAssets", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
int count = sis.readUI16();
|
||||
|
||||
@@ -41,7 +41,7 @@ public class FileAttributesTag extends Tag {
|
||||
super(null, ID, "FileAttributes", new byte[]{}, 0);
|
||||
}
|
||||
|
||||
public FileAttributesTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public FileAttributesTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "FileAttributes", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
reserved1 = (int) sis.readUB(1); // reserved
|
||||
|
||||
@@ -38,7 +38,7 @@ public class FrameLabelTag extends Tag {
|
||||
return namedAnchor;
|
||||
}
|
||||
|
||||
public FrameLabelTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public FrameLabelTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "FrameLabel", data, pos);
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
name = sis.readString();
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ImportAssets2Tag extends Tag implements ImportTag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public ImportAssets2Tag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public ImportAssets2Tag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "ImportAssets2", data, pos);
|
||||
assets = new HashMap<>();
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ImportAssetsTag extends Tag implements ImportTag {
|
||||
* @param version SWF version
|
||||
* @throws IOException
|
||||
*/
|
||||
public ImportAssetsTag(SWF swf, byte data[], int version, long pos) throws IOException {
|
||||
public ImportAssetsTag(SWF swf, byte[] data, int version, long pos) throws IOException {
|
||||
super(swf, ID, "ImportAssets", data, pos);
|
||||
assets = new HashMap<>();
|
||||
SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user