KUNAI Static Analyzer
Kunai is a library for doing static binary analysis of Dalvik.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KUNAI::DEX::Instruction22c Class Reference

Store in the given destination 1 if the register provided contains an instance of the given type/field, 0 in other case. Example: instance-of vA, vB, type@CCCC Semantic: vA = type(vB) == type@CCCC ? 1 : 0. More...

#include <dalvik_instructions.hpp>

Inheritance diagram for KUNAI::DEX::Instruction22c:
Inheritance graph
[legend]
Collaboration diagram for KUNAI::DEX::Instruction22c:
Collaboration graph
[legend]

Public Member Functions

 Instruction22c (std::vector< uint8_t > &bytecode, std::size_t index, Parser *parser)
 
std::uint8_t get_destination () const
 Get the destination operand for the instruction.
 
TYPES::Operand get_destination_type () const
 Get the destination operand type.
 
std::uint8_t get_operand () const
 Get the operand checked in the instruction.
 
TYPES::Operand get_operand_type () const
 Get the type of the operand of the instruction.
 
std::uint16_t get_checked_id () const
 Get the ID of the checked Type/Field.
 
TYPES::Operand get_checked_id_type () const
 Get the type of the checked ID.
 
const std::string & get_checked_value_str () const
 Get a pretty-printed version of the checked value.
 
DVMTypeget_checked_dvmtype () const
 Check if checked value is a DVMType and get a pointer.
 
FieldIDget_checked_field ()
 Check if checked value is a FieldID and get a pointer.
 
virtual std::string print_instruction ()
 Return a string with the representation of the instruction.
 
virtual void print_instruction (std::ostream &os)
 Print the instruction on a given stream.
 
- Public Member Functions inherited from KUNAI::DEX::Instruction
 Instruction (std::vector< uint8_t > &bytecode, std::size_t index, dexinsttype_t instruction_type)
 Constructor of the Instruction, here is applied the parsing of the opcodes.
 
 Instruction (std::vector< uint8_t > &bytecode, std::size_t index, dexinsttype_t instruction_type, std::uint32_t length)
 
virtual ~Instruction ()=default
 Destructor of the instruction.
 
virtual TYPES::Kind get_kind () const
 Get the kind of instruction, use a DalvikOpcodes function.
 
virtual dexinsttype_t get_instruction_type () const
 Get the instruction type from the enum.
 
virtual std::uint32_t get_instruction_length () const
 Get the length of the instruction.
 
virtual std::uint32_t get_instruction_opcode () const
 Get the opcode of the instruction.
 
virtual void set_address (std::uint64_t address)
 Set the address of the instruction.
 
virtual std::uint64_t get_address () const
 Get the address of the instruction.
 
virtual const std::span< std::uint8_t > & get_opcodes ()
 Return the op codes in raw from the instruction.
 
virtual bool is_terminator ()
 Check if the instruction is a terminator (branch, ret, multibranch)
 
virtual bool has_side_effects () const
 Instruction has or can have some side effect.
 
virtual bool may_throw () const
 May throw an exception.
 

Additional Inherited Members

- Protected Attributes inherited from KUNAI::DEX::Instruction
std::span< std::uint8_t > op_codes
 Opcodes of the instruction.
 
std::uint32_t length
 Length of the instruction.
 
std::uint32_t op
 op code from the instruction
 
std::uint64_t address
 address of the instruction
 

Detailed Description

Store in the given destination 1 if the register provided contains an instance of the given type/field, 0 in other case. Example: instance-of vA, vB, type@CCCC Semantic: vA = type(vB) == type@CCCC ? 1 : 0.

Member Function Documentation

◆ get_checked_dvmtype()

DVMType * KUNAI::DEX::Instruction22c::get_checked_dvmtype ( ) const
inline

Check if checked value is a DVMType and get a pointer.

Returns
pointer to DVMType or nullptr

◆ get_checked_field()

FieldID * KUNAI::DEX::Instruction22c::get_checked_field ( )
inline

Check if checked value is a FieldID and get a pointer.

Returns
pointer to FieldID or nullptr

◆ get_checked_id()

std::uint16_t KUNAI::DEX::Instruction22c::get_checked_id ( ) const
inline

Get the ID of the checked Type/Field.

Returns
ID of checked Type/Field

◆ get_checked_id_type()

TYPES::Operand KUNAI::DEX::Instruction22c::get_checked_id_type ( ) const
inline

Get the type of the checked ID.

Returns
return KIND type

◆ get_checked_value_str()

const std::string & KUNAI::DEX::Instruction22c::get_checked_value_str ( ) const
inline

Get a pretty-printed version of the checked value.

Returns
string version of checked type/field

◆ get_destination()

std::uint8_t KUNAI::DEX::Instruction22c::get_destination ( ) const
inline

Get the destination operand for the instruction.

Returns
index of the register for the destination

◆ get_destination_type()

TYPES::Operand KUNAI::DEX::Instruction22c::get_destination_type ( ) const
inline

Get the destination operand type.

Returns
return REGISTER type

◆ get_operand()

std::uint8_t KUNAI::DEX::Instruction22c::get_operand ( ) const
inline

Get the operand checked in the instruction.

Returns
index of the register checked

◆ get_operand_type()

TYPES::Operand KUNAI::DEX::Instruction22c::get_operand_type ( ) const
inline

Get the type of the operand of the instruction.

Returns
return REGISTER type

◆ print_instruction() [1/2]

virtual std::string KUNAI::DEX::Instruction22c::print_instruction ( )
inlinevirtual

Return a string with the representation of the instruction.

Returns
string with instruction

Reimplemented from KUNAI::DEX::Instruction.

◆ print_instruction() [2/2]

virtual void KUNAI::DEX::Instruction22c::print_instruction ( std::ostream &  os)
inlinevirtual

Print the instruction on a given stream.

Parameters
osstream where to print the instruction

Reimplemented from KUNAI::DEX::Instruction.


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