Skip to main content

RichHeader

Struct RichHeader 

Source
pub struct RichHeader<'a> {
    pub key: u32,
    pub data: &'a [u8],
    pub padding_size: usize,
    pub start_offset: u32,
    pub end_offset: u32,
}
Expand description

The Rich header is a undocumented header that is used to store information about the build environment.

The Rich Header first appeared in Visual Studio 6.0 and contains: a product identifier, build number, and the number of times it was used during the build process.

Fields§

§key: u32

Key is 32-bit value used for XOR encrypt/decrypt fields

§data: &'a [u8]

The Rich header data with the padding.

§padding_size: usize

Padding bytes at the prologue of Self::data

§start_offset: u32

Start offset of the Rich header.

§end_offset: u32

End offset of the Rich header.

Implementations§

Source§

impl<'a> RichHeader<'a>

Source

pub fn parse(bytes: &'a [u8]) -> Result<Option<Self>>

Parse the rich header from the given bytes.

To decode the Rich header,

  • First locate the Rich marker and the subsequent 32-bit encryption key.
  • Then, work backwards from the Rich marker, XORing the key with the stored 32-bit values until you decode the DanS marker.

Between these markers, you’ll find pairs of 32-bit values:

  • the first indicates the Microsoft tool used, and
  • the second shows the count of linked object files made with that tool.
  • The upper 16 bits of the tool ID describe the tool type,
  • while the lower 16 bits specify the tool’s build version.
Source

pub fn metadatas(&self) -> RichMetadataIterator<'a>

Returns RichMetadataIterator iterator for RichMetadata

Trait Implementations§

Source§

impl<'a> Clone for RichHeader<'a>

Source§

fn clone(&self) -> RichHeader<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for RichHeader<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for RichHeader<'a>

Source§

fn default() -> RichHeader<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for RichHeader<'a>

Source§

fn eq(&self, other: &RichHeader<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Copy for RichHeader<'a>

Source§

impl<'a> StructuralPartialEq for RichHeader<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RichHeader<'a>

§

impl<'a> RefUnwindSafe for RichHeader<'a>

§

impl<'a> Send for RichHeader<'a>

§

impl<'a> Sync for RichHeader<'a>

§

impl<'a> Unpin for RichHeader<'a>

§

impl<'a> UnsafeUnpin for RichHeader<'a>

§

impl<'a> UnwindSafe for RichHeader<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.