Represents a metadata stream of a .NET application.
Inheritance: IDisposable
Exemplo n.º 1
0
        public static StringsHeap FromStream(MetaDataStream stream)
        {
            StringsHeap heap = new StringsHeap(stream);

            heap.binaryreader = new BinaryReader(new MemoryStream(heap.Contents));
            return heap;
        }
Exemplo n.º 2
0
 internal Heap(MetaDataStream stream)
 {
     name = stream.name;
     netheader = stream.netheader;
     offset = stream.offset;
     size = stream.size;
     streamoffset = stream.streamoffset;
     reader = stream.reader;
     indexsize = 2;
 }
Exemplo n.º 3
0
        public TablesDlg(MetaDataStream stream)
        {
            InitializeComponent();

            tableheap = (TablesHeap)stream.ToHeap();
            hexBox1.ByteProvider = new DynamicByteProvider(stream.Contents);
               // foreach (MetaDataMember member in tableheap.Tables.First(t => t.Type == MetaDataTableType.ManifestResource).Members)
               //     treeView1.Nodes.Add(CreateTreeNode(member));
            foreach (MetaDataTable table in tableheap.Tables)
            {
                if (table != null)
                {
                    TreeNode node = new TreeNode(table.Type.ToString() + " (" + table.AmountOfRows.ToString() + ")");
                    treeView1.Nodes.Add(node);
                    index = 1;
                    foreach (MetaDataMember member in table.Members)
                        node.Nodes.Add(CreateTreeNode(member));
                }
            }
        }
Exemplo n.º 4
0
        internal NETTableReader(MetaDataStream stream)
        {
            this.stream = stream;
            reader = new BinaryReader(new MemoryStream(stream.Contents));
            tableheap = new TablesHeap();
            tableheap.header = ASMGlobals.ReadStructureFromReader<Structures.METADATA_TABLE_HEADER>(reader);
            tableheap.reader = stream.reader;
            tableheap.offset = stream.offset;
            tableheap.size = stream.size;
            tableheap.stream = stream;
            tableheap.streamoffset = stream.streamoffset;
            tableheap.headeroffset = stream.headeroffset;
            tableheap.netheader = stream.netheader;

            for (int i = 0; i < 45; i++)
                if (tableheap.HasTable((MetaDataTableType)i))
                {
                    tableheap.tablecount++;
                }
            ReadTableHeaders();
            tableheap.tablereader = this;
               // ReadTables();
        }
Exemplo n.º 5
0
 internal GuidHeap(MetaDataStream stream)
     : base(stream)
 {
 }
Exemplo n.º 6
0
 internal UserStringsHeap(MetaDataStream stream)
     : base(stream)
 {
 }
Exemplo n.º 7
0
 public static BlobHeap FromStream(MetaDataStream stream)
 {
     BlobHeap heap = new BlobHeap(stream);
     return heap;
 }
Exemplo n.º 8
0
 internal BlobHeap(MetaDataStream stream)
     : base(stream)
 {
     this.mainStream = new MemoryStream(Contents);
     this.mainReader = new BinaryReader(this.mainStream);
 }
Exemplo n.º 9
0
 private ValueType GetHeapOffset(MetaDataStream stream, uint index)
 {
     if (stream.IndexSize == 4)
         return index;
     return (ushort)index;
 }
Exemplo n.º 10
0
        public static TablesHeap FromStream(MetaDataStream stream)
        {
            NETTableReader reader = new NETTableReader(stream);

            return reader.tableheap;
        }
Exemplo n.º 11
0
 internal object GetHeapOffset(MetaDataStream stream, uint offset)
 {
     if (stream.indexsize == 4)
         return offset;
     else
         return (ushort)offset;
 }
Exemplo n.º 12
0
 private byte GetIndexSize(MetaDataStream stream)
 {
     if (stream != null)
         return stream.IndexSize;
     return sizeof(ushort);
 }