public interface

IDalvikInstruction

implements ILocatedInstruction
com.pnfsoftware.jeb.core.units.code.android.dex.IDalvikInstruction

Class Overview

Definition of a Dalvik instruction. Retrieved via methods in the container IDexCodeItem object.

See Also

Summary

Constants
int INDEX_IS_FIELD_OFFSET
int INDEX_IS_INLINE_OFFSET
int INDEX_IS_VTABLE_OFFSET
int INDEX_TO_CALL_SITE
int INDEX_TO_FIELD
int INDEX_TO_METHOD
int INDEX_TO_METHOD_HANDLE
int INDEX_TO_PROTOTYPE
int INDEX_TO_STRING
int INDEX_TO_TYPE
int TYPE_BRA Operand type for branch target.
int TYPE_IDX Operand type for an index into a constant pool (which pool is instruction specific).
int TYPE_IDX2 Operand type for a second index into the prototype pool.
int TYPE_IMM Operand type for an immediate.
int TYPE_REG Operand type for a register or pair of registers.
int TYPE_RGR Operand type for a register range.
Public Methods
abstract IDalvikInstructionArrayData getArrayData()
Get the instruction array data.
abstract byte[] getCode()
Get the binary code that makes up this instruction.

For pseudo-instructions, additional data bytes can be retrieved via getArrayData() or getSwitchData().

abstract int getOpcode()
Get the Dalvik instruction opcode, as defined in DalvikInstructionOpcodes.
abstract IDalvikInstructionParameter getParameter(int index)
Get an instruction operand by index, typed as a proper Dalvik parameter.
abstract int getParameterCount()
Get the count of parameters.
abstract int getParameterFirstIndexType()
If this instruction has an index parameter (of type TYPE_IDX), retrieve the kind of pool that is referenced by this parameter index value.
abstract int getParameterIndexType()
This method is deprecated. No replacement.
abstract int getParameterSecondIndexType()
If this instruction has a second index parameter (of type TYPE_IDX2), retrieve the kind of pool that is referenced by this parameter index value.
abstract int getParameterType(int index)
Get the type of a parameter.
abstract long getParameterValue(int index)
Get the value of a parameter.
abstract IDalvikInstructionParameter[] getParameters()
Get the instruction operands typed as proper Dalvik parameters.
abstract IDalvikInstructionSwitchData getSwitchData()
Get the instruction switch data.
abstract boolean isArray()
Determine if the instruction is an array initializer.
abstract boolean isOptimized()
Provide a hint if the instruction looks like an optimized (non-standard) instruction, such as an odex or Art.
abstract boolean isPseudoInstruction()
Determine if this instruction is a so-called pseudo instruction, that is, a switch or an array-initialization instruction.
abstract boolean isSwitch()
Determine if the instruction is a switch.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.IInstruction
From interface com.pnfsoftware.jeb.core.units.code.ILocatedInstruction

Constants

public static final int INDEX_IS_FIELD_OFFSET

Constant Value: 34 (0x00000022)

public static final int INDEX_IS_INLINE_OFFSET

Constant Value: 32 (0x00000020)

public static final int INDEX_IS_VTABLE_OFFSET

Constant Value: 33 (0x00000021)

public static final int INDEX_TO_CALL_SITE

Constant Value: 21 (0x00000015)

public static final int INDEX_TO_FIELD

Constant Value: 18 (0x00000012)

public static final int INDEX_TO_METHOD

Constant Value: 19 (0x00000013)

public static final int INDEX_TO_METHOD_HANDLE

Constant Value: 22 (0x00000016)

public static final int INDEX_TO_PROTOTYPE

Constant Value: 20 (0x00000014)

public static final int INDEX_TO_STRING

Constant Value: 16 (0x00000010)

public static final int INDEX_TO_TYPE

Constant Value: 17 (0x00000011)

public static final int TYPE_BRA

Operand type for branch target.
Value: signed int, relative displacement in code units (2 bytes) from current instruction address

Constant Value: 3 (0x00000003)

public static final int TYPE_IDX

Operand type for an index into a constant pool (which pool is instruction specific). The index may reference a type, a string, a field, a method, or a call site. It cannot be used to reference a prototype (see TYPE_IDX2. An instruction can have at most one such index.
Value: an unsigned int

Constant Value: 2 (0x00000002)

public static final int TYPE_IDX2

Operand type for a second index into the prototype pool. An instruction can have at most one such index, and only if it also has a first index parameters (type TYPE_IDX).
Value: an unsigned int

Constant Value: 5 (0x00000005)

public static final int TYPE_IMM

Operand type for an immediate.
Value: long, sign-extended, could be anything from a boolean to a double

Constant Value: 1 (0x00000001)

public static final int TYPE_REG

Operand type for a register or pair of registers.
Value: int, the register index (or first register index , in case of a pair)

Constant Value: 0 (0x00000000)

public static final int TYPE_RGR

Operand type for a register range.
Value: long, made up of 2 ints as follows: low-int=first register index, high-int=last register index (inclusive)

Constant Value: 4 (0x00000004)

Public Methods

public abstract IDalvikInstructionArrayData getArrayData ()

Get the instruction array data.

Returns
  • the array data, null of the instruction is not fill-array-data

public abstract byte[] getCode ()

Get the binary code that makes up this instruction.

For pseudo-instructions, additional data bytes can be retrieved via getArrayData() or getSwitchData().

Returns
  • an array of bytes, or null if the instruction is abstract

public abstract int getOpcode ()

Get the Dalvik instruction opcode, as defined in DalvikInstructionOpcodes.

Returns
  • the opcode

public abstract IDalvikInstructionParameter getParameter (int index)

Get an instruction operand by index, typed as a proper Dalvik parameter.

public abstract int getParameterCount ()

Get the count of parameters.

public abstract int getParameterFirstIndexType ()

If this instruction has an index parameter (of type TYPE_IDX), retrieve the kind of pool that is referenced by this parameter index value.

Returns
  • one of the INDEX_xxx constant defined in this class, or 0 if the instruction does not have a first index parameter

public abstract int getParameterIndexType ()

This method is deprecated.
No replacement.

public abstract int getParameterSecondIndexType ()

If this instruction has a second index parameter (of type TYPE_IDX2), retrieve the kind of pool that is referenced by this parameter index value.

Returns
  • one of the INDEX_xxx constant defined in this class, or 0 if the instruction does not have a second index parameter

public abstract int getParameterType (int index)

Get the type of a parameter. Refer to TYPE_xxx constants.

public abstract long getParameterValue (int index)

Get the value of a parameter.

public abstract IDalvikInstructionParameter[] getParameters ()

Get the instruction operands typed as proper Dalvik parameters.

This method is a convenience method, that does the same thing as getOperands() but returns Dalvik-typed parameters instead of generic IInstructionOperand-typed object.

public abstract IDalvikInstructionSwitchData getSwitchData ()

Get the instruction switch data.

Returns
  • the switch payload object, or null if the instruction is neither packed-switch nor sparse-switch

public abstract boolean isArray ()

Determine if the instruction is an array initializer.

public abstract boolean isOptimized ()

Provide a hint if the instruction looks like an optimized (non-standard) instruction, such as an odex or Art.

public abstract boolean isPseudoInstruction ()

Determine if this instruction is a so-called pseudo instruction, that is, a switch or an array-initialization instruction.

public abstract boolean isSwitch ()

Determine if the instruction is a switch.