From 1608d84b391b4c8b2ee14eb77395cb0afafeddd4 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 2 Oct 2015 22:50:32 -0400 Subject: [PATCH] I need a better solution than having to edit the jumpgraph all the time --- .../deob/attributes/code/Instructions.java | 16 ++++++++-------- .../deob/deobfuscators/MethodInliner.java | 13 ++++++++++--- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/runelite/deob/attributes/code/Instructions.java b/src/main/java/net/runelite/deob/attributes/code/Instructions.java index 3f923b42a2..bb7148659b 100644 --- a/src/main/java/net/runelite/deob/attributes/code/Instructions.java +++ b/src/main/java/net/runelite/deob/attributes/code/Instructions.java @@ -79,14 +79,14 @@ public class Instructions public void remove(Instruction ins) { - for (Instruction i : instructions) - { - if (i instanceof JumpingInstruction) - { - JumpingInstruction j = (JumpingInstruction) i; - assert !j.getJumps().contains(ins); - } - } +// for (Instruction i : instructions) +// { +// if (i instanceof JumpingInstruction) +// { +// JumpingInstruction j = (JumpingInstruction) i; +// assert !j.getJumps().contains(ins); +// } +// } ins.remove(); instructions.remove(ins); diff --git a/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java b/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java index 37e946ce68..b8cbd34826 100644 --- a/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java +++ b/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java @@ -203,8 +203,8 @@ public class MethodInliner implements Deobfuscator fromI.jump.remove(invokeIns); fromI.replace(invokeIns, firstParamStore); - fromI.jump.add(firstParamStore); + firstParamStore.from.add(fromI); } invokeIns.from.clear(); @@ -225,8 +225,14 @@ public class MethodInliner implements Deobfuscator // instead of return, jump to next instruction after the invoke Instruction oldI = i; i = new Goto(methodInstructions, nextInstruction); + assert methodInstructions.getInstructions().contains(nextInstruction); - i.jump.addAll(oldI.jump); + assert oldI != nextInstruction; + i.jump.add(nextInstruction); + nextInstruction.from.add(i); + + assert oldI.jump.isEmpty(); + //i.jump.addAll(oldI.jump); i.from.addAll(oldI.from); for (Instruction i2 : oldI.from) @@ -249,7 +255,8 @@ public class MethodInliner implements Deobfuscator if (oldI != i) { - i.jump.addAll(oldI.jump); + assert oldI.jump.isEmpty(); + //i.jump.addAll(oldI.jump); i.from.addAll(oldI.from); for (Instruction i2 : oldI.from)