Represents a .NET data directory header (COR20 header) in a windows assembly image.
Inheritance: FileSegment
コード例 #1
0
 private static void InitializeNetDirectory(ImageNetDirectory directory)
 {
     directory.Cb = 0x48;
     directory.MajorRuntimeVersion = 2;
     directory.Flags = ImageNetDirectoryFlags.IlOnly;
     InitializeMetadata(directory.MetadataHeader);
 }
コード例 #2
0
        internal static ImageNetDirectory FromReadingContext(ReadingContext context)
        {
            var reader = context.Reader;

            var directory = new ImageNetDirectory
            {
                _readingContext = context,

                StartOffset = reader.Position,

                Cb = reader.ReadUInt32(),
                MajorRuntimeVersion = reader.ReadUInt16(),
                MinorRuntimeVersion = reader.ReadUInt16(),
                MetadataDirectory   = ImageDataDirectory.FromReadingContext(context),
                Flags                            = (ImageNetDirectoryFlags)reader.ReadUInt32(),
                EntryPointToken                  = reader.ReadUInt32(),
                ResourcesDirectory               = ImageDataDirectory.FromReadingContext(context),
                StrongNameSignatureDirectory     = ImageDataDirectory.FromReadingContext(context),
                CodeManagerTableDirectory        = ImageDataDirectory.FromReadingContext(context),
                VTableFixupsDirectory            = ImageDataDirectory.FromReadingContext(context),
                ExportAddressTableJumpsDirectory = ImageDataDirectory.FromReadingContext(context),
                ManagedNativeHeaderDirectory     = ImageDataDirectory.FromReadingContext(context),
            };

            return(directory);
        }
コード例 #3
0
 private static void InitializeNetDirectory(ImageNetDirectory directory)
 {
     directory.Cb = 0x48;
     directory.MajorRuntimeVersion = 2;
     directory.Flags = ImageNetDirectoryFlags.IlOnly;
     InitializeMetadata(directory.MetadataHeader);
 }
コード例 #4
0
ファイル: MetadataHeader.cs プロジェクト: xuhaoa/WinPIT
 public MetadataHeader(ImageNetDirectory directory)
     : this()
 {
     NetDirectory = directory;
 }
コード例 #5
0
        internal static ImageNetDirectory FromReadingContext(ReadingContext context)
        {
            var reader = context.Reader;

            var directory = new ImageNetDirectory
            {
                _readingContext = context,

                StartOffset = reader.Position,

                Cb = reader.ReadUInt32(),
                MajorRuntimeVersion = reader.ReadUInt16(),
                MinorRuntimeVersion = reader.ReadUInt16(),
                MetadataDirectory = ImageDataDirectory.FromReadingContext(context),
                Flags = (ImageNetDirectoryFlags)reader.ReadUInt32(),
                EntryPointToken = reader.ReadUInt32(),
                ResourcesDirectory = ImageDataDirectory.FromReadingContext(context),
                StrongNameSignatureDirectory = ImageDataDirectory.FromReadingContext(context),
                CodeManagerTableDirectory = ImageDataDirectory.FromReadingContext(context),
                VTableFixupsDirectory = ImageDataDirectory.FromReadingContext(context),
                ExportAddressTableJumpsDirectory = ImageDataDirectory.FromReadingContext(context),
                ManagedNativeHeaderDirectory = ImageDataDirectory.FromReadingContext(context),

            };

            return directory;
        }