dex++ 0.3.1
C++ and C API reference
Loading...
Searching...
No Matches
DexppInstruction Struct Reference

One decoded instruction. More...

#include <dexpp.h>

Public Attributes

DexppInstructionKind kind
 The instruction family.
 
uint32_t offset
 Position in the method's code.
 
uint8_t opcode
 The raw opcode byte.
 
uint8_t size
 Length in code units (1 to 5).
 
int32_t branch_offset
 Relative to the instruction's own offset.
 
int32_t payload_offset
 Where the switch or array table is.
 
uint8_t reg
 The single register operand.
 
int has_reg
 RETURN: 0 for return-void.
 
uint8_t reg_a
 IF: first register compared.
 
uint8_t reg_b
 IF: second register compared.
 
uint16_t dest
 The register written.
 
uint16_t src
 The register read.
 
int has_src
 MOVE: 0 for move-result and move-exception.
 
uint8_t src_a
 COMPARE, BINARY_OP: first operand.
 
uint8_t src_b
 COMPARE, BINARY_OP: second operand.
 
int64_t value
 CONST: the constant (bit pattern for floats).
 
int32_t literal
 BINARY_LIT: the constant operand.
 
uint32_t string_index
 CONST_STRING.
 
uint32_t type_index
 CONST_CLASS, TYPE, FILLED_NEW_ARRAY.
 
uint32_t method_handle_index
 CONST_METHOD_HANDLE: index in the method handle table.
 
uint32_t proto_index
 CONST_METHOD_TYPE, INVOKE_POLYMORPHIC: prototype index.
 
uint32_t field_index
 FIELD.
 
uint32_t method_index
 INVOKE, INVOKE_POLYMORPHIC.
 
uint32_t call_site_index
 INVOKE_CUSTOM.
 
uint8_t value_reg
 ARRAY_OP, FIELD: the value's register.
 
uint8_t array_reg
 ARRAY_OP, ARRAY_LENGTH.
 
uint8_t index_reg
 ARRAY_OP.
 
uint8_t object_reg
 FIELD: the object's register.
 
int has_object_reg
 FIELD: 0 for a static field.
 
int is_packed
 SWITCH: 1 for packed-switch.
 
int is_enter
 MONITOR: 1 for monitor-enter.
 
int is_write
 ARRAY_OP, FIELD: 1 for a write.
 
int is_static
 FIELD: 1 for a static field.
 
DexppOperandWidth width
 RETURN, MOVE, CONST, ARRAY_OP, FIELD, BINARY_OP.
 
DexppOperandWidth src_width
 COMPARE, UNARY_OP.
 
DexppOperandWidth dest_width
 UNARY_OP.
 
DexppSwitchCase * cases
 SWITCH: the decoded case table.
 
size_t case_count
 SWITCH: number of cases.
 
uint16_t * arg_regs
 FILLED_NEW_ARRAY, INVOKE, INVOKE_POLYMORPHIC, INVOKE_CUSTOM.
 
size_t arg_count
 Number of argument registers.
 

Detailed Description

One decoded instruction.

offset, opcode and size are set for every kind; the other members only for the kinds DexppInstructionKind lists for them, and are 0 or NULL otherwise. Offsets are in 16-bit code units. Pool indices (string_index, type_index, ...) are raw indices into the DEX file's tables; dexpp_method_calls() and the other reference functions give resolved names.

Member Data Documentation

◆ kind

DexppInstructionKind DexppInstruction::kind

The instruction family.

◆ offset

uint32_t DexppInstruction::offset

Position in the method's code.

◆ opcode

uint8_t DexppInstruction::opcode

The raw opcode byte.

◆ size

uint8_t DexppInstruction::size

Length in code units (1 to 5).

◆ branch_offset

int32_t DexppInstruction::branch_offset

Relative to the instruction's own offset.

◆ payload_offset

int32_t DexppInstruction::payload_offset

Where the switch or array table is.

◆ reg

uint8_t DexppInstruction::reg

The single register operand.

◆ has_reg

int DexppInstruction::has_reg

RETURN: 0 for return-void.

◆ reg_a

uint8_t DexppInstruction::reg_a

IF: first register compared.

◆ reg_b

uint8_t DexppInstruction::reg_b

IF: second register compared.

◆ dest

uint16_t DexppInstruction::dest

The register written.

◆ src

uint16_t DexppInstruction::src

The register read.

◆ has_src

int DexppInstruction::has_src

MOVE: 0 for move-result and move-exception.

TYPE: 0 for check-cast and new-instance.

◆ src_a

uint8_t DexppInstruction::src_a

COMPARE, BINARY_OP: first operand.

◆ src_b

uint8_t DexppInstruction::src_b

COMPARE, BINARY_OP: second operand.

◆ value

int64_t DexppInstruction::value

CONST: the constant (bit pattern for floats).

◆ literal

int32_t DexppInstruction::literal

BINARY_LIT: the constant operand.

◆ string_index

uint32_t DexppInstruction::string_index

CONST_STRING.

◆ type_index

uint32_t DexppInstruction::type_index

CONST_CLASS, TYPE, FILLED_NEW_ARRAY.

◆ method_handle_index

uint32_t DexppInstruction::method_handle_index

CONST_METHOD_HANDLE: index in the method handle table.

◆ proto_index

uint32_t DexppInstruction::proto_index

CONST_METHOD_TYPE, INVOKE_POLYMORPHIC: prototype index.

◆ field_index

uint32_t DexppInstruction::field_index

FIELD.

◆ method_index

uint32_t DexppInstruction::method_index

INVOKE, INVOKE_POLYMORPHIC.

◆ call_site_index

uint32_t DexppInstruction::call_site_index

INVOKE_CUSTOM.

◆ value_reg

uint8_t DexppInstruction::value_reg

ARRAY_OP, FIELD: the value's register.

◆ array_reg

uint8_t DexppInstruction::array_reg

ARRAY_OP, ARRAY_LENGTH.

◆ index_reg

uint8_t DexppInstruction::index_reg

ARRAY_OP.

◆ object_reg

uint8_t DexppInstruction::object_reg

FIELD: the object's register.

◆ has_object_reg

int DexppInstruction::has_object_reg

FIELD: 0 for a static field.

◆ is_packed

int DexppInstruction::is_packed

SWITCH: 1 for packed-switch.

◆ is_enter

int DexppInstruction::is_enter

MONITOR: 1 for monitor-enter.

◆ is_write

int DexppInstruction::is_write

ARRAY_OP, FIELD: 1 for a write.

◆ is_static

int DexppInstruction::is_static

FIELD: 1 for a static field.

◆ width

DexppOperandWidth DexppInstruction::width

RETURN, MOVE, CONST, ARRAY_OP, FIELD, BINARY_OP.

◆ src_width

DexppOperandWidth DexppInstruction::src_width

COMPARE, UNARY_OP.

◆ dest_width

DexppOperandWidth DexppInstruction::dest_width

UNARY_OP.

◆ cases

DexppSwitchCase* DexppInstruction::cases

SWITCH: the decoded case table.

◆ case_count

size_t DexppInstruction::case_count

SWITCH: number of cases.

◆ arg_regs

uint16_t* DexppInstruction::arg_regs

FILLED_NEW_ARRAY, INVOKE, INVOKE_POLYMORPHIC, INVOKE_CUSTOM.

◆ arg_count

size_t DexppInstruction::arg_count

Number of argument registers.


The documentation for this struct was generated from the following file: