From 2f3158d2ecff298d7a0b07f473e2b9ed323f00d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sun, 10 Mar 2013 19:32:05 +0100 Subject: [PATCH] AS1/2 better deobfuscation --- .../src/com/jpexs/decompiler/flash/SWFInputStream.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 2b38e794a..608b042e3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -496,10 +496,10 @@ public class SWFInputStream extends InputStream { private static void getConstantPool(List localData, Stack stack, List output, ActionGraphSource code, int ip, int lastIp, List constantPools, List visited) { boolean debugMode = false; while ((ip > -1) && ip < code.size()) { - /*if (visited.contains(ip)) { + if (visited.contains(ip)) { break; - }*/ - visited.add(ip); + } + lastIp = ip; GraphSourceItem ins = code.get(ip); if (debugMode) { @@ -528,6 +528,7 @@ public class SWFInputStream extends InputStream { stack.pop(); getConstantPool(localData, stack, output, code, condition ? (code.adr2pos(((ActionIf) ins).getAddress() + ((ActionIf) ins).getBytes(code.version).length + ((ActionIf) ins).offset)) : ip + 1, ip, constantPools, visited); } else { + visited.add(ip); List branches = ins.getBranches(code); for (int b : branches) { if (b >= 0) { @@ -595,7 +596,8 @@ public class SWFInputStream extends InputStream { last = a; } - List pools = getConstantPool(new ActionGraphSource(ret, version, new HashMap(), new HashMap(), new HashMap()), ip); + List pools = new ArrayList(); + pools= getConstantPool(new ActionGraphSource(ret, version, new HashMap(), new HashMap(), new HashMap()), ip); if (pools.size() == 1) { Action.setConstantPool(ret, pools.get(0));