diff --git a/src/main/java/net/runelite/deob/Deob.java b/src/main/java/net/runelite/deob/Deob.java index 8f1745b9c6..d818cb1221 100644 --- a/src/main/java/net/runelite/deob/Deob.java +++ b/src/main/java/net/runelite/deob/Deob.java @@ -37,7 +37,7 @@ public class Deob { public static void main(String[] args) throws IOException { - merge(); if(true) return; + //merge(); if(true) return; long start = System.currentTimeMillis(); 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 1dce88b0ea..10cd193640 100644 --- a/src/main/java/net/runelite/deob/attributes/code/Instructions.java +++ b/src/main/java/net/runelite/deob/attributes/code/Instructions.java @@ -280,7 +280,9 @@ public class Instructions assert ins.jump.contains(oldi); ins.jump.remove(oldi); + ins.jump.add(newi); + newi.from.add(ins); ins.replace(oldi, newi); } diff --git a/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java b/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java index 9548ab5f01..d416f327c4 100644 --- a/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java +++ b/src/main/java/net/runelite/deob/deobfuscators/MethodInliner.java @@ -265,7 +265,12 @@ public class MethodInliner implements Deobfuscator // instead of return, jump to next instruction after the invoke Instruction oldI = i; + i = new Goto(methodInstructions, nextInstruction); + + i.jump.add(nextInstruction); + nextInstruction.from.add(i); + assert nextInstruction.getInstructions() == methodInstructions; assert methodInstructions.getInstructions().contains(nextInstruction); @@ -287,16 +292,17 @@ public class MethodInliner implements Deobfuscator Instruction oldI = i; i = lvt.setVariableIndex(newIndex); - if (oldI != i) - { - for (Instruction i2 : insMap.values()) - i2.replace(oldI, i); - - for (net.runelite.deob.attributes.code.Exception e : toExceptions.getExceptions()) - e.replace(oldI, i); - - insMap.put(orig, i); - } + assert oldI == i; +// if (oldI != i) +// { +// for (Instruction i2 : insMap.values()) +// i2.replace(oldI, i); +// +// for (net.runelite.deob.attributes.code.Exception e : toExceptions.getExceptions()) +// e.replace(oldI, i); +// +// insMap.put(orig, i); +// } } assert !methodInstructions.getInstructions().contains(i); diff --git a/src/main/java/net/runelite/deob/deobfuscators/rename/Rename.java b/src/main/java/net/runelite/deob/deobfuscators/rename/Rename.java index 24a968c072..2883e58c91 100644 --- a/src/main/java/net/runelite/deob/deobfuscators/rename/Rename.java +++ b/src/main/java/net/runelite/deob/deobfuscators/rename/Rename.java @@ -36,7 +36,10 @@ public class Rename IsomorphismTester isoTest = new TypedVF2IsomorphismTester(); if (!isoTest.areIsomorphic(g1, g2)) + { + System.out.println("Not isomorphic " + g1.size() + " " + g2.size()); return false; + } Map mapping = isoTest.findIsomorphism(g1, g2); Map map1 = f1.getMethodCtx().getIdMap(), map2 = f2.getMethodCtx().getIdMap(); @@ -93,7 +96,12 @@ public class Rename for (Frame fr1 : f1) for (Frame fr2 : f2) { - compare(fr1, fr2); + boolean b = compare(fr1, fr2); + if (!b) + { + System.out.println("Mismatch " + p1.getMethod().getMethods().getClassFile().getName() + "." + p1.getMethod().getName() + " <-> " + p2.getMethod().getMethods().getClassFile().getName() + "." + p2.getMethod().getName()); + int i =7; + } break; }