Skip to main content

Cor20Header

Struct Cor20Header 

Source
#[repr(C)]
pub struct Cor20Header { pub cb: u32, pub major_runtime_version: u16, pub minor_runtime_version: u16, pub metadata: DataDirectory, pub flags: u32, pub entry_point_token_or_rva: u32, pub resources: DataDirectory, pub strong_name_signature: DataDirectory, pub code_manager_table: DataDirectory, pub vtable_fixups: DataDirectory, pub export_address_table_jumps: DataDirectory, pub managed_native_header: DataDirectory, }
Expand description

to .NET assemblies. This header is found in the COM descriptor directory of a PE file.

Fields§

§cb: u32

The size of this structure in bytes.

§major_runtime_version: u16

Major runtime version number of the CLR.

§minor_runtime_version: u16

Minor runtime version number of the CLR.

§metadata: DataDirectory

The location and size of the metadata section, which contains metadata tables for the assembly, such as type definitions and member references.

§flags: u32§entry_point_token_or_rva: u32

Token or RVA of the entry point method for the assembly. For DLLs, this can be 0.

§resources: DataDirectory

Data directory specifying resources in the assembly.

§strong_name_signature: DataDirectory

Data directory containing the strong name signature of the assembly, if signed.

§code_manager_table: DataDirectory

Data directory for the code manager table, reserved for internal use.

§vtable_fixups: DataDirectory

Data directory for vtable fixups, used to fixup vtables in unmanaged code.

§export_address_table_jumps: DataDirectory

Data directory for export address table jumps, which can be used for interop.

§managed_native_header: DataDirectory

Data directory for a managed native header, reserved for future use.

Implementations§

Source§

impl Cor20Header

Source

pub fn is_cb_correct(&self) -> bool

Returns true if Cor20Header::cb matches size of Cor20Header, otherwise false.

Source

pub fn is_il_only(&self) -> bool

Whether the assembly contains only IL (Intermediate Language) code.

Source

pub fn is_32bit_required(&self) -> bool

Whether the assembly requires a 32-bit environment to run.

Source

pub fn is_il_library(&self) -> bool

Whether assembly is a library, not a standalone executable.

Source

pub fn is_strong_name_signed(&self) -> bool

Whether assembly is signed with a strong name.

Source

pub fn is_native_entrypoint(&self) -> bool

Whether the entry point for the assembly is a native method.

Source

pub fn is_track_debug_data(&self) -> bool

Whether debug information is tracked for the assembly.

Source

pub fn is_32bit_preferred(&self) -> bool

Whether the assembly prefers a 32-bit environment if available.

Trait Implementations§

Source§

impl Clone for Cor20Header

Source§

fn clone(&self) -> Cor20Header

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 Debug for Cor20Header

Source§

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

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

impl Default for Cor20Header

Source§

fn default() -> Cor20Header

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

impl PartialEq for Cor20Header

Source§

fn eq(&self, other: &Cor20Header) -> 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 SizeWith<Endian> for Cor20Header

Source§

impl<'a> TryFromCtx<'a, Endian> for Cor20Header
where Cor20Header: 'a,

Source§

type Error = Error

Source§

fn try_from_ctx( src: &'a [u8], ctx: Endian, ) -> Result<(Self, usize), Self::Error>

Source§

impl<'a_fresh> TryIntoCtx<Endian> for &'a_fresh Cor20Header

Source§

type Error = Error

Source§

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>

Source§

impl TryIntoCtx<Endian> for Cor20Header

Source§

type Error = Error

Source§

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>

Source§

impl Copy for Cor20Header

Source§

impl StructuralPartialEq for Cor20Header

Auto Trait Implementations§

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.