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

Class to manage all the ProtoID from the DEX file. More...

#include <protos.hpp>

Public Member Functions

 Protos ()=default
 Default constructor of protos.
 
 ~Protos ()=default
 Default destructor of protos.
 
void parse_protos (stream::KunaiStream *stream, std::uint32_t number_of_protos, std::uint32_t offset, Strings *strings, Types *types)
 Parse all the ProtoIDs from the file.
 
const std::vector< protoid_t > & get_proto_ids () const
 Return a constant reference to proto_ids vector.
 
std::vector< protoid_t > & get_proto_ids ()
 Return a reference to proto_ids vector.
 
std::uint32_t get_number_of_protos () const
 get the number of proto_ids
 
ProtoIDget_proto_by_order (std::uint32_t pos)
 Given a position in the vector of protos, return a ProtoID.
 
void to_xml (std::ofstream &xml_file)
 Dump the proto_ids to an XML file.
 

Friends

std::ostream & operator<< (std::ostream &os, const Protos &entry)
 Return a pretty printed version of the proto_ids.
 

Detailed Description

Class to manage all the ProtoID from the DEX file.

Member Function Documentation

◆ get_number_of_protos()

std::uint32_t KUNAI::DEX::Protos::get_number_of_protos ( ) const
inline

get the number of proto_ids

Returns
number of proto_ids

◆ get_proto_by_order()

ProtoID * KUNAI::DEX::Protos::get_proto_by_order ( std::uint32_t  pos)

Given a position in the vector of protos, return a ProtoID.

Parameters
posposition to obtain the ProtoID
Returns
pointer to a ProtoID*

◆ get_proto_ids() [1/2]

std::vector< protoid_t > & KUNAI::DEX::Protos::get_proto_ids ( )
inline

Return a reference to proto_ids vector.

Returns
reference to proto_ids vector

◆ get_proto_ids() [2/2]

const std::vector< protoid_t > & KUNAI::DEX::Protos::get_proto_ids ( ) const
inline

Return a constant reference to proto_ids vector.

Returns
const reference to the proto_id vector

◆ parse_protos()

void KUNAI::DEX::Protos::parse_protos ( stream::KunaiStream stream,
std::uint32_t  number_of_protos,
std::uint32_t  offset,
Strings strings,
Types types 
)

Parse all the ProtoIDs from the file.

Parameters
streamstream with dex file
number_of_protosnumber of protos to read
offsetoffset where to read the protos
stringsobject with all the strings from the dex
typesobject with all the types from the dex

◆ to_xml()

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

Dump the proto_ids to an XML file.

Parameters
xml_filefile where to dump the data

Friends And Related Symbol Documentation

◆ operator<<

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

Return a pretty printed version of the proto_ids.

Parameters
osstream where to print it
entryentry to print
Returns
stream with printed data

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