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

Public Member Functions

 Types ()=default
 Constructor of the Types object, nothing for initialization.
 
 ~Types ()=default
 Destructor of Types.
 
void parse_types (stream::KunaiStream *stream, Strings *strings, std::uint32_t number_of_types, std::uint32_t types_offset)
 Parse the types and store them in the class.
 
const std::vector< dvmtype_t > & get_ordered_types () const
 Get a reference to the vector with all the types.
 
const std::unordered_map< std::uint32_t, DVMType * > & get_types_by_id () const
 Get the types with the map of string id - type.
 
DVMTypeget_type_by_id (std::uint32_t type_id)
 Get a type given its string ID.
 
DVMTypeget_type_from_order (std::uint32_t pos)
 Get a type given position.
 
std::uint32_t get_number_of_types () const
 Get the number of types stored.
 
std::uint32_t get_offset () const
 Get the offset where types are stored.
 
void to_xml (std::ofstream &xml_file)
 Dump the types to an xml file.
 

Friends

std::ostream & operator<< (std::ostream &os, const Types &entry)
 Pretty printer for Types.
 

Member Function Documentation

◆ get_number_of_types()

std::uint32_t KUNAI::DEX::Types::get_number_of_types ( ) const
inline

Get the number of types stored.

Returns
number of types

◆ get_offset()

std::uint32_t KUNAI::DEX::Types::get_offset ( ) const
inline

Get the offset where types are stored.

Returns
offset where types are

◆ get_ordered_types()

const std::vector< dvmtype_t > & KUNAI::DEX::Types::get_ordered_types ( ) const
inline

Get a reference to the vector with all the types.

Returns
constant reference to vector

◆ get_type_by_id()

DVMType * KUNAI::DEX::Types::get_type_by_id ( std::uint32_t  type_id)

Get a type given its string ID.

Parameters
type_idID of the type
Returns
pointer to the type

◆ get_type_from_order()

DVMType * KUNAI::DEX::Types::get_type_from_order ( std::uint32_t  pos)

Get a type given position.

Parameters
posposition of the Type
Returns
pointer to the type

◆ get_types_by_id()

const std::unordered_map< std::uint32_t, DVMType * > & KUNAI::DEX::Types::get_types_by_id ( ) const
inline

Get the types with the map of string id - type.

Returns
constant reference to map

◆ parse_types()

void KUNAI::DEX::Types::parse_types ( stream::KunaiStream stream,
Strings strings,
std::uint32_t  number_of_types,
std::uint32_t  types_offset 
)

Parse the types and store them in the class.

Parameters
streamstream with the DEX file
stringsstrings to retrieve the type
number_of_typesnumber of types to retrieve
types_offsetoffset where to read the types

◆ to_xml()

void KUNAI::DEX::Types::to_xml ( std::ofstream &  xml_file)

Dump the types to an xml file.

Parameters
xml_filefile where to dump content

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Types entry 
)
friend

Pretty printer for Types.

Parameters
osstream where to print it
entryentry to print
Returns


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