コード例 #1
0
ファイル: FieldRvaTable.cs プロジェクト: xuhaoa/WinPIT
        protected override MetadataRow <DataSegment, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            uint rva      = reader.ReadUInt32();
            uint fieldRid = reader.ReadIndex(TableStream.GetTable(MetadataTokenType.Field).IndexSize);

            DataSegment dataSegment = null;

            if (rva != 0)
            {
                int dataSize   = GetDataSize(fieldRid);
                var dataReader = context.Reader.CreateSubReader(context.Assembly.RvaToFileOffset(rva), dataSize);
                dataSegment = DataSegment.FromReader(dataReader);
            }

            return(new MetadataRow <DataSegment, uint>(token)
            {
                Column1 = dataSegment,
                Column2 = fieldRid
            });
        }
コード例 #2
0
        protected override MetadataRow <uint, uint, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            return(new MetadataRow <uint, uint, uint>(token)
            {
                Column1 = reader.ReadIndex(TableStream.GetIndexEncoder(CodedIndex.HasCustomAttribute).IndexSize),
                Column2 = reader.ReadIndex(TableStream.GetIndexEncoder(CodedIndex.CustomAttributeType).IndexSize),
                Column3 = reader.ReadIndex(TableStream.BlobIndexSize),
            });
        }
コード例 #3
0
ファイル: MethodSemanticsTable.cs プロジェクト: xuhaoa/WinPIT
        public MetadataRow <MethodSemanticsAttributes, uint, uint> FindSemanticsOfOwner(MetadataToken ownersToken)
        {
            var encoder = TableStream.GetIndexEncoder(CodedIndex.HasSemantics);

            return((MetadataRow <MethodSemanticsAttributes, uint, uint>)GetRowByKey(2, encoder.EncodeToken(ownersToken)));
        }
コード例 #4
0
ファイル: MethodSemanticsTable.cs プロジェクト: xuhaoa/WinPIT
        protected override MetadataRow <MethodSemanticsAttributes, uint, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            return(new MetadataRow <MethodSemanticsAttributes, uint, uint>(token)
            {
                Column1 = (MethodSemanticsAttributes)reader.ReadUInt16(),
                Column2 = reader.ReadIndex(TableStream.GetTable(MetadataTokenType.Method).IndexSize),
                Column3 = reader.ReadIndex(TableStream.GetIndexEncoder(CodedIndex.HasSemantics).IndexSize)
            });
        }
コード例 #5
0
        protected override MetadataRow <ElementType, byte, uint, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            return(new MetadataRow <ElementType, byte, uint, uint>(token)
            {
                Column1 = (ElementType)reader.ReadByte(),
                Column2 = reader.ReadByte(),
                Column3 = reader.ReadIndex(TableStream.GetIndexEncoder(CodedIndex.HasConstant).IndexSize),
                Column4 = reader.ReadIndex(TableStream.BlobIndexSize)
            });
        }
コード例 #6
0
ファイル: EncLog.cs プロジェクト: micax/AsmResolver
 internal EncLog(MetadataHeader header, MetadataToken token, MetadataRow <uint, uint> row)
     : base(header, token, row)
 {
     Token    = row.Column1;
     FuncCode = row.Column2;
 }
コード例 #7
0
        protected override MetadataRow <uint, uint, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            return(new MetadataRow <uint, uint, uint>(token)
            {
                Column1 = reader.ReadIndex(TableStream.GetIndexEncoder(CodedIndex.ResolutionScope).IndexSize), // ResolutionScope
                Column2 = reader.ReadIndex(TableStream.StringIndexSize),                                       // Name
                Column3 = reader.ReadIndex(TableStream.StringIndexSize),                                       // Namespace
            });
        }
コード例 #8
0
        public MetadataRow <ElementType, byte, uint, uint> FindConstantOfOwner(MetadataToken ownersToken)
        {
            var encoder = TableStream.GetIndexEncoder(CodedIndex.HasConstant);

            return((MetadataRow <ElementType, byte, uint, uint>)GetRowByKey(2, encoder.EncodeToken(ownersToken)));
        }
コード例 #9
0
        protected override MetadataRow <TypeAttributes, uint, uint, uint, uint, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            return(new MetadataRow <TypeAttributes, uint, uint, uint, uint, uint>(token)
            {
                Column1 = (TypeAttributes)reader.ReadUInt32(),                                              // Attributes
                Column2 = reader.ReadIndex(TableStream.StringIndexSize),                                    // Name
                Column3 = reader.ReadIndex(TableStream.StringIndexSize),                                    // Namespace
                Column4 = reader.ReadIndex(TableStream.GetIndexEncoder(CodedIndex.TypeDefOrRef).IndexSize), // BaseType
                Column5 = reader.ReadIndex(TableStream.GetTable(MetadataTokenType.Field).IndexSize),        // FieldList
                Column6 = reader.ReadIndex(TableStream.GetTable(MetadataTokenType.Method).IndexSize),       // MethodList
            });
        }
コード例 #10
0
        protected override MetadataRow <ushort, ushort, ushort, ushort, AssemblyAttributes, uint, uint, uint, uint> ReadRow(ReadingContext context, MetadataToken token)
        {
            var reader = context.Reader;

            return(new MetadataRow <ushort, ushort, ushort, ushort, AssemblyAttributes, uint, uint, uint, uint>(token)
            {
                Column1 = reader.ReadUInt16(),
                Column2 = reader.ReadUInt16(),
                Column3 = reader.ReadUInt16(),
                Column4 = reader.ReadUInt16(),
                Column5 = (AssemblyAttributes)reader.ReadUInt32(),
                Column6 = reader.ReadIndex(TableStream.BlobIndexSize),
                Column7 = reader.ReadIndex(TableStream.StringIndexSize),
                Column8 = reader.ReadIndex(TableStream.StringIndexSize),
                Column9 = reader.ReadIndex(TableStream.BlobIndexSize),
            });
        }
コード例 #11
0
 internal FieldPtr(MetadataHeader header, MetadataToken token, MetadataRow <uint> row)
     : base(header, token, row)
 {
     _field = new LazyValue <FieldDefinition>(() =>
                                              header.GetStream <TableStream>().GetTable <FieldDefinition>()[(int)(row.Column1 - 1)]);
 }
コード例 #12
0
 public MetadataRow <uint, uint> FindFieldLayoutOfOwner(MetadataToken ownersToken)
 {
     return((MetadataRow <uint, uint>)GetRowByKey(1, ownersToken.Rid));
 }
コード例 #13
0
ファイル: MethodPtr.cs プロジェクト: micax/AsmResolver
 public MethodPtr(MetadataHeader header, MetadataToken token, MetadataRow <uint> row)
     : base(header, token, row)
 {
     _method = new LazyValue <MethodDefinition>(() => header.GetStream <TableStream>().GetTable <MethodDefinition>()[(int)(row.Column1 - 1)]);
 }