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

            heap.binaryreader = new BinaryReader(new MemoryStream(heap.Contents));
            return heap;
        }
Esempio 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;
 }
Esempio 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));
                }
            }
        }
Esempio 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();
        }
Esempio n. 5
0
 internal GuidHeap(MetaDataStream stream)
     : base(stream)
 {
 }
Esempio n. 6
0
 internal UserStringsHeap(MetaDataStream stream)
     : base(stream)
 {
 }
Esempio n. 7
0
 public static BlobHeap FromStream(MetaDataStream stream)
 {
     BlobHeap heap = new BlobHeap(stream);
     return heap;
 }
Esempio n. 8
0
 internal BlobHeap(MetaDataStream stream)
     : base(stream)
 {
     this.mainStream = new MemoryStream(Contents);
     this.mainReader = new BinaryReader(this.mainStream);
 }
Esempio n. 9
0
 private ValueType GetHeapOffset(MetaDataStream stream, uint index)
 {
     if (stream.IndexSize == 4)
         return index;
     return (ushort)index;
 }
Esempio n. 10
0
        public static TablesHeap FromStream(MetaDataStream stream)
        {
            NETTableReader reader = new NETTableReader(stream);

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