From b5c8d766439dfd94c65ec2e6d51d29483b425f5f Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 23 Sep 2015 16:55:07 +0200 Subject: [PATCH] fix --- .../deobfuscation/ActionDeobfuscator.java | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) 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 5f9845e25..60685da27 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 @@ -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;