ise fixes, grr
This commit is contained in:
@@ -79,6 +79,15 @@ public class Instructions
|
|||||||
|
|
||||||
public void remove(Instruction ins)
|
public void remove(Instruction ins)
|
||||||
{
|
{
|
||||||
|
for (Instruction i : instructions)
|
||||||
|
{
|
||||||
|
if (i instanceof JumpingInstruction)
|
||||||
|
{
|
||||||
|
JumpingInstruction j = (JumpingInstruction) i;
|
||||||
|
assert !j.getJumps().contains(ins);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ins.remove();
|
ins.remove();
|
||||||
instructions.remove(ins);
|
instructions.remove(ins);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class IllegalStateExceptions implements Deobfuscator
|
|||||||
|
|
||||||
Instructions instructions = c.getInstructions();
|
Instructions instructions = c.getInstructions();
|
||||||
instructions.clearBlockGraph();
|
instructions.clearBlockGraph();
|
||||||
|
instructions.buildJumpGraph();
|
||||||
|
|
||||||
List<Instruction> ilist = instructions.getInstructions();
|
List<Instruction> ilist = instructions.getInstructions();
|
||||||
for (int i = 0; i < ilist.size(); ++i)
|
for (int i = 0; i < ilist.size(); ++i)
|
||||||
@@ -109,7 +110,11 @@ public class IllegalStateExceptions implements Deobfuscator
|
|||||||
instructions.remove(ins);
|
instructions.remove(ins);
|
||||||
|
|
||||||
// insert goto
|
// insert goto
|
||||||
ilist.add(i, new Goto(instructions, to));
|
assert ilist.contains(to);
|
||||||
|
Goto g = new Goto(instructions, to);
|
||||||
|
g.jump.add(to);
|
||||||
|
to.from.add(g);
|
||||||
|
ilist.add(i, g);
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
break;
|
break;
|
||||||
@@ -121,17 +126,20 @@ public class IllegalStateExceptions implements Deobfuscator
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ClassGroup group)
|
public void run(ClassGroup group)
|
||||||
{
|
{
|
||||||
|
group.buildClassGraph();
|
||||||
Execution execution = new Execution(group);
|
Execution execution = new Execution(group);
|
||||||
execution.populateInitialMethods();
|
execution.populateInitialMethods();
|
||||||
execution.run();
|
execution.run();
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int passes = 0;
|
int passes = 0;
|
||||||
int i;
|
int i;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
i = checkOnce(execution, group);
|
i = checkOnce(execution, group);
|
||||||
|
|
||||||
|
System.out.println("ise removal pass " + passes + " removed " + i);
|
||||||
|
|
||||||
count += i;
|
count += i;
|
||||||
++passes;
|
++passes;
|
||||||
|
|||||||
Reference in New Issue
Block a user