10#ifndef KUNAI_DEX_DEX_HPP
11#define KUNAI_DEX_DEX_HPP
14#include "Kunai/Utils/logger.hpp"
15#include "Kunai/Utils/kunaistream.hpp"
16#include "Kunai/DEX/parser/parser.hpp"
17#include "Kunai/DEX/DVM/dex_disassembler.hpp"
18#include "Kunai/DEX/analysis/dex_analysis.hpp"
38 static std::unique_ptr<Dex>
parse_dex_file(
const char * dex_file_path);
42 std::unique_ptr<stream::KunaiStream> kunai_stream;
44 std::ifstream dex_file;
47 std::unique_ptr<Parser> parser;
50 std::unique_ptr<DexDisassembler> dex_disassembler;
53 std::unique_ptr<Analysis> analysis;
56 bool parsing_correct =
false;
61 void initialization(std::string& dex_file_path);
68 Dex(std::string& dex_file_path)
70 initialization(dex_file_path);
77 if (dex_file.is_open())
85 return parsing_correct;
99 return dex_disassembler.get();
Definition dex_analysis.hpp:21
Disassembler for DEX data.
Definition dex_disassembler.hpp:27
Abstraction of a DEX object, the class offers the analyst a parser, a disassembler and an analysis ob...
Definition dex.hpp:29
Analysis * get_analysis(bool create_xrefs)
Get the analysis object this needs the disassembly and the parser, the dex will be disassembled in ca...
Dex(std::string &dex_file_path)
Constructor of the Dex object, we obtain a path to the DEX file to analyze.
Definition dex.hpp:68
bool get_parsing_correct() const
Was parsing process correct?
Definition dex.hpp:83
static std::unique_ptr< Dex > parse_dex_file(std::string &dex_file_path)
Parse a given dex file, return a Dex object as a unique pointer.
Parser * get_parser()
get a pointer to the DEX parser with all the headers
Definition dex.hpp:90
DexDisassembler * get_dex_disassembler()
Get the disassembler of the DEX file.
Definition dex.hpp:97
~Dex()
Destructor of the Dex object, release any memory or files here in case it is needed.
Definition dex.hpp:75
utilities
Definition analysis.hpp:23