@Test public void test5() { ClassGroup group = ClassGroupFactory.generateGroup(); Code code = group.findClass("test").findMethod("func").getCode(); Instructions ins = code.getInstructions(); code.setMaxStack(2); Instruction[] prepareVariables = { new LDC(ins, 3), new IStore(ins, 0) }; for (Instruction i : prepareVariables) { ins.addInstruction(i); } Label label = new Label(ins); Instruction body[] = { new LDC(ins, 0), new LDC(ins, 3), new ILoad(ins, 0), new IAdd(ins), new IfICmpEq(ins, label), label, new VReturn(ins) }; for (Instruction i : body) { ins.addInstruction(i); } ExprArgOrder exprArgOrder = new ExprArgOrder(); exprArgOrder.run(group); List<Instruction> instructions = ins.getInstructions(); assertEquals(ILOAD, instructions.get(2).getType()); assertEquals(LDC, instructions.get(3).getType()); assertEquals(IADD, instructions.get(4).getType()); assertEquals(LDC, instructions.get(5).getType()); assertEquals(IF_ICMPEQ, instructions.get(6).getType()); }
@Override public void run(ClassGroup group) { Execution execution = new Execution(group); execution.addExecutionVisitor(i -> visit(i)); execution.addMethodContextVisitor(i -> visit(i)); execution.populateInitialMethods(); execution.run(); logger.info("Reordered {} expressions", count); }
ExprArgOrder implements Deobfuscator { @Override public void run(ClassGroup group) { Execution execution = new Execution(group); execution.addExecutionVisitor(i -> visit(i)); execution.addMethodContextVisitor(i -> visit(i)); execution.populateInitialMethods(); execution.run(); logger.info("Reordered {} expressions", count); } }
ExprArgOrder implements Deobfuscator { @Override public void run(ClassGroup group) { Execution execution = new Execution(group); execution.addExecutionVisitor(i -> visit(i)); execution.addMethodContextVisitor(i -> visit(i)); execution.populateInitialMethods(); execution.run(); logger.info("Reordered {} expressions", count); }  }
ExprArgOrder implements Deobfuscator { @Override public void run(ClassGroup group) { Execution execution = new Execution(group); execution.addExecutionVisitor(i -> visit(i)); execution.addMethodContextVisitor(i -> visit(i)); execution.populateInitialMethods(); execution.run(); logger.info("Reordered {} expressions", count); }  static int hash(Method method, InstructionContext ic); static int compare(Method method, InstructionType type, InstructionContext ic1, InstructionContext ic2); static int compare(Method method, InstructionType type, Expression expr1, Expression expr2); @Override void run(ClassGroup group); }
ExprArgOrder implements Deobfuscator { @Override public void run(ClassGroup group) { Execution execution = new Execution(group); execution.addExecutionVisitor(i -> visit(i)); execution.addMethodContextVisitor(i -> visit(i)); execution.populateInitialMethods(); execution.run(); logger.info("Reordered {} expressions", count); }  static int hash(Method method, InstructionContext ic); static int compare(Method method, InstructionType type, InstructionContext ic1, InstructionContext ic2); static int compare(Method method, InstructionType type, Expression expr1, Expression expr2); @Override void run(ClassGroup group);  }