LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
LIEF::PE::Import Class Reference

Class that represents a PE import. More...

#include <Import.hpp>

Inheritance diagram for LIEF::PE::Import:
Inheritance graph
[legend]
Collaboration diagram for LIEF::PE::Import:
Collaboration graph
[legend]

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 (const Import &other)
 
 Import (Import &&other)
 
Importoperator= (Import &&other)
 
Importoperator= (const Import &other)
 
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 (const 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 (const 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 (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
 

Detailed Description

Class that represents a PE import.

Member Function Documentation

◆ accept()

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

Implements LIEF::Object.

◆ directory()

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

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

◆ 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()

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

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

◆ import_address_table_rva()

uint32_t LIEF::PE::Import::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.

Warning
This address could change when re-building the binary

◆ import_lookup_table_rva()

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

Return the relative virtual address of the import lookup table.

Warning
This address could change when re-building the binary

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