< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 17
Coverable lines: 17
Total lines: 67
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/CoffHeader.cs

#LineLine coverage
 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
 4namespace System.Reflection.PortableExecutable
 5{
 6    public sealed class CoffHeader
 7    {
 8        /// <summary>
 9        /// The type of target machine.
 10        /// </summary>
 011        public Machine Machine { get; }
 12
 13        /// <summary>
 14        /// The number of sections. This indicates the size of the section table, which immediately follows the headers.
 15        /// </summary>
 016        public short NumberOfSections { get; }
 17
 18        /// <summary>
 19        /// The low 32 bits of the number of seconds since 00:00 January 1, 1970, that indicates when the file was creat
 20        /// </summary>
 021        public int TimeDateStamp { get; }
 22
 23        /// <summary>
 24        /// The file pointer to the COFF symbol table, or zero if no COFF symbol table is present.
 25        /// This value should be zero for a PE image.
 26        /// </summary>
 027        public int PointerToSymbolTable { get; }
 28
 29        /// <summary>
 30        /// The number of entries in the symbol table. This data can be used to locate the string table,
 31        /// which immediately follows the symbol table. This value should be zero for a PE image.
 32        /// </summary>
 033        public int NumberOfSymbols { get; }
 34
 35        /// <summary>
 36        /// The size of the optional header, which is required for executable files but not for object files.
 37        /// This value should be zero for an object file.
 38        /// </summary>
 039        public short SizeOfOptionalHeader { get; }
 40
 41        /// <summary>
 42        /// The flags that indicate the attributes of the file.
 43        /// </summary>
 044        public Characteristics Characteristics { get; }
 45
 46        internal const int Size =
 47            sizeof(short) + // Machine
 48            sizeof(short) + // NumberOfSections
 49            sizeof(int) +   // TimeDateStamp:
 50            sizeof(int) +   // PointerToSymbolTable
 51            sizeof(int) +   // NumberOfSymbols
 52            sizeof(short) + // SizeOfOptionalHeader:
 53            sizeof(ushort); // Characteristics
 54
 055        internal CoffHeader(ref PEBinaryReader reader)
 056        {
 057            Machine = (Machine)reader.ReadUInt16();
 058            NumberOfSections = reader.ReadInt16();
 059            TimeDateStamp = reader.ReadInt32();
 060            PointerToSymbolTable = reader.ReadInt32();
 061            NumberOfSymbols = reader.ReadInt32();
 062            SizeOfOptionalHeader = reader.ReadInt16();
 063            Characteristics = (Characteristics)reader.ReadUInt16();
 064        }
 65    }
 66}
 67