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

Class that contains the fields and methods from a class in a DEX file. More...

#include <classes.hpp>

Public Member Functions

 ClassDataItem ()=default
 Constructor of ClassDataItem.
 
 ~ClassDataItem ()=default
 Destructor of ClassDataItem.
 
void parse_class_data_item (stream::KunaiStream *stream, Fields *fields, Methods *methods, Types *types)
 Method to parse the ClassDataItem.
 
std::size_t get_number_of_static_fields () const
 Get the number of the static fields.
 
std::size_t get_number_of_instance_fields () const
 Get number of instance fields.
 
std::size_t get_number_of_direct_methods () const
 Get number of direct methods.
 
std::size_t get_number_of_virtual_methods () const
 Get number of virtual methods.
 
EncodedFieldget_static_field_by_order (std::uint32_t ord)
 Get a pointer to static field from the reading order (recommended)
 
EncodedFieldget_static_field_by_id (std::uint32_t id)
 Get a pointer to static field by the id of the FieldID.
 
EncodedFieldget_instance_field_by_order (std::uint32_t ord)
 Get an instance field from the reading order (recommended)
 
EncodedFieldget_instance_field_by_id (std::uint32_t id)
 Get an instance field by the id of the FieldID.
 
EncodedMethodget_direct_method_by_order (std::uint32_t ord)
 Get a direct method from the reading order (recommended)
 
EncodedMethodget_direct_method_by_id (std::uint32_t id)
 Get a direct method by the id of the MethodID.
 
EncodedMethodget_virtual_method_by_order (std::uint32_t ord)
 Get a virtual method from the reading order (recommended)
 
EncodedMethodget_virtual_method_by_id (std::uint32_t id)
 Get a virtual method by the id of the MethodID.
 
std::vector< EncodedField * > & get_fields ()
 Get all the fields from the class.
 
std::vector< EncodedMethod * > & get_methods ()
 Get all the methods from the class.
 

Detailed Description

Class that contains the fields and methods from a class in a DEX file.

Member Function Documentation

◆ get_direct_method_by_id()

EncodedMethod * KUNAI::DEX::ClassDataItem::get_direct_method_by_id ( std::uint32_t  id)

Get a direct method by the id of the MethodID.

Parameters
idid of the MethodID
Returns
pointer to direct encodedmethod

◆ get_direct_method_by_order()

EncodedMethod * KUNAI::DEX::ClassDataItem::get_direct_method_by_order ( std::uint32_t  ord)

Get a direct method from the reading order (recommended)

Parameters
ordorder of the direct method
Returns
pointer to direct encodedmethod

◆ get_fields()

std::vector< EncodedField * > & KUNAI::DEX::ClassDataItem::get_fields ( )

Get all the fields from the class.

Returns
reference to vector with all the fields

◆ get_instance_field_by_id()

EncodedField * KUNAI::DEX::ClassDataItem::get_instance_field_by_id ( std::uint32_t  id)

Get an instance field by the id of the FieldID.

Parameters
idid of the FieldID
Returns
pointer to instance encodedfield

◆ get_instance_field_by_order()

EncodedField * KUNAI::DEX::ClassDataItem::get_instance_field_by_order ( std::uint32_t  ord)

Get an instance field from the reading order (recommended)

Parameters
ordorder of the instance field
Returns
pointer to instance encodedfield

◆ get_methods()

std::vector< EncodedMethod * > & KUNAI::DEX::ClassDataItem::get_methods ( )

Get all the methods from the class.

Returns
reference to vector with all the methods

◆ get_number_of_direct_methods()

std::size_t KUNAI::DEX::ClassDataItem::get_number_of_direct_methods ( ) const
inline

Get number of direct methods.

Returns
size of direct methods

◆ get_number_of_instance_fields()

std::size_t KUNAI::DEX::ClassDataItem::get_number_of_instance_fields ( ) const
inline

Get number of instance fields.

Returns
size of instance fields

◆ get_number_of_static_fields()

std::size_t KUNAI::DEX::ClassDataItem::get_number_of_static_fields ( ) const
inline

Get the number of the static fields.

Returns
size of static fields

◆ get_number_of_virtual_methods()

std::size_t KUNAI::DEX::ClassDataItem::get_number_of_virtual_methods ( ) const
inline

Get number of virtual methods.

Returns
size of virtual methods

◆ get_static_field_by_id()

EncodedField * KUNAI::DEX::ClassDataItem::get_static_field_by_id ( std::uint32_t  id)

Get a pointer to static field by the id of the FieldID.

Parameters
idid of the FieldID
Returns
pointer to static encodedfield

◆ get_static_field_by_order()

EncodedField * KUNAI::DEX::ClassDataItem::get_static_field_by_order ( std::uint32_t  ord)

Get a pointer to static field from the reading order (recommended)

Parameters
ordorder of the static field
Returns
pointer to static encodedfield

◆ get_virtual_method_by_id()

EncodedMethod * KUNAI::DEX::ClassDataItem::get_virtual_method_by_id ( std::uint32_t  id)

Get a virtual method by the id of the MethodID.

Parameters
idid of the MethodID
Returns
pointer to virtual encodedmethod

◆ get_virtual_method_by_order()

EncodedMethod * KUNAI::DEX::ClassDataItem::get_virtual_method_by_order ( std::uint32_t  ord)

Get a virtual method from the reading order (recommended)

Parameters
ordorder of the virtual method
Returns
pointer to virtual encodedmethod

◆ parse_class_data_item()

void KUNAI::DEX::ClassDataItem::parse_class_data_item ( stream::KunaiStream stream,
Fields fields,
Methods methods,
Types types 
)

Method to parse the ClassDataItem.

Parameters
streamstream DEX file
fieldsfields of the DEX file
methodsmethods of the DEX file
typestypes of the DEX file

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