Esempio n. 1
0
        public static DotNetMetadataHeaderReader?TryCreate(HexBufferFile file, HexSpan span)
        {
            if (span.Length < 0x14)
            {
                return(null);
            }
            if (!file.Span.Contains(span))
            {
                return(null);
            }
            if (file.Buffer.ReadUInt32(span.Start) != 0x424A5342)
            {
                return(null);
            }
            var reader = new DotNetMetadataHeaderReader(file, span);

            return(reader.Read() ? reader : null);
        }
Esempio n. 2
0
        void ReadDotNetMetadataHeader(HexSpan span)
        {
            var mdReader = DotNetMetadataHeaderReader.TryCreate(file, span);

            if (mdReader == null)
            {
                return;
            }
            mdHeader = DotNetMetadataHeaderDataImpl.TryCreate(file, mdReader.MetadataHeaderSpan, (int)mdReader.VersionStringSpan.Length.ToUInt64(), mdReader.StorageStreamHeaders);
            if (mdHeader == null)
            {
                return;
            }
            metadataSpan = mdReader.MetadataSpan;
            var dnReader = new DotNetHeapsReader(file, mdHeader, mdReader.StorageStreamHeaders);

            if (dnReader.Read())
            {
                dotNetHeaps = dnReader.Streams;
            }
        }