From a00b2d55caded2e27e46fb90c2d9fef5e5cbaa4c Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sat, 24 Oct 2015 15:40:46 +0200 Subject: [PATCH] AVM2 insturuction execution (without graph translate) improved --- .../decompiler/flash/abc/avm2/AVM2Code.java | 48 ++++++------------- .../flash/abc/avm2/LocalDataArea.java | 15 ++++++ .../abc/avm2/instructions/IfTypeIns.java | 9 ++-- .../instructions/InstructionDefinition.java | 5 +- .../avm2/instructions/alchemy/Lf32Ins.java | 5 -- .../avm2/instructions/alchemy/Lf64Ins.java | 5 -- .../avm2/instructions/alchemy/Li16Ins.java | 5 -- .../avm2/instructions/alchemy/Li32Ins.java | 5 -- .../abc/avm2/instructions/alchemy/Li8Ins.java | 5 -- .../avm2/instructions/alchemy/Sf32Ins.java | 5 -- .../avm2/instructions/alchemy/Sf64Ins.java | 5 -- .../avm2/instructions/alchemy/Si16Ins.java | 5 -- .../avm2/instructions/alchemy/Si32Ins.java | 5 -- .../abc/avm2/instructions/alchemy/Si8Ins.java | 5 -- .../avm2/instructions/alchemy/Sxi16Ins.java | 5 -- .../avm2/instructions/alchemy/Sxi1Ins.java | 5 -- .../avm2/instructions/alchemy/Sxi8Ins.java | 5 -- .../avm2/instructions/arithmetic/AddIns.java | 3 +- .../arithmetic/DecrementIIns.java | 6 ++- .../instructions/arithmetic/DecrementIns.java | 6 ++- .../instructions/arithmetic/DivideIns.java | 6 ++- .../instructions/arithmetic/ModuloIns.java | 6 ++- .../instructions/arithmetic/MultiplyIns.java | 6 ++- .../avm2/instructions/bitwise/BitAndIns.java | 3 +- .../avm2/instructions/bitwise/BitNotIns.java | 3 +- .../avm2/instructions/bitwise/BitOrIns.java | 3 +- .../avm2/instructions/bitwise/BitXorIns.java | 3 +- .../avm2/instructions/bitwise/LShiftIns.java | 3 +- .../avm2/instructions/bitwise/RShiftIns.java | 3 +- .../avm2/instructions/bitwise/URShiftIns.java | 3 +- .../instructions/comparison/EqualsIns.java | 3 +- .../construction/ConstructIns.java | 5 +- .../construction/ConstructPropIns.java | 5 +- .../construction/ConstructSuperIns.java | 5 +- .../avm2/instructions/debug/DebugFileIns.java | 4 +- .../abc/avm2/instructions/debug/DebugIns.java | 4 +- .../avm2/instructions/debug/DebugLineIns.java | 4 +- .../avm2/instructions/executing/CallIns.java | 5 +- .../instructions/executing/CallMethodIns.java | 5 +- .../executing/CallPropVoidIns.java | 5 +- .../executing/CallPropertyIns.java | 5 +- .../instructions/executing/CallStaticIns.java | 5 +- .../instructions/executing/CallSuperIns.java | 5 +- .../executing/CallSuperVoidIns.java | 5 +- .../avm2/instructions/jumps/IfFalseIns.java | 11 +++++ .../avm2/instructions/jumps/IfTrueIns.java | 11 +++++ .../abc/avm2/instructions/jumps/JumpIns.java | 8 ++++ .../instructions/localregs/DecLocalIIns.java | 6 ++- .../instructions/localregs/DecLocalIns.java | 6 ++- .../instructions/localregs/GetLocal0Ins.java | 4 +- .../instructions/localregs/GetLocal1Ins.java | 4 +- .../instructions/localregs/GetLocal2Ins.java | 4 +- .../instructions/localregs/GetLocal3Ins.java | 4 +- .../instructions/localregs/GetLocalIns.java | 3 +- .../instructions/other/DeletePropertyIns.java | 5 +- .../instructions/other/FindPropertyIns.java | 6 +-- .../other/FindPropertyStrictIns.java | 5 +- .../instructions/other/GetDescendantsIns.java | 5 +- .../instructions/other/GetGlobalScopeIns.java | 5 +- .../abc/avm2/instructions/other/LabelIns.java | 4 +- .../abc/avm2/instructions/other/NopIns.java | 4 +- .../instructions/other/ReturnValueIns.java | 8 ++++ .../instructions/other/ReturnVoidIns.java | 9 ++++ .../avm2/instructions/other2/AbsJumpIns.java | 5 -- .../avm2/instructions/other2/AllocIns.java | 5 -- .../instructions/other2/CodeGenOpIns.java | 5 -- .../avm2/instructions/other2/DecodeIns.java | 5 -- .../instructions/other2/DoubleToAtomIns.java | 5 -- .../other2/FindPropGlobalIns.java | 5 -- .../other2/FindPropGlobalStrictIns.java | 5 -- .../instructions/other2/GetOuterScopeIns.java | 5 -- .../abc/avm2/instructions/other2/MarkIns.java | 5 -- .../avm2/instructions/other2/NegatePIns.java | 5 -- .../avm2/instructions/other2/PrologueIns.java | 5 -- .../other2/PushUninitializedIns.java | 5 -- .../instructions/other2/SendEnterIns.java | 5 -- .../other2/SetPropertyLateIns.java | 5 -- .../instructions/other2/SubtractPIns.java | 5 -- .../avm2/instructions/other2/SweepIns.java | 5 -- .../avm2/instructions/other2/VerifyOpIns.java | 5 -- .../instructions/other2/VerifyPassIns.java | 5 -- .../abc/avm2/instructions/other2/WbIns.java | 5 -- .../abc/avm2/instructions/stack/DupIns.java | 3 +- .../abc/avm2/instructions/stack/PopIns.java | 3 +- .../avm2/instructions/stack/PopScopeIns.java | 3 +- .../avm2/instructions/stack/PushByteIns.java | 3 +- .../instructions/stack/PushDoubleIns.java | 3 +- .../avm2/instructions/stack/PushFalseIns.java | 3 +- .../avm2/instructions/stack/PushIntIns.java | 3 +- .../avm2/instructions/stack/PushScopeIns.java | 3 +- .../avm2/instructions/stack/PushShortIns.java | 3 +- .../instructions/stack/PushStringIns.java | 3 +- .../avm2/instructions/stack/PushTrueIns.java | 3 +- .../avm2/instructions/stack/PushUIntIns.java | 3 +- .../abc/avm2/instructions/stack/SwapIns.java | 3 +- .../avm2/instructions/types/ApplyTypeIns.java | 3 +- .../avm2/instructions/types/AsTypeIns.java | 4 +- .../instructions/types/AsTypeLateIns.java | 3 +- .../avm2/instructions/types/CoerceAIns.java | 3 +- .../avm2/instructions/types/CoerceIns.java | 3 +- .../avm2/instructions/types/CoerceSIns.java | 3 +- .../avm2/instructions/types/ConvertBIns.java | 3 +- .../avm2/instructions/types/ConvertDIns.java | 3 +- .../avm2/instructions/types/ConvertIIns.java | 3 +- .../avm2/instructions/types/ConvertOIns.java | 3 +- .../avm2/instructions/types/ConvertSIns.java | 3 +- .../avm2/instructions/types/ConvertUIns.java | 5 +- .../avm2/instructions/xml/CheckFilterIns.java | 3 +- .../abc/avm2/instructions/xml/DXNSIns.java | 3 +- .../avm2/instructions/xml/DXNSLateIns.java | 3 +- .../avm2/instructions/xml/EscXAttrIns.java | 3 +- .../avm2/instructions/xml/EscXElemIns.java | 3 +- 112 files changed, 257 insertions(+), 304 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 2a291e09f..6c6d14525 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -645,41 +645,25 @@ public class AVM2Code implements Cloneable { LocalDataArea lda = new LocalDataArea(); lda.localRegisters = arguments; try { - while (true) { + while (pos < code.size()) { AVM2Instruction ins = code.get(pos); - if (ins.definition instanceof JumpIns) { - pos = adr2pos(ins.getParamAsLong(constants, 0)); - continue; - } - if (ins.definition instanceof IfFalseIns) { - Boolean b = (Boolean) lda.operandStack.pop(); - if (b == false) { - pos = adr2pos(ins.getParamAsLong(constants, 0)); - } else { - pos++; - } - continue; - } - if (ins.definition instanceof IfTrueIns) { - Boolean b = (Boolean) lda.operandStack.pop(); - if (b == true) { - pos = adr2pos(ins.getParamAsLong(constants, 0)); - } else { - pos++; - } - continue; - } - if (ins.definition instanceof ReturnValueIns) { - return lda.operandStack.pop(); - } - if (ins.definition instanceof ReturnVoidIns) { - return null; - } ins.definition.execute(lda, constants, ins); + + if (lda.jump != null) { + pos = adr2pos(lda.jump); + } else { + pos++; + } + + if (lda.returnValue != null) { + return lda.returnValue; + } + pos++; } } catch (ConvertException e) { } + return null; } @@ -1478,10 +1462,8 @@ public class AVM2Code implements Cloneable { } //if(true) return ""; toSourceCount++; - if (toSourceLimit > 0) { - if (toSourceCount >= toSourceLimit) { - throw new ConvertException("Limit of subs(" + toSourceLimit + ") was reached", start); - } + if (toSourceLimit > 0 && toSourceCount >= toSourceLimit) { + throw new ConvertException("Limit of subs(" + toSourceLimit + ") was reached", start); } List output = new ArrayList<>(); int ip = start; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/LocalDataArea.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/LocalDataArea.java index e8d4ad76a..f04fd44eb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/LocalDataArea.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/LocalDataArea.java @@ -26,4 +26,19 @@ public class LocalDataArea { public Stack scopeStack = new Stack<>(); public HashMap localRegisters = new HashMap<>(); + + public Long jump; + + public Object returnValue; + + public String executionException; + + public void clear() { + operandStack.clear(); + scopeStack.clear(); + localRegisters.clear(); + jump = null; + returnValue = null; + executionException = null; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/IfTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/IfTypeIns.java index 18d8ff939..e590df619 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/IfTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/IfTypeIns.java @@ -1,18 +1,19 @@ /* * 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. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.instructions; import com.jpexs.decompiler.graph.GraphTargetItem; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index 6fae70698..67b807034 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -84,8 +84,9 @@ public abstract class InstructionDefinition implements Serializable { return s.toString(); } - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { - throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented"); + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + //throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented"); + return false; } public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) throws InterruptedException { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java index 31cd4cd89..23612b3c8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf32Ins.java @@ -35,11 +35,6 @@ public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x38, "lf32", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java index b95c21300..f230efaf4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Lf64Ins.java @@ -35,11 +35,6 @@ public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x39, "lf64", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java index dd80d0293..0db8cfc3f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li16Ins.java @@ -35,11 +35,6 @@ public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x36, "li16", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java index aabd99cef..507820bdd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li32Ins.java @@ -35,11 +35,6 @@ public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x37, "li32", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java index e3c0d4c79..6284d0ff6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Li8Ins.java @@ -35,11 +35,6 @@ public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x35, "li8", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java index 087c5826d..5fd42a7eb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf32Ins.java @@ -35,11 +35,6 @@ public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x3D, "sf32", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java index e3aed6ad6..02611f994 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sf64Ins.java @@ -35,11 +35,6 @@ public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x3E, "sf64", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java index 4a5a0a110..0c76adba5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si16Ins.java @@ -35,11 +35,6 @@ public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x3B, "si16", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java index 6e177f635..15f5e51e7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si32Ins.java @@ -35,11 +35,6 @@ public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x3C, "si32", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java index b7580a828..75d015a57 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Si8Ins.java @@ -35,11 +35,6 @@ public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x3A, "si8", new int[]{}, true); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem ofs = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java index c320a6398..571c8b3cb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi16Ins.java @@ -35,11 +35,6 @@ public class Sxi16Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x52, "sxi16", new int[]{}, false); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem value = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java index fe1e7c24a..c4e938fa6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi1Ins.java @@ -35,11 +35,6 @@ public class Sxi1Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x50, "sxi1", new int[]{}, false); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem value = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java index 21e8f5085..bebfcf4cd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/alchemy/Sxi8Ins.java @@ -35,11 +35,6 @@ public class Sxi8Ins extends InstructionDefinition implements AlchemyTypeIns { super(0x51, "sxi8", new int[]{}, false); } - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - return 0; - } - @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem value = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java index 067d3d834..f91995a73 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java @@ -34,7 +34,7 @@ public class AddIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object o1 = lda.operandStack.pop(); Object o2 = lda.operandStack.pop(); if ((o1 instanceof Long) && ((o2 instanceof Long))) { @@ -53,6 +53,7 @@ public class AddIns extends InstructionDefinition { String s = o1.toString() + o2.toString(); lda.operandStack.push(s); } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java index 9b55c6d27..aa7f916a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java @@ -34,7 +34,7 @@ public class DecrementIIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj = lda.operandStack.pop(); if (obj instanceof Long) { Long obj2 = ((Long) obj) - 1; @@ -47,8 +47,10 @@ public class DecrementIIns extends InstructionDefinition { Double obj2 = Double.parseDouble((String) obj) - 1; lda.operandStack.push(obj2); } else { - throw new RuntimeException("Cannot decrement local register"); + lda.executionException = "Cannot decrement local register"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java index d999ab21f..c586a3306 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java @@ -34,7 +34,7 @@ public class DecrementIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj = lda.operandStack.pop(); if (obj instanceof Long) { Long obj2 = ((Long) obj) - 1; @@ -47,8 +47,10 @@ public class DecrementIns extends InstructionDefinition { Double obj2 = Double.parseDouble((String) obj) - 1; lda.operandStack.push(obj2); } else { - throw new RuntimeException("Cannot decrement local register"); + lda.executionException = "Cannot decrement local register"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java index d8a6ef1f8..03552ff4c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java @@ -34,7 +34,7 @@ public class DivideIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object o2 = lda.operandStack.pop(); Object o1 = lda.operandStack.pop(); if ((o1 instanceof Long) && ((o2 instanceof Long))) { @@ -57,8 +57,10 @@ public class DivideIns extends InstructionDefinition { Double ret = ((Double) o1) / ((Long) o2); lda.operandStack.push(ret); } else { - throw new RuntimeException("Cannot divide"); + lda.executionException = "Cannot divide"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java index 6524a05f0..b68c06bc3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java @@ -34,7 +34,7 @@ public class ModuloIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object o1 = lda.operandStack.pop(); Object o2 = lda.operandStack.pop(); @@ -42,8 +42,10 @@ public class ModuloIns extends InstructionDefinition { Long ret = ((Long) o2) % ((Long) o1); lda.operandStack.push(ret); } else { - throw new RuntimeException("Cannot modulo"); + lda.executionException = "Cannot modulo"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java index 44e86a8d0..d5086e41a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java @@ -34,7 +34,7 @@ public class MultiplyIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object o1 = lda.operandStack.pop(); Object o2 = lda.operandStack.pop(); if ((o1 instanceof Long) && ((o2 instanceof Long))) { @@ -50,8 +50,10 @@ public class MultiplyIns extends InstructionDefinition { Double ret = ((Double) o1) * ((Long) o2); lda.operandStack.push(ret); } else { - throw new RuntimeException("Cannot multiply"); + lda.executionException = "Cannot multiply"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java index 34a9d50dc..70869c49d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java @@ -34,11 +34,12 @@ public class BitAndIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Long value2 = (Long) lda.operandStack.pop(); Long value1 = (Long) lda.operandStack.pop(); Long value3 = value1 & value2; lda.operandStack.push(value3); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java index 0472fde3f..791d8f098 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java @@ -34,10 +34,11 @@ public class BitNotIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Long value = (Long) lda.operandStack.pop(); Long ret = -value; lda.operandStack.push(ret); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java index 3ef874f8e..143ce286b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java @@ -34,11 +34,12 @@ public class BitOrIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Long value2 = (Long) lda.operandStack.pop(); Long value1 = (Long) lda.operandStack.pop(); Long value3 = value1 | value2; lda.operandStack.push(value3); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java index 4f5d4aa72..2500135bb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java @@ -34,11 +34,12 @@ public class BitXorIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Long value2 = (Long) lda.operandStack.pop(); Long value1 = (Long) lda.operandStack.pop(); Long value3 = value1 ^ value2; lda.operandStack.push(value3); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java index eb6f36de0..fb4a341f3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java @@ -34,11 +34,12 @@ public class LShiftIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { int value2 = (int) ((Long) lda.operandStack.pop() & 0x1F); int value1 = ((Long) lda.operandStack.pop()).intValue(); Long value3 = (long) (value1 << value2); lda.operandStack.push(value3); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java index 08ed8bc80..6cd68f985 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java @@ -34,11 +34,12 @@ public class RShiftIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { int value2 = (int) ((Long) lda.operandStack.pop() & 0x1F); int value1 = ((Long) lda.operandStack.pop()).intValue(); Long value3 = (long) (value1 >> value2); lda.operandStack.push(value3); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java index dc8ade7c5..8bf5ad80e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java @@ -34,11 +34,12 @@ public class URShiftIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Long value2 = ((Long) lda.operandStack.pop() & 0x1F); Long value1 = (Long) lda.operandStack.pop(); Long value3 = value1 >>> value2; lda.operandStack.push(value3); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java index 988329903..98411405d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparison/EqualsIns.java @@ -34,11 +34,12 @@ public class EqualsIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj1 = lda.operandStack.pop(); Object obj2 = lda.operandStack.pop(); Boolean res = obj1.equals(obj2); lda.operandStack.push(res); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java index 04c289c6a..0086c5cd0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java @@ -45,14 +45,15 @@ public class ConstructIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int argCount = ins.getParamAsLong(constants, 0).intValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } Object obj = lda.operandStack.pop();*/ - throw new RuntimeException("Cannot call constructor"); + lda.executionException = "Cannot call constructor"; + return false; //call construct property of obj //push new instance } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java index 8a1d89c72..9f48dd162 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java @@ -38,7 +38,7 @@ public class ConstructPropIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int multinameIndex = ins.getParamAsLong(constants, 0).intValue(); int argCount = ins.getParamAsLong(constants, 1).intValue(); List passArguments = new ArrayList(); @@ -47,7 +47,8 @@ public class ConstructPropIns extends InstructionDefinition { }*/ //if multiname[multinameIndex] is runtime //pop(name) pop(ns) - throw new RuntimeException("Cannot construct property"); + lda.executionException = "Cannot construct property"; + return false; //create property //push new instance } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java index 74b6cb6d4..a7727ee54 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java @@ -36,14 +36,15 @@ public class ConstructSuperIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int argCount = ins.getParamAsLong(constants, 0).intValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { passArguments.set(i, lda.operandStack.pop()); } Object obj = lda.operandStack.pop();*/ - throw new RuntimeException("Cannot call super constructor"); + lda.executionException = "Cannot call super constructor"; + return false; //call construct property of obj //do not push anything } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugFileIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugFileIns.java index 55afdb90d..22f50cca4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugFileIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugFileIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; 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 java.util.List; public class DebugFileIns extends InstructionDefinition { @@ -30,6 +29,7 @@ public class DebugFileIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + return true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugIns.java index 33f10d420..768b623ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; 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 java.util.List; public class DebugIns extends InstructionDefinition { @@ -30,6 +29,7 @@ public class DebugIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + return true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugLineIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugLineIns.java index 67d535c99..6d03d8e03 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugLineIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/debug/DebugLineIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; 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 java.util.List; public class DebugLineIns extends InstructionDefinition { @@ -30,6 +29,7 @@ public class DebugLineIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + return true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java index 4d5155f44..f32ef0104 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java @@ -36,7 +36,7 @@ public class CallIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int argCount = ins.getParamAsLong(constants, 0).intValue(); List passArguments = new ArrayList(); for (int i = argCount - 1; i >= 0; i--) { @@ -44,7 +44,8 @@ public class CallIns extends InstructionDefinition { } Object receiver = lda.operandStack.pop(); Object function = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown function"); + lda.executionException = "Call to unknown function"; + return false; //push(result) } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java index d92cf136f..b011f1839 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java @@ -36,7 +36,7 @@ public class CallMethodIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int methodIndex = ins.getParamAsLong(constants, 0).intValue(); //index of object's method int argCount = ins.getParamAsLong(constants, 1).intValue(); List passArguments = new ArrayList(); @@ -44,7 +44,8 @@ public class CallMethodIns extends InstructionDefinition { passArguments.set(i, lda.operandStack.pop()); } Object receiver = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown method"); + lda.executionException = "Call to unknown method"; + return false; //push(result) } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java index e64fa04d3..e15f3f2b5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -37,7 +37,7 @@ public class CallPropVoidIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //same as callproperty /* int multinameIndex = ins.getParamAsLong(constants, 0).intValue(); @@ -49,7 +49,8 @@ public class CallPropVoidIns extends InstructionDefinition { //if multiname[multinameIndex] is runtime //pop(name) pop(ns) Object obj = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown property"); + lda.executionException = "Call to unknown property"; + return false; //do not push anything } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java index d8976a12c..7347fa376 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java @@ -37,7 +37,7 @@ public class CallPropertyIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int multinameIndex = ins.getParamAsLong(constants, 0).intValue(); int argCount = ins.getParamAsLong(constants, 1).intValue(); List passArguments = new ArrayList(); @@ -47,7 +47,8 @@ public class CallPropertyIns extends InstructionDefinition { //if multiname[multinameIndex] is runtime //pop(name) pop(ns) Object obj = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown property"); + lda.executionException = "Call to unknown property"; + return false; //push(result) } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java index a6d01b2a2..884cee7a7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java @@ -36,7 +36,7 @@ public class CallStaticIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int methodIndex = ins.getParamAsLong(constants, 0).intValue(); //index of method_info int argCount = ins.getParamAsLong(constants, 1).intValue(); List passArguments = new ArrayList(); @@ -44,7 +44,8 @@ public class CallStaticIns extends InstructionDefinition { passArguments.set(i, lda.operandStack.pop()); } Object receiver = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown static method"); + lda.executionException = "Call to unknown static method"; + return false; //push(result) } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java index 080409a34..54f563f14 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java @@ -37,7 +37,7 @@ public class CallSuperIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int multinameIndex = ins.getParamAsLong(constants, 0).intValue(); int argCount = ins.getParamAsLong(constants, 1).intValue(); List passArguments = new ArrayList(); @@ -47,7 +47,8 @@ public class CallSuperIns extends InstructionDefinition { //if multiname[multinameIndex] is runtime //pop(name) pop(ns) Object receiver = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown super method"); + lda.executionException = "Call to unknown super method"; + return false; //push(result) } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java index c78cd07ff..cca169a72 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java @@ -37,7 +37,7 @@ public class CallSuperVoidIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int multinameIndex = ins.getParamAsLong(constants, 0).intValue(); int argCount = ins.getParamAsLong(constants, 1).intValue(); List passArguments = new ArrayList(); @@ -47,7 +47,8 @@ public class CallSuperVoidIns extends InstructionDefinition { //if multiname[multinameIndex] is runtime //pop(name) pop(ns) Object receiver = lda.operandStack.pop();*/ - throw new RuntimeException("Call to unknown super method"); + lda.executionException = "Call to unknown super method"; + return false; //do not push anything } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java index bc89de2b9..9c65842ce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java @@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; 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.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; @@ -33,6 +35,15 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns { super(0x12, "iffalse", new int[]{AVM2Code.DAT_OFFSET}, false); } + @Override + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + Boolean b = (Boolean) lda.operandStack.pop(); + if (b == false) { + lda.jump = ins.getParamAsLong(constants, 0); + } + return true; + } + @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { GraphTargetItem v1 = stack.pop(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java index 674b3ddc8..9a0787cb2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java @@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; 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.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; @@ -33,6 +35,15 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns { super(0x11, "iftrue", new int[]{AVM2Code.DAT_OFFSET}, false); } + @Override + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + Boolean b = (Boolean) lda.operandStack.pop(); + if (b == true) { + lda.jump = ins.getParamAsLong(constants, 0); + } + return true; + } + @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { //String v1 = stack.pop().toString(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java index 28997ded6..b0a643f45 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/JumpIns.java @@ -18,6 +18,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps; 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.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; @@ -34,6 +36,12 @@ public class JumpIns extends InstructionDefinition implements IfTypeIns { super(0x10, NAME, new int[]{AVM2Code.DAT_OFFSET}, false); } + @Override + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + lda.jump = ins.getParamAsLong(constants, 0); + return true; + } + @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { //stack.push(new BooleanAVM2Item(ins, Boolean.TRUE));// + ins.operands[0]); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java index 44bfb190b..2db468c84 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIIns.java @@ -36,7 +36,7 @@ public class DecLocalIIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { int locRegIndex = ins.getParamAsLong(constants, 0).intValue(); Object obj = lda.localRegisters.get(locRegIndex); if (obj instanceof Long) { @@ -50,8 +50,10 @@ public class DecLocalIIns extends InstructionDefinition { Double obj2 = Double.parseDouble((String) obj) - 1; lda.localRegisters.put(locRegIndex, obj2); } else { - throw new RuntimeException("Cannot decrement local register"); + lda.executionException = "Cannot decrement local register"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java index 1a41b1ee0..a4059a614 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/DecLocalIns.java @@ -36,7 +36,7 @@ public class DecLocalIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { int locRegIndex = ins.getParamAsLong(constants, 0).intValue(); Object obj = lda.localRegisters.get(locRegIndex); if (obj instanceof Long) { @@ -50,8 +50,10 @@ public class DecLocalIns extends InstructionDefinition { Double obj2 = Double.parseDouble((String) obj) - 1; lda.localRegisters.put(locRegIndex, obj2); } else { - throw new RuntimeException("Cannot decrement local register"); + lda.executionException = "Cannot decrement local register"; + return false; } + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java index 85838ea5b..cf0046f04 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal0Ins.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import java.util.List; public class GetLocal0Ins extends GetLocalTypeIns { @@ -28,8 +27,9 @@ public class GetLocal0Ins extends GetLocalTypeIns { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(lda.localRegisters.get(0)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal1Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal1Ins.java index 9765a584f..8a102715a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal1Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal1Ins.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import java.util.List; public class GetLocal1Ins extends GetLocalTypeIns { @@ -28,8 +27,9 @@ public class GetLocal1Ins extends GetLocalTypeIns { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(lda.localRegisters.get(1)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal2Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal2Ins.java index dec29ec41..12dd782d3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal2Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal2Ins.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import java.util.List; public class GetLocal2Ins extends GetLocalTypeIns { @@ -28,8 +27,9 @@ public class GetLocal2Ins extends GetLocalTypeIns { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(lda.localRegisters.get(2)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal3Ins.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal3Ins.java index f89ba96d0..605295356 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal3Ins.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocal3Ins.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs; import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import java.util.List; public class GetLocal3Ins extends GetLocalTypeIns { @@ -28,8 +27,9 @@ public class GetLocal3Ins extends GetLocalTypeIns { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(lda.localRegisters.get(3)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalIns.java index 2aaccf240..149bd9c47 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/GetLocalIns.java @@ -28,8 +28,9 @@ public class GetLocalIns extends GetLocalTypeIns { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(lda.localRegisters.get(ins.getParamAsLong(constants, 0).intValue())); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java index 23d3708da..c4ceb54cd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java @@ -36,13 +36,14 @@ public class DeletePropertyIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int multiIndex = ins.getParamAsLong(constants, 0).intValue(); //if multiname[multinameIndex] is runtime //pop(name) pop(ns) Object obj = lda.operandStack.pop(); //push true if removed*/ - throw new RuntimeException("Cannot remove property"); + lda.executionException = "Cannot remove property"; + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java index cd797740c..d52b3df41 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyIns.java @@ -36,12 +36,12 @@ public class FindPropertyIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //int multiIndex = ins.getParamAsLong(constants, 0).intValue(); //if is runtime //pop(name), pop(ns) - throw new RuntimeException("Cannot find property"); - + lda.executionException = "Cannot find property"; + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java index d3268d864..514cae324 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/FindPropertyStrictIns.java @@ -36,11 +36,12 @@ public class FindPropertyStrictIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //int multiIndex = ins.getParamAsLong(constants, 0).intValue(); //if is runtime //pop(name), pop(ns) - throw new RuntimeException("Cannot find property"); + lda.executionException = "Cannot find property"; + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java index ae7476fe6..134405319 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java @@ -36,12 +36,13 @@ public class GetDescendantsIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { /*int multiIndex = ins.getParamAsLong(constants, 0).intValue(); //if is runtime //pop(name), pop(ns) Object obj = lda.operandStack.pop();*/ - throw new RuntimeException("getdescendants not working"); + lda.executionException = "getdescendants not working"; + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java index 7904646a3..c83c8ceae 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalScopeIns.java @@ -35,8 +35,9 @@ public class GetGlobalScopeIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { - throw new RuntimeException("getglobalscope not working"); + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + lda.executionException = "getglobalscope not working"; + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/LabelIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/LabelIns.java index 2e218b1bb..8568cebb3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/LabelIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/LabelIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; 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 java.util.List; public class LabelIns extends InstructionDefinition { //this can be target of branch @@ -30,6 +29,7 @@ public class LabelIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + return true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NopIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NopIns.java index c5aa21637..5465143bb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NopIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/NopIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; 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 java.util.List; public class NopIns extends InstructionDefinition { @@ -29,6 +28,7 @@ public class NopIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + return true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java index 36e251fae..0d30a1b72 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java @@ -18,6 +18,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.AVM2LocalData; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +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.ReturnValueAVM2Item; @@ -31,6 +33,12 @@ public class ReturnValueIns extends InstructionDefinition { super(0x48, "returnvalue", new int[]{}, true); } + @Override + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + lda.returnValue = lda.operandStack.pop(); + return true; + } + @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { output.add(new ReturnValueAVM2Item(ins, stack.pop())); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java index 1476b8ef7..0ae3bef31 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnVoidIns.java @@ -17,9 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other; import com.jpexs.decompiler.flash.abc.AVM2LocalData; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +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.ReturnVoidAVM2Item; +import com.jpexs.decompiler.flash.ecma.Undefined; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.TranslateStack; import java.util.List; @@ -30,6 +33,12 @@ public class ReturnVoidIns extends InstructionDefinition { super(0x47, "returnvoid", new int[]{}, false); } + @Override + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + lda.returnValue = Undefined.INSTANCE; + return true; + } + @Override public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List output, String path) { output.add(new ReturnVoidAVM2Item(ins)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AbsJumpIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AbsJumpIns.java index aca111a43..62133e6cc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AbsJumpIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AbsJumpIns.java @@ -35,9 +35,4 @@ public class AbsJumpIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AllocIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AllocIns.java index 02f02c96e..3dd625acd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AllocIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/AllocIns.java @@ -35,9 +35,4 @@ public class AllocIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/CodeGenOpIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/CodeGenOpIns.java index 6fbf8b658..463b56c5a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/CodeGenOpIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/CodeGenOpIns.java @@ -35,9 +35,4 @@ public class CodeGenOpIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DecodeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DecodeIns.java index 9c6f6cac3..7cbb7a324 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DecodeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DecodeIns.java @@ -35,9 +35,4 @@ public class DecodeIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DoubleToAtomIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DoubleToAtomIns.java index 475fadffe..15c109a07 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DoubleToAtomIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/DoubleToAtomIns.java @@ -35,9 +35,4 @@ public class DoubleToAtomIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalIns.java index d9e33ff1e..4f470be82 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalIns.java @@ -36,9 +36,4 @@ public class FindPropGlobalIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalStrictIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalStrictIns.java index 1e484c54f..f0e54bd58 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalStrictIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/FindPropGlobalStrictIns.java @@ -36,9 +36,4 @@ public class FindPropGlobalStrictIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/GetOuterScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/GetOuterScopeIns.java index bc7c0d35b..3d63b5c8b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/GetOuterScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/GetOuterScopeIns.java @@ -36,9 +36,4 @@ public class GetOuterScopeIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/MarkIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/MarkIns.java index 5ff3fcf46..7eeac01fb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/MarkIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/MarkIns.java @@ -35,9 +35,4 @@ public class MarkIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/NegatePIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/NegatePIns.java index e7ebc2eaf..c37c6b82f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/NegatePIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/NegatePIns.java @@ -36,9 +36,4 @@ public class NegatePIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PrologueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PrologueIns.java index bf52904b0..8c940ec1a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PrologueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PrologueIns.java @@ -35,9 +35,4 @@ public class PrologueIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PushUninitializedIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PushUninitializedIns.java index 26f3afea3..79ce45bd6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PushUninitializedIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/PushUninitializedIns.java @@ -36,9 +36,4 @@ public class PushUninitializedIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SendEnterIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SendEnterIns.java index 754002e1f..1fea7b855 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SendEnterIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SendEnterIns.java @@ -35,9 +35,4 @@ public class SendEnterIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SetPropertyLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SetPropertyLateIns.java index 52e0e278d..6fcf28f3b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SetPropertyLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SetPropertyLateIns.java @@ -35,9 +35,4 @@ public class SetPropertyLateIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SubtractPIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SubtractPIns.java index 9f7ea0900..3fb4ce328 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SubtractPIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SubtractPIns.java @@ -36,9 +36,4 @@ public class SubtractPIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SweepIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SweepIns.java index 476b2e4b1..45e795978 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SweepIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/SweepIns.java @@ -35,9 +35,4 @@ public class SweepIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyOpIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyOpIns.java index 659f5577b..652e3b759 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyOpIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyOpIns.java @@ -35,9 +35,4 @@ public class VerifyOpIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyPassIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyPassIns.java index 624ae4513..09e612a52 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyPassIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/VerifyPassIns.java @@ -35,9 +35,4 @@ public class VerifyPassIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/WbIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/WbIns.java index d9ef51432..a758fedfa 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/WbIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other2/WbIns.java @@ -35,9 +35,4 @@ public class WbIns extends InstructionDefinition { public int getStackPushCount(AVM2Instruction ins, ABC abc) { throw new UnsupportedOperationException(); } - - @Override - public int getScopeStackDelta(AVM2Instruction ins, ABC abc) { - throw new UnsupportedOperationException(); - } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java index bc6580ebf..d808a4c0a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java @@ -34,10 +34,11 @@ public class DupIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj = lda.operandStack.pop(); lda.operandStack.push(obj); lda.operandStack.push(obj); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java index e7ede0c19..ce6853794 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopIns.java @@ -34,8 +34,9 @@ public class PopIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.pop(); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java index 3c3954867..ab238ceb6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java @@ -35,8 +35,9 @@ public class PopScopeIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.scopeStack.pop(); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java index b331c7a3b..36e1dd9ba 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java @@ -35,8 +35,9 @@ public class PushByteIns extends InstructionDefinition implements PushIntegerTyp } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(ins.getParam(constants, 0)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java index d7201e4c9..ce30a796f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushDoubleIns.java @@ -35,8 +35,9 @@ public class PushDoubleIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(ins.getParam(constants, 0)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java index c122696bd..0a6c368ab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushFalseIns.java @@ -34,8 +34,9 @@ public class PushFalseIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(Boolean.FALSE); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java index df02ab7b2..5fd215d0b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java @@ -35,8 +35,9 @@ public class PushIntIns extends InstructionDefinition implements PushIntegerType } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(ins.getParam(constants, 0)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java index 4829cd6f4..9c2c489bc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java @@ -33,8 +33,9 @@ public class PushScopeIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.scopeStack.push(lda.operandStack.pop()); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java index 3aa0565b2..46d605187 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java @@ -35,8 +35,9 @@ public class PushShortIns extends InstructionDefinition implements PushIntegerTy } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(((Number) ins.getParam(constants, 0)).longValue()); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java index 56b3b8c02..eb685009a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushStringIns.java @@ -35,8 +35,9 @@ public class PushStringIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(ins.getParam(constants, 0)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java index 959e84937..539f63077 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushTrueIns.java @@ -34,8 +34,9 @@ public class PushTrueIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(Boolean.TRUE); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java index 5c511da2c..d3592d9c1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java @@ -35,8 +35,9 @@ public class PushUIntIns extends InstructionDefinition implements PushIntegerTyp } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { lda.operandStack.push(ins.getParam(constants, 0)); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java index d31e682a2..0365cde35 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/SwapIns.java @@ -34,11 +34,12 @@ public class SwapIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj1 = lda.operandStack.pop(); Object obj2 = lda.operandStack.pop(); lda.operandStack.push(obj1); lda.operandStack.push(obj2); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java index b1a1ceec3..1c410f6a0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java @@ -37,7 +37,7 @@ public class ApplyTypeIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { int argCount = ins.getParamAsLong(constants, 0).intValue(); List params = new ArrayList<>(); for (int i = 0; i < argCount; i++) { @@ -45,6 +45,7 @@ public class ApplyTypeIns extends InstructionDefinition { } Collections.reverse(params); //TODO: pop type and push type + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java index b34e523b6..7d9d1279b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java @@ -36,13 +36,13 @@ public class AsTypeIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //Long typeIndex = ins.getParamAsLong(constants, 0); Object obj = lda.operandStack.pop(); //if multiname[typeIndex]==obj lda.operandStack.push(obj); //else push null - + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java index 506fa1c06..13cbeb0a3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java @@ -34,12 +34,13 @@ public class AsTypeLateIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //Object objClass = lda.operandStack.pop(); Object obj = lda.operandStack.pop(); //if obj.class=objClass lda.operandStack.push(obj); //else push null + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java index e68fb64ca..5d83aa6d4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java @@ -39,8 +39,9 @@ public class CoerceAIns extends InstructionDefinition implements CoerceOrConvert } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //coerce any type + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java index 9d601fa06..7d445528c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java @@ -36,9 +36,10 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //int multinameIndex = ins.getParamAsLong(constants, 0).intValue(); //push and pop coerced value to specified type + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index be5fc96dc..bdd89b211 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -36,9 +36,10 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj = lda.operandStack.pop(); lda.operandStack.push(obj.toString()); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java index 90e271641..3e56a7a80 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java @@ -36,7 +36,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object value = lda.operandStack.pop(); boolean bval; if (value instanceof Boolean) { @@ -49,6 +49,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver bval = true; } lda.operandStack.push((Boolean) bval); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java index edc29eb92..b1aebc850 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java @@ -36,7 +36,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object value = lda.operandStack.pop(); double ret; if (value == null) { @@ -57,6 +57,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver ret = 1; //must call toPrimitive } lda.operandStack.push(ret); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 5108a6387..03ec7733a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -36,7 +36,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object value = lda.operandStack.pop(); long ret; if (value == null) { @@ -55,6 +55,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver ret = 1; //must call toPrimitive } lda.operandStack.push(ret); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java index db61121f5..0fa6c9a20 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java @@ -36,8 +36,9 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //throw if pop is not object + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java index 3fb42db20..7302b90c9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java @@ -36,9 +36,10 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { Object obj = lda.operandStack.pop(); lda.operandStack.push(obj.toString()); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java index 3d6c15c6a..46fcfcd27 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java @@ -36,8 +36,9 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { - throw new UnsupportedOperationException("Cannot convert to uint "); + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + //throw new UnsupportedOperationException("Cannot convert to uint "); + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java index 76ca329c7..425d0e26c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/CheckFilterIns.java @@ -34,8 +34,9 @@ public class CheckFilterIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { //if pop() is not XML|XMLList throw + return false; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java index 3e180f698..14751c18a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSIns.java @@ -35,10 +35,11 @@ public class DXNSIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { int strIndex = ins.getParamAsLong(constants, 0).intValue(); String s = constants.getString(strIndex); System.out.println("Set default XML space " + s); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java index 59b7d5f96..d944ce2bc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/DXNSLateIns.java @@ -34,9 +34,10 @@ public class DXNSLateIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { String s = lda.operandStack.pop().toString(); System.out.println("Set default XML space " + s); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java index 525e95ef3..bed31986f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXAttrIns.java @@ -34,10 +34,11 @@ public class EscXAttrIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { String s = lda.operandStack.pop().toString(); //escape lda.operandStack.push(s); + return true; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java index 7a5500a13..28030ab64 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/xml/EscXElemIns.java @@ -34,10 +34,11 @@ public class EscXElemIns extends InstructionDefinition { } @Override - public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { + public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) { String s = lda.operandStack.pop().toString(); //escape lda.operandStack.push(s); + return true; } @Override