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

Specification of the method analysis, a method contains instructions, exceptions data, and so on... More...

#include <analysis.hpp>

Public Member Functions

 MethodAnalysis (std::variant< EncodedMethod *, ExternalMethod * > method_encoded, std::vector< std::unique_ptr< Instruction > > &instructions)
 
void dump_dot_file (std::string &file_path)
 Dump the method as a dot file into the current path.
 
bool external () const
 Check if the method is external.
 
const BasicBlocksget_basic_blocks () const
 
BasicBlocksget_basic_blocks ()
 
std::uint32_t get_number_of_registers () const
 
std::uint32_t get_number_of_parameters () const
 
bool is_android_api () const
 Check if current method is an android api.
 
const std::string & get_name () const
 
const std::string & get_descriptor () const
 
const std::string & get_access_flags () const
 
const std::string & get_class_name () const
 
const std::string & get_full_name () const
 
std::vector< std::unique_ptr< Instruction > > & get_instructions ()
 
std::variant< EncodedMethod *, ExternalMethod * > get_encoded_method () const
 
const std::vector< std::tuple< ClassAnalysis *, FieldAnalysis *, std::uint64_t > > & get_xrefread () const
 
std::vector< std::tuple< ClassAnalysis *, FieldAnalysis *, std::uint64_t > > & get_xrefread ()
 
const std::vector< std::tuple< ClassAnalysis *, FieldAnalysis *, std::uint64_t > > & get_xrefwrite () const
 
std::vector< std::tuple< ClassAnalysis *, FieldAnalysis *, std::uint64_t > > & get_xrefwrite ()
 
const std::vector< std::tuple< ClassAnalysis *, MethodAnalysis *, std::uint64_t > > & get_xrefto () const
 
std::vector< std::tuple< ClassAnalysis *, MethodAnalysis *, std::uint64_t > > & get_xrefto ()
 
const std::vector< std::tuple< ClassAnalysis *, MethodAnalysis *, std::uint64_t > > & get_xreffrom () const
 
std::vector< std::tuple< ClassAnalysis *, MethodAnalysis *, std::uint64_t > > & get_xreffrom ()
 
const std::vector< std::pair< ClassAnalysis *, std::uint64_t > > & get_xrefnewinstance () const
 
std::vector< std::pair< ClassAnalysis *, std::uint64_t > > & get_xrefnewinstance ()
 
const std::vector< std::pair< ClassAnalysis *, std::uint64_t > > & get_xrefconstclass () const
 
std::vector< std::pair< ClassAnalysis *, std::uint64_t > > & get_xrefconstclass ()
 
void add_xrefread (ClassAnalysis *c, FieldAnalysis *f, std::uint64_t offset)
 
void add_xrefwrite (ClassAnalysis *c, FieldAnalysis *f, std::uint64_t offset)
 
void add_xrefto (ClassAnalysis *c, MethodAnalysis *m, std::uint64_t offset)
 
void add_xreffrom (ClassAnalysis *c, MethodAnalysis *m, std::uint64_t offset)
 
void add_xrefnewinstance (ClassAnalysis *c, std::uint64_t offset)
 
void add_xrefconstclass (ClassAnalysis *c, std::uint64_t offset)
 

Public Attributes

const std::vector< std::string > known_apis
 vector of known apis of Android
 

Detailed Description

Specification of the method analysis, a method contains instructions, exceptions data, and so on...

Member Function Documentation

◆ dump_dot_file()

void KUNAI::DEX::MethodAnalysis::dump_dot_file ( std::string &  file_path)
inline

Dump the method as a dot file into the current path.

Parameters
file_pathreference to a path where to dump the content

◆ external()

bool KUNAI::DEX::MethodAnalysis::external ( ) const
inline

Check if the method is external.

Returns
method external

◆ is_android_api()

bool KUNAI::DEX::MethodAnalysis::is_android_api ( ) const

Check if current method is an android api.

Returns
is android api method

Member Data Documentation

◆ known_apis

const std::vector<std::string> KUNAI::DEX::MethodAnalysis::known_apis
Initial value:
{
"Landroid/", "Lcom/android/internal/util", "Ldalvik/", "Ljava/", "Ljavax/", "Lorg/apache/",
"Lorg/json/", "Lorg/w3c/dom/", "Lorg/xml/sax", "Lorg/xmlpull/v1/", "Ljunit/", "Landroidx/"}

vector of known apis of Android


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