@Test @Ignore public void testRun() throws IOException { PacketTypeFinder bf = new PacketTypeFinder(group); bf.find(); }
private void run(Code code) { if (code == null) { return; } Instructions instructions = code.getInstructions(); for (int i = 0; i < instructions.getInstructions().size() - 1; ++i) { Instruction i1 = instructions.getInstructions().get(i), i2 = instructions.getInstructions().get(i + 1); if (i1 instanceof PushConstantInstruction && i2.getType() == InstructionType.PUTSTATIC) { PushConstantInstruction pci = (PushConstantInstruction) i1; SetFieldInstruction sfi = (SetFieldInstruction) i2; Field field = sfi.getMyField(); if (Objects.equal(-1, pci.getConstant()) && field != null) { Integer count = sets.get(field); if (count == null) { sets.put(field, 1); } else { sets.put(field, count + 1); } } } } }
PacketTypeFinder { private void run(Code code) { if (code == null) { return; } Instructions instructions = code.getInstructions(); for (int i = 0; i < instructions.getInstructions().size() - 1; ++i) { Instruction i1 = instructions.getInstructions().get(i), i2 = instructions.getInstructions().get(i + 1); if (i1 instanceof PushConstantInstruction && i2.getType() == InstructionType.PUTSTATIC) { PushConstantInstruction pci = (PushConstantInstruction) i1; SetFieldInstruction sfi = (SetFieldInstruction) i2; Field field = sfi.getMyField(); if (Objects.equal(-1, pci.getConstant()) && field != null) { Integer count = sets.get(field); if (count == null) { sets.put(field, 1); } else { sets.put(field, count + 1); } } } } } }
PacketTypeFinder { private void run(Code code) { if (code == null) { return; } Instructions instructions = code.getInstructions(); for (int i = 0; i < instructions.getInstructions().size() - 1; ++i) { Instruction i1 = instructions.getInstructions().get(i), i2 = instructions.getInstructions().get(i + 1); if (i1 instanceof PushConstantInstruction && i2.getType() == InstructionType.PUTSTATIC) { PushConstantInstruction pci = (PushConstantInstruction) i1; SetFieldInstruction sfi = (SetFieldInstruction) i2; Field field = sfi.getMyField(); if (Objects.equal(-1, pci.getConstant()) && field != null) { Integer count = sets.get(field); if (count == null) { sets.put(field, 1); } else { sets.put(field, count + 1); } } } } } PacketTypeFinder(ClassGroup group); }
PacketTypeFinder { private void run(Code code) { if (code == null) { return; } Instructions instructions = code.getInstructions(); for (int i = 0; i < instructions.getInstructions().size() - 1; ++i) { Instruction i1 = instructions.getInstructions().get(i), i2 = instructions.getInstructions().get(i + 1); if (i1 instanceof PushConstantInstruction && i2.getType() == InstructionType.PUTSTATIC) { PushConstantInstruction pci = (PushConstantInstruction) i1; SetFieldInstruction sfi = (SetFieldInstruction) i2; Field field = sfi.getMyField(); if (Objects.equal(-1, pci.getConstant()) && field != null) { Integer count = sets.get(field); if (count == null) { sets.put(field, 1); } else { sets.put(field, count + 1); } } } } } PacketTypeFinder(ClassGroup group); Field getPacketType(); void find(); }
PacketTypeFinder { private void run(Code code) { if (code == null) { return; } Instructions instructions = code.getInstructions(); for (int i = 0; i < instructions.getInstructions().size() - 1; ++i) { Instruction i1 = instructions.getInstructions().get(i), i2 = instructions.getInstructions().get(i + 1); if (i1 instanceof PushConstantInstruction && i2.getType() == InstructionType.PUTSTATIC) { PushConstantInstruction pci = (PushConstantInstruction) i1; SetFieldInstruction sfi = (SetFieldInstruction) i2; Field field = sfi.getMyField(); if (Objects.equal(-1, pci.getConstant()) && field != null) { Integer count = sets.get(field); if (count == null) { sets.put(field, 1); } else { sets.put(field, count + 1); } } } } } PacketTypeFinder(ClassGroup group); Field getPacketType(); void find();  }