@Nonnull private BuilderInstruction23x newBuilderInstruction23x(@Nonnull Instruction23x instruction) { return new BuilderInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
@Override public void jimplify(DexBody body) { if (!(instruction instanceof Instruction23x)) { throw new IllegalArgumentException("Expected Instruction23x but got: " + instruction.getClass()); } Instruction23x aPutInstr = (Instruction23x) instruction; int source = aPutInstr.getRegisterA(); Local arrayBase = body.getRegisterLocal(aPutInstr.getRegisterB()); Local index = body.getRegisterLocal(aPutInstr.getRegisterC()); ArrayRef arrayRef = Jimple.v().newArrayRef(arrayBase, index); Local sourceValue = body.getRegisterLocal(source); AssignStmt assign = getAssignStmt(body, sourceValue, arrayRef); if (aPutInstr.getOpcode() == Opcode.APUT_OBJECT) { assign.addTag(new ObjectOpTag()); } setUnit(assign); addTags(assign); body.add(assign); if (IDalvikTyper.ENABLE_DVKTYPER) { DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox()); DalvikTyper.v().setType(arrayRef.getIndexBox(), IntType.v(), true); } }
@Override public void jimplify(DexBody body) throws InvalidDalvikBytecodeException { if (!(instruction instanceof Instruction23x)) { throw new IllegalArgumentException("Expected Instruction23x but got: " + instruction.getClass()); } Instruction23x aGetInstr = (Instruction23x) instruction; int dest = aGetInstr.getRegisterA(); Local arrayBase = body.getRegisterLocal(aGetInstr.getRegisterB()); Local index = body.getRegisterLocal(aGetInstr.getRegisterC()); ArrayRef arrayRef = Jimple.v().newArrayRef(arrayBase, index); Local l = body.getRegisterLocal(dest); AssignStmt assign = Jimple.v().newAssignStmt(l, arrayRef); if (aGetInstr.getOpcode() == Opcode.AGET_OBJECT) { assign.addTag(new ObjectOpTag()); } setUnit(assign); addTags(assign); body.add(assign); if (IDalvikTyper.ENABLE_DVKTYPER) { DalvikTyper.v().addConstraint(assign.getLeftOpBox(), assign.getRightOpBox()); DalvikTyper.v().setType(arrayRef.getIndexBox(), IntType.v(), true); } }
@Nonnull private BuilderInstruction23x newBuilderInstruction23x(@Nonnull Instruction23x instruction) { return new BuilderInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
@Nonnull private BuilderInstruction23x newBuilderInstruction23x(@Nonnull Instruction23x instruction) { return new BuilderInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
@Nonnull private BuilderInstruction23x newBuilderInstruction23x(@Nonnull Instruction23x instruction) { return new BuilderInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
@Nonnull private BuilderInstruction23x newBuilderInstruction23x(@Nonnull Instruction23x instruction) { return new BuilderInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
public static ImmutableInstruction23x of(Instruction23x instruction) { if (instruction instanceof ImmutableInstruction23x) { return (ImmutableInstruction23x)instruction; } return new ImmutableInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
public void write(@Nonnull Instruction23x instruction) { try { writer.write(instruction.getOpcode().value); writer.write(instruction.getRegisterA()); writer.write(instruction.getRegisterB()); writer.write(instruction.getRegisterC()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction23x instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(instruction.getRegisterA()); writer.write(instruction.getRegisterB()); writer.write(instruction.getRegisterC()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public static ImmutableInstruction23x of(Instruction23x instruction) { if (instruction instanceof ImmutableInstruction23x) { return (ImmutableInstruction23x)instruction; } return new ImmutableInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
public static ImmutableInstruction23x of(Instruction23x instruction) { if (instruction instanceof ImmutableInstruction23x) { return (ImmutableInstruction23x)instruction; } return new ImmutableInstruction23x( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getRegisterC()); }
public void write(@Nonnull Instruction23x instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(instruction.getRegisterA()); writer.write(instruction.getRegisterB()); writer.write(instruction.getRegisterC()); } catch (IOException ex) { throw new RuntimeException(ex); } }