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: u32Key is 32-bit value used for XOR encrypt/decrypt fields
data: &'a [u8]The Rich header data with the padding.
padding_size: usizePadding bytes at the prologue of Self::data
start_offset: u32Start offset of the Rich header.
end_offset: u32End offset of the Rich header.
Implementations§
Source§impl<'a> RichHeader<'a>
impl<'a> RichHeader<'a>
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Option<Self>>
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.
Sourcepub fn metadatas(&self) -> RichMetadataIterator<'a> ⓘ
pub fn metadatas(&self) -> RichMetadataIterator<'a> ⓘ
Returns RichMetadataIterator iterator for RichMetadata
Trait Implementations§
Source§impl<'a> Clone for RichHeader<'a>
impl<'a> Clone for RichHeader<'a>
Source§fn clone(&self) -> RichHeader<'a>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for RichHeader<'a>
impl<'a> Debug for RichHeader<'a>
Source§impl<'a> Default for RichHeader<'a>
impl<'a> Default for RichHeader<'a>
Source§fn default() -> RichHeader<'a>
fn default() -> RichHeader<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> PartialEq for RichHeader<'a>
impl<'a> PartialEq for RichHeader<'a>
Source§fn eq(&self, other: &RichHeader<'a>) -> bool
fn eq(&self, other: &RichHeader<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Copy for RichHeader<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more