retdec
Public Member Functions | Protected Attributes | List of all members
PeLib::PeFile Class Referenceabstract

#include <PeFile.h>

Inheritance diagram for PeLib::PeFile:
Inheritance graph
[legend]
Collaboration diagram for PeLib::PeFile:
Collaboration graph
[legend]

Public Member Functions

virtual ~PeFile ()
 
virtual std::string getFileName () const =0
 Returns the name of the current file. More...
 
virtual void setFileName (const std::string &strFilename)=0
 Changes the name of the current file. More...
 
virtual int readExportDirectory ()=0
 Reads the export directory of the current file from disc. More...
 
virtual int readImportDirectory ()=0
 Reads the import directory of the current file from disc. More...
 
virtual int readBoundImportDirectory ()=0
 Reads the bound import directory of the current file from disc. More...
 
virtual int readResourceDirectory ()=0
 Reads the resource directory of the current file from disc. More...
 
virtual int readRelocationsDirectory ()=0
 Reads the relocations directory of the current file from disc. More...
 
virtual int readComHeaderDirectory ()=0
 Reads the COM+ descriptor directory of the current file from disc. More...
 
virtual int readIatDirectory ()=0
 Reads the IAT directory of the current file from disc. More...
 
virtual int readDebugDirectory ()=0
 Reads the Debug directory of the current file. More...
 
virtual int readTlsDirectory ()=0
 Reads the TLS directory of the current file. More...
 
virtual int readRichHeader (std::size_t offset, std::size_t size, bool ignoreInvalidKey=false)=0
 Reads rich header of the current file. More...
 
virtual int readCoffSymbolTable (ByteBuffer &fileData)=0
 Reads the COFF symbol table of the current file. More...
 
virtual int readDelayImportDirectory ()=0
 Reads delay import directory of the current file. More...
 
virtual int readSecurityDirectory ()=0
 Reads security directory of the current file. More...
 
virtual LoaderError loaderError () const =0
 Returns a loader error, if there was any. More...
 
virtual unsigned int getBits () const =0
 
const ImageLoaderimageLoader () const
 Accessor function for the image loader. More...
 
ImageLoaderimageLoader ()
 Accessor function for the MZ header. More...
 
const RichHeaderrichHeader () const
 Accessor function for the Rich header. More...
 
RichHeaderrichHeader ()
 Accessor function for the Rich header. More...
 
const CoffSymbolTablecoffSymTab () const
 Accessor function for the COFF symbol table. More...
 
CoffSymbolTablecoffSymTab ()
 Accessor function for the COFF symbol table. More...
 
const SecurityDirectorysecurityDir () const
 Accessor function for the security directory. More...
 
SecurityDirectorysecurityDir ()
 Accessor function for the security directory. More...
 

Protected Attributes

std::string m_filename
 Name of the current file. More...
 
ImageLoader m_imageLoader
 
RichHeader m_richheader
 Rich header of the current file. More...
 
CoffSymbolTable m_coffsymtab
 Symbol table of the current file. More...
 
SecurityDirectory m_secdir
 Security directory of the current file. More...
 

Detailed Description

This class represents the common structures of PE and PE+ files.

Constructor & Destructor Documentation

◆ ~PeFile()

PeLib::PeFile::~PeFile ( )
virtual

Member Function Documentation

◆ coffSymTab() [1/2]

CoffSymbolTable & PeLib::PeFile::coffSymTab ( )

Accessor function for the COFF symbol table.

◆ coffSymTab() [2/2]

const CoffSymbolTable & PeLib::PeFile::coffSymTab ( ) const

Accessor function for the COFF symbol table.

◆ getBits()

virtual unsigned int PeLib::PeFile::getBits ( ) const
pure virtual

Implemented in PeLib::PeFileT.

◆ getFileName()

virtual std::string PeLib::PeFile::getFileName ( ) const
pure virtual

Returns the name of the current file.

Implemented in PeLib::PeFileT.

◆ imageLoader() [1/2]

ImageLoader & PeLib::PeFile::imageLoader ( )

Accessor function for the MZ header.

Returns
A reference to the file's image loader.

◆ imageLoader() [2/2]

const ImageLoader & PeLib::PeFile::imageLoader ( ) const

Accessor function for the image loader.

Returns
A reference to the file's image loader.

◆ loaderError()

virtual LoaderError PeLib::PeFile::loaderError ( ) const
pure virtual

Returns a loader error, if there was any.

Implemented in PeLib::PeFileT.

◆ readBoundImportDirectory()

virtual int PeLib::PeFile::readBoundImportDirectory ( )
pure virtual

Reads the bound import directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readCoffSymbolTable()

virtual int PeLib::PeFile::readCoffSymbolTable ( ByteBuffer fileData)
pure virtual

Reads the COFF symbol table of the current file.

Implemented in PeLib::PeFileT.

◆ readComHeaderDirectory()

virtual int PeLib::PeFile::readComHeaderDirectory ( )
pure virtual

Reads the COM+ descriptor directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readDebugDirectory()

virtual int PeLib::PeFile::readDebugDirectory ( )
pure virtual

Reads the Debug directory of the current file.

Implemented in PeLib::PeFileT.

◆ readDelayImportDirectory()

virtual int PeLib::PeFile::readDelayImportDirectory ( )
pure virtual

Reads delay import directory of the current file.

Implemented in PeLib::PeFileT.

◆ readExportDirectory()

virtual int PeLib::PeFile::readExportDirectory ( )
pure virtual

Reads the export directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readIatDirectory()

virtual int PeLib::PeFile::readIatDirectory ( )
pure virtual

Reads the IAT directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readImportDirectory()

virtual int PeLib::PeFile::readImportDirectory ( )
pure virtual

Reads the import directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readRelocationsDirectory()

virtual int PeLib::PeFile::readRelocationsDirectory ( )
pure virtual

Reads the relocations directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readResourceDirectory()

virtual int PeLib::PeFile::readResourceDirectory ( )
pure virtual

Reads the resource directory of the current file from disc.

Implemented in PeLib::PeFileT.

◆ readRichHeader()

virtual int PeLib::PeFile::readRichHeader ( std::size_t  offset,
std::size_t  size,
bool  ignoreInvalidKey = false 
)
pure virtual

Reads rich header of the current file.

Implemented in PeLib::PeFileT.

◆ readSecurityDirectory()

virtual int PeLib::PeFile::readSecurityDirectory ( )
pure virtual

Reads security directory of the current file.

Implemented in PeLib::PeFileT.

◆ readTlsDirectory()

virtual int PeLib::PeFile::readTlsDirectory ( )
pure virtual

Reads the TLS directory of the current file.

Implemented in PeLib::PeFileT.

◆ richHeader() [1/2]

RichHeader & PeLib::PeFile::richHeader ( )

Accessor function for the Rich header.

◆ richHeader() [2/2]

const RichHeader & PeLib::PeFile::richHeader ( ) const

Accessor function for the Rich header.

◆ securityDir() [1/2]

SecurityDirectory & PeLib::PeFile::securityDir ( )

Accessor function for the security directory.

◆ securityDir() [2/2]

const SecurityDirectory & PeLib::PeFile::securityDir ( ) const

Accessor function for the security directory.

◆ setFileName()

virtual void PeLib::PeFile::setFileName ( const std::string &  strFilename)
pure virtual

Changes the name of the current file.

Implemented in PeLib::PeFileT.

Member Data Documentation

◆ m_coffsymtab

CoffSymbolTable PeLib::PeFile::m_coffsymtab
protected

Symbol table of the current file.

◆ m_filename

std::string PeLib::PeFile::m_filename
protected

Name of the current file.

◆ m_imageLoader

ImageLoader PeLib::PeFile::m_imageLoader
protected

◆ m_richheader

RichHeader PeLib::PeFile::m_richheader
protected

Rich header of the current file.

◆ m_secdir

SecurityDirectory PeLib::PeFile::m_secdir
protected

Security directory of the current file.


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