From 02660f396ef849edc552422cc9e09d3826fe024c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 28 May 2018 18:00:32 +0200 Subject: [PATCH] AS1/2 deobfuscation of empty stack pops - returning Undefined instead --- CHANGELOG.md | 1 + .../flash/action/LocalDataArea.java | 51 ++++++++++++++++--- .../deobfuscation/ActionDeobfuscator.java | 22 ++++++-- .../flash/action/swf4/ActionAdd.java | 4 +- .../flash/action/swf4/ActionAnd.java | 7 +-- .../flash/action/swf4/ActionAsciiToChar.java | 7 +-- .../flash/action/swf4/ActionCall.java | 7 +-- .../flash/action/swf4/ActionCharToAscii.java | 7 +-- .../flash/action/swf4/ActionCloneSprite.java | 8 +-- .../flash/action/swf4/ActionDivide.java | 7 +-- .../flash/action/swf4/ActionEquals.java | 7 +-- .../flash/action/swf4/ActionGetProperty.java | 13 ++--- .../flash/action/swf4/ActionGetTime.java | 2 +- .../flash/action/swf4/ActionGetURL2.java | 9 ++-- .../flash/action/swf4/ActionGetVariable.java | 7 +-- .../flash/action/swf4/ActionGotoFrame2.java | 7 +-- .../flash/action/swf4/ActionIf.java | 5 +- .../flash/action/swf4/ActionLess.java | 7 +-- .../action/swf4/ActionMBAsciiToChar.java | 7 +-- .../action/swf4/ActionMBCharToAscii.java | 7 +-- .../action/swf4/ActionMBStringExtract.java | 7 +-- .../action/swf4/ActionMBStringLength.java | 7 +-- .../flash/action/swf4/ActionMultiply.java | 7 +-- .../flash/action/swf4/ActionNot.java | 7 +-- .../flash/action/swf4/ActionOr.java | 7 +-- .../flash/action/swf4/ActionPop.java | 7 +-- .../flash/action/swf4/ActionPush.java | 8 +-- .../flash/action/swf4/ActionRandomNumber.java | 7 +-- .../flash/action/swf4/ActionRemoveSprite.java | 7 +-- .../flash/action/swf4/ActionSetProperty.java | 5 +- .../flash/action/swf4/ActionSetTarget2.java | 5 +- .../flash/action/swf4/ActionSetVariable.java | 5 +- .../flash/action/swf4/ActionStringAdd.java | 7 +-- .../flash/action/swf4/ActionStringEquals.java | 7 +-- .../action/swf4/ActionStringExtract.java | 7 +-- .../flash/action/swf4/ActionStringLength.java | 7 +-- .../flash/action/swf4/ActionStringLess.java | 7 +-- .../flash/action/swf4/ActionSubtract.java | 7 +-- .../flash/action/swf4/ActionToInteger.java | 7 +-- .../flash/action/swf4/ActionTrace.java | 5 +- .../flash/action/swf5/ActionAdd2.java | 7 +-- .../flash/action/swf5/ActionBitAnd.java | 7 +-- .../flash/action/swf5/ActionBitLShift.java | 7 +-- .../flash/action/swf5/ActionBitOr.java | 7 +-- .../flash/action/swf5/ActionBitRShift.java | 7 +-- .../flash/action/swf5/ActionBitURShift.java | 7 +-- .../flash/action/swf5/ActionBitXor.java | 7 +-- .../flash/action/swf5/ActionCallFunction.java | 2 +- .../flash/action/swf5/ActionCallMethod.java | 9 ++-- .../flash/action/swf5/ActionDecrement.java | 7 +-- .../action/swf5/ActionDefineFunction.java | 2 +- .../flash/action/swf5/ActionDefineLocal.java | 5 +- .../flash/action/swf5/ActionDefineLocal2.java | 5 +- .../flash/action/swf5/ActionDelete2.java | 5 +- .../flash/action/swf5/ActionEnumerate.java | 6 +-- .../flash/action/swf5/ActionEquals2.java | 7 +-- .../flash/action/swf5/ActionGetMember.java | 9 ++-- .../flash/action/swf5/ActionIncrement.java | 7 +-- .../flash/action/swf5/ActionInitArray.java | 11 ++-- .../flash/action/swf5/ActionInitObject.java | 9 ++-- .../flash/action/swf5/ActionLess2.java | 7 +-- .../flash/action/swf5/ActionModulo.java | 7 +-- .../flash/action/swf5/ActionNewMethod.java | 9 ++-- .../flash/action/swf5/ActionNewObject.java | 11 ++-- .../action/swf5/ActionPushDuplicate.java | 7 +-- .../flash/action/swf5/ActionReturn.java | 7 +-- .../flash/action/swf5/ActionSetMember.java | 5 +- .../flash/action/swf5/ActionStackSwap.java | 13 ++--- .../action/swf5/ActionStoreRegister.java | 2 +- .../flash/action/swf5/ActionTargetPath.java | 9 ++-- .../flash/action/swf5/ActionToNumber.java | 7 +-- .../flash/action/swf5/ActionToString.java | 7 +-- .../flash/action/swf5/ActionTypeOf.java | 7 +-- .../flash/action/swf5/ActionWith.java | 5 +- .../flash/action/swf6/ActionEnumerate2.java | 6 +-- .../flash/action/swf6/ActionGreater.java | 7 +-- .../flash/action/swf6/ActionInstanceOf.java | 13 ++--- .../flash/action/swf6/ActionStrictEquals.java | 7 +-- .../action/swf6/ActionStringGreater.java | 7 +-- .../flash/action/swf7/ActionCastOp.java | 9 ++-- .../action/swf7/ActionDefineFunction2.java | 2 +- .../flash/action/swf7/ActionExtends.java | 5 +- .../flash/action/swf7/ActionImplementsOp.java | 9 ++-- .../collections/FixItemCounterStack.java | 3 +- .../decompiler/flash/gui/FlashPlayerTest.java | 2 +- 85 files changed, 377 insertions(+), 254 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd8b1869c..1309cd5c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file. - Copy AS1/2 Graph source (GraphViz) to clipboard - rightclick menu on graph - AS1 slash syntax support (decompilation, direct editation) - Setting of limit of executed instructions during AS1/2 deobfuscation +- AS1/2 deobfuscation of empty stack pops ### Changed - AS1/2 Better unresolved constant handling - §§constant(xx) func instead of §§constantxx diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/LocalDataArea.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/LocalDataArea.java index 503d2609d..28576a42d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/LocalDataArea.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/LocalDataArea.java @@ -12,10 +12,12 @@ * 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.action; import com.jpexs.decompiler.flash.ecma.EcmaScript; +import com.jpexs.decompiler.flash.ecma.Undefined; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -51,6 +53,10 @@ public class LocalDataArea { public String executionException; + public boolean checkStackSize = true; + + public int undefinedCount = 0; + public LocalDataArea(Stage stage) { this.stage = stage; this.target = this.stage; @@ -64,6 +70,20 @@ public class LocalDataArea { } } + public boolean stackIsEmpty() { + if (!checkStackSize) { + return false; + } + return stack.isEmpty(); + } + + public boolean stackHasMinSize(int count) { + if (!checkStackSize) { + return true; + } + return stack.size() >= count; + } + public void clear() { constantPool = null; stack.clear(); @@ -76,17 +96,36 @@ public class LocalDataArea { returnValue = null; executionException = null; target = stage; + undefinedCount = 0; } - public Object pop() { + public synchronized Object push(Object val) { + return stack.push(val); + } + + public synchronized Object peek() { + if (!checkStackSize && stack.isEmpty()) { + undefinedCount++; + stack.push(Undefined.INSTANCE); + return Undefined.INSTANCE; + } + return stack.peek(); + } + + public synchronized Object pop() { + boolean isEmpty = stack.isEmpty(); + if (!checkStackSize && stack.isEmpty()) { + undefinedCount++; + return Undefined.INSTANCE; + } return stack.pop(); } - public Double popAsNumber() { - return EcmaScript.toNumberAs2(stack.pop()); + public synchronized Double popAsNumber() { + return EcmaScript.toNumberAs2(pop()); } - public String popAsString() { - return EcmaScript.toString(stack.pop()); + public synchronized String popAsString() { + return EcmaScript.toString(pop()); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java index 703a473ac..0e0cef18d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/deobfuscation/ActionDeobfuscator.java @@ -210,11 +210,23 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter { ActionItem actionItem = iterator.next(); result.clear(); localData.clear(); - /*ActionItem container = actions.getContainer(actionItem); - actions.setExcludedFlags(false); - if (container != null) { - markContainerActions(container, actions); - }*/ + + /* + When running code from first action, + there can be pops from stack when the stack is empty + which results in Undefined popped. + Some obfuscated code checks for these undefineds like: + + Not + If loc1 + ConstantPool + Jump loc2 + loc1: + + loc2: + + */ + localData.checkStackSize = !first; //this enables popping undefineds executeActions(actionItem, localData, cPool, result, fakeFunctions, useVariables, first); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java index ef754c664..2f040fb1c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAdd.java @@ -45,11 +45,11 @@ public class ActionAdd extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(AddActionItem.getResult(lda.pop(), lda.pop(), false)); + lda.push(AddActionItem.getResult(lda.pop(), lda.pop(), false)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java index 42e1813b3..268cbe0d4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAnd.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionAnd extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(AndActionItem.getResult(lda.pop(), lda.pop())); + lda.push(AndActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java index e968b2e8f..1386cffb6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionAsciiToChar.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionAsciiToChar extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(AsciiToCharActionItem.getResult(lda.pop())); + lda.push(AsciiToCharActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java index 0e15e05bb..82761e7c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCall.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -49,11 +50,11 @@ public class ActionCall extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stage.callFrame(EcmaScript.toInt32(lda.stack.pop())); + lda.stage.callFrame(EcmaScript.toInt32(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java index a6b643b20..2c76f59f4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCharToAscii.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionCharToAscii extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(CharToAsciiActionItem.getResult(lda.pop())); + lda.push(CharToAsciiActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java index 5b2a63575..f30c9720d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionCloneSprite.java @@ -48,13 +48,13 @@ public class ActionCloneSprite extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } - int depth = EcmaScript.toInt32(lda.stack.pop()); - String source = EcmaScript.toString(lda.stack.pop()); - String target = EcmaScript.toString(lda.stack.pop()); + int depth = EcmaScript.toInt32(lda.pop()); + String source = EcmaScript.toString(lda.pop()); + String target = EcmaScript.toString(lda.pop()); Object clonedMember = lda.stage.getMember(source); if (clonedMember != Undefined.INSTANCE) { lda.stage.setMember(target, ((ActionScriptObject) clonedMember).clone()); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java index 668d4b9c2..30c4101eb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionDivide.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionDivide extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(DivideActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); + lda.push(DivideActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java index 66a7af3df..d6083fed3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionEquals.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionEquals extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(EqActionItem.getResult(lda.pop(), lda.pop(), false)); + lda.push(EqActionItem.getResult(lda.pop(), lda.pop(), false)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java index 82043030e..5f5db744f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetProperty.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -48,18 +49,18 @@ public class ActionGetProperty extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - int index = EcmaScript.toInt32(lda.stack.pop()); - String target = EcmaScript.toString(lda.stack.pop()); + int index = EcmaScript.toInt32(lda.pop()); + String target = EcmaScript.toString(lda.pop()); Object movieClip = lda.stage.getMember(target); if (movieClip instanceof ActionScriptObject) { - lda.stack.push(((ActionScriptObject) movieClip).getProperty(index)); + lda.push(((ActionScriptObject) movieClip).getProperty(index)); return true; } - lda.stack.push(Undefined.INSTANCE); + lda.push(Undefined.INSTANCE); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java index 53c89e2ce..fc97f2fc8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetTime.java @@ -44,7 +44,7 @@ public class ActionGetTime extends Action { @Override public boolean execute(LocalDataArea lda) { - lda.stack.push(lda.stage.getTime()); + lda.push(lda.stage.getTime()); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java index 82a8a8053..29a87c8dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetURL2.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -112,12 +113,12 @@ public class ActionGetURL2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - String target = EcmaScript.toString(lda.stack.pop()); - String urlString = EcmaScript.toString(lda.stack.pop()); + String target = EcmaScript.toString(lda.pop()); + String urlString = EcmaScript.toString(lda.pop()); //TODO: Execute - Connection return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java index a958fe498..3bf290e51 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGetVariable.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -50,7 +51,7 @@ public class ActionGetVariable extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } @@ -59,7 +60,7 @@ public class ActionGetVariable extends Action { value = Undefined.INSTANCE; } - lda.stack.push(value); + lda.push(value); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java index 8b9e40d66..79261fe6c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionGotoFrame2.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -108,11 +109,11 @@ public class ActionGotoFrame2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - String frame = EcmaScript.toString(lda.stack.pop()); + String frame = EcmaScript.toString(lda.pop()); String target = "/"; if (frame.contains(":")) { target = frame.substring(0, frame.indexOf(':')); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java index 52233be43..9c2241005 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionIf.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.SWFInputStream; @@ -109,7 +110,7 @@ public class ActionIf extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java index bb736f67e..92db3e4b8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionLess.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionLess extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(LtActionItem.getResult(lda.pop(), lda.pop(), false)); + lda.push(LtActionItem.getResult(lda.pop(), lda.pop(), false)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java index 1a9f3b179..052356089 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBAsciiToChar.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionMBAsciiToChar extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(MBAsciiToCharActionItem.getResult(lda.pop())); + lda.push(MBAsciiToCharActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java index ecef9ab58..47fd8eeed 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBCharToAscii.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionMBCharToAscii extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(MBCharToAsciiActionItem.getResult(lda.pop())); + lda.push(MBCharToAsciiActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java index 9ff7864cf..78e15360b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringExtract.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionMBStringExtract extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } - lda.stack.push(MBStringExtractActionItem.getResult(lda.pop(), lda.pop(), lda.pop())); + lda.push(MBStringExtractActionItem.getResult(lda.pop(), lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java index 84e6df110..35eacc1eb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMBStringLength.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionMBStringLength extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(MBStringLengthActionItem.getResult(lda.pop())); + lda.push(MBStringLengthActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java index e86acdae7..c5883aac6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionMultiply.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionMultiply extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(MultiplyActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); + lda.push(MultiplyActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java index 52d8161c4..556e15c0c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionNot.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionNot extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(NotItem.getResult(lda.pop())); + lda.push(NotItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java index 4eff80e10..43318f76c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionOr.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionOr extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(OrActionItem.getResult(lda.pop(), lda.pop())); + lda.push(OrActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java index 0fa744297..3c3cbe1b9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPop.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -38,11 +39,11 @@ public class ActionPop extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.pop(); + lda.pop(); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java index 9d22ee15c..bc2999e61 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionPush.java @@ -373,16 +373,16 @@ public class ActionPush extends Action { if (value instanceof ConstantIndex) { ConstantIndex constantIndex = (ConstantIndex) value; List cPool = lda.constantPool != null ? lda.constantPool : constantPool; - lda.stack.push(constantIndex.toStringNoQ(cPool, true)); + lda.push(constantIndex.toStringNoQ(cPool, true)); } else if (value instanceof RegisterNumber) { int rn = ((RegisterNumber) value).number; if (lda.localRegisters.containsKey(rn)) { - lda.stack.push(lda.localRegisters.get(rn)); + lda.push(lda.localRegisters.get(rn)); } else { - lda.stack.push(Undefined.INSTANCE); + lda.push(Undefined.INSTANCE); } } else { - lda.stack.push(value); + lda.push(value); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java index 4ead65188..398d214c3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRandomNumber.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionRandomNumber extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(RandomNumberActionItem.getResult(lda.pop())); + lda.push(RandomNumberActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java index 80106f46b..80111ef6f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionRemoveSprite.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -45,11 +46,11 @@ public class ActionRemoveSprite extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - String target = EcmaScript.toString(lda.stack.pop()); + String target = EcmaScript.toString(lda.pop()); lda.stage.removeMember(target); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java index ce3a26c6f..971192e20 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetProperty.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -55,7 +56,7 @@ public class ActionSetProperty extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java index a34cd1937..bf92d5906 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetTarget2.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,7 +45,7 @@ public class ActionSetTarget2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java index 4c421da6c..1702a714e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -58,7 +59,7 @@ public class ActionSetVariable extends Action implements StoreTypeAction { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java index 16dd9d740..5d1dddf93 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringAdd.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStringAdd extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(StringAddActionItem.getResult(lda.pop(), lda.pop())); + lda.push(StringAddActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java index 7c2443d9a..79e28a3ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringEquals.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStringEquals extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(StringEqActionItem.getResult(lda.pop(), lda.pop())); + lda.push(StringEqActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java index eb8d71683..32b47229a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringExtract.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStringExtract extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } - lda.stack.push(StringExtractActionItem.getResult(lda.pop(), lda.pop(), lda.pop())); + lda.push(StringExtractActionItem.getResult(lda.pop(), lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java index 83e3b08c2..2bfa5b7ce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLength.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStringLength extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(StringLengthActionItem.getResult(lda.pop())); + lda.push(StringLengthActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java index fbfa1c193..e226cc9f8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionStringLess.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStringLess extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(StringLtActionItem.getResult(lda.pop(), lda.pop())); + lda.push(StringLtActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java index f1b64d9b2..a06d871a3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSubtract.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionSubtract extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(SubtractActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); + lda.push(SubtractActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java index 80ab50aca..3dc5c489c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionToInteger.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionToInteger extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(ToIntegerActionItem.getResult(lda.pop())); + lda.push(ToIntegerActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java index 65e4bc53b..658301a1d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionTrace.java @@ -12,7 +12,8 @@ * 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.action.swf4; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,7 +45,7 @@ public class ActionTrace extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java index 3145db61b..6f3013125 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionAdd2.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionAdd2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(AddActionItem.getResult(lda.pop(), lda.pop(), true)); + lda.push(AddActionItem.getResult(lda.pop(), lda.pop(), true)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java index cc4332ac5..53975ed0e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitAnd.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionBitAnd extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(BitAndActionItem.getResult(lda.pop(), lda.pop())); + lda.push(BitAndActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java index cc23921b3..e47179ba8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitLShift.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionBitLShift extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(LShiftActionItem.getResult(lda.pop(), lda.pop())); + lda.push(LShiftActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java index 54976f587..abceec8bf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitOr.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionBitOr extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(BitOrActionItem.getResult(lda.pop(), lda.pop())); + lda.push(BitOrActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java index b0565ddc9..73ee47c51 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitRShift.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionBitRShift extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(RShiftActionItem.getResult(lda.pop(), lda.pop())); + lda.push(RShiftActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java index 78bee5c3f..f400e6839 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitURShift.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionBitURShift extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(URShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); + lda.push(URShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java index 0eb5a9d32..83cad4068 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionBitXor.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionBitXor extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(BitXorActionItem.getResult(lda.pop(), lda.pop())); + lda.push(BitXorActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java index 0c0da6a54..547df8f02 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallFunction.java @@ -57,7 +57,7 @@ public class ActionCallFunction extends Action { for (ActionScriptFunction f : lda.functions) { if (functionName.equals(f.getFunctionName())) { - lda.stack.push(lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), Undefined.INSTANCE /*?*/)); + lda.push(lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), Undefined.INSTANCE /*?*/)); return true; } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java index 87e2836da..b365e82a4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionCallMethod.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -47,7 +48,7 @@ public class ActionCallMethod extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } @@ -59,7 +60,7 @@ public class ActionCallMethod extends Action { ActionScriptObject obj = (ActionScriptObject) obj0; int numArgs = (int) (double) lda.popAsNumber(); - if (lda.stack.size() < numArgs) { + if (!lda.stackHasMinSize(numArgs)) { return false; } @@ -70,7 +71,7 @@ public class ActionCallMethod extends Action { ActionScriptFunction f = (ActionScriptFunction) obj.getMember(methodName); - lda.stack.push(lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), obj)); + lda.push(lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), obj)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java index 1e25fd189..17bfa91d5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDecrement.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionDecrement extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(DecrementActionItem.getResult(lda.popAsNumber())); + lda.push(DecrementActionItem.getResult(lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java index a38fb42da..5ba459f41 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineFunction.java @@ -65,7 +65,7 @@ public class ActionDefineFunction extends Action implements GraphSourceItemConta @Override public boolean execute(LocalDataArea lda) { ActionScriptFunction f = new ActionScriptFunction(fileOffset, codeSize, functionName, paramNames, getRegNames()); - lda.stack.push(f); + lda.push(f); lda.functions.add(f); ((ActionScriptObject) lda.target).setMember(functionName, f); return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java index 485ab6684..bf8158ac6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -47,7 +48,7 @@ public class ActionDefineLocal extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java index e3b7dbfc5..c6c0cbc25 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDefineLocal2.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -57,7 +58,7 @@ public class ActionDefineLocal2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 1) { + if (!lda.stackHasMinSize(1)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java index 4be8b52b2..d67ad9869 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionDelete2.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -46,7 +47,7 @@ public class ActionDelete2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java index 7490215f9..f9d399ae0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEnumerate.java @@ -48,19 +48,19 @@ public class ActionEnumerate extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } String objectName = lda.popAsString(); - lda.stack.push(Null.INSTANCE); + lda.push(Null.INSTANCE); Object o = lda.stage.getMember(objectName); if (o instanceof ActionScriptObject) { List members = ((ActionScriptObject) o).enumerate(); for (String m : members) { - lda.stack.push(m); + lda.push(m); } } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java index 810e99987..417fe3f1c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionEquals2.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionEquals2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(EqActionItem.getResult(lda.pop(), lda.pop(), true)); + lda.push(EqActionItem.getResult(lda.pop(), lda.pop(), true)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java index 50adab2d0..7ed57414b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionGetMember.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -46,16 +47,16 @@ public class ActionGetMember extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } String membername = lda.popAsString(); Object obj = lda.pop(); if (obj instanceof ActionScriptObject) { - lda.stack.push(((ActionScriptObject) obj).getMember(membername)); + lda.push(((ActionScriptObject) obj).getMember(membername)); } else { - lda.stack.push(Undefined.INSTANCE); + lda.push(Undefined.INSTANCE); } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java index 350d4d90d..bcf520fe3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionIncrement.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionIncrement extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(IncrementActionItem.getResult(lda.popAsNumber())); + lda.push(IncrementActionItem.getResult(lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java index 2bb0937b1..f49547312 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitArray.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -41,21 +42,21 @@ public class ActionInitArray extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } int num = (int) (double) lda.popAsNumber(); - if (lda.stack.size() < num) { + if (!lda.stackHasMinSize(num)) { return false; } ActionScriptArray arr = new ActionScriptArray(); for (int i = 0; i < num; i++) { - arr.setValueAtIndex(i, lda.stack.pop()); + arr.setValueAtIndex(i, lda.pop()); } - lda.stack.push(arr); + lda.push(arr); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java index 0c3341ab7..430f9cee0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionInitObject.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -46,12 +47,12 @@ public class ActionInitObject extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } int num = (int) (double) lda.popAsNumber(); - if (lda.stack.size() < 2 * num) { + if (!lda.stackHasMinSize(2 * num)) { return false; } @@ -62,7 +63,7 @@ public class ActionInitObject extends Action { obj.setMember(name, val); } - lda.stack.push(obj); + lda.push(obj); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java index 299497df6..86130ea1f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionLess2.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionLess2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(LtActionItem.getResult(lda.pop(), lda.pop(), true)); + lda.push(LtActionItem.getResult(lda.pop(), lda.pop(), true)); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java index 7141d82c1..d42c6aa29 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionModulo.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionModulo extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(ModuloActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); + lda.push(ModuloActionItem.getResult(lda.popAsNumber(), lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java index 6c292fe4c..de80ea1c4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewMethod.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -47,14 +48,14 @@ public class ActionNewMethod extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } String methodName = lda.popAsString(); ActionScriptObject obj = (ActionScriptObject) lda.pop(); int numArgs = (int) (double) lda.popAsNumber(); - if (lda.stack.size() < numArgs) { + if (!lda.stackHasMinSize(numArgs)) { return false; } @@ -66,7 +67,7 @@ public class ActionNewMethod extends Action { ActionScriptObject nobj = new ActionScriptObject(); ActionScriptFunction f = (ActionScriptFunction) obj.getMember(methodName); lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), nobj); - lda.stack.push(nobj); + lda.push(nobj); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java index 49719646e..327606e8a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionNewObject.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -46,19 +47,19 @@ public class ActionNewObject extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } String objectName = lda.popAsString(); int numArgs = (int) (double) lda.popAsNumber(); - if (lda.stack.size() < numArgs) { + if (!lda.stackHasMinSize(numArgs)) { return false; } List args = new ArrayList<>(); for (int i = 0; i < numArgs; i++) { - args.add(lda.stack.pop()); + args.add(lda.pop()); } ActionScriptObject obj = new ActionScriptObject(); @@ -66,7 +67,7 @@ public class ActionNewObject extends Action { /*ActionScriptFunction constructor = (ActionScriptFunction) lda.stage.getMember(objectName); lda.stage.callFunction(constructor.getFunctionOffset(), constructor.getFunctionLength(), args, constructor.getFuncRegNames(), obj); */ - lda.stack.push(obj); + lda.push(obj); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java index 390a9c5a4..422f1f42a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionPushDuplicate.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -45,11 +46,11 @@ public class ActionPushDuplicate extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(lda.stack.peek()); + lda.push(lda.peek()); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java index f246c96d9..9179ad787 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionReturn.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionReturn extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { //lda.returnValue = Undefined.INSTANCE; return false; } else { - lda.returnValue = lda.stack.pop(); + lda.returnValue = lda.pop(); } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java index dff7fe2d4..33bfffa0c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -54,7 +55,7 @@ public class ActionSetMember extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 3) { + if (!lda.stackHasMinSize(3)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java index 43283c664..e8d651cca 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStackSwap.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,14 +45,14 @@ public class ActionStackSwap extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - Object obj1 = lda.stack.pop(); - Object obj2 = lda.stack.pop(); - lda.stack.push(obj1); - lda.stack.push(obj2); + Object obj1 = lda.pop(); + Object obj2 = lda.pop(); + lda.push(obj1); + lda.push(obj2); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java index 797554a24..6511759da 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionStoreRegister.java @@ -55,7 +55,7 @@ public class ActionStoreRegister extends Action implements StoreTypeAction { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 1) { + if (!lda.stackHasMinSize(1)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java index 718f1f6e1..0e5bc0213 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTargetPath.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -45,7 +46,7 @@ public class ActionTargetPath extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } @@ -53,9 +54,9 @@ public class ActionTargetPath extends Action { String path = lda.stage.getMemberPath(obj); if (path == null) { - lda.stack.push(Undefined.INSTANCE); + lda.push(Undefined.INSTANCE); } else { - lda.stack.push(path); + lda.push(path); } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java index e90b5e3f0..fbc690a62 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToNumber.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionToNumber extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(ToNumberActionItem.getResult(lda.popAsNumber())); + lda.push(ToNumberActionItem.getResult(lda.popAsNumber())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java index 5b5c443ac..c744616e2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionToString.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionToString extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(ToStringActionItem.getResult(lda.pop())); + lda.push(ToStringActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java index e4b30b5ab..65c9a18cc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionTypeOf.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionTypeOf extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } - lda.stack.push(TypeOfActionItem.getResult(lda.pop())); + lda.push(TypeOfActionItem.getResult(lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java index d06932905..90a61f69f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionWith.java @@ -12,7 +12,8 @@ * 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.action.swf5; import com.jpexs.decompiler.flash.SWFInputStream; @@ -55,7 +56,7 @@ public class ActionWith extends Action implements GraphSourceItemContainer { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java index cd9caacbf..1964c8d73 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionEnumerate2.java @@ -60,17 +60,17 @@ public class ActionEnumerate2 extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.isEmpty()) { + if (lda.stackIsEmpty()) { return false; } Object o = lda.pop(); - lda.stack.push(Null.INSTANCE); + lda.push(Null.INSTANCE); if (o instanceof ActionScriptObject) { List members = ((ActionScriptObject) o).enumerate(); for (String m : members) { - lda.stack.push(m); + lda.push(m); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java index 4e144f418..c5c560aab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionGreater.java @@ -12,7 +12,8 @@ * 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.action.swf6; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionGreater extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(GtActionItem.getResult(lda.pop(), lda.pop())); + lda.push(GtActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java index 3795bb7fd..18f2b55e9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionInstanceOf.java @@ -12,7 +12,8 @@ * 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.action.swf6; import com.jpexs.decompiler.flash.BaseLocalData; @@ -68,16 +69,16 @@ public class ActionInstanceOf extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - Object type = lda.stack.pop(); - Object obj = lda.stack.pop(); + Object type = lda.pop(); + Object obj = lda.pop(); if (getInstanceOfResult(obj, type)) { - lda.stack.push(Boolean.TRUE); + lda.push(Boolean.TRUE); } else { - lda.stack.push(Boolean.FALSE); + lda.push(Boolean.FALSE); } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java index 276a7ce8b..f2d88e6a0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStrictEquals.java @@ -12,7 +12,8 @@ * 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.action.swf6; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStrictEquals extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(StrictEqActionItem.getResult(lda.pop(), lda.pop())); + lda.push(StrictEqActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java index e03d9629f..ce4c683a3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf6/ActionStringGreater.java @@ -12,7 +12,8 @@ * 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.action.swf6; import com.jpexs.decompiler.flash.BaseLocalData; @@ -44,11 +45,11 @@ public class ActionStringGreater extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } - lda.stack.push(StringGtActionItem.getResult(lda.pop(), lda.pop())); + lda.push(StringGtActionItem.getResult(lda.pop(), lda.pop())); return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java index 410490cbb..08fe24402 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionCastOp.java @@ -12,7 +12,8 @@ * 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.action.swf7; import com.jpexs.decompiler.flash.BaseLocalData; @@ -47,16 +48,16 @@ public class ActionCastOp extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } ActionScriptObject obj = (ActionScriptObject) lda.pop(); ActionScriptObject constr = (ActionScriptObject) lda.pop(); if (ActionInstanceOf.getInstanceOfResult(obj, constr)) { - lda.stack.push(obj); + lda.push(obj); } else { - lda.stack.push(Null.INSTANCE); + lda.push(Null.INSTANCE); } return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java index 5a1650cf6..ec69fcc33 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionDefineFunction2.java @@ -90,7 +90,7 @@ public class ActionDefineFunction2 extends Action implements GraphSourceItemCont @Override public boolean execute(LocalDataArea lda) { ActionScriptFunction f = new ActionScriptFunction(fileOffset, codeSize, functionName, paramNames, getRegNames()); - lda.stack.push(f); + lda.push(f); lda.functions.add(f); ((ActionScriptObject) lda.target).setMember(functionName, f); return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java index a333563b1..e36c43c70 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionExtends.java @@ -12,7 +12,8 @@ * 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.action.swf7; import com.jpexs.decompiler.flash.BaseLocalData; @@ -45,7 +46,7 @@ public class ActionExtends extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java index 454cb3ef2..8bef29ca3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf7/ActionImplementsOp.java @@ -12,7 +12,8 @@ * 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.action.swf7; import com.jpexs.decompiler.flash.BaseLocalData; @@ -46,7 +47,7 @@ public class ActionImplementsOp extends Action { @Override public boolean execute(LocalDataArea lda) { - if (lda.stack.size() < 2) { + if (!lda.stackHasMinSize(2)) { return false; } @@ -54,12 +55,12 @@ public class ActionImplementsOp extends Action { ActionScriptObject obj = (ActionScriptObject) lda.pop(); int num = (int) (double) lda.popAsNumber(); List interfaces = new ArrayList<>(); - if (lda.stack.size() < num) { + if (!lda.stackHasMinSize(num)) { return false; } for (int i = 0; i < num; i++) { - interfaces.add(lda.stack.pop()); + interfaces.add(lda.pop()); } obj.setImplementsObjs(interfaces); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/FixItemCounterStack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/FixItemCounterStack.java index ddba15f66..d3a3183a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/FixItemCounterStack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/collections/FixItemCounterStack.java @@ -12,7 +12,8 @@ * 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.helpers.collections; import java.util.Stack; diff --git a/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java b/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java index 88da30590..952cdf994 100644 --- a/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java +++ b/test/com/jpexs/decompiler/flash/gui/FlashPlayerTest.java @@ -582,7 +582,7 @@ public class FlashPlayerTest { } } - Object res = lda.stack.pop(); + Object res = lda.pop(); ffdecExecuteResult = "Result:" + EcmaScript.toString(res) + " Type:" + EcmaScript.typeString(res); } catch (Exception e) { ffdecExecuteResult = "Error:" + e.getMessage();