Esempio n. 1
0
        private MetaRow GetRow(UInt32 rowIndex)
        {
            using (MemoryStream stream = new MemoryStream(this.GetData()))
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    reader.BaseStream.Position = this.RowSize * rowIndex;

                    MetaCell[] cells = new MetaCell[this._columns.Length];
                    for (Int32 loop = 0; loop < this._columns.Length; loop++)
                    {
                        cells[loop] = new MetaCell(this, this._columns[loop], rowIndex, reader);
                    }

                    return(new MetaRow(this, rowIndex, cells));
                }
        }
Esempio n. 2
0
 /// <summary>Create instance of pointer cell</summary>
 /// <param name="cell">Source cell</param>
 /// <param name="rawValue">Original value from PE file</param>
 internal MetaCellPointer(MetaCell cell, UInt32 rawValue)
     : base(cell,
            rawValue,
            (Cor.MetaTableType)cell.Column.ColumnType)
 {
 }
Esempio n. 3
0
 internal MetaCellCodedToken(MetaCell cell, UInt32 rowIndex, MetaColumnType columnType)
     : base(cell,
            (UInt32)rowIndex,
            (Cor.MetaTableType)columnType)
 {
 }
Esempio n. 4
0
 /// <summary>Create instance of base cell pointer class</summary>
 /// <param name="cell">Source cell</param>
 /// <param name="rowIndex">Target row index</param>
 /// <param name="tableType">Target table type</param>
 internal CellPointerBase(MetaCell cell, UInt32 rowIndex, Cor.MetaTableType tableType)
 {
     this._cell      = cell;
     this._rowIndex  = rowIndex == 0 ? (UInt32?)null : checked (rowIndex - 1);          //TODO: Почему -1? (Код вылетает в Overflow в таблице TypeDef в TypeName=<Module>)
     this._tableType = tableType;
 }
Esempio n. 5
0
 /// <summary>Create instance of coded token class</summary>
 /// <param name="cell">Source cell</param>
 /// <param name="rawValue">Original value from PE file</param>
 internal MetaCellCodedToken(MetaCell cell, UInt32 rawValue)
     : this(cell, (rawValue & 0xFFFFFF), (MetaColumnType)(rawValue >> 24))
 {
 }