LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
LIEF::PE::Import Class Reference

Class that represents a PE import. More...

#include <Import.hpp>

Inheritance diagram for LIEF::PE::Import:
Collaboration diagram for LIEF::PE::Import:

Public Types

using entries_t = std::vector<ImportEntry>
 
using it_entries = ref_iterator<entries_t&>
 
using it_const_entries = const_ref_iterator<const entries_t&>
 
- 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

 Import (const details::pe_import &import)
 
 Import (std::string name)
 
 Import ()=default
 
 ~Import () override=default
 
 Import (const Import &other)=default
 
 Import (Import &&other) noexcept=default
 
Importoperator= (Import &&other) noexcept=default
 
Importoperator= (const Import &other)=default
 
uint32_t forwarder_chain () const
 The index of the first forwarder reference.
 
uint32_t timedatestamp () const
 The stamp that is set to zero until the image is bound. After the image is bound, this field is set to the time/data stamp of the DLL.
 
it_const_entries entries () const
 Iterator over the PE::ImportEntry.
 
it_entries entries ()
 
uint32_t import_address_table_rva () const
 The RVA of the import address table (IAT). The content of this table is identical to the content of the Import Lookup Table (ILT) until the image is bound.
 
uint32_t import_lookup_table_rva () const
 Return the relative virtual address of the import lookup table.
 
result< uint32_t > get_function_rva_from_iat (const std::string &function) const
 Return the Function's RVA from the import address table (IAT)
 
ImportEntryget_entry (const std::string &name)
 Return the imported function with the given name.
 
const ImportEntryget_entry (const std::string &name) const
 
const std::string & name () const
 Return the library's name (e.g. kernel32.dll)
 
void name (std::string name)
 Change the current import name.
 
DataDirectorydirectory ()
 Return the PE::DataDirectory associated with this import. It should be the one at index PE::DataDirectory::TYPES::IMPORT_TABLE.
 
const DataDirectorydirectory () const
 
DataDirectoryiat_directory ()
 Return the PE::DataDirectory associated associated with the IAT. It should be the one at index PE::DataDirectory::TYPES::IAT.
 
const DataDirectoryiat_directory () const
 
ImportEntryadd_entry (ImportEntry entry)
 Add a new import entry (i.e. an imported function)
 
ImportEntryadd_entry (const std::string &name)
 Add a new import entry with the given name (i.e. an imported function)
 
void import_lookup_table_rva (uint32_t rva)
 
void import_address_table_rva (uint32_t rva)
 
void accept (Visitor &visitor) const 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 PE import.

Member Typedef Documentation

◆ entries_t

◆ it_const_entries

◆ it_entries

Constructor & Destructor Documentation

◆ Import() [1/5]

LIEF::PE::Import::Import ( const details::pe_import & import)

◆ Import() [2/5]

LIEF::PE::Import::Import ( std::string name)
inline

◆ Import() [3/5]

LIEF::PE::Import::Import ( )
default

◆ ~Import()

LIEF::PE::Import::~Import ( )
overridedefault

◆ Import() [4/5]

LIEF::PE::Import::Import ( const Import & other)
default

◆ Import() [5/5]

LIEF::PE::Import::Import ( Import && other)
defaultnoexcept

Member Function Documentation

◆ accept()

void LIEF::PE::Import::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ add_entry() [1/2]

ImportEntry & LIEF::PE::Import::add_entry ( const std::string & name)
inline

Add a new import entry with the given name (i.e. an imported function)

◆ add_entry() [2/2]

ImportEntry & LIEF::PE::Import::add_entry ( ImportEntry entry)
inline

Add a new import entry (i.e. an imported function)

◆ directory() [1/2]

DataDirectory * LIEF::PE::Import::directory ( )
inline

Return the PE::DataDirectory associated with this import. It should be the one at index PE::DataDirectory::TYPES::IMPORT_TABLE.

If the data directory can't be found, return a nullptr

◆ directory() [2/2]

const DataDirectory * LIEF::PE::Import::directory ( ) const
inline

◆ entries() [1/2]

it_entries LIEF::PE::Import::entries ( )
inline

◆ entries() [2/2]

it_const_entries LIEF::PE::Import::entries ( ) const
inline

Iterator over the PE::ImportEntry.

◆ forwarder_chain()

uint32_t LIEF::PE::Import::forwarder_chain ( ) const
inline

The index of the first forwarder reference.

◆ get_entry() [1/2]

ImportEntry * LIEF::PE::Import::get_entry ( const std::string & name)
inline

Return the imported function with the given name.

◆ get_entry() [2/2]

const ImportEntry * LIEF::PE::Import::get_entry ( const std::string & name) const

◆ get_function_rva_from_iat()

result< uint32_t > LIEF::PE::Import::get_function_rva_from_iat ( const std::string & function) const

Return the Function's RVA from the import address table (IAT)

Warning
This address could change when re-building the binary

◆ iat_directory() [1/2]

DataDirectory * LIEF::PE::Import::iat_directory ( )
inline

Return the PE::DataDirectory associated associated with the IAT. It should be the one at index PE::DataDirectory::TYPES::IAT.

If the data directory can't be found, return a nullptr

◆ iat_directory() [2/2]

const DataDirectory * LIEF::PE::Import::iat_directory ( ) const
inline

◆ import_address_table_rva() [1/2]

uint32_t LIEF::PE::Import::import_address_table_rva ( ) const
inline

The RVA of the import address table (IAT). The content of this table is identical to the content of the Import Lookup Table (ILT) until the image is bound.

Warning
This address could change when re-building the binary

◆ import_address_table_rva() [2/2]

void LIEF::PE::Import::import_address_table_rva ( uint32_t rva)
inline

◆ import_lookup_table_rva() [1/2]

uint32_t LIEF::PE::Import::import_lookup_table_rva ( ) const
inline

Return the relative virtual address of the import lookup table.

Warning
This address could change when re-building the binary

◆ import_lookup_table_rva() [2/2]

void LIEF::PE::Import::import_lookup_table_rva ( uint32_t rva)
inline

◆ name() [1/2]

const std::string & LIEF::PE::Import::name ( ) const
inline

Return the library's name (e.g. kernel32.dll)

◆ name() [2/2]

void LIEF::PE::Import::name ( std::string name)
inline

Change the current import name.

◆ operator=() [1/2]

Import & LIEF::PE::Import::operator= ( const Import & other)
default

◆ operator=() [2/2]

Import & LIEF::PE::Import::operator= ( Import && other)
defaultnoexcept

◆ timedatestamp()

uint32_t LIEF::PE::Import::timedatestamp ( ) const
inline

The stamp that is set to zero until the image is bound. After the image is bound, this field is set to the time/data stamp of the DLL.


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