LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
instructions.hpp File Reference
#include "LIEF/visibility.h"
#include "LIEF/types.hpp"
#include <cstddef>
Include dependency graph for instructions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LIEF::DEX::packed_switch
 
struct  LIEF::DEX::sparse_switch
 
struct  LIEF::DEX::fill_array_data
 

Namespaces

namespace  LIEF
 LIEF namespace.
 
namespace  LIEF::DEX
 

Enumerations

enum  LIEF::DEX::SWITCH_ARRAY_IDENT : uint16_t { LIEF::DEX::IDENT_PACKED_SWITCH = 0x0100 , LIEF::DEX::IDENT_SPARSE_SWITCH = 0x0200 , LIEF::DEX::IDENT_FILL_ARRAY = 0x0300 }
 
enum  LIEF::DEX::OPCODES : uint8_t {
  LIEF::DEX::OP_NOP = 0x00 , LIEF::DEX::OP_MOVE = 0x01 , LIEF::DEX::OP_MOVE_FROM_16 = 0x02 , LIEF::DEX::OP_MOVE_16 = 0x03 ,
  LIEF::DEX::OP_MOVE_WIDE = 0x04 , LIEF::DEX::OP_MOVE_WIDE_FROM_16 = 0x05 , LIEF::DEX::OP_MOVE_WIDE_16 = 0x06 , LIEF::DEX::OP_MOVE_OBJECT = 0x07 ,
  LIEF::DEX::OP_MOVE_OBJECT_FROM_16 = 0x08 , LIEF::DEX::OP_MOVE_OBJECT_16 = 0x09 , LIEF::DEX::OP_MOVE_RESULT = 0x0a , LIEF::DEX::OP_MOVE_RESULT_WIDE = 0x0b ,
  LIEF::DEX::OP_MOVE_RESULT_OBJECT = 0x0c , LIEF::DEX::OP_MOVE_EXCEPTION = 0x0d , LIEF::DEX::OP_RETURN_VOID = 0x0e , LIEF::DEX::OP_RETURN = 0x0f ,
  LIEF::DEX::OP_RETURN_WIDE = 0x10 , LIEF::DEX::OP_RETURN_OBJECT = 0x11 , LIEF::DEX::OP_CONST_4 = 0x12 , LIEF::DEX::OP_CONST_16 = 0x13 ,
  LIEF::DEX::OP_CONST = 0x14 , LIEF::DEX::OP_CONST_HIGH_16 = 0x15 , LIEF::DEX::OP_CONST_WIDE_16 = 0x16 , LIEF::DEX::OP_CONST_WIDE_32 = 0x17 ,
  LIEF::DEX::OP_CONST_WIDE = 0x18 , LIEF::DEX::OP_CONST_WIDE_HIGH_16 = 0x19 , LIEF::DEX::OP_CONST_STRING = 0x1a , LIEF::DEX::OP_CONST_STRING_JUMBO = 0x1b ,
  LIEF::DEX::OP_CONST_CLASS = 0x1c , LIEF::DEX::OP_MONITOR_ENTER = 0x1d , LIEF::DEX::OP_MONITOR_EXIT = 0x1e , LIEF::DEX::OP_CHECK_CAST = 0x1f ,
  LIEF::DEX::OP_INSTANCE_OF = 0x20 , LIEF::DEX::OP_ARRAY_LENGTH = 0x21 , LIEF::DEX::OP_NEW_INSTANCE = 0x22 , LIEF::DEX::OP_NEW_ARRAY = 0x23 ,
  LIEF::DEX::OP_FILLED_NEW_ARRAY = 0x24 , LIEF::DEX::OP_FILLED_NEW_ARRAY_RANGE = 0x25 , LIEF::DEX::OP_FILL_ARRAY_DATA = 0x26 , LIEF::DEX::OP_THROW = 0x27 ,
  LIEF::DEX::OP_GOTO = 0x28 , LIEF::DEX::OP_GOTO_16 = 0x29 , LIEF::DEX::OP_GOTO_32 = 0x2a , LIEF::DEX::OP_PACKED_SWITCH = 0x2b ,
  LIEF::DEX::OP_SPARSE_SWITCH = 0x2c , LIEF::DEX::OP_CMPL_FLOAT = 0x2d , LIEF::DEX::OP_CMPG_FLOAT = 0x2e , LIEF::DEX::OP_CMPL_DOUBLE = 0x2f ,
  LIEF::DEX::OP_CMPG_DOUBLE = 0x30 , LIEF::DEX::OP_CMP_LONG = 0x31 , LIEF::DEX::OP_IF_EQ = 0x32 , LIEF::DEX::OP_IF_NE = 0x33 ,
  LIEF::DEX::OP_IF_LT = 0x34 , LIEF::DEX::OP_IF_GE = 0x35 , LIEF::DEX::OP_IF_GT = 0x36 , LIEF::DEX::OP_IF_LE = 0x37 ,
  LIEF::DEX::OP_IF_EQZ = 0x38 , LIEF::DEX::OP_IF_NEZ = 0x39 , LIEF::DEX::OP_IF_LTZ = 0x3a , LIEF::DEX::OP_IF_GEZ = 0x3b ,
  LIEF::DEX::OP_IF_GTZ = 0x3c , LIEF::DEX::OP_IF_LEZ = 0x3d , LIEF::DEX::OP_AGET = 0x44 , LIEF::DEX::OP_AGET_WIDE = 0x45 ,
  LIEF::DEX::OP_AGET_OBJECT = 0x46 , LIEF::DEX::OP_AGET_BOOLEAN = 0x47 , LIEF::DEX::OP_AGET_BYTE = 0x48 , LIEF::DEX::OP_AGET_CHAR = 0x49 ,
  LIEF::DEX::OP_AGET_SHORT = 0x4a , LIEF::DEX::OP_APUT = 0x4b , LIEF::DEX::OP_APUT_WIDE = 0x4c , LIEF::DEX::OP_APUT_OBJECT = 0x4d ,
  LIEF::DEX::OP_APUT_BOOLEAN = 0x4e , LIEF::DEX::OP_APUT_BYTE = 0x4f , LIEF::DEX::OP_APUT_CHAR = 0x50 , LIEF::DEX::OP_APUT_SHORT = 0x51 ,
  LIEF::DEX::OP_IGET = 0x52 , LIEF::DEX::OP_IGET_WIDE = 0x53 , LIEF::DEX::OP_IGET_OBJECT = 0x54 , LIEF::DEX::OP_IGET_BOOLEAN = 0x55 ,
  LIEF::DEX::OP_IGET_BYTE = 0x56 , LIEF::DEX::OP_IGET_CHAR = 0x57 , LIEF::DEX::OP_IGET_SHORT = 0x58 , LIEF::DEX::OP_IPUT = 0x59 ,
  LIEF::DEX::OP_IPUT_WIDE = 0x5a , LIEF::DEX::OP_IPUT_OBJECT = 0x5b , LIEF::DEX::OP_IPUT_BOOLEAN = 0x5c , LIEF::DEX::OP_IPUT_BYTE = 0x5d ,
  LIEF::DEX::OP_IPUT_CHAR = 0x5e , LIEF::DEX::OP_IPUT_SHORT = 0x5f , LIEF::DEX::OP_SGET = 0x60 , LIEF::DEX::OP_SGET_WIDE = 0x61 ,
  LIEF::DEX::OP_SGET_OBJECT = 0x62 , LIEF::DEX::OP_SGET_BOOLEAN = 0x63 , LIEF::DEX::OP_SGET_BYTE = 0x64 , LIEF::DEX::OP_SGET_CHAR = 0x65 ,
  LIEF::DEX::OP_SGET_SHORT = 0x66 , LIEF::DEX::OP_SPUT = 0x67 , LIEF::DEX::OP_SPUT_WIDE = 0x68 , LIEF::DEX::OP_SPUT_OBJECT = 0x69 ,
  LIEF::DEX::OP_SPUT_BOOLEAN = 0x6a , LIEF::DEX::OP_SPUT_BYTE = 0x6b , LIEF::DEX::OP_SPUT_CHAR = 0x6c , LIEF::DEX::OP_SPUT_SHORT = 0x6d ,
  LIEF::DEX::OP_INVOKE_VIRTUAL = 0x6e , LIEF::DEX::OP_INVOKE_SUPER = 0x6f , LIEF::DEX::OP_INVOKE_DIRECT = 0x70 , LIEF::DEX::OP_INVOKE_STATIC = 0x71 ,
  LIEF::DEX::OP_INVOKE_INTERFACE = 0x72 , LIEF::DEX::OP_RETURN_VOID_NO_BARRIER = 0x73 , LIEF::DEX::OP_INVOKE_VIRTUAL_RANGE = 0x74 , LIEF::DEX::OP_INVOKE_SUPER_RANGE = 0x75 ,
  LIEF::DEX::OP_INVOKE_DIRECT_RANGE = 0x76 , LIEF::DEX::OP_INVOKE_STATIC_RANGE = 0x77 , LIEF::DEX::OP_INVOKE_INTERFACE_RANGE = 0x78 , LIEF::DEX::OP_NEG_INT = 0x7b ,
  LIEF::DEX::OP_NOT_INT = 0x7c , LIEF::DEX::OP_NEG_LONG = 0x7d , LIEF::DEX::OP_NOT_LONG = 0x7e , LIEF::DEX::OP_NEG_FLOAT = 0x7f ,
  LIEF::DEX::OP_NEG_DOUBLE = 0x80 , LIEF::DEX::OP_INT_TO_LONG = 0x81 , LIEF::DEX::OP_INT_TO_FLOAT = 0x82 , LIEF::DEX::OP_INT_TO_DOUBLE = 0x83 ,
  LIEF::DEX::OP_LONG_TO_INT = 0x84 , LIEF::DEX::OP_LONG_TO_FLOAT = 0x85 , LIEF::DEX::OP_LONG_TO_DOUBLE = 0x86 , LIEF::DEX::OP_FLOAT_TO_INT = 0x87 ,
  LIEF::DEX::OP_FLOAT_TO_LONG = 0x88 , LIEF::DEX::OP_FLOAT_TO_DOUBLE = 0x89 , LIEF::DEX::OP_DOUBLE_TO_INT = 0x8a , LIEF::DEX::OP_DOUBLE_TO_LONG = 0x8b ,
  LIEF::DEX::OP_DOUBLE_TO_FLOAT = 0x8c , LIEF::DEX::OP_INT_TO_BYTE = 0x8d , LIEF::DEX::OP_INT_TO_CHAR = 0x8e , LIEF::DEX::OP_INT_TO_SHORT = 0x8f ,
  LIEF::DEX::OP_ADD_INT = 0x90 , LIEF::DEX::OP_SUB_INT = 0x91 , LIEF::DEX::OP_MUL_INT = 0x92 , LIEF::DEX::OP_DIV_INT = 0x93 ,
  LIEF::DEX::OP_REM_INT = 0x94 , LIEF::DEX::OP_AND_INT = 0x95 , LIEF::DEX::OP_OR_INT = 0x96 , LIEF::DEX::OP_XOR_INT = 0x97 ,
  LIEF::DEX::OP_SHL_INT = 0x98 , LIEF::DEX::OP_SHR_INT = 0x99 , LIEF::DEX::OP_USHR_INT = 0x9a , LIEF::DEX::OP_ADD_LONG = 0x9b ,
  LIEF::DEX::OP_SUB_LONG = 0x9c , LIEF::DEX::OP_MUL_LONG = 0x9d , LIEF::DEX::OP_DIV_LONG = 0x9e , LIEF::DEX::OP_REM_LONG = 0x9f ,
  LIEF::DEX::OP_AND_LONG = 0xa0 , LIEF::DEX::OP_OR_LONG = 0xa1 , LIEF::DEX::OP_XOR_LONG = 0xa2 , LIEF::DEX::OP_SHL_LONG = 0xa3 ,
  LIEF::DEX::OP_SHR_LONG = 0xa4 , LIEF::DEX::OP_USHR_LONG = 0xa5 , LIEF::DEX::OP_ADD_FLOAT = 0xa6 , LIEF::DEX::OP_SUB_FLOAT = 0xa7 ,
  LIEF::DEX::OP_MUL_FLOAT = 0xa8 , LIEF::DEX::OP_DIV_FLOAT = 0xa9 , LIEF::DEX::OP_REM_FLOAT = 0xaa , LIEF::DEX::OP_ADD_DOUBLE = 0xab ,
  LIEF::DEX::OP_SUB_DOUBLE = 0xac , LIEF::DEX::OP_MUL_DOUBLE = 0xad , LIEF::DEX::OP_DIV_DOUBLE = 0xae , LIEF::DEX::OP_REM_DOUBLE = 0xaf ,
  LIEF::DEX::OP_ADD_INT_2_ADDR = 0xb0 , LIEF::DEX::OP_SUB_INT_2_ADDR = 0xb1 , LIEF::DEX::OP_MUL_INT_2_ADDR = 0xb2 , LIEF::DEX::OP_DIV_INT_2_ADDR = 0xb3 ,
  LIEF::DEX::OP_REM_INT_2_ADDR = 0xb4 , LIEF::DEX::OP_AND_INT_2_ADDR = 0xb5 , LIEF::DEX::OP_OR_INT_2_ADDR = 0xb6 , LIEF::DEX::OP_XOR_INT_2_ADDR = 0xb7 ,
  LIEF::DEX::OP_SHL_INT_2_ADDR = 0xb8 , LIEF::DEX::OP_SHR_INT_2_ADDR = 0xb9 , LIEF::DEX::OP_USHR_INT_2_ADDR = 0xba , LIEF::DEX::OP_ADD_LONG_2_ADDR = 0xbb ,
  LIEF::DEX::OP_SUB_LONG_2_ADDR = 0xbc , LIEF::DEX::OP_MUL_LONG_2_ADDR = 0xbd , LIEF::DEX::OP_DIV_LONG_2_ADDR = 0xbe , LIEF::DEX::OP_REM_LONG_2_ADDR = 0xbf ,
  LIEF::DEX::OP_AND_LONG_2_ADDR = 0xc0 , LIEF::DEX::OP_OR_LONG_2_ADDR = 0xc1 , LIEF::DEX::OP_XOR_LONG_2_ADDR = 0xc2 , LIEF::DEX::OP_SHL_LONG_2_ADDR = 0xc3 ,
  LIEF::DEX::OP_SHR_LONG_2_ADDR = 0xc4 , LIEF::DEX::OP_USHR_LONG_2_ADDR = 0xc5 , LIEF::DEX::OP_ADD_FLOAT_2_ADDR = 0xc6 , LIEF::DEX::OP_SUB_FLOAT_2_ADDR = 0xc7 ,
  LIEF::DEX::OP_MUL_FLOAT_2_ADDR = 0xc8 , LIEF::DEX::OP_DIV_FLOAT_2_ADDR = 0xc9 , LIEF::DEX::OP_REM_FLOAT_2_ADDR = 0xca , LIEF::DEX::OP_ADD_DOUBLE_2_ADDR = 0xcb ,
  LIEF::DEX::OP_SUB_DOUBLE_2_ADDR = 0xcc , LIEF::DEX::OP_MUL_DOUBLE_2_ADDR = 0xcd , LIEF::DEX::OP_DIV_DOUBLE_2_ADDR = 0xce , LIEF::DEX::OP_REM_DOUBLE_2_ADDR = 0xcf ,
  LIEF::DEX::OP_ADD_INT_LIT_16 = 0xd0 , LIEF::DEX::OP_RSUB_INT = 0xd1 , LIEF::DEX::OP_MUL_INT_LIT_16 = 0xd2 , LIEF::DEX::OP_DIV_INT_LIT_16 = 0xd3 ,
  LIEF::DEX::OP_REM_INT_LIT_16 = 0xd4 , LIEF::DEX::OP_AND_INT_LIT_16 = 0xd5 , LIEF::DEX::OP_OR_INT_LIT_16 = 0xd6 , LIEF::DEX::OP_XOR_INT_LIT_16 = 0xd7 ,
  LIEF::DEX::OP_ADD_INT_LIT_8 = 0xd8 , LIEF::DEX::OP_RSUB_INT_LIT_8 = 0xd9 , LIEF::DEX::OP_MUL_INT_LIT_8 = 0xda , LIEF::DEX::OP_DIV_INT_LIT_8 = 0xdb ,
  LIEF::DEX::OP_REM_INT_LIT_8 = 0xdc , LIEF::DEX::OP_AND_INT_LIT_8 = 0xdd , LIEF::DEX::OP_OR_INT_LIT_8 = 0xde , LIEF::DEX::OP_XOR_INT_LIT_8 = 0xdf ,
  LIEF::DEX::OP_SHL_INT_LIT_8 = 0xe0 , LIEF::DEX::OP_SHR_INT_LIT_8 = 0xe1 , LIEF::DEX::OP_USHR_INT_LIT_8 = 0xe2 , LIEF::DEX::OP_IGET_QUICK = 0xe3 ,
  LIEF::DEX::OP_IGET_WIDE_QUICK = 0xe4 , LIEF::DEX::OP_IGET_OBJECT_QUICK = 0xe5 , LIEF::DEX::OP_IPUT_QUICK = 0xe6 , LIEF::DEX::OP_IPUT_WIDE_QUICK = 0xe7 ,
  LIEF::DEX::OP_IPUT_OBJECT_QUICK = 0xe8 , LIEF::DEX::OP_INVOKE_VIRTUAL_QUICK = 0xe9 , LIEF::DEX::OP_INVOKE_VIRTUAL_RANGE_QUICK = 0xea , LIEF::DEX::OP_IPUT_BOOLEAN_QUICK = 0xeb ,
  LIEF::DEX::OP_IPUT_BYTE_QUICK = 0xec , LIEF::DEX::OP_IPUT_CHAR_QUICK = 0xed , LIEF::DEX::OP_IPUT_SHORT_QUICK = 0xee , LIEF::DEX::OP_IGET_BOOLEAN_QUICK = 0xef ,
  LIEF::DEX::OP_IGET_BYTE_QUICK = 0xf0 , LIEF::DEX::OP_IGET_CHAR_QUICK = 0xf1 , LIEF::DEX::OP_IGET_SHORT_QUICK = 0xf2 , LIEF::DEX::OP_INVOKE_POLYMORPHIC = 0xfa ,
  LIEF::DEX::OP_INVOKE_POLYMORPHIC_RANGE = 0xfb , LIEF::DEX::OP_INVOKE_CUSTOM = 0xfc , LIEF::DEX::OP_INVOKE_CUSTOM_RANGE = 0xfd , LIEF::DEX::OP_CONST_METHOD_HANDLE = 0xfe ,
  LIEF::DEX::OP_CONST_METHOD_TYPE = 0xff
}
 The Dalvik Opcodes. More...
 
enum  LIEF::DEX::INST_FORMATS : uint8_t {
  LIEF::DEX::F_00x = 0 , LIEF::DEX::F_10x , LIEF::DEX::F_12x , LIEF::DEX::F_11n ,
  LIEF::DEX::F_11x , LIEF::DEX::F_10t , LIEF::DEX::F_20t , LIEF::DEX::F_20bc ,
  LIEF::DEX::F_22x , LIEF::DEX::F_21t , LIEF::DEX::F_21s , LIEF::DEX::F_21h ,
  LIEF::DEX::F_21c , LIEF::DEX::F_23x , LIEF::DEX::F_22b , LIEF::DEX::F_22t ,
  LIEF::DEX::F_22s , LIEF::DEX::F_22c , LIEF::DEX::F_22cs , LIEF::DEX::F_30t ,
  LIEF::DEX::F_32x , LIEF::DEX::F_31i , LIEF::DEX::F_31t , LIEF::DEX::F_31c ,
  LIEF::DEX::F_35c , LIEF::DEX::F_35ms , LIEF::DEX::F_35mi , LIEF::DEX::F_3rc ,
  LIEF::DEX::F_3rms , LIEF::DEX::F_3rmi , LIEF::DEX::F_51l , LIEF::DEX::F_45cc ,
  LIEF::DEX::F_4rcc
}
 

Functions

INST_FORMATS LIEF::DEX::inst_format_from_opcode (OPCODES op)
 Return the INST_FORMATS format associated with the given opcode.
 
size_t LIEF::DEX::inst_size_from_format (INST_FORMATS fmt)
 
size_t LIEF::DEX::inst_size_from_opcode (OPCODES op)
 
bool LIEF::DEX::is_switch_array (const uint8_t *ptr, const uint8_t *end)
 
size_t LIEF::DEX::switch_array_size (const uint8_t *ptr, const uint8_t *end)