Esempio n. 1
0
        public TablesHeaderDataImpl(HexBufferSpan span, bool hasExtraData, int rowsFieldCount)
            : base(span)
        {
            var buffer = span.Buffer;
            var pos    = span.Start.Position;

            Reserved     = new StructField <UInt32Data>("m_ulReserved", new UInt32Data(buffer, pos));
            MajorVersion = new StructField <ByteData>("m_major", new ByteData(buffer, pos + 4));
            MinorVersion = new StructField <ByteData>("m_minor", new ByteData(buffer, pos + 5));
            Flags        = new StructField <ByteFlagsData>("m_heaps", new ByteFlagsData(buffer, pos + 6, heapsFlagInfos));
            Log2Rid      = new StructField <ByteData>("m_rid", new ByteData(buffer, pos + 7));
            ValidMask    = new StructField <UInt64FlagsData>("m_maskvalid", new UInt64FlagsData(buffer, pos + 8, tableFlagInfos));
            SortedMask   = new StructField <UInt64FlagsData>("m_sorted", new UInt64FlagsData(buffer, pos + 0x10, tableFlagInfos));
            pos         += 0x18;
            Rows         = new StructField <ArrayData <UInt32Data> >("m_rows", ArrayData.CreateUInt32Array(buffer, pos, rowsFieldCount));
            if (hasExtraData)
            {
                ExtraData = new StructField <UInt32Data>("m_ulExtra", new UInt32Data(buffer, pos));
                pos      += 4;
            }
            var fields = new List <BufferField>(9)
            {
                Reserved,
                MajorVersion,
                MinorVersion,
                Flags,
                Log2Rid,
                ValidMask,
                SortedMask,
            };

            fields.Add(Rows);
            if (hasExtraData)
            {
                fields.Add(ExtraData);
            }
            Fields = fields.ToArray();
        }
Esempio n. 2
0
        public PdbStreamHeaderDataImpl(HexBufferSpan span, int rowsFieldCount)
            : base(span)
        {
            var buffer = span.Buffer;
            var pos    = span.Start.Position;

            PdbId      = new StructField <PortablePdbIdData>("PdbId", new PortablePdbIdData(buffer, pos));
            EntryPoint = new StructField <TokenData>("EntryPoint", new TokenData(buffer, pos + 20));
            ReferencedTypeSystemTables = new StructField <UInt64FlagsData>("ReferencedTypeSystemTables", new UInt64FlagsData(buffer, pos + 24, TablesHeaderDataImpl.tableFlagInfos));
            TypeSystemTableRows        = new StructField <ArrayData <UInt32Data> >("TypeSystemTableRows", ArrayData.CreateUInt32Array(buffer, pos + 32, rowsFieldCount));
            Fields = new BufferField[] {
                PdbId,
                EntryPoint,
                ReferencedTypeSystemTables,
                TypeSystemTableRows,
            };
        }