11#ifndef KUNAI_DEX_PARSER_STRINGS_HPP
12#define KUNAI_DEX_PARSER_STRINGS_HPP
17#include <unordered_map>
19#include "Kunai/Utils/kunaistream.hpp"
27 using ordered_strings_t = std::vector<std::string>;
29 using offset_string_t = std::unordered_map<std::uint32_t, std::string*>;
36 std::uint32_t strings_offset;
38 std::uint32_t number_of_strings;
40 ordered_strings_t ordered_strings;
42 offset_string_t offset_strings;
60 std::uint32_t number_of_strings,
63 const ordered_strings_t& get_ordered_strings()
const
65 return ordered_strings;
72 return offset_strings;
89 return number_of_strings;
Storage class for all the strings of the DEX file.
Definition strings.hpp:34
std::string * get_string_from_offset(std::uint32_t offset)
Return a pointer to an string giving an offset.
std::uint32_t get_number_of_strings() const
Get the number of the strings stored.
Definition strings.hpp:87
Strings(Strings &str)
Copy constructors of strings.
std::string & get_string_by_id(std::uint32_t id)
Get reference to string by a given id.
~Strings()=default
destructor of the strings.
Strings()=default
Constructor of string class.
void to_xml(std::ofstream &fos)
Dump the Strings to an XML.
friend std::ostream & operator<<(std::ostream &os, const Strings &entry)
pretty print the list of strings.
const offset_string_t & get_offset_strings() const
Return the offset strings map as constant.
Definition strings.hpp:70
void parse_strings(std::uint32_t strings_offset, std::uint32_t number_of_strings, stream::KunaiStream *stream)
Parse the strings from the DEX file.
Class to manage an input file stream given for the analysis.
Definition kunaistream.hpp:20
utilities
Definition analysis.hpp:23