From b50f159f6a73220596126ff67ba197873f2ef25c Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Wed, 23 Sep 2015 08:20:48 +0200 Subject: [PATCH] action deobfuasscator: removing fake functions enabled again --- .../deobfuscation/ActionDeobfuscator.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 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 09a653f8f..4bf491723 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 @@ -423,16 +423,28 @@ public class ActionDeobfuscator extends ActionDeobfuscatorSimple { if (action instanceof ActionDefineFunction) { ActionDefineFunction def = (ActionDefineFunction) action; if (def.paramNames.isEmpty()) { + boolean isFakeName = true; + for (char ch : def.functionName.toCharArray()) { + if (ch > 31) { + isFakeName = false; + break; + } + } + + // remove funcion only when the function name contains only non printable characters + if (!isFakeName) { + continue; + } + ExecutionResult result = new ExecutionResult(); List lastActions = actions.getContainerLastActions(action); int lastActionIdx = actions.indexOf(lastActions.get(0)); executeActions(actions, i + 1, lastActionIdx, null, result, null); if (result.resultValue != null) { results.put(def.functionName, result.resultValue); - // todo: remove fake function - /*for (int j = i; j <= lastActionIdx; j++) { - actions.removeAction(i); - }*/ + for (int j = i; j <= lastActionIdx; j++) { + actions.removeAction(i); + } } } }