8#ifndef KUNAI_DEX_PARSER_METHODS_HPP
9#define KUNAI_DEX_PARSER_METHODS_HPP
11#include "Kunai/DEX/parser/protos.hpp"
12#include "Kunai/DEX/parser/strings.hpp"
13#include "Kunai/Utils/kunaistream.hpp"
36 std::string pretty_name;
46 : class_(class_), proto_(proto_), name_(name_)
57 return encoded_method;
114 using methodid_t = std::unique_ptr<MethodID>;
120 std::vector<methodid_t> methods;
123 std::uint32_t methods_size;
143 std::uint32_t methods_offset,
144 std::uint32_t methods_size
Represents the base class of a Type in the DVM we have different types.
Definition types.hpp:26
Class that represent the information from a Method.
Definition encoded.hpp:635
MethodID represents a single method from DEX file.
Definition methods.hpp:28
void set_encoded_method(EncodedMethod *e)
Set the encoded method from this MethodID.
Definition methods.hpp:62
std::string & get_name()
Get a reference to the name of the method.
Definition methods.hpp:104
const std::string & get_name() const
Get a constant reference to the name of the method.
Definition methods.hpp:97
const DVMType * get_class() const
Get a constant pointer to the class where method is.
Definition methods.hpp:69
const ProtoID * get_proto() const
Get a constant pointer to the proto of the method.
Definition methods.hpp:83
~MethodID()=default
Destructor of the MethodID.
ProtoID * get_proto()
Get a pointer to the proto of the method.
Definition methods.hpp:90
DVMType * get_class()
Get a pointer to the class where method is.
Definition methods.hpp:76
MethodID(DVMType *class_, ProtoID *proto_, std::string &name_)
Constructor of the MethodID.
Definition methods.hpp:45
std::string & pretty_method()
Get a string representation of the method.
EncodedMethod * get_encoded_method()
get the encoded method set in this MethodID*
Definition methods.hpp:55
Methods contains all the MethodIDs from the DEX file.
Definition methods.hpp:118
std::vector< methodid_t > & get_methods()
Get a reference to all the methods.
Definition methods.hpp:156
MethodID * get_method(std::uint32_t pos)
Get one of the methods by its position.
void to_xml(std::ofstream &fos)
Print the methods into an XML format.
Methods()=default
Constructor of Methods, default.
~Methods()=default
Destructor of Methods, default.
std::uint32_t get_number_of_methods() const
Get the number of the methods.
Definition methods.hpp:168
friend std::ostream & operator<<(std::ostream &os, const Methods &entry)
Give a pretty print result of the methods.
const std::vector< methodid_t > & get_methods() const
Get a constant reference to all the methods.
Definition methods.hpp:149
void parse_methods(stream::KunaiStream *stream, Types *types, Protos *protos, Strings *strings, std::uint32_t methods_offset, std::uint32_t methods_size)
Parse all the method ids objects.
Store the information of a ProtoID, this is a string with the return type, the list of parameters and...
Definition protos.hpp:54
Class to manage all the ProtoID from the DEX file.
Definition protos.hpp:137
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