| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | namespace System.Reflection.PortableExecutable |
| | | 5 | | { |
| | | 6 | | public sealed class CorHeader |
| | | 7 | | { |
| | 0 | 8 | | public ushort MajorRuntimeVersion { get; } |
| | 0 | 9 | | public ushort MinorRuntimeVersion { get; } |
| | 0 | 10 | | public DirectoryEntry MetadataDirectory { get; } |
| | 0 | 11 | | public CorFlags Flags { get; } |
| | 0 | 12 | | public int EntryPointTokenOrRelativeVirtualAddress { get; } |
| | 0 | 13 | | public DirectoryEntry ResourcesDirectory { get; } |
| | 0 | 14 | | public DirectoryEntry StrongNameSignatureDirectory { get; } |
| | 0 | 15 | | public DirectoryEntry CodeManagerTableDirectory { get; } |
| | 0 | 16 | | public DirectoryEntry VtableFixupsDirectory { get; } |
| | 0 | 17 | | public DirectoryEntry ExportAddressTableJumpsDirectory { get; } |
| | 0 | 18 | | public DirectoryEntry ManagedNativeHeaderDirectory { get; } |
| | | 19 | | |
| | 0 | 20 | | internal CorHeader(ref PEBinaryReader reader) |
| | 0 | 21 | | { |
| | | 22 | | // byte count |
| | 0 | 23 | | reader.ReadInt32(); |
| | | 24 | | |
| | 0 | 25 | | MajorRuntimeVersion = reader.ReadUInt16(); |
| | 0 | 26 | | MinorRuntimeVersion = reader.ReadUInt16(); |
| | 0 | 27 | | MetadataDirectory = new DirectoryEntry(ref reader); |
| | 0 | 28 | | Flags = (CorFlags)reader.ReadUInt32(); |
| | 0 | 29 | | EntryPointTokenOrRelativeVirtualAddress = reader.ReadInt32(); |
| | 0 | 30 | | ResourcesDirectory = new DirectoryEntry(ref reader); |
| | 0 | 31 | | StrongNameSignatureDirectory = new DirectoryEntry(ref reader); |
| | 0 | 32 | | CodeManagerTableDirectory = new DirectoryEntry(ref reader); |
| | 0 | 33 | | VtableFixupsDirectory = new DirectoryEntry(ref reader); |
| | 0 | 34 | | ExportAddressTableJumpsDirectory = new DirectoryEntry(ref reader); |
| | 0 | 35 | | ManagedNativeHeaderDirectory = new DirectoryEntry(ref reader); |
| | 0 | 36 | | } |
| | | 37 | | } |
| | | 38 | | } |
| | | 39 | | |