mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-08-02 15:42:36 +00:00
Merge origin/master
This commit is contained in:
@@ -656,16 +656,16 @@ public class AVM2Code implements Cloneable {
|
||||
}
|
||||
|
||||
public Object execute(HashMap<Integer, Object> arguments, AVM2ConstantPool constants) throws AVM2ExecutionException {
|
||||
return execute(arguments, constants, AVM2Runtime.UNKNOWN, 0);
|
||||
return execute(arguments, constants, null);
|
||||
}
|
||||
|
||||
public Object execute(HashMap<Integer, Object> arguments, AVM2ConstantPool constants, AVM2Runtime runtime, int runtimeVersoin) throws AVM2ExecutionException {
|
||||
public Object execute(HashMap<Integer, Object> arguments, AVM2ConstantPool constants, AVM2RuntimeInfo runtimeInfo) throws AVM2ExecutionException {
|
||||
int pos = 0;
|
||||
LocalDataArea lda = new LocalDataArea();
|
||||
lda.methodName = "methodName"; // todo: needed for VerifyError exception message
|
||||
lda.localRegisters = arguments;
|
||||
lda.runtime = runtime;
|
||||
lda.runtimeVersion = runtimeVersoin;
|
||||
lda.runtimeInfo = runtimeInfo;
|
||||
|
||||
for (AVM2Instruction ins : code) {
|
||||
ins.definition.verify(lda, constants, ins);
|
||||
}
|
||||
@@ -680,7 +680,7 @@ public class AVM2Code implements Cloneable {
|
||||
try {
|
||||
pos = adr2pos(lda.jump);
|
||||
} catch (ConvertException ex) {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.BRANCH_TARGET_INVALID_INSTRUCTION);
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.BRANCH_TARGET_INVALID_INSTRUCTION, lda.isDebug());
|
||||
}
|
||||
lda.jump = null;
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. */
|
||||
package com.jpexs.decompiler.flash.abc.avm2;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class AVM2RuntimeInfo {
|
||||
|
||||
public AVM2Runtime runtime;
|
||||
|
||||
public int version;
|
||||
|
||||
public boolean debug;
|
||||
|
||||
public AVM2RuntimeInfo(AVM2Runtime runtime, int version, boolean debug) {
|
||||
this.runtime = runtime;
|
||||
this.version = version;
|
||||
this.debug = debug;
|
||||
}
|
||||
}
|
||||
@@ -35,9 +35,7 @@ public class LocalDataArea {
|
||||
|
||||
public String executionException;
|
||||
|
||||
public AVM2Runtime runtime;
|
||||
|
||||
public int runtimeVersion;
|
||||
public AVM2RuntimeInfo runtimeInfo;
|
||||
|
||||
private byte[] domainMemory;
|
||||
|
||||
@@ -46,12 +44,20 @@ public class LocalDataArea {
|
||||
|
||||
public byte[] getDomainMemory() {
|
||||
if (domainMemory == null) {
|
||||
domainMemory = new byte[1024 * 1024];
|
||||
domainMemory = new byte[1024]; // in flash player this is the default size
|
||||
}
|
||||
|
||||
return domainMemory;
|
||||
}
|
||||
|
||||
public AVM2Runtime getRuntime() {
|
||||
return runtimeInfo == null ? AVM2Runtime.UNKNOWN : runtimeInfo.runtime;
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return runtimeInfo != null && runtimeInfo.debug;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
operandStack.clear();
|
||||
scopeStack.clear();
|
||||
|
||||
@@ -21,23 +21,23 @@ package com.jpexs.decompiler.flash.abc.avm2.exceptions;
|
||||
*/
|
||||
public class AVM2RangeErrorException extends AVM2ExecutionException {
|
||||
|
||||
public AVM2RangeErrorException(int code) {
|
||||
super(codeToMessage(code, null));
|
||||
public AVM2RangeErrorException(int code, boolean debug) {
|
||||
super(codeToMessage(code, debug, null));
|
||||
}
|
||||
|
||||
public AVM2RangeErrorException(int code, Object[] params) {
|
||||
super(codeToMessage(code, params));
|
||||
public AVM2RangeErrorException(int code, boolean debug, Object[] params) {
|
||||
super(codeToMessage(code, debug, params));
|
||||
}
|
||||
|
||||
private static String codeToMessage(int code, Object[] params) {
|
||||
private static String codeToMessage(int code, boolean debug, Object[] params) {
|
||||
String msg = null;
|
||||
switch (code) {
|
||||
}
|
||||
|
||||
String result = "RangeError: Error #" + code;
|
||||
/*if (msg != null) {
|
||||
result += ": " + msg;
|
||||
}*/
|
||||
if (debug && msg != null) {
|
||||
result += ": " + msg;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -21,23 +21,23 @@ package com.jpexs.decompiler.flash.abc.avm2.exceptions;
|
||||
*/
|
||||
public class AVM2TypeErrorException extends AVM2ExecutionException {
|
||||
|
||||
public AVM2TypeErrorException(int code) {
|
||||
super(codeToMessage(code, null));
|
||||
public AVM2TypeErrorException(int code, boolean debug) {
|
||||
super(codeToMessage(code, debug, null));
|
||||
}
|
||||
|
||||
public AVM2TypeErrorException(int code, Object[] params) {
|
||||
super(codeToMessage(code, params));
|
||||
public AVM2TypeErrorException(int code, boolean debug, Object[] params) {
|
||||
super(codeToMessage(code, debug, params));
|
||||
}
|
||||
|
||||
private static String codeToMessage(int code, Object[] params) {
|
||||
private static String codeToMessage(int code, boolean debug, Object[] params) {
|
||||
String msg = null;
|
||||
switch (code) {
|
||||
}
|
||||
|
||||
String result = "TypeError: Error #" + code;
|
||||
/*if (msg != null) {
|
||||
result += ": " + msg;
|
||||
}*/
|
||||
if (debug && msg != null) {
|
||||
result += ": " + msg;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -27,15 +27,15 @@ public class AVM2VerifyErrorException extends AVM2ExecutionException {
|
||||
|
||||
public static final int CPOOL_INDEX_OUT_OF_RANGE = 1032;
|
||||
|
||||
public AVM2VerifyErrorException(int code) {
|
||||
super(codeToMessage(code, null));
|
||||
public AVM2VerifyErrorException(int code, boolean debug) {
|
||||
super(codeToMessage(code, debug, null));
|
||||
}
|
||||
|
||||
public AVM2VerifyErrorException(int code, Object[] params) {
|
||||
super(codeToMessage(code, params));
|
||||
public AVM2VerifyErrorException(int code, boolean debug, Object[] params) {
|
||||
super(codeToMessage(code, debug, params));
|
||||
}
|
||||
|
||||
private static String codeToMessage(int code, Object[] params) {
|
||||
private static String codeToMessage(int code, boolean debug, Object[] params) {
|
||||
String msg = null;
|
||||
switch (code) {
|
||||
case ILLEGAL_OPCODE:
|
||||
@@ -56,9 +56,9 @@ public class AVM2VerifyErrorException extends AVM2ExecutionException {
|
||||
}
|
||||
|
||||
String result = "VerifyError: Error #" + code;
|
||||
/*if (msg != null) {
|
||||
result += ": " + msg;
|
||||
}*/
|
||||
if (debug && msg != null) {
|
||||
result += ": " + msg;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -98,27 +98,27 @@ public abstract class InstructionDefinition implements Serializable {
|
||||
if (operand == AVM2Code.DAT_MULTINAME_INDEX) {
|
||||
int idx = ins.operands[i];
|
||||
if (idx <= 0 || idx >= constants.getMultinameCount()) {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getMultinameCount()});
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getMultinameCount()});
|
||||
}
|
||||
} else if (operand == AVM2Code.DAT_DOUBLE_INDEX) {
|
||||
int idx = ins.operands[i];
|
||||
if (idx <= 0 || idx >= constants.getDoubleCount()) {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getDoubleCount()});
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getDoubleCount()});
|
||||
}
|
||||
} else if (operand == AVM2Code.DAT_INT_INDEX) {
|
||||
int idx = ins.operands[i];
|
||||
if (idx <= 0 || idx >= constants.getIntCount()) {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getIntCount()});
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getIntCount()});
|
||||
}
|
||||
} else if (operand == AVM2Code.DAT_UINT_INDEX) {
|
||||
int idx = ins.operands[i];
|
||||
if (idx <= 0 || idx >= constants.getUIntCount()) {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getUIntCount()});
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getUIntCount()});
|
||||
}
|
||||
} else if (operand == AVM2Code.DAT_STRING_INDEX) {
|
||||
int idx = ins.operands[i];
|
||||
if (idx <= 0 || idx >= constants.getStringCount()) {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, new Object[]{idx, constants.getStringCount()});
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public abstract class InstructionDefinition implements Serializable {
|
||||
}
|
||||
|
||||
protected void illegalOpCode(LocalDataArea lda, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.ILLEGAL_OPCODE, new Object[]{lda.methodName, instructionCode, ins.getOffset()});
|
||||
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.ILLEGAL_OPCODE, lda.isDebug(), new Object[]{lda.methodName, instructionCode, ins.getOffset()});
|
||||
}
|
||||
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) throws InterruptedException {
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -31,8 +32,12 @@ public class UnknownInstruction extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
// todo: get 32 bits float
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
// todo: get 64 bits float
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
// todo: get 16 bits
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
// todo: get 32 bits
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
lda.operandStack.push((Double) (double) (domainMemory[addr]));
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
Double value = (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
Double value = (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
int value = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
int value = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
|
||||
@@ -41,10 +41,10 @@ public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2RangeErrorException {
|
||||
int addr = (int) (double) EcmaScript.toNumber(lda.operandStack.pop());
|
||||
int addr = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
byte[] domainMemory = lda.getDomainMemory();
|
||||
if (addr < 0 || addr >= domainMemory.length) {
|
||||
throw new AVM2RangeErrorException(1506);
|
||||
throw new AVM2RangeErrorException(1506, lda.isDebug());
|
||||
}
|
||||
|
||||
int value = EcmaScript.toInt32(lda.operandStack.pop());
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class AbsJumpIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class AddDIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class AddPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class AllocIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class CallInterfaceIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class CallSuperIdIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class CodeGenOpIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class ConcatIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class ConvertF4Ins extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class ConvertMIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class ConvertMPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class DecLocalPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class DecodeIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class DecrementPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class DelDescendantsIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class DeletePropertyLateIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class DividePIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class DoubleToAtomIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class FindPropGlobalIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class IncLocalPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,11 +31,11 @@ public class IncrementPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class InvalidIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class Lf32x4Ins extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class MarkIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class ModuloPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class MultiplyPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class NegatePIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class PrologueIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class PushConstantIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class PushDNanIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class PushDecimalIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class PushFloat4Ins extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class SendEnterIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class SetPropertyLateIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -30,11 +30,11 @@ public class Sf32x4Ins extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -32,12 +32,12 @@ public class SubtractPIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class SweepIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class VerifyOpIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class VerifyPassIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,9 +18,9 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
|
||||
@@ -31,12 +31,12 @@ public class WbIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
if (lda.runtime == AVM2Runtime.ADOBE_FLASH) {
|
||||
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
|
||||
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
|
||||
illegalOpCode(lda, ins);
|
||||
}
|
||||
|
||||
return super.execute(lda, constants, ins);
|
||||
super.verify(lda, constants, ins);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,9 +20,9 @@ import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2TypeErrorException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item;
|
||||
@@ -46,7 +46,7 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2ExecutionException {
|
||||
Multiname multiname = (Multiname) ins.getParam(constants, 0);
|
||||
if (multiname == null) {
|
||||
throw new AVM2TypeErrorException(1034);
|
||||
throw new AVM2TypeErrorException(1034, lda.isDebug());
|
||||
}
|
||||
|
||||
Object value = lda.operandStack.pop();
|
||||
@@ -54,13 +54,22 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT
|
||||
value = Null.INSTANCE;
|
||||
}
|
||||
|
||||
//push and pop coerced value to specified type
|
||||
EcmaType type = EcmaScript.type(value);
|
||||
if (type != EcmaType.NULL && type != EcmaType.OBJECT) {
|
||||
throw new AVM2TypeErrorException(1034);
|
||||
switch (type) {
|
||||
case NUMBER:
|
||||
case BOOLEAN:
|
||||
lda.operandStack.push(EcmaScript.toString(value));
|
||||
break;
|
||||
case NULL:
|
||||
case OBJECT:
|
||||
case STRING:
|
||||
lda.operandStack.push(value);
|
||||
break;
|
||||
default:
|
||||
throw new AVM2TypeErrorException(1034, lda.isDebug());
|
||||
}
|
||||
|
||||
//push and pop coerced value to specified type
|
||||
lda.operandStack.push(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.CoerceAVM2Item;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.ecma.Null;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
@@ -47,7 +48,7 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert
|
||||
if (value == Null.INSTANCE) {
|
||||
lda.operandStack.push(value);
|
||||
} else {
|
||||
lda.operandStack.push(value.toString());
|
||||
lda.operandStack.push(EcmaScript.toString(value));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -42,11 +42,11 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2TypeErrorException {
|
||||
Object obj = lda.operandStack.peek();
|
||||
if (EcmaScript.type(obj) == EcmaType.NULL) {
|
||||
throw new AVM2TypeErrorException(1009);
|
||||
throw new AVM2TypeErrorException(1009, lda.isDebug());
|
||||
}
|
||||
|
||||
if (EcmaScript.type(obj) == EcmaType.UNDEFINED) {
|
||||
throw new AVM2TypeErrorException(1010);
|
||||
throw new AVM2TypeErrorException(1010, lda.isDebug());
|
||||
}
|
||||
|
||||
//throw if pop is not object
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.ConvertAVM2Item;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
@@ -38,7 +39,7 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object obj = lda.operandStack.pop();
|
||||
lda.operandStack.push(obj.toString());
|
||||
lda.operandStack.push(EcmaScript.toString(obj));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.EscapeXAttrAVM2Item;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.List;
|
||||
@@ -35,8 +36,8 @@ public class EscXAttrIns extends InstructionDefinition {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
String s = lda.operandStack.pop().toString();
|
||||
//escape
|
||||
String s = EcmaScript.toString(lda.operandStack.pop());
|
||||
// todo: escape
|
||||
lda.operandStack.push(s);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.EscapeXElemAVM2Item;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.List;
|
||||
@@ -35,8 +36,8 @@ public class EscXElemIns extends InstructionDefinition {
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
String s = lda.operandStack.pop().toString();
|
||||
//escape
|
||||
String s = EcmaScript.toString(lda.operandStack.pop());
|
||||
// todo: escape
|
||||
lda.operandStack.push(s);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -163,12 +163,7 @@ public final class MethodBody implements Cloneable {
|
||||
}
|
||||
|
||||
public void markOffsets() {
|
||||
long offset = 0;
|
||||
AVM2Code code = getCode();
|
||||
for (int i = 0; i < code.code.size(); i++) {
|
||||
code.code.get(i).offset = offset;
|
||||
offset += code.code.get(i).getBytesLength();
|
||||
}
|
||||
getCode().markOffsets();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionAsciiToChar;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -51,11 +52,11 @@ public class AsciiToCharActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(value.getResultAsNumber());
|
||||
return getResult(value.getResult());
|
||||
}
|
||||
|
||||
public static String getResult(Double ascii) {
|
||||
int res = (int) (double) ascii;
|
||||
public static String getResult(Object ascii) {
|
||||
int res = (char) EcmaScript.toInt32(ascii);
|
||||
if (res == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionMBAsciiToChar;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -51,11 +52,11 @@ public class MBAsciiToCharActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(value.getResultAsNumber());
|
||||
return getResult(value.getResult());
|
||||
}
|
||||
|
||||
public static String getResult(Double ascii) {
|
||||
int res = (int) (double) ascii;
|
||||
public static String getResult(Object ascii) {
|
||||
int res = (char) EcmaScript.toInt32(ascii);
|
||||
if (res == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MBStringExtractActionItem extends ActionItem {
|
||||
}
|
||||
|
||||
public MBStringExtractActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem index, GraphTargetItem count) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
|
||||
this.index = index;
|
||||
this.count = count;
|
||||
}
|
||||
@@ -80,10 +80,10 @@ public class MBStringExtractActionItem extends ActionItem {
|
||||
|
||||
public static String getResult(Object count, Object index, Object value) {
|
||||
String str = EcmaScript.toString(value);
|
||||
int idx = (int) (double) EcmaScript.toNumberAs2(index);
|
||||
int idx = EcmaScript.toInt32(index);
|
||||
idx--; // index seems to be 1 based
|
||||
|
||||
int cnt = (int) (double) EcmaScript.toNumberAs2(count);
|
||||
int cnt = EcmaScript.toInt32(count);
|
||||
|
||||
/*if (idx < 0) {
|
||||
idx = str.length() + idx;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class StringExtractActionItem extends ActionItem {
|
||||
public GraphTargetItem count;
|
||||
|
||||
public StringExtractActionItem(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem index, GraphTargetItem count) {
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
|
||||
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
|
||||
this.index = index;
|
||||
this.count = count;
|
||||
}
|
||||
@@ -69,10 +69,10 @@ public class StringExtractActionItem extends ActionItem {
|
||||
|
||||
public static String getResult(Object count, Object index, Object value) {
|
||||
String str = EcmaScript.toString(value);
|
||||
int idx = (int) (double) EcmaScript.toNumberAs2(index);
|
||||
int idx = EcmaScript.toInt32(index);
|
||||
idx--; // index seems to be 1 based
|
||||
|
||||
int cnt = (int) (double) EcmaScript.toNumberAs2(count);
|
||||
int cnt = EcmaScript.toInt32(count);
|
||||
|
||||
/*if (idx < 0) {
|
||||
idx = str.length() + idx;
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf4.ActionToInteger;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -51,11 +52,11 @@ public class ToIntegerActionItem extends ActionItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(value.getResultAsNumber());
|
||||
return getResult(value.getResult());
|
||||
}
|
||||
|
||||
public static long getResult(Double num) {
|
||||
return Math.round(num);
|
||||
public static long getResult(Object num) {
|
||||
return EcmaScript.toInt32(num);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitAnd;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,11 +35,11 @@ public class BitAndActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
|
||||
return getResult(rightSide.getResult(), leftSide.getResult());
|
||||
}
|
||||
|
||||
public static long getResult(Double rightResult, Double leftResult) {
|
||||
return ((long) (double) leftResult) & ((long) (double) rightResult);
|
||||
public static long getResult(Object rightResult, Object leftResult) {
|
||||
return EcmaScript.toInt32(leftResult) & EcmaScript.toInt32(rightResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitOr;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,11 +35,11 @@ public class BitOrActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
|
||||
return getResult(rightSide.getResult(), leftSide.getResult());
|
||||
}
|
||||
|
||||
public static long getResult(Double rightResult, Double leftResult) {
|
||||
return ((long) (double) leftResult) | ((long) (double) rightResult);
|
||||
public static long getResult(Object rightResult, Object leftResult) {
|
||||
return EcmaScript.toInt32(leftResult) | EcmaScript.toInt32(rightResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.model.DirectValueActionItem;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitXor;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
@@ -37,11 +38,11 @@ public class BitXorActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
|
||||
return getResult(rightSide.getResult(), leftSide.getResult());
|
||||
}
|
||||
|
||||
public static long getResult(Double rightResult, Double leftResult) {
|
||||
return ((long) (double) leftResult) ^ ((long) (double) rightResult);
|
||||
public static long getResult(Object rightResult, Object leftResult) {
|
||||
return EcmaScript.toInt32(leftResult) ^ EcmaScript.toInt32(rightResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public class EqActionItem extends BinaryOpItem implements LogicalOpItem, EqualsT
|
||||
|
||||
public static Boolean getResult(Object rightResult, Object leftResult, boolean version2) {
|
||||
if (version2) {
|
||||
return EcmaScript.equals(leftResult, rightResult);
|
||||
return EcmaScript.equals(true, leftResult, rightResult);
|
||||
} else {
|
||||
//For SWF 4 and older, it should return 1 or 0
|
||||
return (Action.toFloatPoint(leftResult) == Action.toFloatPoint(rightResult));
|
||||
|
||||
@@ -44,13 +44,13 @@ public class GtActionItem extends BinaryOpItem implements LogicalOpItem {
|
||||
}
|
||||
|
||||
public static Object getResult(Object rightResult, Object leftResult) {
|
||||
Object ret = EcmaScript.compare(rightResult, leftResult, true);
|
||||
Object ret = EcmaScript.compare(leftResult, rightResult, true);
|
||||
if (ret == Undefined.INSTANCE) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int reti = (int) ret;
|
||||
return reti == -1;
|
||||
return reti == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitLShift;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,11 +35,11 @@ public class LShiftActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
|
||||
return getResult(rightSide.getResult(), leftSide.getResult());
|
||||
}
|
||||
|
||||
public static int getResult(Double rightResult, Double leftResult) {
|
||||
return ((int) (double) leftResult) << ((int) (double) rightResult);
|
||||
public static int getResult(Object rightResult, Object leftResult) {
|
||||
return EcmaScript.toInt32(leftResult) << EcmaScript.toInt32(rightResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,13 +41,13 @@ public class LeActionItem extends BinaryOpItem implements LogicalOpItem, Inverte
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
Object ret = EcmaScript.compare(rightSide.getResult(), leftSide.getResult(), true);
|
||||
Object ret = EcmaScript.compare(leftSide.getResult(), rightSide.getResult(), true);
|
||||
if (ret == Undefined.INSTANCE) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int reti = (int) ret;
|
||||
return reti != -1;
|
||||
return reti != 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,10 +38,10 @@ public class ModuloActionItem extends BinaryOpItem {
|
||||
}
|
||||
|
||||
public static Number getResult(Double rightResult, Double leftResult) {
|
||||
if (Double.isNaN(rightResult) || Double.compare(rightResult, 0) == 0) {
|
||||
if (Double.isNaN(leftResult) || Double.isNaN(rightResult) || Double.compare(rightResult, 0) == 0) {
|
||||
return Double.NaN;
|
||||
}
|
||||
return ((long) (double) leftResult) % ((long) (double) rightResult);
|
||||
return ((double) leftResult) % ((double) rightResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class NeqActionItem extends BinaryOpItem implements LogicalOpItem, Invert
|
||||
@Override
|
||||
public Object getResult() {
|
||||
if (version2) {
|
||||
return !EcmaScript.equals(leftSide.getResult(), rightSide.getResult());
|
||||
return !EcmaScript.equals(true, leftSide.getResult(), rightSide.getResult());
|
||||
} else {
|
||||
//For SWF 4 and older, it should return 1 or 0
|
||||
return (Action.toFloatPoint(leftSide.getResult()) != Action.toFloatPoint(rightSide.getResult()));
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.action.model.operations;
|
||||
|
||||
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
|
||||
import com.jpexs.decompiler.flash.action.swf5.ActionBitRShift;
|
||||
import com.jpexs.decompiler.flash.ecma.EcmaScript;
|
||||
import com.jpexs.decompiler.graph.CompilationException;
|
||||
import com.jpexs.decompiler.graph.GraphSourceItem;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
@@ -34,12 +35,12 @@ public class RShiftActionItem extends BinaryOpItem {
|
||||
|
||||
@Override
|
||||
public Object getResult() {
|
||||
return getResult(rightSide.getResultAsNumber(), leftSide.getResultAsNumber());
|
||||
return getResult(rightSide.getResult(), leftSide.getResult());
|
||||
}
|
||||
|
||||
public static long getResult(Double rightResult, Double leftResult) {
|
||||
long rightResult2 = ((long) (double) rightResult) & 0x1f;
|
||||
return ((long) (double) leftResult) >> rightResult2;
|
||||
public static long getResult(Object rightResult, Object leftResult) {
|
||||
long rightResult2 = EcmaScript.toInt32(rightResult) & 0x1f;
|
||||
return EcmaScript.toInt32(leftResult) >> rightResult2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,8 +43,7 @@ public class StrictEqActionItem extends BinaryOpItem implements LogicalOpItem, I
|
||||
public static boolean getResult(Object rightResult, Object leftResult) {
|
||||
Object x = leftResult;
|
||||
Object y = rightResult;
|
||||
return EcmaScript.type(x) == EcmaScript.type(y)
|
||||
&& EcmaScript.equals(x, y);
|
||||
return EcmaScript.strictEquals(true, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,8 +39,7 @@ public class StrictNeqActionItem extends BinaryOpItem implements LogicalOpItem,
|
||||
public Object getResult() {
|
||||
Object x = leftSide.getResult();
|
||||
Object y = rightSide.getResult();
|
||||
return EcmaScript.type(x) != EcmaScript.type(y)
|
||||
|| (!EcmaScript.equals(x, y));
|
||||
return !EcmaScript.strictEquals(true, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ActionAsciiToChar extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(AsciiToCharActionItem.getResult(lda.popAsNumber()));
|
||||
lda.stack.push(AsciiToCharActionItem.getResult(lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionMBAsciiToChar extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(MBAsciiToCharActionItem.getResult(lda.popAsNumber()));
|
||||
lda.stack.push(MBAsciiToCharActionItem.getResult(lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.utf8.Utf8Helper;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -254,6 +255,13 @@ public class ActionPush extends Action {
|
||||
updateLength();
|
||||
}
|
||||
|
||||
public ActionPush(Object[] values) {
|
||||
super(0x96, 0);
|
||||
this.values = new ArrayList<>();
|
||||
this.values.addAll(Arrays.asList(values));
|
||||
updateLength();
|
||||
}
|
||||
|
||||
public ActionPush(FlasmLexer lexer, List<String> constantPool) throws IOException, ActionParseException {
|
||||
super(0x96, 0);
|
||||
this.constantPool = constantPool;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionToInteger extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(ToIntegerActionItem.getResult(lda.popAsNumber()));
|
||||
lda.stack.push(ToIntegerActionItem.getResult(lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionBitAnd extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(BitAndActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
|
||||
lda.stack.push(BitAndActionItem.getResult(lda.pop(), lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionBitLShift extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(LShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
|
||||
lda.stack.push(LShiftActionItem.getResult(lda.pop(), lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionBitOr extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(BitOrActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
|
||||
lda.stack.push(BitOrActionItem.getResult(lda.pop(), lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionBitRShift extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(RShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
|
||||
lda.stack.push(RShiftActionItem.getResult(lda.pop(), lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ActionBitXor extends Action {
|
||||
return false;
|
||||
}
|
||||
|
||||
lda.stack.push(BitXorActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
|
||||
lda.stack.push(BitXorActionItem.getResult(lda.pop(), lda.pop()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,10 @@ public class EcmaScript {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
if (o instanceof String && ((String) o).isEmpty()) {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
return toNumber(o);
|
||||
}
|
||||
|
||||
@@ -184,6 +188,15 @@ public class EcmaScript {
|
||||
if (sx.equals(sy)) {
|
||||
return 0;
|
||||
}
|
||||
if (as2) {
|
||||
// in AS2 an empty string is greater than a non-empty string...
|
||||
if (sx.isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
if (sy.isEmpty()) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (sx.startsWith(sy)) {
|
||||
return 1;
|
||||
}
|
||||
@@ -213,14 +226,22 @@ public class EcmaScript {
|
||||
}
|
||||
|
||||
public static boolean strictEquals(Object x, Object y) {
|
||||
return strictEquals(false, x, y);
|
||||
}
|
||||
|
||||
public static boolean equals(Object x, Object y) {
|
||||
return equals(false, x, y);
|
||||
}
|
||||
|
||||
public static boolean strictEquals(boolean as2, Object x, Object y) {
|
||||
if (type(x) != type(y)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return equals(x, y);
|
||||
return equals(as2, x, y);
|
||||
}
|
||||
|
||||
public static boolean equals(Object x, Object y) {
|
||||
public static boolean equals(boolean as2, Object x, Object y) {
|
||||
EcmaType typeX = type(x);
|
||||
EcmaType typeY = type(y);
|
||||
if (typeX == typeY) {
|
||||
@@ -279,16 +300,16 @@ public class EcmaScript {
|
||||
}
|
||||
|
||||
if ((typeX == EcmaType.NUMBER) && (typeY == EcmaType.STRING)) {
|
||||
return equals(x, toNumber(y));
|
||||
return equals(as2, x, as2 ? toNumberAs2(y) : toNumber(y));
|
||||
}
|
||||
if ((typeX == EcmaType.STRING) && (typeY == EcmaType.NUMBER)) {
|
||||
return equals(toNumber(x), y);
|
||||
return equals(as2, as2 ? toNumberAs2(x) : toNumber(x), y);
|
||||
}
|
||||
if (typeX == EcmaType.BOOLEAN) {
|
||||
return equals(toNumber(x), y);
|
||||
return equals(as2, as2 ? toNumberAs2(x) : toNumber(x), y);
|
||||
}
|
||||
if (typeY == EcmaType.BOOLEAN) {
|
||||
return equals(x, toNumber(y));
|
||||
return equals(as2, x, as2 ? toNumberAs2(y) : toNumber(y));
|
||||
}
|
||||
if (typeX == EcmaType.STRING || typeX == EcmaType.NUMBER) {
|
||||
//y is object
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. */
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2RuntimeInfo;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2ExecutionException;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodBody;
|
||||
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
|
||||
import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.tags.DoABC2Tag;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.fail;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class ActionScript3ExecuteTest {
|
||||
|
||||
private SWF swf;
|
||||
|
||||
private ABC abc;
|
||||
|
||||
@BeforeClass
|
||||
public void init() throws IOException, InterruptedException {
|
||||
//Main.initLogging(false);
|
||||
swf = new SWF(new BufferedInputStream(new FileInputStream("testdata/run_as3/run.swf")), false);
|
||||
/*try (InputStream is = new BufferedInputStream(new FileInputStream("testdata/run_as3/run.swf"))) {
|
||||
swf = new SWF(is, false);
|
||||
}*/
|
||||
DoABC2Tag tag = null;
|
||||
for (Tag t : swf.tags) {
|
||||
if (t instanceof DoABC2Tag) {
|
||||
tag = (DoABC2Tag) t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assertNotNull(tag);
|
||||
this.abc = tag.getABC();
|
||||
Configuration.autoDeobfuscate.set(false);
|
||||
Configuration.decompile.set(true);
|
||||
Configuration.registerNameFormat.set("_loc%d_");
|
||||
Configuration.showMethodBodyId.set(false);
|
||||
}
|
||||
|
||||
//@Test
|
||||
public void testRun() throws IOException, InterruptedException {
|
||||
MethodBody body = abc.findBodyByClassAndName("Run", "run");
|
||||
Object result;
|
||||
try {
|
||||
result = body.getCode().execute(new HashMap<>(), abc.constants, new AVM2RuntimeInfo(AVM2Runtime.ADOBE_FLASH, 19, true));
|
||||
assertEquals(result, "Test");
|
||||
} catch (AVM2ExecutionException ex) {
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
//@Test
|
||||
public void testAddMethod() throws IOException, InterruptedException {
|
||||
int classId = abc.findClassByName("Run");
|
||||
MethodBody runBody = abc.findBodyByClassAndName("Run", "runInstance");
|
||||
runBody.max_stack = 10;
|
||||
|
||||
AVM2Code ccode = new AVM2Code();
|
||||
ccode.code = new ArrayList<>();
|
||||
List<AVM2Instruction> code = ccode.code;
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.GetLocal0, null));
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.PushScope, null));
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.PushString, new int[]{abc.constants.getStringId("", true)}));
|
||||
|
||||
for (int testMethodId = 1; testMethodId < 10; testMethodId++) {
|
||||
AVM2Code ccode2 = new AVM2Code();
|
||||
ccode2.code = new ArrayList<>();
|
||||
List<AVM2Instruction> code2 = ccode2.code;
|
||||
code2.add(new AVM2Instruction(0, AVM2Instructions.GetLocal0, null));
|
||||
code2.add(new AVM2Instruction(0, AVM2Instructions.PushScope, null));
|
||||
code2.add(new AVM2Instruction(0, AVM2Instructions.PushString, new int[]{abc.constants.getStringId(testMethodId + ""/* + "\r\n"*/, true)}));
|
||||
code2.add(new AVM2Instruction(0, AVM2Instructions.ReturnValue, null));
|
||||
|
||||
boolean isStatic = testMethodId % 2 == 0;
|
||||
int multinameId = addMethod(classId, "test" + testMethodId, isStatic, ccode2);
|
||||
if (isStatic) {
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.FindPropertyStrict, new int[]{multinameId}));
|
||||
} else {
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.GetLocal0, null));
|
||||
}
|
||||
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.CallProperty, new int[]{multinameId, 0}));
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.Add, null));
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.PushString, new int[]{abc.constants.getStringId("\r\n", true)}));
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.Add, null));
|
||||
}
|
||||
|
||||
code.add(new AVM2Instruction(0, AVM2Instructions.ReturnValue, null));
|
||||
runBody.setCode(ccode);
|
||||
runBody.markOffsets();
|
||||
}
|
||||
|
||||
private int addMethod(int classId, String name, boolean isStatic, AVM2Code code) {
|
||||
TraitMethodGetterSetter methodTrait = abc.addMethod(classId, name, isStatic);
|
||||
MethodInfo methodInfo = abc.method_info.get(methodTrait.method_info);
|
||||
MethodBody methodBody = methodInfo.getBody();
|
||||
methodBody.max_stack = 10;
|
||||
methodBody.max_regs = 10;
|
||||
methodBody.init_scope_depth = 3;
|
||||
methodBody.max_scope_depth = 10;
|
||||
|
||||
methodBody.setCode(code);
|
||||
methodBody.markOffsets();
|
||||
|
||||
return methodTrait.name_index;
|
||||
}
|
||||
}
|
||||
BIN
libsrc/ffdec_lib/testdata/run_as2/run_as2.fla
vendored
Normal file
BIN
libsrc/ffdec_lib/testdata/run_as2/run_as2.fla
vendored
Normal file
Binary file not shown.
49
libsrc/ffdec_lib/testdata/run_as2/run_as2.html
vendored
Normal file
49
libsrc/ffdec_lib/testdata/run_as2/run_as2.html
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>run_as2</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css" media="screen">
|
||||
html, body { height:100%; background-color: #ffffff;}
|
||||
body { margin:0; padding:0; overflow:hidden; }
|
||||
#flashContent { width:100%; height:100%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="flashContent">
|
||||
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="run_as2" align="middle">
|
||||
<param name="movie" value="run_as2.swf" />
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="#ffffff" />
|
||||
<param name="play" value="true" />
|
||||
<param name="loop" value="true" />
|
||||
<param name="wmode" value="window" />
|
||||
<param name="scale" value="showall" />
|
||||
<param name="menu" value="true" />
|
||||
<param name="devicefont" value="false" />
|
||||
<param name="salign" value="" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<!--[if !IE]>-->
|
||||
<object type="application/x-shockwave-flash" data="run_as2.swf" width="550" height="400">
|
||||
<param name="movie" value="run_as2.swf" />
|
||||
<param name="quality" value="high" />
|
||||
<param name="bgcolor" value="#ffffff" />
|
||||
<param name="play" value="true" />
|
||||
<param name="loop" value="true" />
|
||||
<param name="wmode" value="window" />
|
||||
<param name="scale" value="showall" />
|
||||
<param name="menu" value="true" />
|
||||
<param name="devicefont" value="false" />
|
||||
<param name="salign" value="" />
|
||||
<param name="allowScriptAccess" value="sameDomain" />
|
||||
<!--<![endif]-->
|
||||
<a href="http://www.adobe.com/go/getflash">
|
||||
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
|
||||
</a>
|
||||
<!--[if !IE]>-->
|
||||
</object>
|
||||
<!--<![endif]-->
|
||||
</object>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
59
libsrc/ffdec_lib/testdata/run_as3/RunMain.as
vendored
59
libsrc/ffdec_lib/testdata/run_as3/RunMain.as
vendored
@@ -1,21 +1,24 @@
|
||||
package {
|
||||
|
||||
package
|
||||
{
|
||||
|
||||
import flash.display.*;
|
||||
import flash.text.TextField;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.external.ExternalInterface;
|
||||
import flash.system.fscommand;
|
||||
|
||||
public class RunMain extends MovieClip {
|
||||
|
||||
|
||||
public class RunMain extends MovieClip
|
||||
{
|
||||
|
||||
private var myTextBox:TextField;
|
||||
|
||||
public function RunMain() {
|
||||
myTextBox = new TextField();
|
||||
|
||||
public function RunMain()
|
||||
{
|
||||
myTextBox = new TextField();
|
||||
myTextBox.text = "";
|
||||
myTextBox.width = 400;
|
||||
myTextBox.multiline = true;
|
||||
addChild(myTextBox);
|
||||
addChild(myTextBox);
|
||||
|
||||
var rectangleShape:Shape = new Shape();
|
||||
rectangleShape.graphics.beginFill(0xFF0000);
|
||||
@@ -39,30 +42,36 @@
|
||||
simpleButton.y = 100;
|
||||
simpleButton.addEventListener(MouseEvent.CLICK, this.clickListener);
|
||||
addChild(simpleButton);
|
||||
|
||||
ExternalInterface.addCallback("testFunc", testFunction);
|
||||
|
||||
var result;
|
||||
try {
|
||||
result = testFunction();
|
||||
} catch (e) {
|
||||
result = e.toString();
|
||||
|
||||
if (ExternalInterface.available)
|
||||
{
|
||||
ExternalInterface.addCallback("testFunc", testFunction);
|
||||
}
|
||||
|
||||
|
||||
var result = testFunction();
|
||||
myText.text = result;
|
||||
fscommand("run", result);
|
||||
}
|
||||
|
||||
function testFunction() {
|
||||
try {
|
||||
|
||||
function testFunction()
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = Run.run();
|
||||
return "Result:" + result + " Type:" + typeof(result);
|
||||
} catch (ex) {
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
return "Error:" + ex;
|
||||
}
|
||||
}
|
||||
|
||||
function clickListener(e:MouseEvent) {
|
||||
myTextBox.text = testFunction();
|
||||
function clickListener(e:MouseEvent)
|
||||
{
|
||||
var result = testFunction();
|
||||
myTextBox.text = result;
|
||||
|
||||
fscommand("run", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
libsrc/ffdec_lib/testdata/run_as3/run.fla
vendored
BIN
libsrc/ffdec_lib/testdata/run_as3/run.fla
vendored
Binary file not shown.
Reference in New Issue
Block a user