-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathImageCoffHeader.cs
More file actions
46 lines (43 loc) · 2 KB
/
ImageCoffHeader.cs
File metadata and controls
46 lines (43 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using BytecodeApi.Extensions;
namespace BytecodeApi.PEParser;
/// <summary>
/// Represents the COFF header of a PE image file.
/// </summary>
public sealed class ImageCoffHeader
{
/// <summary>
/// Gets the number that identifies the type of target machine.
/// </summary>
public ImageMachineType Machine { get; internal set; }
/// <summary>
/// Gets the number of sections. This indicates the size of the section table, which immediately follows the headers.
/// </summary>
public ushort NumberOfSections { get; internal set; }
/// <summary>
/// Gets the low 32 bits of the number of seconds since 01.01.1970 00:00:00, that indicates when the file was created.
/// </summary>
public uint TimeDateStamp { get; internal set; }
/// <summary>
/// Gets the <see cref="DateTime" /> representation of the <see cref="TimeDateStamp" /> property.
/// </summary>
public DateTime TimeDateStampValue => DateTime.FromUnixTimeStamp((int)TimeDateStamp, DateTimeKind.Utc);
/// <summary>
/// Gets the file offset of the COFF symbol table, or zero if no COFF symbol table is present. This value should be zero for an image because COFF debugging information is deprecated.
/// </summary>
public uint PointerToSymbolTable { get; internal set; }
/// <summary>
/// Gets the number of entries in the symbol table. This data can be used to locate the string table, which immediately follows the symbol table. This value should be zero for an image because COFF debugging information is deprecated.
/// </summary>
public uint NumberOfSymbols { get; internal set; }
/// <summary>
/// Gets the size of the optional header, which is required for executable files but not for object files. This value should be zero for an object file.
/// </summary>
public ushort SizeOfOptionalHeader { get; internal set; }
/// <summary>
/// Gets the flags that indicate the attributes of the file.
/// </summary>
public ImageCharacteristics Characteristics { get; internal set; }
internal ImageCoffHeader()
{
}
}