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

Storage class for all the strings of the DEX file. More...

#include <strings.hpp>

Public Member Functions

 Strings ()=default
 Constructor of string class.
 
 Strings (Strings &str)
 Copy constructors of strings.
 
 ~Strings ()=default
 destructor of the strings.
 
void parse_strings (std::uint32_t strings_offset, std::uint32_t number_of_strings, stream::KunaiStream *stream)
 Parse the strings from the DEX file.
 
const ordered_strings_t & get_ordered_strings () const
 
const offset_string_t & get_offset_strings () const
 Return the offset strings map as constant.
 
std::string * get_string_from_offset (std::uint32_t offset)
 Return a pointer to an string giving an offset.
 
std::string & get_string_by_id (std::uint32_t id)
 Get reference to string by a given id.
 
std::uint32_t get_number_of_strings () const
 Get the number of the strings stored.
 
void to_xml (std::ofstream &fos)
 Dump the Strings to an XML.
 

Friends

std::ostream & operator<< (std::ostream &os, const Strings &entry)
 pretty print the list of strings.
 

Detailed Description

Storage class for all the strings of the DEX file.

Constructor & Destructor Documentation

◆ Strings()

KUNAI::DEX::Strings::Strings ( Strings str)

Copy constructors of strings.

Parameters
stranother strings object

Member Function Documentation

◆ get_number_of_strings()

std::uint32_t KUNAI::DEX::Strings::get_number_of_strings ( ) const
inline

Get the number of the strings stored.

Returns
uint32_t with number of strings

◆ get_offset_strings()

const offset_string_t & KUNAI::DEX::Strings::get_offset_strings ( ) const
inline

Return the offset strings map as constant.

Returns
offset-strings map

◆ get_string_by_id()

std::string & KUNAI::DEX::Strings::get_string_by_id ( std::uint32_t  id)

Get reference to string by a given id.

Parameters
idid commonly refers to position
Returns
reference to string

◆ get_string_from_offset()

std::string * KUNAI::DEX::Strings::get_string_from_offset ( std::uint32_t  offset)

Return a pointer to an string giving an offset.

Parameters
offsetoffset where string is
Returns
pointer to string in the offset

◆ parse_strings()

void KUNAI::DEX::Strings::parse_strings ( std::uint32_t  strings_offset,
std::uint32_t  number_of_strings,
stream::KunaiStream stream 
)

Parse the strings from the DEX file.

Parameters
strings_offsetoffset where to read the strings
number_of_stringsnumber of strings to read
streamstream with file

◆ to_xml()

void KUNAI::DEX::Strings::to_xml ( std::ofstream &  fos)

Dump the Strings to an XML.

Parameters
fosxml where to dump

Friends And Related Symbol Documentation

◆ operator<<

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

pretty print the list of strings.

Parameters
osstream where to print to
entryentry with the strings
Returns


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