From 4addbe1c4d34dc47386ae5aa18a6bb4adb1f86df Mon Sep 17 00:00:00 2001 From: Stanislav Izmalkov Date: Wed, 3 Dec 2014 16:21:44 +0300 Subject: [PATCH 1/2] Made PushShortIns.execute properly handle short integer overflow --- .../flash/abc/avm2/instructions/stack/PushShortIns.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1002d4040..532ab7c55 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 @@ -38,7 +38,7 @@ public class PushShortIns extends InstructionDefinition implements PushIntegerTy @Override public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { - lda.operandStack.push(arguments.get(0)); + lda.operandStack.push((long) ((Number) arguments.get(0)).shortValue()); } @Override From a2e67ce22f4b123bfbab54ad43adb04a4d6b9b9a Mon Sep 17 00:00:00 2001 From: Stanislav Izmalkov Date: Wed, 3 Dec 2014 16:47:06 +0300 Subject: [PATCH 2/2] Added empty execute method for nop, debug, debugfile and debugline instructions --- .../flash/abc/avm2/instructions/debug/DebugFileIns.java | 7 +++++++ .../flash/abc/avm2/instructions/debug/DebugIns.java | 7 +++++++ .../flash/abc/avm2/instructions/debug/DebugLineIns.java | 7 +++++++ .../flash/abc/avm2/instructions/other/NopIns.java | 7 +++++++ 4 files changed, 28 insertions(+) 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 a7d801df7..8d549b504 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 @@ -16,11 +16,18 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.debug; 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.InstructionDefinition; +import java.util.List; public class DebugFileIns extends InstructionDefinition { public DebugFileIns() { super(0xf1, "debugfile", new int[]{AVM2Code.DAT_STRING_INDEX}); } + + @Override + public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { + } } 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 9c66abebe..4ecb043a2 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 @@ -16,11 +16,18 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.debug; 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.InstructionDefinition; +import java.util.List; public class DebugIns extends InstructionDefinition { public DebugIns() { super(0xef, "debug", new int[]{AVM2Code.DAT_DEBUG_TYPE, AVM2Code.DAT_STRING_INDEX, AVM2Code.DAT_REGISTER_INDEX, AVM2Code.OPT_U30}); } + + @Override + public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { + } } 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 a26c8701f..ae6c05b48 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 @@ -16,11 +16,18 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.debug; 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.InstructionDefinition; +import java.util.List; public class DebugLineIns extends InstructionDefinition { public DebugLineIns() { super(0xf0, "debugline", new int[]{AVM2Code.DAT_LINENUM}); } + + @Override + public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { + } } 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 00d156db1..f0c935868 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 @@ -15,11 +15,18 @@ * License along with this library. */ package com.jpexs.decompiler.flash.abc.avm2.instructions.other; +import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool; +import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; +import java.util.List; public class NopIns extends InstructionDefinition { public NopIns() { super(0x02, "nop", new int[]{}); } + + @Override + public void execute(LocalDataArea lda, AVM2ConstantPool constants, List arguments) { + } }