36#ifndef KUNAI_DEX_PARSER_PROTOS_HPP
37#define KUNAI_DEX_PARSER_PROTOS_HPP
39#include "Kunai/Utils/kunaistream.hpp"
40#include "Kunai/DEX/parser/types.hpp"
41#include "Kunai/DEX/parser/strings.hpp"
56 std::string &shorty_idx;
60 std::vector<DVMType *> parameters;
65 void parse_parameters(
68 std::uint32_t parameters_off);
80 std::string& shorty_idx,
81 std::uint32_t return_type_idx,
82 std::uint32_t parameters_off)
83 : shorty_idx(shorty_idx),
84 return_type(types->get_type_from_order(return_type_idx))
86 parse_parameters(stream, types, parameters_off);
132 using protoid_t = std::unique_ptr<ProtoID>;
140 std::vector<protoid_t> proto_ids;
142 std::uint32_t number_of_protos;
157 std::uint32_t number_of_protos,
158 std::uint32_t offset,
180 return number_of_protos;
Represents the base class of a Type in the DVM we have different types.
Definition types.hpp:26
Store the information of a ProtoID, this is a string with the return type, the list of parameters and...
Definition protos.hpp:54
const DVMType * get_return_type() const
Get a constant reference to the return type.
Definition protos.hpp:105
std::vector< DVMType * > & get_parameters()
Get a reference to the parameters.
Definition protos.hpp:126
const std::string & get_shorty_idx() const
Get constant reference to shorty_idx string.
Definition protos.hpp:91
const std::vector< DVMType * > & get_parameters() const
Get a constant reference to the parameters.
Definition protos.hpp:119
DVMType * get_return_type()
Get a reference to the return type.
Definition protos.hpp:112
std::string & get_shorty_idx()
Get a reference to shorty_idx string.
Definition protos.hpp:98
ProtoID(stream::KunaiStream *stream, Types *types, std::string &shorty_idx, std::uint32_t return_type_idx, std::uint32_t parameters_off)
Constructor of a ProtoID, the ProtoID parses its own parameters.
Definition protos.hpp:77
Class to manage all the ProtoID from the DEX file.
Definition protos.hpp:137
~Protos()=default
Default destructor of protos.
friend std::ostream & operator<<(std::ostream &os, const Protos &entry)
Return a pretty printed version of the proto_ids.
Protos()=default
Default constructor of protos.
ProtoID * get_proto_by_order(std::uint32_t pos)
Given a position in the vector of protos, return a ProtoID.
std::uint32_t get_number_of_protos() const
get the number of proto_ids
Definition protos.hpp:178
std::vector< protoid_t > & get_proto_ids()
Return a reference to proto_ids vector.
Definition protos.hpp:171
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.
void to_xml(std::ofstream &xml_file)
Dump the proto_ids to an XML file.
const std::vector< protoid_t > & get_proto_ids() const
Return a constant reference to proto_ids vector.
Definition protos.hpp:164
Storage class for all the strings of the DEX file.
Definition strings.hpp:34
Class to manage an input file stream given for the analysis.
Definition kunaistream.hpp:20
utilities
Definition analysis.hpp:23