- Setting of limit of executed instructions during AS1/2 deobfuscation

- Default limit of maximum executed instructions during AS1/2 deobfuscation raised to 10000
This commit is contained in:
Jindra Petřík
2018-05-27 19:39:02 +02:00
parent a115e19b7c
commit 6c998254b9
5 changed files with 32 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ import com.jpexs.decompiler.flash.action.swf5.ActionToString;
import com.jpexs.decompiler.flash.action.swf5.ActionTypeOf;
import com.jpexs.decompiler.flash.action.swf6.ActionGreater;
import com.jpexs.decompiler.flash.action.swf6.ActionStringGreater;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
import com.jpexs.decompiler.flash.helpers.SWFDecompilerAdapter;
import com.jpexs.decompiler.flash.helpers.collections.FixItemCounterStack;
@@ -97,8 +98,6 @@ import java.util.Stack;
*/
public class ActionDeobfuscator extends SWFDecompilerAdapter {
private final int executionLimit = 5000;
@Override
public void actionListParsed(ActionList actions, SWF swf) throws InterruptedException {
FastActionList fastActions = new FastActionList(actions);
@@ -447,6 +446,7 @@ public class ActionDeobfuscator extends SWFDecompilerAdapter {
int skippedInstructions = 0;
ActionConstantPool lastConstantPool = null;
int executionLimit = Configuration.as12DeobfuscatorExecutionLimit.get();
boolean skippedInstructionsUnknown = false;
boolean jumpedHere = true;
boolean jumpFound = false;

View File

@@ -206,6 +206,13 @@ public final class Configuration {
@ConfigurationCategory("limit")
public static final ConfigurationItem<Integer> decompilationTimeoutFile = null;
/**
* AS1/2 deobfuscator execution limit (max number of instructions processed)
*/
@ConfigurationDefaultInt(10000)
@ConfigurationCategory("limit")
public static final ConfigurationItem<Integer> as12DeobfuscatorExecutionLimit = null;
/**
* Using parameter names in decompiling may cause problems because official
* programs like Flash CS 5.5 inserts wrong parameter names indices