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