Trying to run the better inliner so the graph matches up. Maybe instead figure out a way to passively ignored the static func calls. Regardless this assert fails due to a corrupted jump graph.

This commit is contained in:
Adam
2015-11-09 21:18:21 -05:00
parent 60d4cd94fd
commit 3edf7e2f4c
4 changed files with 28 additions and 12 deletions

View File

@@ -37,7 +37,7 @@ public class Deob
{ {
public static void main(String[] args) throws IOException public static void main(String[] args) throws IOException
{ {
merge(); if(true) return; //merge(); if(true) return;
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();

View File

@@ -280,7 +280,9 @@ public class Instructions
assert ins.jump.contains(oldi); assert ins.jump.contains(oldi);
ins.jump.remove(oldi); ins.jump.remove(oldi);
ins.jump.add(newi); ins.jump.add(newi);
newi.from.add(ins);
ins.replace(oldi, newi); ins.replace(oldi, newi);
} }

View File

@@ -265,7 +265,12 @@ public class MethodInliner implements Deobfuscator
// instead of return, jump to next instruction after the invoke // instead of return, jump to next instruction after the invoke
Instruction oldI = i; Instruction oldI = i;
i = new Goto(methodInstructions, nextInstruction); i = new Goto(methodInstructions, nextInstruction);
i.jump.add(nextInstruction);
nextInstruction.from.add(i);
assert nextInstruction.getInstructions() == methodInstructions; assert nextInstruction.getInstructions() == methodInstructions;
assert methodInstructions.getInstructions().contains(nextInstruction); assert methodInstructions.getInstructions().contains(nextInstruction);
@@ -287,16 +292,17 @@ public class MethodInliner implements Deobfuscator
Instruction oldI = i; Instruction oldI = i;
i = lvt.setVariableIndex(newIndex); i = lvt.setVariableIndex(newIndex);
if (oldI != i) assert oldI == i;
{ // if (oldI != i)
for (Instruction i2 : insMap.values()) // {
i2.replace(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); // for (net.runelite.deob.attributes.code.Exception e : toExceptions.getExceptions())
// e.replace(oldI, i);
insMap.put(orig, i); //
} // insMap.put(orig, i);
// }
} }
assert !methodInstructions.getInstructions().contains(i); assert !methodInstructions.getInstructions().contains(i);

View File

@@ -36,7 +36,10 @@ public class Rename
IsomorphismTester isoTest = new TypedVF2IsomorphismTester(); IsomorphismTester isoTest = new TypedVF2IsomorphismTester();
if (!isoTest.areIsomorphic(g1, g2)) if (!isoTest.areIsomorphic(g1, g2))
{
System.out.println("Not isomorphic " + g1.size() + " " + g2.size());
return false; return false;
}
Map<Integer, Integer> mapping = isoTest.findIsomorphism(g1, g2); Map<Integer, Integer> mapping = isoTest.findIsomorphism(g1, g2);
Map<Integer, Instruction> map1 = f1.getMethodCtx().getIdMap(), map2 = f2.getMethodCtx().getIdMap(); Map<Integer, Instruction> map1 = f1.getMethodCtx().getIdMap(), map2 = f2.getMethodCtx().getIdMap();
@@ -93,7 +96,12 @@ public class Rename
for (Frame fr1 : f1) for (Frame fr1 : f1)
for (Frame fr2 : f2) 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; break;
} }