retdec
Public Member Functions | Protected Attributes | List of all members
PeLib::ComHeaderDirectory Class Reference

Class that handles the COM+ descriptor directory. More...

#include <ComHeaderDirectory.h>

Collaboration diagram for PeLib::ComHeaderDirectory:
Collaboration graph
[legend]

Public Member Functions

virtual ~ComHeaderDirectory ()=default
 
int read (ImageLoader &imageLoader)
 Read a file's COM+ runtime descriptor directory. More...
 
void rebuild (std::vector< std::uint8_t > &vBuffer) const
 Rebuild the COM+ descriptor. More...
 
unsigned int size () const
 Returns the size of the current COM+ descriptor. More...
 
int write (const std::string &strFilename, unsigned int dwOffset) const
 Writes the current COM+ descriptor directory to a file. More...
 
std::uint32_t getSizeOfHeader () const
 Get the COM+ descriptor's SizeOfHeader (cb) value. More...
 
std::uint16_t getMajorRuntimeVersion () const
 Get the COM+ descriptor's MajorRuntimeVersion value. More...
 
std::uint16_t getMinorRuntimeVersion () const
 Get the COM+ descriptor's MinorRuntimeVersion value. More...
 
std::uint32_t getMetaDataVa () const
 Get the COM+ descriptor's MetaData (Virtual Address) value. More...
 
std::uint32_t getMetaDataSize () const
 Get the COM+ descriptor's MetaData (Size) value. More...
 
std::uint32_t getFlags () const
 Get the COM+ descriptor's Flags value. More...
 
std::uint32_t getEntryPointToken () const
 Get the COM+ descriptor's EntryPointToken value. More...
 
std::uint32_t getResourcesVa () const
 Get the COM+ descriptor's Resources (Virtual Address) value. More...
 
std::uint32_t getResourcesSize () const
 Get the COM+ descriptor's Resources (Size) value. More...
 
std::uint32_t getStrongNameSignatureVa () const
 Get the COM+ descriptor's StrongNameSignature (Virtual Address) value. More...
 
std::uint32_t getStrongNameSignatureSize () const
 Get the COM+ descriptor's StrongNameSignature (Size) value. More...
 
std::uint32_t getCodeManagerTableVa () const
 Get the COM+ descriptor's CodeManagerTable (Virtual Address) value. More...
 
std::uint32_t getCodeManagerTableSize () const
 Get the COM+ descriptor's CodeManagerTable (Size) value. More...
 
std::uint32_t getVTableFixupsVa () const
 Get the COM+ descriptor's VTableFixup (Virtual Address) value. More...
 
std::uint32_t getVTableFixupsSize () const
 Get the COM+ descriptor's VTableFixup (Size) value. More...
 
std::uint32_t getExportAddressTableJumpsVa () const
 Get the COM+ descriptor's ExportAddressTable (Virtual Address) value. More...
 
std::uint32_t getExportAddressTableJumpsSize () const
 Get the COM+ descriptor's ExportAddressTable (Size) value. More...
 
std::uint32_t getManagedNativeHeaderVa () const
 Get the COM+ descriptor's ManagedNativeHeader (Virtual Address) value. More...
 
std::uint32_t getManagedNativeHeaderSize () const
 Get the COM+ descriptor's ManagedNativeHeader (Size) value. More...
 
void setSizeOfHeader (std::uint32_t dwValue)
 Change the COM+ descriptor's SizeOfHeader (cb) value. More...
 
void setMajorRuntimeVersion (std::uint16_t wValue)
 Change the COM+ descriptor's MajorRuntimeVersion value. More...
 
void setMinorRuntimeVersion (std::uint16_t wValue)
 Change the COM+ descriptor's MinorRuntimeVersion value. More...
 
void setMetaDataVa (std::uint32_t dwValue)
 Change the COM+ descriptor's MetaData (VirtualAddress) value. More...
 
void setMetaDataSize (std::uint32_t dwValue)
 Change the COM+ descriptor's MetaData (Size) value. More...
 
void setFlags (std::uint32_t dwValue)
 Change the COM+ descriptor's Flags value. More...
 
void setEntryPointToken (std::uint32_t dwValue)
 Change the COM+ descriptor's EntryPointToken value. More...
 
void setResourcesVa (std::uint32_t dwValue)
 Change the COM+ descriptor's Resources (VirtualAddress) value. More...
 
void setResourcesSize (std::uint32_t dwValue)
 Change the COM+ descriptor's Resources (Size) value. More...
 
void setStrongNameSignatureVa (std::uint32_t dwValue)
 Change the COM+ descriptor's StrongNameSignatureVa (VirtualAddress) value. More...
 
void setStrongNameSignagureSize (std::uint32_t dwValue)
 Change the COM+ descriptor's StrongNameSignatureVa (Size) value. More...
 
void setCodeManagerTableVa (std::uint32_t dwValue)
 Change the COM+ descriptor's CodeManagerTable (VirtualAddress) value. More...
 
void setCodeManagerTableSize (std::uint32_t dwValue)
 Change the COM+ descriptor's CodeManagerTable (Size) value. More...
 
void setVTableFixupsVa (std::uint32_t dwValue)
 Change the COM+ descriptor's VTableFixups (VirtualAddress) value. More...
 
void setVTableFixupsSize (std::uint32_t dwValue)
 Change the COM+ descriptor's VTableFixups (Size) value. More...
 
void setExportAddressTableJumpsVa (std::uint32_t dwValue)
 Change the COM+ descriptor's ExportAddressTableJumps (VirtualAddress) value. More...
 
void setExportAddressTableJumpsSize (std::uint32_t dwValue)
 Change the COM+ descriptor's ExportAddressTableJumps (Size) value. More...
 
void setManagedNativeHeaderVa (std::uint32_t dwValue)
 Change the COM+ descriptor's ManagedNativeHeader (VirtualAddress) value. More...
 
void setManagedNativeHeaderSize (std::uint32_t dwValue)
 Change the COM+ descriptor's ManagedNativeHeader (Size) value. More...
 

Protected Attributes

PELIB_IMAGE_COR20_HEADER m_ichComHeader
 The COM+ descriptor. More...
 

Detailed Description

Class that handles the COM+ descriptor directory.

This class handles the COM+ Descriptor directory which was added to PE files which work with the .NET runtime modules.

Constructor & Destructor Documentation

◆ ~ComHeaderDirectory()

virtual PeLib::ComHeaderDirectory::~ComHeaderDirectory ( )
virtualdefault

Member Function Documentation

◆ getCodeManagerTableSize()

std::uint32_t PeLib::ComHeaderDirectory::getCodeManagerTableSize ( ) const

Get the COM+ descriptor's CodeManagerTable (Size) value.

Returns
CodeManagerTable (Size) value of the current COM+ descriptor.

◆ getCodeManagerTableVa()

std::uint32_t PeLib::ComHeaderDirectory::getCodeManagerTableVa ( ) const

Get the COM+ descriptor's CodeManagerTable (Virtual Address) value.

Returns
CodeManagerTable (Virtual Address) value of the current COM+ descriptor.

◆ getEntryPointToken()

std::uint32_t PeLib::ComHeaderDirectory::getEntryPointToken ( ) const

Get the COM+ descriptor's EntryPointToken value.

Returns
EntryPointToken value of the current COM+ descriptor.

◆ getExportAddressTableJumpsSize()

std::uint32_t PeLib::ComHeaderDirectory::getExportAddressTableJumpsSize ( ) const

Get the COM+ descriptor's ExportAddressTable (Size) value.

Returns
ExportAddressTableJumps (Size) value of the current COM+ descriptor.

◆ getExportAddressTableJumpsVa()

std::uint32_t PeLib::ComHeaderDirectory::getExportAddressTableJumpsVa ( ) const

Get the COM+ descriptor's ExportAddressTable (Virtual Address) value.

Returns
ExportAddressTableJumps (Virtual Address) value of the current COM+ descriptor.

◆ getFlags()

std::uint32_t PeLib::ComHeaderDirectory::getFlags ( ) const

Get the COM+ descriptor's Flags value.

Returns
Flags value of the current COM+ descriptor.

◆ getMajorRuntimeVersion()

std::uint16_t PeLib::ComHeaderDirectory::getMajorRuntimeVersion ( ) const

Get the COM+ descriptor's MajorRuntimeVersion value.

Returns
MajorRuntimeVersion value of the current COM+ descriptor.

◆ getManagedNativeHeaderSize()

std::uint32_t PeLib::ComHeaderDirectory::getManagedNativeHeaderSize ( ) const

Get the COM+ descriptor's ManagedNativeHeader (Size) value.

Returns
ManagedNativeHeader (Size) value of the current COM+ descriptor.

◆ getManagedNativeHeaderVa()

std::uint32_t PeLib::ComHeaderDirectory::getManagedNativeHeaderVa ( ) const

Get the COM+ descriptor's ManagedNativeHeader (Virtual Address) value.

Returns
ManagedNativeHeader (Virtual Address) value of the current COM+ descriptor.

◆ getMetaDataSize()

std::uint32_t PeLib::ComHeaderDirectory::getMetaDataSize ( ) const

Get the COM+ descriptor's MetaData (Size) value.

Returns
MetaData (Size) value of the current COM+ descriptor.

◆ getMetaDataVa()

std::uint32_t PeLib::ComHeaderDirectory::getMetaDataVa ( ) const

Get the COM+ descriptor's MetaData (Virtual Address) value.

Returns
MetaData (Virtual Address) value of the current COM+ descriptor.

◆ getMinorRuntimeVersion()

std::uint16_t PeLib::ComHeaderDirectory::getMinorRuntimeVersion ( ) const

Get the COM+ descriptor's MinorRuntimeVersion value.

Returns
MinorRuntimeVersion value of the current COM+ descriptor.

◆ getResourcesSize()

std::uint32_t PeLib::ComHeaderDirectory::getResourcesSize ( ) const

Get the COM+ descriptor's Resources (Size) value.

Returns
Resources (Size) value of the current COM+ descriptor.

◆ getResourcesVa()

std::uint32_t PeLib::ComHeaderDirectory::getResourcesVa ( ) const

Get the COM+ descriptor's Resources (Virtual Address) value.

Returns
Resources (Virtual Address) value of the current COM+ descriptor.

◆ getSizeOfHeader()

std::uint32_t PeLib::ComHeaderDirectory::getSizeOfHeader ( ) const

Get the COM+ descriptor's SizeOfHeader (cb) value.

Returns
SizeOfHeader value of the current COM+ descriptor.

◆ getStrongNameSignatureSize()

std::uint32_t PeLib::ComHeaderDirectory::getStrongNameSignatureSize ( ) const

Get the COM+ descriptor's StrongNameSignature (Size) value.

Returns
StrongNameSignature (Size) value of the current COM+ descriptor.

◆ getStrongNameSignatureVa()

std::uint32_t PeLib::ComHeaderDirectory::getStrongNameSignatureVa ( ) const

Get the COM+ descriptor's StrongNameSignature (Virtual Address) value.

Returns
StrongNameSignature (Virtual Address) value of the current COM+ descriptor.

◆ getVTableFixupsSize()

std::uint32_t PeLib::ComHeaderDirectory::getVTableFixupsSize ( ) const

Get the COM+ descriptor's VTableFixup (Size) value.

Returns
VTableFixups (Size) value of the current COM+ descriptor.

◆ getVTableFixupsVa()

std::uint32_t PeLib::ComHeaderDirectory::getVTableFixupsVa ( ) const

Get the COM+ descriptor's VTableFixup (Virtual Address) value.

Returns
VTableFixups (Virtual Address) value of the current COM+ descriptor.

◆ read()

int PeLib::ComHeaderDirectory::read ( ImageLoader imageLoader)

Read a file's COM+ runtime descriptor directory.

Reads a file's COM+ descriptor.

Parameters
imageLoaderReference to the valid PE image loader

◆ rebuild()

void PeLib::ComHeaderDirectory::rebuild ( std::vector< std::uint8_t > &  vBuffer) const

Rebuild the COM+ descriptor.

Rebuilds the current COM+ descriptor.

Parameters
vBufferBuffer where the COM+ descriptor will be written to.

◆ setCodeManagerTableSize()

void PeLib::ComHeaderDirectory::setCodeManagerTableSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's CodeManagerTable (Size) value.

Parameters
dwValueNew value for the current CodeManagerTable (Size) value.

◆ setCodeManagerTableVa()

void PeLib::ComHeaderDirectory::setCodeManagerTableVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's CodeManagerTable (VirtualAddress) value.

Parameters
dwValueNew value for the current CodeManagerTable (VirtualAddress) value.

◆ setEntryPointToken()

void PeLib::ComHeaderDirectory::setEntryPointToken ( std::uint32_t  dwValue)

Change the COM+ descriptor's EntryPointToken value.

Parameters
dwValueNew value for the current EntryPointToken value.

◆ setExportAddressTableJumpsSize()

void PeLib::ComHeaderDirectory::setExportAddressTableJumpsSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's ExportAddressTableJumps (Size) value.

Parameters
dwValueNew value for the current ExportAddressTableJumps (Size) value.

◆ setExportAddressTableJumpsVa()

void PeLib::ComHeaderDirectory::setExportAddressTableJumpsVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's ExportAddressTableJumps (VirtualAddress) value.

Parameters
dwValueNew value for the current ExportAddressTableJumps (VirtualAddress) value.

◆ setFlags()

void PeLib::ComHeaderDirectory::setFlags ( std::uint32_t  dwValue)

Change the COM+ descriptor's Flags value.

Parameters
dwValueNew value for the current Flags value.

◆ setMajorRuntimeVersion()

void PeLib::ComHeaderDirectory::setMajorRuntimeVersion ( std::uint16_t  wValue)

Change the COM+ descriptor's MajorRuntimeVersion value.

Parameters
wValueNew value for the current MajorRuntimeVersion value.

◆ setManagedNativeHeaderSize()

void PeLib::ComHeaderDirectory::setManagedNativeHeaderSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's ManagedNativeHeader (Size) value.

Parameters
dwValueNew value for the current ManagedNativeHeader (Size) value.

◆ setManagedNativeHeaderVa()

void PeLib::ComHeaderDirectory::setManagedNativeHeaderVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's ManagedNativeHeader (VirtualAddress) value.

Parameters
dwValueNew value for the current ManagedNativeHeader (VirtualAddress) value.

◆ setMetaDataSize()

void PeLib::ComHeaderDirectory::setMetaDataSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's MetaData (Size) value.

Parameters
dwValueNew value for the current MetaData (Size) value.

◆ setMetaDataVa()

void PeLib::ComHeaderDirectory::setMetaDataVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's MetaData (VirtualAddress) value.

Parameters
dwValueNew value for the current MetaData (VirtualAddress) value.

◆ setMinorRuntimeVersion()

void PeLib::ComHeaderDirectory::setMinorRuntimeVersion ( std::uint16_t  wValue)

Change the COM+ descriptor's MinorRuntimeVersion value.

Parameters
wValueNew value for the current MinorRuntimeVersion value.

◆ setResourcesSize()

void PeLib::ComHeaderDirectory::setResourcesSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's Resources (Size) value.

Parameters
dwValueNew value for the current Resources (Size) value.

◆ setResourcesVa()

void PeLib::ComHeaderDirectory::setResourcesVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's Resources (VirtualAddress) value.

Parameters
dwValueNew value for the current Resources (VirtualAddress) value.

◆ setSizeOfHeader()

void PeLib::ComHeaderDirectory::setSizeOfHeader ( std::uint32_t  dwValue)

Change the COM+ descriptor's SizeOfHeader (cb) value.

Parameters
dwValueNew value for the current SizeOfHeader (cb) value.

◆ setStrongNameSignagureSize()

void PeLib::ComHeaderDirectory::setStrongNameSignagureSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's StrongNameSignatureVa (Size) value.

Parameters
dwValueNew value for the current StrongNameSignature (Size) value.

◆ setStrongNameSignatureVa()

void PeLib::ComHeaderDirectory::setStrongNameSignatureVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's StrongNameSignatureVa (VirtualAddress) value.

Parameters
dwValueNew value for the current StrongNameSignature (VirtualAddress) value.

◆ setVTableFixupsSize()

void PeLib::ComHeaderDirectory::setVTableFixupsSize ( std::uint32_t  dwValue)

Change the COM+ descriptor's VTableFixups (Size) value.

Parameters
dwValueNew value for the current VTableFixups (Size) value.

◆ setVTableFixupsVa()

void PeLib::ComHeaderDirectory::setVTableFixupsVa ( std::uint32_t  dwValue)

Change the COM+ descriptor's VTableFixups (VirtualAddress) value.

Parameters
dwValueNew value for the current VTableFixups (VirtualAddress) value.

◆ size()

unsigned int PeLib::ComHeaderDirectory::size ( ) const

Returns the size of the current COM+ descriptor.

Returns
Size in bytes.

◆ write()

int PeLib::ComHeaderDirectory::write ( const std::string &  strFilename,
unsigned int  dwOffset 
) const

Writes the current COM+ descriptor directory to a file.

Parameters
strFilenameName of the file.
dwOffsetFile offset the COM+ descriptor will be written to.

Member Data Documentation

◆ m_ichComHeader

PELIB_IMAGE_COR20_HEADER PeLib::ComHeaderDirectory::m_ichComHeader
protected

The COM+ descriptor.


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