This commit is contained in:
honfika@gmail.com
2015-09-23 16:55:07 +02:00
parent de66ba86e5
commit b5c8d76643

View File

@@ -289,12 +289,29 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
return;
}
String variableName = stack.peek().getResult().toString();
GraphTargetItem variableNameObj = stack.peek();
if (!(variableNameObj instanceof DirectValueActionItem)) {
// avoid dynamic variable names, for example: eval("item" add i);
break;
}
String variableName = variableNameObj.getResult().toString();
if (!localData.variables.containsKey(variableName)) {
break;
}
}
if (action instanceof ActionSetVariable) {
if (stack.size() < 2) {
return;
}
if (!(stack.peek(2) instanceof DirectValueActionItem)) {
// avoid dynamic variable names, for example: set("item" add i, 1);
break;
}
}
if (action instanceof ActionCallFunction) {
if (stack.isEmpty()) {
return;
@@ -370,28 +387,6 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple {
break;
}
if (action instanceof ActionGetVariable) {
if (stack.isEmpty()) {
return;
}
if (stack.peek() instanceof DirectValueActionItem) {
// avoid dynamic variable names, for example: eval("item" add i);
break;
}
}
if (action instanceof ActionSetVariable) {
if (stack.size() < 2) {
return;
}
if (stack.peek(2) instanceof DirectValueActionItem) {
// avoid dynamic variable names, for example: set("item" add i, 1);
break;
}
}
if (action instanceof ActionPush) {
ActionPush push = (ActionPush) action;
boolean ok = true;