RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Microsoft::PEFormat::ImportsSection Class Reference

Represents an .idata section for imported DLLs in the binary. More...

#include <peexe.h>

Inheritance diagram for Microsoft::PEFormat::ImportsSection:
Microsoft::PEFormat::Section COFF::COFFFormat::Section

Public Member Functions

bool IsPresent () const
 
void Generate (PEFormat &fmt)
 
void ReadSectionData (Linker::Reader &rd, const PEFormat &fmt) override
 Reads the contents of the section in the file.
 
void WriteSectionData (Linker::Writer &wr, const PEFormat &fmt) const override
 Writes the contents of the section to the file.
 
uint32_t ImageSize (const PEFormat &fmt) const override
 Retrieves the size of the section, as stored in the file.
 
uint32_t MemorySize (const PEFormat &fmt) const override
 Retrieves the size of the section, as loaded into memory.
 
void ReadSectionData (Linker::Reader &rd, const COFFFormat &coff_format) override
 
virtual void ReadSectionData (Linker::Reader &rd, const PEFormat &fmt)
 Reads the contents of the section in the file.
 
void WriteSectionData (Linker::Writer &wr, const COFFFormat &coff_format) const override
 
virtual void WriteSectionData (Linker::Writer &wr, const PEFormat &fmt) const
 Writes the contents of the section to the file.
 
uint32_t ImageSize (const COFFFormat &coff_format) const override
 
virtual uint32_t ImageSize (const PEFormat &fmt) const
 Retrieves the size of the section, as stored in the file.
 
- Public Member Functions inherited from Microsoft::PEFormat::Section
 Section (uint32_t flags=0, std::shared_ptr< Linker::Image > image=nullptr)
 
constexpr offset_t & virtual_size ()
 The COFF s_paddr field is redefined to contain the size of the section as loaded into memory.
 
constexpr const offset_t & virtual_size () const
 The COFF s_paddr field is redefined to contain the size of the section as loaded into memory.
 
void ReadSectionData (Linker::Reader &rd, const COFFFormat &coff_format) override
 
void WriteSectionData (Linker::Writer &wr, const COFFFormat &coff_format) const override
 
uint32_t ImageSize (const COFFFormat &coff_format) const override
 
- Public Member Functions inherited from COFF::COFFFormat::Section
void Clear ()
 
 Section (uint32_t flags=0, std::shared_ptr< Linker::Image > image=nullptr)
 
void ReadSectionHeader (Linker::Reader &rd, COFFVariantType coff_variant)
 Reads an entry in the section header table.
 
void WriteSectionHeader (Linker::Writer &wr, COFFVariantType coff_variant)
 Writes an entry in the section header table.
 
virtual uint32_t ImageSize (const COFFFormat &coff_format) const
 Retrieves the size of the section (for PE, the size of the section as stored in the file)
 
virtual void ReadSectionData (Linker::Reader &rd, const COFFFormat &coff_format)
 Reads the section contents from a stream, can be overloaded by subclasses.
 
virtual void WriteSectionData (Linker::Writer &wr, const COFFFormat &coff_format) const
 Writes the section contents to a stream, can be overloaded by subclasses.
 

Public Attributes

std::vector< ImportDirectorydirectories
 The sequence of all import directories, one for each DLL.
 
std::map< std::string, size_t > library_indexes
 A convenience field to access the DLL index by its name.
 
uint32_t address_table_rva
 Relative virtual address of the import address table, to be stored in the optional header.
 
uint32_t address_table_size
 Size of the import address table, to be stored in the optional header.
 
- Public Attributes inherited from COFF::COFFFormat::Section
std::string name
 The name of the section (COFF name: s_name)
 
offset_t physical_address = 0
 The physical address of the section (expected to be identical to the virtual address) (COFF name: s_paddr)
 
offset_t address = 0
 The virtual address of the section (COFF name: s_vaddr)
 
offset_t size = 0
 The size of the section (COFF name: s_size)
 
offset_t section_pointer = 0
 Offset of stored image data from COFF header start (COFF name: s_scnptr)
 
offset_t relocation_pointer = 0
 Offset to COFF relocations (COFF name: s_relptr)
 
offset_t line_number_pointer = 0
 unused (COFF name: s_lnnoptr)
 
uint32_t relocation_count = 0
 COFF relocation count (COFF name: s_nreloc)
 
uint32_t line_number_count = 0
 unused (COFF name: s_nlnno)
 
uint32_t flags = 0
 COFF section flags, determines the type of the section (text, data, bss, etc.) (COFF name: s_flags)
 
uint16_t memory_page_number = 0
 TICOFF specific field.
 
std::shared_ptr< Linker::Imageimage
 The stored image data.
 
std::vector< std::unique_ptr< Relocation > > relocations
 Collection of COFF relocations.
 

Additional Inherited Members

- Static Public Attributes inherited from Microsoft::PEFormat::Section
static constexpr uint32_t DISCARDABLE = 0x02000000
 The section is discardable.
 
static constexpr uint32_t EXECUTE = 0x20000000
 The section contains executable code.
 
static constexpr uint32_t READ = 0x40000000
 The section contents are readable to the program.
 
static constexpr uint32_t WRITE = 0x80000000
 The section contents are writable to the program.
 
- Static Public Attributes inherited from COFF::COFFFormat::Section
static constexpr uint32_t TEXT = 0x0020
 COFF section flag: Section contains executable (COFF name: STYP_TEXT)
 
static constexpr uint32_t DATA = 0x0040
 COFF section flag: Section contains initialized data (COFF name: STYP_DATA)
 
static constexpr uint32_t BSS = 0x0080
 COFF section flag: Section contains uninitialized data (COFF name: STYP_BSS)
 

Detailed Description

Represents an .idata section for imported DLLs in the binary.

Member Function Documentation

◆ ImageSize() [1/2]

uint32_t PEFormat::Section::ImageSize ( const PEFormat & fmt) const
virtual

Retrieves the size of the section, as stored in the file.

Reimplemented from Microsoft::PEFormat::Section.

◆ ImageSize() [2/2]

uint32_t PEFormat::ImportsSection::ImageSize ( const PEFormat & fmt) const
overridevirtual

Retrieves the size of the section, as stored in the file.

Reimplemented from Microsoft::PEFormat::Section.

◆ MemorySize()

uint32_t PEFormat::ImportsSection::MemorySize ( const PEFormat & fmt) const
overridevirtual

Retrieves the size of the section, as loaded into memory.

Reimplemented from Microsoft::PEFormat::Section.

◆ ReadSectionData() [1/2]

void PEFormat::Section::ReadSectionData ( Linker::Reader & rd,
const PEFormat & fmt )
virtual

Reads the contents of the section in the file.

Reimplemented from Microsoft::PEFormat::Section.

◆ ReadSectionData() [2/2]

void PEFormat::ImportsSection::ReadSectionData ( Linker::Reader & rd,
const PEFormat & fmt )
overridevirtual

Reads the contents of the section in the file.

Reimplemented from Microsoft::PEFormat::Section.

◆ WriteSectionData() [1/2]

void PEFormat::Section::WriteSectionData ( Linker::Writer & wr,
const PEFormat & fmt ) const
virtual

Writes the contents of the section to the file.

Reimplemented from Microsoft::PEFormat::Section.

◆ WriteSectionData() [2/2]

void PEFormat::ImportsSection::WriteSectionData ( Linker::Writer & wr,
const PEFormat & fmt ) const
overridevirtual

Writes the contents of the section to the file.

Reimplemented from Microsoft::PEFormat::Section.


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