@Test public void test4() { 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); } Instruction body[] = { new SiPush(ins, (short) 600), new ILoad(ins, 0), new LDC(ins, 3), new IMul(ins), new IAdd(ins), new Pop(ins), new ILoad(ins, 0), new LDC(ins, 3), new IMul(ins), new SiPush(ins, (short) 600), new IAdd(ins), new Pop(ins), new VReturn(ins) }; for (Instruction i : body) { ins.addInstruction(i); } ExprArgOrder exprArgOrder = new ExprArgOrder(); exprArgOrder.run(group); List<Instruction> instructions = ins.getInstructions(); for (int i = 2; i <= 7; ++i) { assertEquals(instructions.get(i).getType(), instructions.get(i + 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);  }