コード例 #1
0
ファイル: StorageHeaderVM.cs プロジェクト: manojdjoshi/dnSpy
		public StorageHeaderVM(object owner, HexBuffer buffer, HexPosition startOffset)
			: base(owner) {
			FFlagsVM = new ByteFlagsHexField(buffer, Name, "fFlags", startOffset + 0);
			FFlagsVM.Add(new BooleanHexBitField("ExtraData", 0));
			PadVM = new ByteHexField(buffer, Name, "pad", startOffset + 1);
			IStreamsVM = new UInt16HexField(buffer, Name, "iStreams", startOffset + 2);

			hexFields = new HexField[] {
				FFlagsVM,
				PadVM,
				IStreamsVM,
			};
		}
コード例 #2
0
ファイル: StorageHeaderVM.cs プロジェクト: idkwim/dnSpy
        public StorageHeaderVM(object owner, HexBuffer buffer, HexPosition startOffset)
            : base(owner)
        {
            FFlagsVM = new ByteFlagsHexField(buffer, Name, "fFlags", startOffset + 0);
            FFlagsVM.Add(new BooleanHexBitField("ExtraData", 0));
            PadVM      = new ByteHexField(buffer, Name, "pad", startOffset + 1);
            IStreamsVM = new UInt16HexField(buffer, Name, "iStreams", startOffset + 2);

            hexFields = new HexField[] {
                FFlagsVM,
                PadVM,
                IStreamsVM,
            };
        }
コード例 #3
0
ファイル: TablesStreamVM.cs プロジェクト: manojdjoshi/dnSpy
		public TablesStreamVM(object owner, HexBuffer buffer, TablesStream tblStream)
			: base(owner) {
			var startOffset = new HexPosition((ulong)tblStream.StartOffset);
			M_ulReservedVM = new UInt32HexField(buffer, Name, "m_ulReserved", startOffset + 0);
			M_majorVM = new ByteHexField(buffer, Name, "m_major", startOffset + 4, true);
			M_minorVM = new ByteHexField(buffer, Name, "m_minor", startOffset + 5, true);
			M_heapsVM = new ByteFlagsHexField(buffer, Name, "m_heaps", startOffset + 6);
			M_heapsVM.Add(new BooleanHexBitField("BigStrings", 0));
			M_heapsVM.Add(new BooleanHexBitField("BigGUID", 1));
			M_heapsVM.Add(new BooleanHexBitField("BigBlob", 2));
			M_heapsVM.Add(new BooleanHexBitField("Padding", 3));
			M_heapsVM.Add(new BooleanHexBitField("Reserved", 4));
			M_heapsVM.Add(new BooleanHexBitField("DeltaOnly", 5));
			M_heapsVM.Add(new BooleanHexBitField("ExtraData", 6));
			M_heapsVM.Add(new BooleanHexBitField("HasDelete", 7));
			M_ridVM = new ByteHexField(buffer, Name, "m_rid", startOffset + 7);
			M_maskvalidVM = new UInt64FlagsHexField(buffer, Name, "m_maskvalid", startOffset + 8);
			AddTableFlags(M_maskvalidVM);
			M_sortedVM = new UInt64FlagsHexField(buffer, Name, "m_sorted", startOffset + 0x10);
			AddTableFlags(M_sortedVM);

			var list = new List<HexField> {
				M_ulReservedVM,
				M_majorVM,
				M_minorVM,
				M_heapsVM,
				M_ridVM,
				M_maskvalidVM,
				M_sortedVM,
			};

			rowsVM = new UInt32HexField[64];
			ulong valid = tblStream.ValidMask;
			var offs = startOffset + 0x18;
			for (int i = 0; i < rowsVM.Length; i++) {
				rowsVM[i] = new UInt32HexField(buffer, Name, string.Format("rows[{0:X2}]", i), offs);
				if ((valid & 1) != 0) {
					list.Add(rowsVM[i]);
					offs += 4;
				}
				else
					rowsVM[i].IsVisible = false;

				valid >>= 1;
			}

			M_ulExtraVM = new UInt32HexField(buffer, Name, "m_ulExtra", offs);
			M_ulExtraVM.IsVisible = tblStream.HasExtraData;
			if (tblStream.HasExtraData)
				list.Add(M_ulExtraVM);

			Debug.Assert(offs == (ulong)tblStream.MDTables[0].StartOffset);

			hexFields = list.ToArray();
		}
コード例 #4
0
ファイル: TablesStreamVM.cs プロジェクト: idkwim/dnSpy
        public TablesStreamVM(object owner, HexBuffer buffer, TablesStream tblStream)
            : base(owner)
        {
            var startOffset = new HexPosition((ulong)tblStream.StartOffset);

            M_ulReservedVM = new UInt32HexField(buffer, Name, "m_ulReserved", startOffset + 0);
            M_majorVM      = new ByteHexField(buffer, Name, "m_major", startOffset + 4, true);
            M_minorVM      = new ByteHexField(buffer, Name, "m_minor", startOffset + 5, true);
            M_heapsVM      = new ByteFlagsHexField(buffer, Name, "m_heaps", startOffset + 6);
            M_heapsVM.Add(new BooleanHexBitField("BigStrings", 0));
            M_heapsVM.Add(new BooleanHexBitField("BigGUID", 1));
            M_heapsVM.Add(new BooleanHexBitField("BigBlob", 2));
            M_heapsVM.Add(new BooleanHexBitField("Padding", 3));
            M_heapsVM.Add(new BooleanHexBitField("Reserved", 4));
            M_heapsVM.Add(new BooleanHexBitField("DeltaOnly", 5));
            M_heapsVM.Add(new BooleanHexBitField("ExtraData", 6));
            M_heapsVM.Add(new BooleanHexBitField("HasDelete", 7));
            M_ridVM       = new ByteHexField(buffer, Name, "m_rid", startOffset + 7);
            M_maskvalidVM = new UInt64FlagsHexField(buffer, Name, "m_maskvalid", startOffset + 8);
            AddTableFlags(M_maskvalidVM);
            M_sortedVM = new UInt64FlagsHexField(buffer, Name, "m_sorted", startOffset + 0x10);
            AddTableFlags(M_sortedVM);

            var list = new List <HexField> {
                M_ulReservedVM,
                M_majorVM,
                M_minorVM,
                M_heapsVM,
                M_ridVM,
                M_maskvalidVM,
                M_sortedVM,
            };

            rowsVM = new UInt32HexField[64];
            ulong valid = tblStream.ValidMask;
            var   offs  = startOffset + 0x18;

            for (int i = 0; i < rowsVM.Length; i++)
            {
                rowsVM[i] = new UInt32HexField(buffer, Name, string.Format("rows[{0:X2}]", i), offs);
                if ((valid & 1) != 0)
                {
                    list.Add(rowsVM[i]);
                    offs += 4;
                }
                else
                {
                    rowsVM[i].IsVisible = false;
                }

                valid >>= 1;
            }

            M_ulExtraVM           = new UInt32HexField(buffer, Name, "m_ulExtra", offs);
            M_ulExtraVM.IsVisible = tblStream.HasExtraData;
            if (tblStream.HasExtraData)
            {
                list.Add(M_ulExtraVM);
            }

            Debug.Assert(offs == (ulong)tblStream.MDTables[0].StartOffset);

            hexFields = list.ToArray();
        }