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::DVMBasicBlock Class Reference

Class that contain the instructions of basic block different DVMBasicBlock exists. More...

#include <analysis.hpp>

Public Member Functions

size_t get_nb_instructions () const
 Obtain the number of instructions from the instructions vector.
 
void add_instruction (Instruction *instr)
 Add an instruction to the basic block.
 
const std::vector< Instruction * > & get_instructions () const
 Get a constant reference to the vector of instructions.
 
std::vector< Instruction * > & get_instructions ()
 Get a reference to the vector of instructions.
 
Instructionget_terminator ()
 Return the last instruction in case this is a terminator instruction.
 
std::uint64_t get_first_address ()
 Get the first address of the basic block in case there are instructions.
 
std::uint64_t get_last_address ()
 Get the last address of the basic block in case there are instructions.
 
std::string & get_name ()
 
bool is_try_block () const
 Is the current block a try-block?
 
void set_try_block (bool try_block)
 Set the block is a try block.
 
bool is_catch_block () const
 Is the current block a catch-block?
 
void set_catch_block (bool catch_block)
 Set the block is a catch block.
 
DVMTypeget_handler_type ()
 Get the type of handler in case is a catch block.
 
void set_handler_type (DVMType *handler)
 Set a handler type.
 
bool is_start_block () const
 Get if current block is a starting block.
 
void set_start_block (bool start_block)
 Set the block as a start block.
 
bool is_end_block () const
 Get if current block is an end block.
 
void set_end_block (bool end_block)
 Set the block as an end block.
 

Detailed Description

Class that contain the instructions of basic block different DVMBasicBlock exists.

Member Function Documentation

◆ add_instruction()

void KUNAI::DEX::DVMBasicBlock::add_instruction ( Instruction instr)
inline

Add an instruction to the basic block.

Parameters
instrnew instructions from the basic block

◆ get_first_address()

std::uint64_t KUNAI::DEX::DVMBasicBlock::get_first_address ( )
inline

Get the first address of the basic block in case there are instructions.

Returns
first address of basic block

◆ get_handler_type()

DVMType * KUNAI::DEX::DVMBasicBlock::get_handler_type ( )
inline

Get the type of handler in case is a catch block.

Returns
handler type

◆ get_instructions() [1/2]

std::vector< Instruction * > & KUNAI::DEX::DVMBasicBlock::get_instructions ( )
inline

Get a reference to the vector of instructions.

Returns
instructions from the block

◆ get_instructions() [2/2]

const std::vector< Instruction * > & KUNAI::DEX::DVMBasicBlock::get_instructions ( ) const
inline

Get a constant reference to the vector of instructions.

Returns
instructions from the block

◆ get_last_address()

std::uint64_t KUNAI::DEX::DVMBasicBlock::get_last_address ( )
inline

Get the last address of the basic block in case there are instructions.

Returns
last address of basic block

◆ get_nb_instructions()

size_t KUNAI::DEX::DVMBasicBlock::get_nb_instructions ( ) const
inline

Obtain the number of instructions from the instructions vector.

Returns
number of instructions of DVMBasicBlock

◆ get_terminator()

Instruction * KUNAI::DEX::DVMBasicBlock::get_terminator ( )
inline

Return the last instruction in case this is a terminator instruction.

Returns
terminator instruction

◆ is_catch_block()

bool KUNAI::DEX::DVMBasicBlock::is_catch_block ( ) const
inline

Is the current block a catch-block?

Returns
true in case this is a catch block

◆ is_end_block()

bool KUNAI::DEX::DVMBasicBlock::is_end_block ( ) const
inline

Get if current block is an end block.

Returns
true in case this is an end block

◆ is_start_block()

bool KUNAI::DEX::DVMBasicBlock::is_start_block ( ) const
inline

Get if current block is a starting block.

Returns
true in case this is a starting block

◆ is_try_block()

bool KUNAI::DEX::DVMBasicBlock::is_try_block ( ) const
inline

Is the current block a try-block?

Returns
true in case this is a try block

◆ set_catch_block()

void KUNAI::DEX::DVMBasicBlock::set_catch_block ( bool  catch_block)
inline

Set the block is a catch block.

Parameters
catch_blocknew value

◆ set_end_block()

void KUNAI::DEX::DVMBasicBlock::set_end_block ( bool  end_block)
inline

Set the block as an end block.

Parameters
end_blocknew value

◆ set_handler_type()

void KUNAI::DEX::DVMBasicBlock::set_handler_type ( DVMType handler)
inline

Set a handler type.

Parameters
handlerhandler type

◆ set_start_block()

void KUNAI::DEX::DVMBasicBlock::set_start_block ( bool  start_block)
inline

Set the block as a start block.

Parameters
start_blocknew value

◆ set_try_block()

void KUNAI::DEX::DVMBasicBlock::set_try_block ( bool  try_block)
inline

Set the block is a try block.

Parameters
try_blocknew value

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