LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
LIEF::runtime::android::Module Class Reference

This class exposes Android-specific API for a module. More...

#include <Module.hpp>

Inheritance diagram for LIEF::runtime::android::Module:
Collaboration diagram for LIEF::runtime::android::Module:

Public Member Functions

void * handle () const
 Return the dlopen handle for this library.
void * dlsym (const std::string &name) const
 Resolve the symbol from with the given name for the current module.
std::unique_ptr< ELF::Binaryparse_from_path () const
 Parse the ELF module from its path on the filesystem.
std::unique_ptr< ELF::Binaryparse_from_path (const ELF::ParserConfig &config) const
 Parse the ELF module from its path on the filesystem and given the parser configuration.
std::unique_ptr< ELF::Binaryparse_from_memory (const ELF::ParserConfig &config) const
 Parse the ELF module from memory with the given configuration.
std::unique_ptr< ELF::Binaryparse_from_memory () const
 Parse the ELF module from memory.
 ~Module () override=default
 Module ()=delete
 Module (std::unique_ptr< details::Module > impl)
 Module (const Module &)=delete
 Module (Module &&) noexcept
Public Member Functions inherited from LIEF::runtime::Module
 Module ()=delete
 Module (std::unique_ptr< details::Module > impl)
 Module (const Module &)=delete
Moduleoperator= (const Module &)=delete
 Module (Module &&) noexcept
Moduleoperator= (Module &&) noexcept
virtual std::unique_ptr< Moduleclone () const
uint64_t imagebase () const
 Base address where the module is loaded in memory.
uint64_t size () const
 Virtual size of the current module.
uint64_t end () const
 End address of the module.
std::string name () const
 Name of the module (e.g. libc.so.6, kernel32.dll, libsystem_c.dylib).
std::string path () const
 Path of the module.
bool contains (uintptr_t addr) const
 Check if the current module contains the given address.
std::vector< uint8_t > dump () const
 Return the content of the module as it is currently mapped in memory.
std::vector< uint8_t > dump (const std::string &filepath) const
 Same as dump() but also writes the content into the file located at filepath.
std::vector< uint8_t > dump (std::ostream &os) const
 Same as dump() but also writes the content into the given output stream.
std::string to_string () const
template<class T>
const T * as () const
 This function can be used to downcast a Module instance.
template<class T>
T * as ()

Static Public Member Functions

static std::unique_ptr< Modulefrom_handle (void *H)
 Instantiate a Module from the given dlopen handle.
static constexpr bool classof (const runtime::Module *)

Detailed Description

This class exposes Android-specific API for a module.

Constructor & Destructor Documentation

◆ ~Module()

LIEF::runtime::android::Module::~Module ( )
overridevirtualdefault

Reimplemented from LIEF::runtime::Module.

◆ Module() [1/4]

◆ Module() [2/4]

LIEF::runtime::Module::Module ( std::unique_ptr< details::Module > impl)

◆ Module() [3/4]

LIEF::runtime::Module::Module ( const Module & )
delete

◆ Module() [4/4]

LIEF::runtime::Module::Module ( Module && )
noexcept

Member Function Documentation

◆ classof()

constexpr bool LIEF::runtime::android::Module::classof ( const runtime::Module * )
inlinestaticconstexpr

◆ dlsym()

void * LIEF::runtime::android::Module::dlsym ( const std::string & name) const

Resolve the symbol from with the given name for the current module.

References LIEF::runtime::Module::name().

◆ from_handle()

std::unique_ptr< Module > LIEF::runtime::android::Module::from_handle ( void * H)
static

Instantiate a Module from the given dlopen handle.

◆ handle()

void * LIEF::runtime::android::Module::handle ( ) const

Return the dlopen handle for this library.

Return a nullptr if the function fails or if the handler can't be found

◆ parse_from_memory() [1/2]

std::unique_ptr< ELF::Binary > LIEF::runtime::android::Module::parse_from_memory ( ) const

Parse the ELF module from memory.

◆ parse_from_memory() [2/2]

std::unique_ptr< ELF::Binary > LIEF::runtime::android::Module::parse_from_memory ( const ELF::ParserConfig & config) const

Parse the ELF module from memory with the given configuration.

◆ parse_from_path() [1/2]

std::unique_ptr< ELF::Binary > LIEF::runtime::android::Module::parse_from_path ( ) const

Parse the ELF module from its path on the filesystem.

◆ parse_from_path() [2/2]

std::unique_ptr< ELF::Binary > LIEF::runtime::android::Module::parse_from_path ( const ELF::ParserConfig & config) const

Parse the ELF module from its path on the filesystem and given the parser configuration.


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