Exemple #1
0
        void VisitHeap(MetadataHeap heap)
        {
            long cursor = m_binaryReader.BaseStream.Position;

            m_binaryReader.BaseStream.Position = m_root.GetImage().ResolveVirtualAddress(
                m_root.GetImage().CLIHeader.Metadata.VirtualAddress)
                                                 + heap.GetStream().Header.Offset;

            heap.Data = m_binaryReader.ReadBytes((int)heap.GetStream().Header.Size);

            m_binaryReader.BaseStream.Position = cursor;
        }
Exemple #2
0
        void PatchStreamHeaderOffset(MetadataHeap heap)
        {
            long pos = m_binaryWriter.BaseStream.Position;

            m_binaryWriter.BaseStream.Position = heap.GetStream().Header.Offset;
            m_binaryWriter.Write((uint)(pos - m_mdStart));
            m_binaryWriter.BaseStream.Position = pos;
        }