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

Save the information of the code from a Method. More...

#include <encoded.hpp>

Classes

struct  code_item_struct_t
 Structure with information about a method code. More...
 

Public Member Functions

 CodeItemStruct ()=default
 Constructor of CodeItemStruct.
 
 ~CodeItemStruct ()=default
 Destructor of CodeItemStruct.
 
void parse_code_item_struct (stream::KunaiStream *stream, Types *types)
 Parser for the CodeItemStruct.
 
std::uint16_t get_registers_size () const
 Get the number of registers used in a method.
 
std::uint16_t get_incomings_args () const
 Get the number of words incoming arguments to the method.
 
std::uint16_t get_outgoing_args () const
 Get the number of words outgoing argument space required by the code.
 
std::uint16_t get_number_try_items () const
 Get the number of try items in the method.
 
std::uint16_t get_offset_to_debug_info () const
 Get the offset to the debug information.
 
std::uint16_t get_instructions_size () const
 Get size of the dalvik instructions (number of opcodes)
 
const std::vector< std::uint8_t > & get_bytecode () const
 Get a constant reference to the vector with the bytecode.
 
std::vector< std::uint8_t > & get_bytecode ()
 Get a reference to the vector with the bytecode.
 
const std::vector< tryitem_t > & get_try_items () const
 Get a constant reference to the vector of Try Items.
 
std::vector< tryitem_t > & get_try_items ()
 Get a reference to the vector of Try Items.
 
std::uint64_t get_encoded_catch_handler_offset ()
 Return the offset where encoded catch handler is read.
 
const std::vector< encodedcatchhandler_t > & get_encoded_catch_handlers () const
 Get a constant reference to the catch handlers vector.
 
std::vector< encodedcatchhandler_t > & get_encoded_catch_handlers ()
 Get a reference to the catch handlers vector.
 

Detailed Description

Save the information of the code from a Method.

Member Function Documentation

◆ get_bytecode() [1/2]

std::vector< std::uint8_t > & KUNAI::DEX::CodeItemStruct::get_bytecode ( )
inline

Get a reference to the vector with the bytecode.

Returns
reference to bytecode of the method

◆ get_bytecode() [2/2]

const std::vector< std::uint8_t > & KUNAI::DEX::CodeItemStruct::get_bytecode ( ) const
inline

Get a constant reference to the vector with the bytecode.

Returns
constant reference to the bytecode of the method

◆ get_encoded_catch_handler_offset()

std::uint64_t KUNAI::DEX::CodeItemStruct::get_encoded_catch_handler_offset ( )
inline

Return the offset where encoded catch handler is read.

Returns
offset to encoded catch handler list

◆ get_encoded_catch_handlers() [1/2]

std::vector< encodedcatchhandler_t > & KUNAI::DEX::CodeItemStruct::get_encoded_catch_handlers ( )
inline

Get a reference to the catch handlers vector.

Returns
reference to catch handlers of the method

◆ get_encoded_catch_handlers() [2/2]

const std::vector< encodedcatchhandler_t > & KUNAI::DEX::CodeItemStruct::get_encoded_catch_handlers ( ) const
inline

Get a constant reference to the catch handlers vector.

Returns
constant reference catch handlers of the method

◆ get_incomings_args()

std::uint16_t KUNAI::DEX::CodeItemStruct::get_incomings_args ( ) const
inline

Get the number of words incoming arguments to the method.

Returns
number of words incoming arguments

◆ get_instructions_size()

std::uint16_t KUNAI::DEX::CodeItemStruct::get_instructions_size ( ) const
inline

Get size of the dalvik instructions (number of opcodes)

Returns
size of dalvik instructions

◆ get_number_try_items()

std::uint16_t KUNAI::DEX::CodeItemStruct::get_number_try_items ( ) const
inline

Get the number of try items in the method.

Returns
number of try items

◆ get_offset_to_debug_info()

std::uint16_t KUNAI::DEX::CodeItemStruct::get_offset_to_debug_info ( ) const
inline

Get the offset to the debug information.

Returns
offset to debug information

◆ get_outgoing_args()

std::uint16_t KUNAI::DEX::CodeItemStruct::get_outgoing_args ( ) const
inline

Get the number of words outgoing argument space required by the code.

Returns
number of words outgoing argument space

◆ get_registers_size()

std::uint16_t KUNAI::DEX::CodeItemStruct::get_registers_size ( ) const
inline

Get the number of registers used in a method.

Returns
number of registers

◆ get_try_items() [1/2]

std::vector< tryitem_t > & KUNAI::DEX::CodeItemStruct::get_try_items ( )
inline

Get a reference to the vector of Try Items.

Returns
reference to all try items

◆ get_try_items() [2/2]

const std::vector< tryitem_t > & KUNAI::DEX::CodeItemStruct::get_try_items ( ) const
inline

Get a constant reference to the vector of Try Items.

Returns
constant reference to all try items

◆ parse_code_item_struct()

void KUNAI::DEX::CodeItemStruct::parse_code_item_struct ( stream::KunaiStream stream,
Types types 
)

Parser for the CodeItemStruct.

Parameters
streamDEX file where to read data
typestypes of the DEX

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