12#ifndef KUNAI_DEX_DVM_DEX_DISASSEMBLER_HPP
13#define KUNAI_DEX_DVM_DEX_DISASSEMBLER_HPP
15#include "Kunai/DEX/parser/methods.hpp"
16#include "Kunai/DEX/parser/classes.hpp"
17#include "Kunai/DEX/DVM/disassembler.hpp"
18#include "Kunai/DEX/DVM/linear_sweep_disassembler.hpp"
19#include "Kunai/DEX/DVM/recursive_traversal_disassembler.hpp"
33 LINEAR_SWEEP_ALGORITHM,
34 RECURSIVE_TRAVERSAL_ALGORITHM
52 bool disassembly_correct =
false;
73 linear_sweep.set_internal_disassembler(&disassembler);
74 recursive_traversal.set_internal_disassembler(&disassembler);
82 this->algorithm = algorithm;
89 return dex_instructions;
96 return dex_instructions;
103 return disassembly_correct;
121 std::vector<std::unique_ptr<Instruction>>
Disassembler for DEX data.
Definition dex_disassembler.hpp:27
Disassembler::instructions_t & get_dex_instructions()
Get access to all the instructions from a dex.
Definition dex_disassembler.hpp:94
void set_disassembly_algorithm(disassembly_algorithm algorithm)
Set the disassembly algorithm to use in the next calls to the different disassembly methods.
Definition dex_disassembler.hpp:80
bool correct_disassembly() const
Get if the disassembly process was correct or not.
Definition dex_disassembler.hpp:101
const Disassembler::instructions_t & get_dex_instructions() const
Get access to all the instructions from a dex.
Definition dex_disassembler.hpp:87
std::vector< std::unique_ptr< Instruction > > disassembly_buffer(std::vector< std::uint8_t > &buffer)
Disassembly a buffer of bytes, take the buffer of bytes as dalvik instructions.
DexDisassembler(Parser *parser)
Constructor of the DexDisassembler, this should be called only if the parsing was correct.
Definition dex_disassembler.hpp:69
void disassembly_dex()
This is the most important function from the disassembler, this function takes the given parser objec...
disassembly_algorithm
enum of the different algorithms implemented for doing disassembly of DEX file
Definition dex_disassembler.hpp:32
void add_disassembly(DexDisassembler &other)
Add the instructions from another disassembler to the current one, this invalidate the previous one.
Definition disassembler.hpp:30
void set_parser(Parser *parser)
Set the parser for the disassembler.
Definition disassembler.hpp:74
std::unordered_map< EncodedMethod *, std::vector< std::unique_ptr< Instruction > > > instructions_t
For those who just want the full set of instructions it is possible to retrieve a vector with all the...
Definition disassembler.hpp:56
LinearSweepDisassembler is one of the DEX disassembly algorithms implemented by Kunai,...
Definition linear_sweep_disassembler.hpp:23
RecursiveTraversalDisassembler is one of the DEX disassembly algorithms implemented by Kunai,...
Definition recursive_traversal_disassembler.hpp:23
utilities
Definition analysis.hpp:23