LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::COFF::Header Class Referenceabstract

Class that represents the COFF header. It is subclassed by LIEF::COFF::RegularHeader and LIEF::COFF::BigObjHeader for normal vs /bigobj files. More...

#include <Header.hpp>

Inheritance diagram for LIEF::COFF::Header:

Public Types

enum class  KIND { UNKNOWN = 0 , REGULAR , BIGOBJ }
 
using MACHINE_TYPES = LIEF::PE::Header::MACHINE_TYPES
 The different architectures (mirrored from PE)
 

Public Member Functions

 Header ()=default
 
 Header (KIND kind)
 
Headeroperator= (const Header &)=default
 
 Header (const Header &)=default
 
Headeroperator= (Header &&)=default
 
 Header (Header &&)=default
 
virtual std::unique_ptr< Headerclone () const =0
 
KIND kind () const
 The type of this header: whether it is regular or using the /bigobj format.
 
MACHINE_TYPES machine () const
 The machine type targeted by this COFF.
 
uint32_t nb_sections () const
 The number of sections.
 
uint32_t pointerto_symbol_table () const
 Offset of the symbols table.
 
uint32_t nb_symbols () const
 Number of symbols (including auxiliary symbols)
 
uint32_t timedatestamp () const
 Timestamp when the COFF has been generated.
 
void machine (MACHINE_TYPES machine)
 
void nb_sections (uint32_t value)
 
void pointerto_symbol_table (uint32_t value)
 
void nb_symbols (uint32_t value)
 
void timedatestamp (uint32_t value)
 
virtual std::string to_string () const
 
template<class T >
const T * as () const
 
virtual ~Header ()=default
 

Static Public Member Functions

static std::unique_ptr< Headercreate (BinaryStream &stream)
 Create a header from the given stream.
 
static std::unique_ptr< Headercreate (BinaryStream &stream, KIND kind)
 

Detailed Description

Class that represents the COFF header. It is subclassed by LIEF::COFF::RegularHeader and LIEF::COFF::BigObjHeader for normal vs /bigobj files.

Member Typedef Documentation

◆ MACHINE_TYPES

The different architectures (mirrored from PE)

Member Enumeration Documentation

◆ KIND

enum class LIEF::COFF::Header::KIND
strong
Enumerator
UNKNOWN 
REGULAR 
BIGOBJ 

Constructor & Destructor Documentation

◆ Header() [1/4]

LIEF::COFF::Header::Header ( )
default

◆ Header() [2/4]

LIEF::COFF::Header::Header ( KIND kind)
inline

◆ Header() [3/4]

LIEF::COFF::Header::Header ( const Header & )
default

◆ Header() [4/4]

LIEF::COFF::Header::Header ( Header && )
default

◆ ~Header()

virtual LIEF::COFF::Header::~Header ( )
virtualdefault

Member Function Documentation

◆ as()

template<class T >
const T * LIEF::COFF::Header::as ( ) const
inline

◆ clone()

virtual std::unique_ptr< Header > LIEF::COFF::Header::clone ( ) const
pure virtual

◆ create() [1/2]

static std::unique_ptr< Header > LIEF::COFF::Header::create ( BinaryStream & stream)
static

Create a header from the given stream.

◆ create() [2/2]

static std::unique_ptr< Header > LIEF::COFF::Header::create ( BinaryStream & stream,
KIND kind )
static

◆ kind()

KIND LIEF::COFF::Header::kind ( ) const
inline

The type of this header: whether it is regular or using the /bigobj format.

Referenced by LIEF::COFF::BigObjHeader::classof(), and LIEF::COFF::RegularHeader::classof().

◆ machine() [1/2]

MACHINE_TYPES LIEF::COFF::Header::machine ( ) const
inline

The machine type targeted by this COFF.

◆ machine() [2/2]

void LIEF::COFF::Header::machine ( MACHINE_TYPES machine)
inline

◆ nb_sections() [1/2]

uint32_t LIEF::COFF::Header::nb_sections ( ) const
inline

The number of sections.

◆ nb_sections() [2/2]

void LIEF::COFF::Header::nb_sections ( uint32_t value)
inline

◆ nb_symbols() [1/2]

uint32_t LIEF::COFF::Header::nb_symbols ( ) const
inline

Number of symbols (including auxiliary symbols)

◆ nb_symbols() [2/2]

void LIEF::COFF::Header::nb_symbols ( uint32_t value)
inline

◆ operator=() [1/2]

Header & LIEF::COFF::Header::operator= ( const Header & )
default

◆ operator=() [2/2]

Header & LIEF::COFF::Header::operator= ( Header && )
default

◆ pointerto_symbol_table() [1/2]

uint32_t LIEF::COFF::Header::pointerto_symbol_table ( ) const
inline

Offset of the symbols table.

◆ pointerto_symbol_table() [2/2]

void LIEF::COFF::Header::pointerto_symbol_table ( uint32_t value)
inline

◆ timedatestamp() [1/2]

uint32_t LIEF::COFF::Header::timedatestamp ( ) const
inline

Timestamp when the COFF has been generated.

◆ timedatestamp() [2/2]

void LIEF::COFF::Header::timedatestamp ( uint32_t value)
inline

◆ to_string()

virtual std::string LIEF::COFF::Header::to_string ( ) const
virtual

Reimplemented in LIEF::COFF::BigObjHeader, and LIEF::COFF::RegularHeader.

Referenced by operator<<.


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