LIEF: Library to Instrument Executable Formats Version 1.0.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
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
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)
 Object (Object &&other) noexcept=default
Objectoperator= (Object &&other) noexcept=default
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

Initial value:
ref_iterator< CT, U, typename decay_t< CT >::const_iterator > const_ref_iterator
Iterator which returns a const ref on container's values.
Definition iterators.hpp:286

◆ it_const_strings

◆ 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

References File().

Referenced by File(), operator<<, operator=(), and ~File().

◆ ~File()

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

References File().

Member Function Documentation

◆ accept()

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

Implements LIEF::Object.

References accept().

Referenced by accept().

◆ classes() [1/2]

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

References classes(), and LIEF_LIFETIMEBOUND.

◆ classes() [2/2]

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

All classes used in the DEX file

References classes(), and LIEF_LIFETIMEBOUND.

Referenced by classes(), and classes().

◆ dex2dex_info()

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

De-optimize information.

References dex2dex_info().

Referenced by dex2dex_info().

◆ dex2dex_json_info()

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

De-optimize information as JSON.

References dex2dex_json_info().

Referenced by dex2dex_json_info().

◆ fields() [1/2]

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

References fields(), and LIEF_LIFETIMEBOUND.

◆ fields() [2/2]

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

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

References fields(), and LIEF_LIFETIMEBOUND.

Referenced by fields(), and fields().

◆ get_class() [1/4]

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

References get_class(), and LIEF_LIFETIMEBOUND.

◆ 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.

References get_class(), and LIEF_LIFETIMEBOUND.

Referenced by get_class(), get_class(), get_class(), and get_class().

◆ get_class() [3/4]

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

References get_class(), and LIEF_LIFETIMEBOUND.

◆ 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.

References get_class(), and LIEF_LIFETIMEBOUND.

◆ has_class()

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

Check if the given class name exists.

References has_class().

Referenced by has_class().

◆ header() [1/2]

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

References header(), and LIEF_LIFETIMEBOUND.

◆ header() [2/2]

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

DEX header.

References LIEF_LIFETIMEBOUND.

Referenced by header().

◆ location() [1/2]

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

Location of this file.

Referenced by location().

◆ location() [2/2]

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

References location().

◆ map() [1/2]

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

References map().

◆ map() [2/2]

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

DEX Map.

References map().

Referenced by map(), and map().

◆ methods() [1/2]

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

References LIEF_LIFETIMEBOUND, and 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.

References LIEF_LIFETIMEBOUND, and methods().

Referenced by methods(), and methods().

◆ name() [1/2]

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

Name of this file.

Referenced by name().

◆ name() [2/2]

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

References name().

◆ operator=()

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

References File().

◆ prototypes() [1/2]

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

Prototype pool.

References LIEF_LIFETIMEBOUND, and prototypes().

Referenced by prototypes(), and prototypes().

◆ prototypes() [2/2]

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

References LIEF_LIFETIMEBOUND, and prototypes().

◆ raw()

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

References raw().

Referenced by raw().

◆ save()

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

Extract the current dex file and deoptimize it.

References save().

Referenced by save().

◆ strings() [1/2]

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

References LIEF_LIFETIMEBOUND, and strings().

◆ strings() [2/2]

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

String pool.

References LIEF_LIFETIMEBOUND, and strings().

Referenced by strings(), and strings().

◆ types() [1/2]

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

References LIEF_LIFETIMEBOUND, and types().

◆ types() [2/2]

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

Type pool.

References LIEF_LIFETIMEBOUND, and types().

Referenced by types(), and types().

◆ 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: