Inheritance: Asmex.FileViewer.MDHeap
Beispiel #1
0
        public MModule(BinaryReader reader)
        {
            try
            {
                _mh = new ModHeaders(reader);
            }
            catch (Exception)
            {
                return;
            }

            //imports
            try
            {
                _imp = new ImpExports(reader, this);
            }
            catch (Exception)
            {
                return;
            }

            //relocs
            try
            {
                _fix = new Relocations(reader, this);
            }
            catch (Exception)
            {
                return;
            }

            //heaps
            try
            {
                _stringHeap = new MDStringHeap(reader, _mh.MetaDataHeaders.StringStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start, _mh.MetaDataHeaders.StringStreamHeader.Size, _mh.MetaDataHeaders.StringStreamHeader.Name);
                _blobHeap   = new MDBlobHeap(reader, _mh.MetaDataHeaders.BlobStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start, _mh.MetaDataHeaders.BlobStreamHeader.Size, _mh.MetaDataHeaders.BlobStreamHeader.Name);
                _GUIDHeap   = new MDGUIDHeap(reader, _mh.MetaDataHeaders.GUIDStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start, _mh.MetaDataHeaders.GUIDStreamHeader.Size, _mh.MetaDataHeaders.GUIDStreamHeader.Name);

                if (_mh.MetaDataHeaders.USStreamHeader != null)
                {
                    _USHeap = new MDBlobHeap(reader, _mh.MetaDataHeaders.USStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start, _mh.MetaDataHeaders.USStreamHeader.Size, _mh.MetaDataHeaders.USStreamHeader.Name);
                }
            }
            catch (Exception)
            {
                return;
            }

            //tables
            try
            {
                reader.BaseStream.Position = _mh.MetaDataTableHeader.End;
                _tables = new MDTables(reader, this);
            }
            catch (Exception)
            {
                return;
            }
        }
Beispiel #2
0
        public MModule(BinaryReader reader)
        {
            try
            {
                _mh = new ModHeaders(reader);
            }
            catch (Exception)
            {
                return;
            }

            //imports
            try
            {
                _imp = new ImpExports(reader, this);
            }
            catch (Exception)
            {
                return;
            }

            //relocs
            try
            {
                _fix = new Relocations(reader, this);
            }
            catch (Exception)
            {
                return;
            }

            //heaps
            try
            {
                _stringHeap = new MDStringHeap(reader, _mh.MetaDataHeaders.StringStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start,
                                               _mh.MetaDataHeaders.StringStreamHeader.Size, _mh.MetaDataHeaders.StringStreamHeader.Name);
                _blobHeap = new MDBlobHeap(reader, _mh.MetaDataHeaders.BlobStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start,
                                           _mh.MetaDataHeaders.BlobStreamHeader.Size, _mh.MetaDataHeaders.BlobStreamHeader.Name);
                _GUIDHeap = new MDGUIDHeap(reader, _mh.MetaDataHeaders.GUIDStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start,
                                           _mh.MetaDataHeaders.GUIDStreamHeader.Size, _mh.MetaDataHeaders.GUIDStreamHeader.Name);

                if (_mh.MetaDataHeaders.USStreamHeader != null)
                {
                    _USHeap = new MDBlobHeap(reader, _mh.MetaDataHeaders.USStreamHeader.Offset + _mh.MetaDataHeaders.StorageSigAndHeader.Start,
                                             _mh.MetaDataHeaders.USStreamHeader.Size, _mh.MetaDataHeaders.USStreamHeader.Name);
                }
            }
            catch (Exception)
            {
                return;
            }

            //tables
            try
            {
                reader.BaseStream.Position = _mh.MetaDataTableHeader.End;
                _tables = new MDTables(reader, this);
            }
            catch
            {
            }
        }