10#ifndef KUNAI_DEX_DVM_DISASSEMBLER_HPP
11#define KUNAI_DEX_DVM_DISASSEMBLER_HPP
13#include "Kunai/DEX/DVM/dalvik_instructions.hpp"
19#include <unordered_map>
38 std::uint64_t handler_start_addr;
45 std::uint64_t try_value_start_addr;
46 std::uint64_t try_value_end_addr;
47 std::vector<handler_data> handler;
56 std::vector<std::unique_ptr<Instruction>>>;
65 DVMClass throwable_class{
"Ljava/lang/Throwable;"};
76 this->parser = parser;
86 std::vector<uint8_t> & bytecode,
Classes of the DVM.
Definition types.hpp:174
Represents the base class of a Type in the DVM we have different types.
Definition types.hpp:26
Definition disassembler.hpp:30
std::unique_ptr< Instruction > disassemble_instruction(std::uint32_t opcode, std::vector< uint8_t > &bytecode, std::size_t index)
Get an instruction object from the op.
std::vector< exceptions_data > determine_exception(EncodedMethod *method)
Retrieve information from possible exception code inside of a method.
struct KUNAI::DEX::Disassembler::_exceptions_data exceptions_data
Information for the exceptions in the code.
std::int16_t get_conditional_jump_target(Instruction *instr)
Given an instruction check if it is a conditional jump and retrieve in that case the target of the ju...
Disassembler()=default
Constructor of the internal Disassembler for Dalvik.
void set_parser(Parser *parser)
Set the parser for the disassembler.
Definition disassembler.hpp:74
std::vector< std::int64_t > determine_next(Instruction *instruction, std::uint64_t curr_idx)
Determine given the last instruction the next instruction to run, the bytecode is retrieved from a :c...
std::int32_t get_unconditional_jump_target(Instruction *instr)
Given an instruction check if it is an unconditional jump and retrieve in that case the target of the...
std::vector< std::int64_t > determine_next(std::uint64_t curr_idx)
Same as the other determine_next but the instruction we give is the instruction last_instr that Disas...
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
struct KUNAI::DEX::Disassembler::_handler_data handler_data
Information for the handler of exceptions, handler type, the start address of it and basic blocks.
Class that represent the information from a Method.
Definition encoded.hpp:635
Base class for the Instructions of the Dalvik Bytecode.
Definition dalvik_instructions.hpp:69
utilities
Definition analysis.hpp:23
Information for the exceptions in the code.
Definition disassembler.hpp:44
Information for the handler of exceptions, handler type, the start address of it and basic blocks.
Definition disassembler.hpp:36