private InsnNode fillArray(DecodedInstruction insn) { DecodedInstruction payload = insnArr[insn.getTarget()]; return new FillArrayNode(insn.getA(), (FillArrayDataPayloadDecodedInstruction) payload); }
public IfNode(DecodedInstruction insn, IfOp op) { this(op, insn.getTarget(), InsnArg.reg(insn, 0, ARG_TYPE), insn.getRegisterCount() == 1 ? InsnArg.lit(0, ARG_TYPE) : InsnArg.reg(insn, 1, ARG_TYPE)); }
private InsnNode decodeSwitch(DecodedInstruction insn, int offset, boolean packed) { int payloadOffset = insn.getTarget(); DecodedInstruction payload = insnArr[payloadOffset]; Object[] keys; int[] targets; if (packed) { PackedSwitchPayloadDecodedInstruction ps = (PackedSwitchPayloadDecodedInstruction) payload; targets = ps.getTargets(); keys = new Object[targets.length]; int k = ps.getFirstKey(); for (int i = 0; i < keys.length; i++) { keys[i] = k++; } } else { SparseSwitchPayloadDecodedInstruction ss = (SparseSwitchPayloadDecodedInstruction) payload; targets = ss.getTargets(); keys = new Object[targets.length]; for (int i = 0; i < keys.length; i++) { keys[i] = ss.getKeys()[i]; } } // convert from relative to absolute offsets for (int i = 0; i < targets.length; i++) { targets[i] = targets[i] - payloadOffset + offset; } int nextOffset = getNextInsnOffset(insnArr, offset); return new SwitchNode(InsnArg.reg(insn, 0, ArgType.NARROW), keys, targets, nextOffset); }
case Opcodes.GOTO_16: case Opcodes.GOTO_32: return new GotoNode(insn.getTarget());
/** * Gets the target as a relative offset from the given base * address, as a code unit. This will throw if the value is out of * the range of a signed code unit. */ public final short getTargetUnit(int baseAddress) { int relativeTarget = getTarget(baseAddress); if (relativeTarget != (short) relativeTarget) { throw new DexException("Target out of range: " + Hex.s4(relativeTarget)); } return (short) relativeTarget; }
/** * Gets the target as a relative offset from the given base * address, as a code unit. This will throw if the value is out of * the range of a signed code unit. */ public final short getTargetUnit(int baseAddress) { int relativeTarget = getTarget(baseAddress); if (relativeTarget != (short) relativeTarget) { throw new DexException("Target out of range: " + Hex.s4(relativeTarget)); } return (short) relativeTarget; }
/** * Gets the target as a relative offset from the given base * address, masked to be a byte in size. This will throw if the * value is out of the range of a signed byte. */ public final int getTargetByte(int baseAddress) { int relativeTarget = getTarget(baseAddress); if (relativeTarget != (byte) relativeTarget) { throw new DexException("Target out of range: " + Hex.s4(relativeTarget)); } return relativeTarget & 0xff; }
/** * Gets the target as a relative offset from the given base * address, masked to be a byte in size. This will throw if the * value is out of the range of a signed byte. */ public final int getTargetByte(int baseAddress) { int relativeTarget = getTarget(baseAddress); if (relativeTarget != (byte) relativeTarget) { throw new DexException("Target out of range: " + Hex.s4(relativeTarget)); } return relativeTarget & 0xff; }
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write(insn.getOpcodeUnit(), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write(insn.getOpcodeUnit(), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write(insn.getOpcodeUnit(), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write(insn.getOpcodeUnit(), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write(insn.getOpcodeUnit(), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write(insn.getOpcodeUnit(), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write( codeUnit(insn.getOpcode(), insn.getA()), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write( codeUnit(insn.getOpcode(), insn.getA()), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write( codeUnit(insn.getOpcode(), insn.getA()), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write( codeUnit(insn.getOpcode(), insn.getA()), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write( codeUnit(insn.getOpcode(), insn.getA()), unit0(relativeTarget), unit1(relativeTarget)); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { int relativeTarget = insn.getTarget(out.cursor()); out.write( codeUnit(insn.getOpcode(), insn.getA()), unit0(relativeTarget), unit1(relativeTarget)); } },