From 4e8eddfbbc74a4d19b0903f85bf07c8b483db401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Mon, 25 Mar 2013 21:29:24 +0100 Subject: [PATCH] AS3 ClassCast fix static const init in obfuscated code --- trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java | 5 +++-- trunk/src/com/jpexs/decompiler/flash/graph/Graph.java | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 26defdd11..f02ad6187 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -1288,7 +1288,7 @@ public class AVM2Code implements Serializable { if (!isKilled(reg, 0, end)) { for (int i = ip; i >= start; i--) { if (code.get(i).definition instanceof DupIns) { - TreeItem v = (TreeItem) stack.pop(); + GraphTargetItem v = stack.pop(); stack.push(new LocalRegTreeItem(ins, reg, v)); stack.push(v); } else { @@ -1509,7 +1509,8 @@ public class AVM2Code implements Serializable { } } } else { - break; + //In obfuscated code, SetLocal instructions comes first + //break; } } } diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 4724e99b1..077266e37 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -443,7 +443,6 @@ public class Graph { output.addAll(code.translatePart(localData, stack, start, end)); } catch (Exception ex) { Logger.getLogger(Graph.class.getName()).log(Level.SEVERE, "error during printgraph", ex); - //ex.printStackTrace(); return ret; } }