165 references to PEHeader
BuildValidator (3)
PEReaderExtensions.cs (2)
23
Debug.Assert(peReader.PEHeaders.
PEHeader
is object);
27
DirectoryEntry exportTable = peReader.PEHeaders.
PEHeader
.ExportTableDirectory;
Util.cs (1)
89
peReader.PEHeaders.
PEHeader
is null ||
Microsoft.CodeAnalysis (1)
PEWriter\MetadataWriter.PortablePdb.cs (1)
1002
builder.WriteInt32(peReader.PEHeaders.
PEHeader
.SizeOfImage);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTests.cs (3)
7344
Assert.Equal(5, peHeaders.
PEHeader
.MajorSubsystemVersion);
7345
Assert.Equal(1, peHeaders.
PEHeader
.MinorSubsystemVersion);
12306
var debugDirectory = peReader.PEHeaders.
PEHeader
.DebugTableDirectory;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (77)
Emit\CompilationEmitTests.cs (75)
3534
Assert.Equal(0x30, peHeaders.
PEHeader
.MajorLinkerVersion);
3535
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion);
3536
Assert.Equal(0x10000000u, peHeaders.
PEHeader
.ImageBase);
3537
Assert.Equal(0x200, peHeaders.
PEHeader
.FileAlignment);
3538
Assert.Equal(0x8540u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
3540
Assert.Equal(0x00100000u, peHeaders.
PEHeader
.SizeOfStackReserve);
3541
Assert.Equal(0x1000u, peHeaders.
PEHeader
.SizeOfStackCommit);
3542
Assert.Equal(0x00100000u, peHeaders.
PEHeader
.SizeOfHeapReserve);
3543
Assert.Equal(0x1000u, peHeaders.
PEHeader
.SizeOfHeapCommit);
3568
Assert.Equal(0x30, peHeaders.
PEHeader
.MajorLinkerVersion);
3569
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion);
3571
Assert.Equal(0x0000000180000000u, peHeaders.
PEHeader
.ImageBase);
3572
Assert.Equal(0x00000200, peHeaders.
PEHeader
.FileAlignment); //doesn't change based on architecture.
3573
Assert.Equal(0x8540u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
3575
Assert.Equal(0x00400000u, peHeaders.
PEHeader
.SizeOfStackReserve);
3576
Assert.Equal(0x4000u, peHeaders.
PEHeader
.SizeOfStackCommit);
3577
Assert.Equal(0x00100000u, peHeaders.
PEHeader
.SizeOfHeapReserve);
3578
Assert.Equal(0x2000u, peHeaders.
PEHeader
.SizeOfHeapCommit);
3584
Assert.Equal(4, peHeaders.
PEHeader
.MajorSubsystemVersion);
3585
Assert.Equal(0, peHeaders.
PEHeader
.MinorSubsystemVersion);
3588
Assert.Equal(0, peHeaders.
PEHeader
.ImportAddressTableDirectory.RelativeVirtualAddress);
3589
Assert.Equal(0, peHeaders.
PEHeader
.ImportAddressTableDirectory.Size);
3590
Assert.Equal(0, peHeaders.
PEHeader
.ImportTableDirectory.RelativeVirtualAddress);
3591
Assert.Equal(0, peHeaders.
PEHeader
.ImportTableDirectory.Size);
3592
Assert.Equal(0, peHeaders.
PEHeader
.BaseRelocationTableDirectory.RelativeVirtualAddress);
3593
Assert.Equal(0, peHeaders.
PEHeader
.BaseRelocationTableDirectory.Size);
3618
Assert.Equal(0x30, peHeaders.
PEHeader
.MajorLinkerVersion);
3619
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion);
3621
Assert.Equal(0x10000000u, peHeaders.
PEHeader
.ImageBase);
3622
Assert.Equal(0x200, peHeaders.
PEHeader
.FileAlignment);
3623
Assert.Equal(0x8540u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
3625
Assert.Equal(6, peHeaders.
PEHeader
.MajorSubsystemVersion); //Arm targets only run on 6.2 and above
3626
Assert.Equal(2, peHeaders.
PEHeader
.MinorSubsystemVersion);
3628
Assert.Equal(0, peHeaders.
PEHeader
.ImportAddressTableDirectory.RelativeVirtualAddress);
3629
Assert.Equal(0, peHeaders.
PEHeader
.ImportAddressTableDirectory.Size);
3630
Assert.Equal(0, peHeaders.
PEHeader
.ImportTableDirectory.RelativeVirtualAddress);
3631
Assert.Equal(0, peHeaders.
PEHeader
.ImportTableDirectory.Size);
3632
Assert.Equal(0, peHeaders.
PEHeader
.BaseRelocationTableDirectory.RelativeVirtualAddress);
3633
Assert.Equal(0, peHeaders.
PEHeader
.BaseRelocationTableDirectory.Size);
3658
Assert.Equal(0x30, peHeaders.
PEHeader
.MajorLinkerVersion);
3659
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion);
3660
Assert.Equal(0x00400000ul, peHeaders.
PEHeader
.ImageBase);
3661
Assert.Equal(0x00000200, peHeaders.
PEHeader
.FileAlignment);
3663
Assert.Equal(0x8540u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
3664
Assert.Equal(0x00100000u, peHeaders.
PEHeader
.SizeOfStackReserve);
3665
Assert.Equal(0x1000u, peHeaders.
PEHeader
.SizeOfStackCommit);
3666
Assert.Equal(0x00100000u, peHeaders.
PEHeader
.SizeOfHeapReserve);
3667
Assert.Equal(0x1000u, peHeaders.
PEHeader
.SizeOfHeapCommit);
3670
Assert.NotEqual(0, peHeaders.
PEHeader
.ImportAddressTableDirectory.RelativeVirtualAddress);
3671
Assert.NotEqual(0, peHeaders.
PEHeader
.ImportAddressTableDirectory.Size);
3672
Assert.NotEqual(0, peHeaders.
PEHeader
.ImportTableDirectory.RelativeVirtualAddress);
3673
Assert.NotEqual(0, peHeaders.
PEHeader
.ImportTableDirectory.Size);
3674
Assert.NotEqual(0, peHeaders.
PEHeader
.BaseRelocationTableDirectory.RelativeVirtualAddress);
3675
Assert.NotEqual(0, peHeaders.
PEHeader
.BaseRelocationTableDirectory.Size);
3698
Assert.Equal(0x30, peHeaders.
PEHeader
.MajorLinkerVersion);
3699
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion);
3700
Assert.Equal(0x0000000140000000ul, peHeaders.
PEHeader
.ImageBase);
3701
Assert.Equal(0x200, peHeaders.
PEHeader
.FileAlignment); //doesn't change based on architecture
3703
Assert.Equal(0x8540u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
3704
Assert.Equal(0x00400000u, peHeaders.
PEHeader
.SizeOfStackReserve);
3705
Assert.Equal(0x4000u, peHeaders.
PEHeader
.SizeOfStackCommit);
3706
Assert.Equal(0x00100000u, peHeaders.
PEHeader
.SizeOfHeapReserve); //no sure why we don't bump this up relative to 32bit as well.
3707
Assert.Equal(0x2000u, peHeaders.
PEHeader
.SizeOfHeapCommit);
3724
Assert.Equal(0x8560u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE | HIGH_ENTROPY_VA (0x20)
3742
Assert.Equal(0x9540u, (ushort)peHeaders.
PEHeader
.DllCharacteristics); //DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE | IMAGE_DLLCHARACTERISTICS_APPCONTAINER (0x1000)
3758
Assert.Equal(0x10110000ul, peHeaders.
PEHeader
.ImageBase);
3763
Assert.Equal(0x10000ul, peHeaders.
PEHeader
.ImageBase);
3768
Assert.Equal(0x00400000u, peHeaders.
PEHeader
.ImageBase);
3773
Assert.Equal(0x00400000u, peHeaders.
PEHeader
.ImageBase);
3778
Assert.Equal(0xffff0000ul, peHeaders.
PEHeader
.ImageBase);
3783
Assert.Equal(0x00400000u, peHeaders.
PEHeader
.ImageBase);
3787
Assert.Equal(0x0000000140000000u, peHeaders.
PEHeader
.ImageBase);
3792
Assert.Equal(0xffffffffffff0000ul, peHeaders.
PEHeader
.ImageBase);
3797
Assert.Equal(0x0000000140000000u, peHeaders.
PEHeader
.ImageBase);
3812
Assert.Equal(1024, peHeaders.
PEHeader
.FileAlignment);
Emit\EmitMetadataTests.cs (2)
2241
var peHeader = peHeaders.
PEHeader
;
2429
var peHeader = peHeaders.
PEHeader
;
Microsoft.CodeAnalysis.Rebuild (1)
CompilationFactory.cs (1)
105
var peHeader = OptionsReader.PeReader.PEHeaders.
PEHeader
!;
Microsoft.CodeAnalysis.Test.Utilities (6)
Metadata\ILValidation.cs (3)
83
uint expectedChecksum = peHeaders.
PEHeader
.CheckSum;
134
bool is32bit = peHeaders.
PEHeader
.Magic == PEMagic.PE32;
143
var authenticodeDir = peHeaders.
PEHeader
.CertificateTableDirectory;
Metadata\MetadataReaderUtils.cs (2)
82
return headers.
PEHeader
!= null && headers.
PEHeader
.Magic == PEMagic.PE32Plus
PDB\TestMetadataReferenceInfo.cs (1)
44
_peReader.PEHeaders.
PEHeader
.SizeOfImage,
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
CommandLineTests.vb (3)
6498
Assert.Equal(5, peHeaders.
PEHeader
.MajorSubsystemVersion)
6499
Assert.Equal(1, peHeaders.
PEHeader
.MinorSubsystemVersion)
9717
Dim debugDirectory = peReader.PEHeaders.
PEHeader
.DebugTableDirectory
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (60)
Emit\CompilationEmitTests.vb (60)
2125
Assert.Equal(&H50, peHeaders.
PEHeader
.MajorLinkerVersion)
2126
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion)
2127
Assert.Equal(&H10000000UL, peHeaders.
PEHeader
.ImageBase)
2130
Assert.Equal(&H200, peHeaders.
PEHeader
.FileAlignment)
2131
Assert.Equal(CType(&H8540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
2133
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfStackReserve)
2134
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfStackCommit)
2135
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfHeapReserve)
2136
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfHeapCommit)
2149
Assert.Equal(&H50, peHeaders.
PEHeader
.MajorLinkerVersion)
2150
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion)
2151
Assert.Equal(CType(&H400000, ULong), peHeaders.
PEHeader
.ImageBase)
2153
Assert.Equal(&H200, peHeaders.
PEHeader
.FileAlignment)
2155
Assert.Equal(CType(&H8540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
2157
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfStackReserve)
2158
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfStackCommit)
2159
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfHeapReserve)
2160
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfHeapCommit)
2186
Assert.Equal(&H50, peHeaders.
PEHeader
.MajorLinkerVersion)
2187
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion)
2188
Assert.Equal(&H10000000UL, peHeaders.
PEHeader
.ImageBase)
2191
Assert.Equal(&H200, peHeaders.
PEHeader
.FileAlignment)
2192
Assert.Equal(CType(&H8540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
2194
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfStackReserve)
2195
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfStackCommit)
2196
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfHeapReserve)
2197
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfHeapCommit)
2210
Assert.Equal(&H50, peHeaders.
PEHeader
.MajorLinkerVersion)
2211
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion)
2212
Assert.Equal(CType(&H400000, ULong), peHeaders.
PEHeader
.ImageBase)
2214
Assert.Equal(&H200, peHeaders.
PEHeader
.FileAlignment)
2216
Assert.Equal(CType(&H8540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
2218
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfStackReserve)
2219
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfStackCommit)
2220
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfHeapReserve)
2221
Assert.Equal(&H1000UL, peHeaders.
PEHeader
.SizeOfHeapCommit)
2247
Assert.Equal(&H50, peHeaders.
PEHeader
.MajorLinkerVersion)
2248
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion)
2249
Assert.Equal(&H180000000UL, peHeaders.
PEHeader
.ImageBase)
2252
Assert.Equal(&H200, peHeaders.
PEHeader
.FileAlignment) 'doesn't change based on architecture
2253
Assert.Equal(CType(&H8540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
2266
Assert.Equal(&H50, peHeaders.
PEHeader
.MajorLinkerVersion)
2267
Assert.Equal(0, peHeaders.
PEHeader
.MinorLinkerVersion)
2268
Assert.Equal(&H140000000UL, peHeaders.
PEHeader
.ImageBase)
2270
Assert.Equal(&H200, peHeaders.
PEHeader
.FileAlignment)
2272
Assert.Equal(CType(&H8540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE
2275
Assert.Equal(&H400000UL, peHeaders.
PEHeader
.SizeOfStackReserve)
2276
Assert.Equal(&H4000UL, peHeaders.
PEHeader
.SizeOfStackCommit)
2277
Assert.Equal(&H100000UL, peHeaders.
PEHeader
.SizeOfHeapReserve) ' is the 32bit value!
2278
Assert.Equal(&H2000UL, peHeaders.
PEHeader
.SizeOfHeapCommit)
2295
Assert.Equal(CType(&H8560, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE | HIGH_ENTROPY_VA (0x20)
2313
Assert.Equal(CType(&H9540, UShort), peHeaders.
PEHeader
.DllCharacteristics) 'DYNAMIC_BASE | NX_COMPAT | NO_SEH | TERMINAL_SERVER_AWARE | HIGH_ENTROPY_VA (0x20)
2331
Assert.Equal(CType(&H10110000, ULong), peHeaders.
PEHeader
.ImageBase)
2336
Assert.Equal(CType(&H10000, ULong), peHeaders.
PEHeader
.ImageBase)
2341
Assert.Equal(&H400000UL, peHeaders.
PEHeader
.ImageBase)
2346
Assert.Equal(&H400000UL, peHeaders.
PEHeader
.ImageBase)
2350
Assert.Equal(&H140000000UL, peHeaders.
PEHeader
.ImageBase)
2354
Assert.Equal(&H180000000UL, peHeaders.
PEHeader
.ImageBase)
2372
Assert.Equal(1024, peHeaders.
PEHeader
.FileAlignment)
2376
Assert.Equal(4096, peHeaders.
PEHeader
.FileAlignment)
Microsoft.DotNet.Arcade.Sdk (2)
src\Unsign.cs (2)
51
var entry = headers.
PEHeader
.CertificateTableDirectory;
59
int certificateTableDirectoryOffset = (headers.
PEHeader
.Magic == PEMagic.PE32Plus) ? 144 : 128;
Microsoft.DotNet.GenFacades (2)
ClearAssemblyReferenceVersions.cs (2)
52
if (peReader.PEHeaders.
PEHeader
.CertificateTableDirectory.Size != 0)
55
int certificateTableDirectoryOffset = (peReader.PEHeaders.
PEHeader
.Magic == PEMagic.PE32Plus) ? 144 : 128;
Microsoft.DotNet.SignTool (1)
src\ContentUtil.cs (1)
113
var entry = headers.
PEHeader
.CertificateTableDirectory;
SemanticSearch.BuildTask (3)
GenerateFilteredReferenceAssembliesTask.cs (3)
296
Debug.Assert(headers.
PEHeader
!= null);
323
if (headers.
PEHeader
.CertificateTableDirectory.Size > 0)
325
var certificateTableDirectoryOffset = (headers.
PEHeader
.Magic == PEMagic.PE32Plus) ? 144 : 128;
System.Reflection.Metadata (2)
System\Reflection\PortableExecutable\PEReader.cs (2)
539
Debug.Assert(PEHeaders.
PEHeader
!= null);
541
var debugDirectory = PEHeaders.
PEHeader
.DebugTableDirectory;
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (1)
90
PEMagic peMagic = peHeaders.
PEHeader
!.Magic;