From b998601d41e610d441fa6a331fe96dc1057ec58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 12 Mar 2023 12:39:43 +0100 Subject: [PATCH] pushconstant verify --- .../instructions/other/unknown/PushConstantIns.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/unknown/PushConstantIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/unknown/PushConstantIns.java index a06c295ce..8c23fde15 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/unknown/PushConstantIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/unknown/PushConstantIns.java @@ -18,6 +18,10 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other.unknown; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime; +import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; +import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; @@ -33,6 +37,15 @@ public class PushConstantIns extends InstructionDefinition { public PushConstantIns() { super(0x22, "pushconstant", new int[]{AVM2Code.OPT_U30}, false /*?*/, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.NO_FLASH_PLAYER); } + + @Override + public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException { + if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) { + illegalOpCode(lda, ins); + } + + super.verify(lda, constants, ins); + } @Override public int getStackPopCount(AVM2Instruction ins, ABC abc) {