KUNAI Static Analyzer
Kunai is a library for doing static binary analysis of Dalvik.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
KUNAI::DEX::DexDisassembler Class Reference

Disassembler for DEX data. More...

#include <dex_disassembler.hpp>

Public Types

enum class  disassembly_algorithm { LINEAR_SWEEP_ALGORITHM , RECURSIVE_TRAVERSAL_ALGORITHM }
 enum of the different algorithms implemented for doing disassembly of DEX file
 

Public Member Functions

 DexDisassembler (Parser *parser)
 Constructor of the DexDisassembler, this should be called only if the parsing was correct.
 
void set_disassembly_algorithm (disassembly_algorithm algorithm)
 Set the disassembly algorithm to use in the next calls to the different disassembly methods.
 
const Disassembler::instructions_tget_dex_instructions () const
 Get access to all the instructions from a dex.
 
Disassembler::instructions_tget_dex_instructions ()
 Get access to all the instructions from a dex.
 
bool correct_disassembly () const
 Get if the disassembly process was correct or not.
 
void add_disassembly (DexDisassembler &other)
 Add the instructions from another disassembler to the current one, this invalidate the previous one.
 
void disassembly_dex ()
 This is the most important function from the disassembler, this function takes the given parser object and calls one of the internal disassemblers for retrieving all the instructions from the DEX file.
 
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.
 
DexDisassembleroperator+= (DexDisassembler &other)
 

Detailed Description

Disassembler for DEX data.

Constructor & Destructor Documentation

◆ DexDisassembler()

KUNAI::DEX::DexDisassembler::DexDisassembler ( Parser parser)
inline

Constructor of the DexDisassembler, this should be called only if the parsing was correct.

Parameters
parserparser for the internal disassembler, this is used in some of the instructions

Member Function Documentation

◆ add_disassembly()

void KUNAI::DEX::DexDisassembler::add_disassembly ( DexDisassembler other)

Add the instructions from another disassembler to the current one, this invalidate the previous one.

Parameters
otherother dex disassembler

◆ correct_disassembly()

bool KUNAI::DEX::DexDisassembler::correct_disassembly ( ) const
inline

Get if the disassembly process was correct or not.

Returns
boolean value that says if disassembly was correct

◆ disassembly_buffer()

std::vector< std::unique_ptr< Instruction > > KUNAI::DEX::DexDisassembler::disassembly_buffer ( std::vector< std::uint8_t > &  buffer)

Disassembly a buffer of bytes, take the buffer of bytes as dalvik instructions.

Parameters
bufferbuffer with possible bytecode for dalvik
Returns
vector with disassembled instructions

◆ get_dex_instructions() [1/2]

Disassembler::instructions_t & KUNAI::DEX::DexDisassembler::get_dex_instructions ( )
inline

Get access to all the instructions from a dex.

Returns
reference to instructions

◆ get_dex_instructions() [2/2]

const Disassembler::instructions_t & KUNAI::DEX::DexDisassembler::get_dex_instructions ( ) const
inline

Get access to all the instructions from a dex.

Returns
constant reference to instructions

◆ set_disassembly_algorithm()

void KUNAI::DEX::DexDisassembler::set_disassembly_algorithm ( disassembly_algorithm  algorithm)
inline

Set the disassembly algorithm to use in the next calls to the different disassembly methods.

Parameters
algorithmnew algorithm to use

The documentation for this class was generated from the following file: