AS1/2 deobfuscation of empty stack pops - returning Undefined instead

This commit is contained in:
Jindra Petřík
2018-05-28 18:00:32 +02:00
parent f48c92df27
commit 02660f396e
85 changed files with 377 additions and 254 deletions

View File

@@ -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 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() {
public synchronized Double popAsNumber() {
return EcmaScript.toNumberAs2(pop());
}
public String popAsString() {
public synchronized String popAsString() {
return EcmaScript.toString(pop());
}
}

View File

@@ -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:
<code>
loc2:
*/
localData.checkStackSize = !first; //this enables popping undefineds
executeActions(actionItem, localData, cPool, result, fakeFunctions, useVariables, first);

View File

@@ -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;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(AndActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(AsciiToCharActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.stage.callFrame(EcmaScript.toInt32(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(CharToAsciiActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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());

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(DivideActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(EqActionItem.getResult(lda.pop(), lda.pop(), false));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
int index = EcmaScript.toInt32(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) {
if (movieClip instanceof ActionScriptObject) {
lda.push(((ActionScriptObject) movieClip).getProperty(index));
return true;
}
}
lda.push(Undefined.INSTANCE);
return true;
}

View File

@@ -44,7 +44,7 @@ public class ActionGetTime extends Action {
}
@Override
public boolean execute(LocalDataArea lda) {
public boolean execute(LocalDataArea lda) {
lda.push(lda.stage.getTime());
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
String target = EcmaScript.toString(lda.stack.pop());
String target = EcmaScript.toString(lda.pop());
String urlString = EcmaScript.toString(lda.pop());
//TODO: Execute - Connection
return true;

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
@@ -59,7 +60,7 @@ public class ActionGetVariable extends Action {
value = Undefined.INSTANCE;
}
lda.push(value);
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
String frame = EcmaScript.toString(lda.pop());
String target = "/";
if (frame.contains(":")) {
target = frame.substring(0, frame.indexOf(':'));

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(LtActionItem.getResult(lda.pop(), lda.pop(), false));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(MBAsciiToCharActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(MBCharToAsciiActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(3)) {
return false;
}
lda.push(MBStringExtractActionItem.getResult(lda.pop(), lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(MBStringLengthActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(MultiplyActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(NotItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(OrActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.pop();
return true;
}

View File

@@ -373,16 +373,16 @@ public class ActionPush extends Action {
if (value instanceof ConstantIndex) {
ConstantIndex constantIndex = (ConstantIndex) value;
List<String> 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);
}
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(RandomNumberActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
String target = EcmaScript.toString(lda.pop());
lda.stage.removeMember(target);
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(3)) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(StringAddActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(StringEqActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(3)) {
return false;
}
lda.push(StringExtractActionItem.getResult(lda.pop(), lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(StringLengthActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(StringLtActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(SubtractActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(ToIntegerActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(AddActionItem.getResult(lda.pop(), lda.pop(), true));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(BitAndActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(LShiftActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(BitOrActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(RShiftActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(URShiftActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(BitXorActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -57,7 +57,7 @@ public class ActionCallFunction extends Action {
}
for (ActionScriptFunction f : lda.functions) {
if (functionName.equals(f.getFunctionName())) {
if (functionName.equals(f.getFunctionName())) {
lda.push(lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), Undefined.INSTANCE /*?*/));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
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();
int numArgs = (int) (double) lda.popAsNumber();
if (!lda.stackHasMinSize(numArgs)) {
return false;
}
@@ -70,7 +71,7 @@ public class ActionCallMethod extends Action {
ActionScriptFunction f = (ActionScriptFunction) obj.getMember(methodName);
lda.push(lda.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), obj));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(DecrementActionItem.getResult(lda.popAsNumber()));
return true;
}

View File

@@ -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());
ActionScriptFunction f = new ActionScriptFunction(fileOffset, codeSize, functionName, paramNames, getRegNames());
lda.push(f);
lda.functions.add(f);
((ActionScriptObject) lda.target).setMember(functionName, f);

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(1)) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}

View File

@@ -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<String> members = ((ActionScriptObject) o).enumerate();
for (String m : members) {
lda.stack.push(m);
lda.push(m);
}
}
return true;

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(EqActionItem.getResult(lda.pop(), lda.pop(), true));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
String membername = lda.popAsString();
Object obj = lda.pop();
if (obj instanceof ActionScriptObject) {
if (obj instanceof ActionScriptObject) {
lda.push(((ActionScriptObject) obj).getMember(membername));
} else {
} else {
lda.push(Undefined.INSTANCE);
}
return true;

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(IncrementActionItem.getResult(lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
int num = (int) (double) lda.popAsNumber();
int num = (int) (double) lda.popAsNumber();
if (!lda.stackHasMinSize(num)) {
return false;
}
ActionScriptArray arr = new ActionScriptArray();
for (int i = 0; i < num; i++) {
for (int i = 0; i < num; i++) {
arr.setValueAtIndex(i, lda.pop());
}
lda.push(arr);
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
int num = (int) (double) lda.popAsNumber();
int num = (int) (double) lda.popAsNumber();
if (!lda.stackHasMinSize(2 * num)) {
return false;
}
@@ -62,7 +63,7 @@ public class ActionInitObject extends Action {
obj.setMember(name, val);
}
lda.push(obj);
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(LtActionItem.getResult(lda.pop(), lda.pop(), true));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(ModuloActionItem.getResult(lda.popAsNumber(), lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(3)) {
return false;
}
String methodName = lda.popAsString();
ActionScriptObject obj = (ActionScriptObject) lda.pop();
int numArgs = (int) (double) lda.popAsNumber();
int numArgs = (int) (double) lda.popAsNumber();
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.stage.callFunction(f.getFunctionOffset(), f.getFunctionLength(), args, f.getFuncRegNames(), nobj);
lda.push(nobj);
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
String objectName = lda.popAsString();
int numArgs = (int) (double) lda.popAsNumber();
int numArgs = (int) (double) lda.popAsNumber();
if (!lda.stackHasMinSize(numArgs)) {
return false;
}
List<Object> args = new ArrayList<>();
for (int i = 0; i < numArgs; i++) {
for (int i = 0; i < numArgs; i++) {
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.push(obj);
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(lda.peek());
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
//lda.returnValue = Undefined.INSTANCE;
return false;
} else {
} else {
lda.returnValue = lda.pop();
}
return true;

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(3)) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
Object obj1 = lda.stack.pop();
Object obj2 = lda.stack.pop();
lda.stack.push(obj1);
Object obj1 = lda.pop();
Object obj2 = lda.pop();
lda.push(obj1);
lda.push(obj2);
return true;
}

View File

@@ -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;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
@@ -53,9 +54,9 @@ public class ActionTargetPath extends Action {
String path = lda.stage.getMemberPath(obj);
if (path == null) {
if (path == null) {
lda.push(Undefined.INSTANCE);
} else {
} else {
lda.push(path);
}
return true;

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(ToNumberActionItem.getResult(lda.popAsNumber()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(ToStringActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}
lda.push(TypeOfActionItem.getResult(lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (lda.stackIsEmpty()) {
return false;
}

View File

@@ -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<String> members = ((ActionScriptObject) o).enumerate();
for (String m : members) {
lda.stack.push(m);
lda.push(m);
}
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(GtActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
Object type = lda.stack.pop();
Object type = lda.pop();
Object obj = lda.pop();
if (getInstanceOfResult(obj, type)) {
if (getInstanceOfResult(obj, type)) {
lda.push(Boolean.TRUE);
} else {
} else {
lda.push(Boolean.FALSE);
}
return true;

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(StrictEqActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
lda.push(StringGtActionItem.getResult(lda.pop(), lda.pop()));
return true;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}
ActionScriptObject obj = (ActionScriptObject) lda.pop();
ActionScriptObject constr = (ActionScriptObject) lda.pop();
if (ActionInstanceOf.getInstanceOfResult(obj, constr)) {
if (ActionInstanceOf.getInstanceOfResult(obj, constr)) {
lda.push(obj);
} else {
} else {
lda.push(Null.INSTANCE);
}
return true;

View File

@@ -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());
ActionScriptFunction f = new ActionScriptFunction(fileOffset, codeSize, functionName, paramNames, getRegNames());
lda.push(f);
lda.functions.add(f);
((ActionScriptObject) lda.target).setMember(functionName, f);

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
if (!lda.stackHasMinSize(2)) {
return false;
}

View File

@@ -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) {
public boolean execute(LocalDataArea lda) {
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<Object> interfaces = new ArrayList<>();
List<Object> interfaces = new ArrayList<>();
if (!lda.stackHasMinSize(num)) {
return false;
}
for (int i = 0; i < num; i++) {
for (int i = 0; i < num; i++) {
interfaces.add(lda.pop());
}
obj.setImplementsObjs(interfaces);

View File

@@ -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;