Unused params is not working

This commit is contained in:
Adam
2015-10-18 20:34:20 -04:00
parent 9678bff181
commit 75364815aa
4 changed files with 36 additions and 26 deletions

View File

@@ -39,36 +39,36 @@ public class Deob
ClassGroup group = loadJar(args[0]); ClassGroup group = loadJar(args[0]);
run(group, new RenameUnique()); // run(group, new RenameUnique());
//
// remove except RuntimeException // // remove except RuntimeException
run(group, new RuntimeExceptions()); // run(group, new RuntimeExceptions());
// remove unused methods
run(group, new UnusedMethods());
run(group, new UnreachedCode());
// remove illegal state exceptions, frees up some parameters
run(group, new IllegalStateExceptions());
// remove constant logically dead parameters
run(group, new ConstantParameter());
// remove unhit blocks
run(group, new UnreachedCode());
// // remove unused parameters
// run(group, new UnusedParameters());
// //
// // remove jump obfuscation // // remove unused methods
// //new Jumps().run(group); // run(group, new UnusedMethods());
// //
// run(group, new UnreachedCode());
//
// // remove illegal state exceptions, frees up some parameters
// run(group, new IllegalStateExceptions());
//
// // remove constant logically dead parameters
// run(group, new ConstantParameter());
//
// // remove unhit blocks
// run(group, new UnreachedCode());
// remove unused parameters
run(group, new UnusedParameters());
// remove jump obfuscation
//new Jumps().run(group);
// remove unused fields // remove unused fields
run(group, new UnusedFields()); //run(group, new UnusedFields());
// remove unused methods, again? // remove unused methods, again?
run(group, new UnusedMethods()); //run(group, new UnusedMethods());
// //
// run(group, new MethodInliner()); // run(group, new MethodInliner());
// //

View File

@@ -260,6 +260,8 @@ public class UnusedParameters implements Deobfuscator
int[] i; int[] i;
do do
{ {
group.buildClassGraph();
Execution execution = new Execution(group); Execution execution = new Execution(group);
execution.populateInitialMethods(); execution.populateInitialMethods();
execution.run(); execution.run();

View File

@@ -169,7 +169,10 @@ public class Frame
while (stack.getSize() > 0) while (stack.getSize() > 0)
{ {
StackContext stacki = stack.pop(); StackContext stacki = stack.pop();
System.err.println(stacki); InstructionContext pushed = stacki.getPushed();
Frame frame = pushed.getFrame();
System.err.println(pushed.getInstruction().getDesc(frame));
} }
System.err.println("end of stack"); System.err.println("end of stack");
ex.printStackTrace(); ex.printStackTrace();

View File

@@ -59,6 +59,11 @@ public class InstructionContext
{ {
return ins; return ins;
} }
public Frame getFrame()
{
return frame;
}
public Stack getStack() public Stack getStack()
{ {