LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::DEX::File Class Reference

Class that represents a DEX file. More...

#include <File.hpp>

Inheritance diagram for LIEF::DEX::File:
Collaboration diagram for LIEF::DEX::File:

Public Types

using classes_t = std::unordered_map<std::string, Class*>
 
using classes_list_t = std::vector<std::unique_ptr<Class>>
 
using it_classes = ref_iterator<classes_list_t&, Class*>
 
using it_const_classes = const_ref_iterator<const classes_list_t&, const Class*>
 
using methods_t = std::vector<std::unique_ptr<Method>>
 
using it_methods = ref_iterator<methods_t&, Method*>
 
using it_const_methods = const_ref_iterator<const methods_t&, const Method*>
 
using strings_t = std::vector<std::unique_ptr<std::string>>
 
using it_strings = ref_iterator<strings_t&, std::string*>
 
using it_const_strings = const_ref_iterator<const strings_t&, const std::string*>
 
using types_t = std::vector<std::unique_ptr<Type>>
 
using it_types = ref_iterator<types_t&, Type*>
 
using it_const_types = const_ref_iterator<const types_t&, const Type*>
 
using prototypes_t = std::vector<std::unique_ptr<Prototype>>
 
using it_prototypes = ref_iterator<prototypes_t&, Prototype*>
 
using it_const_prototypes = const_ref_iterator<const prototypes_t&, const Prototype*>
 
using fields_t = std::vector<std::unique_ptr<Field>>
 
using it_fields = ref_iterator<fields_t&, Field*>
 
using it_const_fields = const_ref_iterator<const fields_t&, const Field*>
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

Fileoperator= (const File &copy)=delete
 
 File (const File &copy)=delete
 
dex_version_t version () const
 Version of the current DEX file.
 
const std::string & name () const
 Name of this file.
 
void name (const std::string &name)
 
const std::string & location () const
 Location of this file.
 
void location (const std::string &location)
 
const Headerheader () const
 DEX header.
 
Headerheader ()
 
it_const_classes classes () const
 All classes used in the DEX file
 
it_classes classes ()
 
bool has_class (const std::string &class_name) const
 Check if the given class name exists.
 
const Classget_class (const std::string &class_name) const
 Return the DEX::Class object associated with the given name.
 
Classget_class (const std::string &class_name)
 
const Classget_class (size_t index) const
 Return the DEX::Class object associated with the given index.
 
Classget_class (size_t index)
 
dex2dex_info_t dex2dex_info () const
 De-optimize information.
 
std::string dex2dex_json_info () const
 De-optimize information as JSON.
 
it_const_methods methods () const
 Return an iterator over all the DEX::Method used in this DEX file.
 
it_methods methods ()
 
it_const_fields fields () const
 Return an iterator over all the DEX::Field used in this DEX file.
 
it_fields fields ()
 
it_const_strings strings () const
 String pool.
 
it_strings strings ()
 
it_const_types types () const
 Type pool.
 
it_types types ()
 
it_prototypes prototypes ()
 Prototype pool.
 
it_const_prototypes prototypes () const
 
const MapListmap () const
 DEX Map.
 
MapListmap ()
 
std::string save (const std::string &path="", bool deoptimize=true) const
 Extract the current dex file and deoptimize it.
 
std::vector< uint8_t > raw (bool deoptimize=true) const
 
void accept (Visitor &visitor) const override
 
 ~File () override
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 
virtual ~Object ()
 

Detailed Description

Class that represents a DEX file.

Member Typedef Documentation

◆ classes_list_t

using LIEF::DEX::File::classes_list_t = std::vector<std::unique_ptr<Class>>

◆ classes_t

using LIEF::DEX::File::classes_t = std::unordered_map<std::string, Class*>

◆ fields_t

using LIEF::DEX::File::fields_t = std::vector<std::unique_ptr<Field>>

◆ it_classes

◆ it_const_classes

◆ it_const_fields

◆ it_const_methods

◆ it_const_prototypes

◆ it_const_strings

using LIEF::DEX::File::it_const_strings = const_ref_iterator<const strings_t&, const std::string*>

◆ it_const_types

◆ it_fields

◆ it_methods

◆ it_prototypes

◆ it_strings

◆ it_types

◆ methods_t

using LIEF::DEX::File::methods_t = std::vector<std::unique_ptr<Method>>

◆ prototypes_t

using LIEF::DEX::File::prototypes_t = std::vector<std::unique_ptr<Prototype>>

◆ strings_t

using LIEF::DEX::File::strings_t = std::vector<std::unique_ptr<std::string>>

◆ types_t

using LIEF::DEX::File::types_t = std::vector<std::unique_ptr<Type>>

Constructor & Destructor Documentation

◆ File()

LIEF::DEX::File::File ( const File & copy)
delete

◆ ~File()

LIEF::DEX::File::~File ( )
override

Member Function Documentation

◆ accept()

void LIEF::DEX::File::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ classes() [1/2]

it_classes LIEF::DEX::File::classes ( )

◆ classes() [2/2]

it_const_classes LIEF::DEX::File::classes ( ) const

All classes used in the DEX file

◆ dex2dex_info()

dex2dex_info_t LIEF::DEX::File::dex2dex_info ( ) const

De-optimize information.

◆ dex2dex_json_info()

std::string LIEF::DEX::File::dex2dex_json_info ( ) const

De-optimize information as JSON.

◆ fields() [1/2]

it_fields LIEF::DEX::File::fields ( )

◆ fields() [2/2]

it_const_fields LIEF::DEX::File::fields ( ) const

Return an iterator over all the DEX::Field used in this DEX file.

◆ get_class() [1/4]

Class * LIEF::DEX::File::get_class ( const std::string & class_name)

◆ get_class() [2/4]

const Class * LIEF::DEX::File::get_class ( const std::string & class_name) const

Return the DEX::Class object associated with the given name.

◆ get_class() [3/4]

Class * LIEF::DEX::File::get_class ( size_t index)

◆ get_class() [4/4]

const Class * LIEF::DEX::File::get_class ( size_t index) const

Return the DEX::Class object associated with the given index.

◆ has_class()

bool LIEF::DEX::File::has_class ( const std::string & class_name) const

Check if the given class name exists.

◆ header() [1/2]

Header & LIEF::DEX::File::header ( )

◆ header() [2/2]

const Header & LIEF::DEX::File::header ( ) const

DEX header.

◆ location() [1/2]

const std::string & LIEF::DEX::File::location ( ) const

Location of this file.

◆ location() [2/2]

void LIEF::DEX::File::location ( const std::string & location)

◆ map() [1/2]

MapList & LIEF::DEX::File::map ( )

◆ map() [2/2]

const MapList & LIEF::DEX::File::map ( ) const

DEX Map.

◆ methods() [1/2]

it_methods LIEF::DEX::File::methods ( )

◆ methods() [2/2]

it_const_methods LIEF::DEX::File::methods ( ) const

Return an iterator over all the DEX::Method used in this DEX file.

◆ name() [1/2]

const std::string & LIEF::DEX::File::name ( ) const

Name of this file.

◆ name() [2/2]

void LIEF::DEX::File::name ( const std::string & name)

◆ operator=()

File & LIEF::DEX::File::operator= ( const File & copy)
delete

◆ prototypes() [1/2]

it_prototypes LIEF::DEX::File::prototypes ( )

Prototype pool.

◆ prototypes() [2/2]

it_const_prototypes LIEF::DEX::File::prototypes ( ) const

◆ raw()

std::vector< uint8_t > LIEF::DEX::File::raw ( bool deoptimize = true) const

◆ save()

std::string LIEF::DEX::File::save ( const std::string & path = "",
bool deoptimize = true ) const

Extract the current dex file and deoptimize it.

◆ strings() [1/2]

it_strings LIEF::DEX::File::strings ( )

◆ strings() [2/2]

it_const_strings LIEF::DEX::File::strings ( ) const

String pool.

◆ types() [1/2]

it_types LIEF::DEX::File::types ( )

◆ types() [2/2]

it_const_types LIEF::DEX::File::types ( ) const

Type pool.

◆ version()

dex_version_t LIEF::DEX::File::version ( ) const

Version of the current DEX file.


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