From a188de262fb903dfb641dde9630f96d42bc989d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 6 Jul 2013 15:41:16 +0200 Subject: [PATCH] deobfuscation - getconstantpool fix --- .../src/com/jpexs/decompiler/flash/SWFInputStream.java | 10 +++++----- .../decompiler/flash/action/special/ActionEnd.java | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 01068e1d7..3f1a3c9aa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -548,7 +548,10 @@ public class SWFInputStream extends InputStream { } GraphSourceItem ins = code.get(ip); if (ins.isIgnored()) { - ip++; + if(ins.isExit()){ + break; + } + ip++; continue; } @@ -601,10 +604,7 @@ public class SWFInputStream extends InputStream { if (ins instanceof ActionJump) { add += " change:" + (((ActionJump) ins).getJumpOffset()); } - System.err.println("getConstantPool ip " + ip + ", addr " + Helper.formatAddress(((Action) ins).getAddress()) + ": " + ((Action) ins).getASMSource(new ArrayList(), new ArrayList(), cpool.constants, version, false) + add + " stack:" + Helper.stackToString(stack, Helper.toList(cpool))); - if (ip == 116) { - System.err.println("kok"); - } + System.err.println("getConstantPool ip " + ip + ", addr " + Helper.formatAddress(((Action) ins).getAddress()) + ": " + ((Action) ins).getASMSource(new ArrayList(), new ArrayList(), cpool==null?null:cpool.constants, version, false) + add + " stack:" + Helper.stackToString(stack, Helper.toList(cpool))); } if (ins instanceof ActionConstantPool) { constantPools.add(new ConstantPool(((ActionConstantPool) ins).constantPool)); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java b/trunk/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java index 3034f4aab..fa978c5d4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/special/ActionEnd.java @@ -34,6 +34,11 @@ public class ActionEnd extends Action { return "End"; } + @Override + public boolean isExit() { + return true; + } + @Override public void translate(Stack stack, List output, java.util.HashMap regNames, HashMap variables, HashMap functions) { //output.add(new SimpleActionTreeItem(this, "end()"));