LIEF: Library to Instrument Executable Formats Version 0.17.0
|
Class which represents the not-so-documented rich header. More...
#include <RichHeader.hpp>
Public Types | |
using | entries_t = std::vector<RichEntry> |
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 | |
RichHeader ()=default | |
RichHeader (const RichHeader &)=default | |
RichHeader & | operator= (const RichHeader &)=default |
~RichHeader () override=default | |
uint32_t | key () const |
Key used to encode the header (xor operation) | |
it_entries | entries () |
Return an iterator over the PE::RichEntry within the header. | |
it_const_entries | entries () const |
void | key (uint32_t key) |
void | add_entry (RichEntry entry) |
Add a new PE::RichEntry. | |
void | add_entry (uint16_t id, uint16_t build_id, uint32_t count) |
Add a new entry given the id, build_id and count. | |
std::vector< uint8_t > | raw () const |
The raw structure of the Rich header without xor-encoding. | |
std::vector< uint8_t > | raw (uint32_t xor_key) const |
Given this rich header, this function re-computes the raw bytes of the structure with the provided xor-key. | |
std::vector< uint8_t > | hash (ALGORITHMS algo) const |
Compute the hash of the decoded rich header structure with the given hash algorithm. | |
std::vector< uint8_t > | hash (ALGORITHMS algo, uint32_t xor_key) const |
Compute the hash of the rich header structure encoded with the provided key. | |
void | accept (Visitor &visitor) const override |
Public Member Functions inherited from LIEF::Object | |
Object () | |
Object (const Object &other) | |
Object & | operator= (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 |
virtual | ~Object () |
Static Public Attributes | |
static constexpr uint8_t | RICH_MAGIC [] = {'R', 'i', 'c', 'h'} |
static constexpr uint32_t | RICH_MAGIC_INT = 0x68636952 |
static constexpr uint32_t | DANS_MAGIC_NUMBER = 0x536E6144 |
Class which represents the not-so-documented rich header.
This structure is usually located at the end of the Binary::dos_stub and contains information about the build environment. It is generated by the Microsoft linker link.exe
and there are no options to disable or remove this information.
using LIEF::PE::RichHeader::entries_t = std::vector<RichEntry> |
using LIEF::PE::RichHeader::it_const_entries = const_ref_iterator<const entries_t&> |
|
default |
|
default |
|
overridedefault |
|
overridevirtual |
Implements LIEF::Object.
|
inline |
Add a new PE::RichEntry.
|
inline |
Add a new entry given the id, build_id and count.
|
inline |
Return an iterator over the PE::RichEntry within the header.
|
inline |
|
inline |
Compute the hash of the decoded rich header structure with the given hash algorithm.
References LIEF::hash().
std::vector< uint8_t > LIEF::PE::RichHeader::hash | ( | ALGORITHMS | algo, |
uint32_t | xor_key ) const |
Compute the hash of the rich header structure encoded with the provided key.
|
inline |
Key used to encode the header (xor operation)
|
inline |
|
default |
|
inline |
The raw structure of the Rich header without xor-encoding.
This function is equivalent as calling RichHeader::raw(uint32_t) with a xor_key
set to 0
std::vector< uint8_t > LIEF::PE::RichHeader::raw | ( | uint32_t | xor_key | ) | const |
Given this rich header, this function re-computes the raw bytes of the structure with the provided xor-key.
You can access the decoded data's structure with the xor_key
set to 0
[in] | xor_key | The key to use for the xor-encoding (can be 0) |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |