Table of Contents

Class MsfFile

Namespace
AsmResolver.Symbols.Pdb.Msf
Assembly
AsmResolver.Symbols.Pdb.dll

Models a file that is in the Microsoft Multi-Stream Format (MSF).

public class MsfFile
Inheritance
MsfFile
Derived
Inherited Members

Constructors

MsfFile()

Creates a new empty MSF file with a default block size of 4096.

public MsfFile()

MsfFile(uint)

Creates a new empty MSF file with the provided block size.

public MsfFile(uint blockSize)

Parameters

blockSize uint

The block size to use. This must be a value of 512, 1024, 2048 or 4096.

Exceptions

ArgumentOutOfRangeException

Occurs when an invalid block size was provided.

Properties

BlockSize

Gets or sets the size of each block in the MSF file.

public uint BlockSize { get; set; }

Property Value

uint

Exceptions

ArgumentOutOfRangeException

Occurs when the provided value is neither 512, 1024, 2048 or 4096.

Streams

Gets a collection of streams that are present in the MSF file.

public IList<MsfStream> Streams { get; }

Property Value

IList<MsfStream>

Methods

FromBytes(byte[])

Interprets a byte array as an MSF file.

public static MsfFile FromBytes(byte[] data)

Parameters

data byte[]

The data to interpret.

Returns

MsfFile

The read MSF file.

FromFile(IInputFile)

Reads an MSF file from an input file.

public static MsfFile FromFile(IInputFile file)

Parameters

file IInputFile

The file to read.

Returns

MsfFile

The read MSF file.

FromFile(string)

Reads an MSF file from a file on the disk.

public static MsfFile FromFile(string path)

Parameters

path string

The path to the file to read.

Returns

MsfFile

The read MSF file.

FromReader(BinaryStreamReader)

Reads an MSF file from the provided input stream reader.

public static MsfFile FromReader(BinaryStreamReader reader)

Parameters

reader BinaryStreamReader

The reader.

Returns

MsfFile

The read MSF file.

GetStreams()

Obtains the list of streams stored in the MSF file.

protected virtual IList<MsfStream> GetStreams()

Returns

IList<MsfStream>

The streams.

Remarks

This method is called upon initialization of the Streams property.

Write(BinaryStreamWriter)

Reconstructs and writes the MSF file to an output stream.

public void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream.

Write(BinaryStreamWriter, IMsfFileBuilder)

Reconstructs and writes the MSF file to an output stream.

public void Write(BinaryStreamWriter writer, IMsfFileBuilder builder)

Parameters

writer BinaryStreamWriter

The output stream.

builder IMsfFileBuilder

The builder to use for reconstructing the MSF file.

Write(Stream)

Reconstructs and writes the MSF file to an output stream.

public void Write(Stream stream)

Parameters

stream Stream

The output stream.

Write(string)

Reconstructs and writes the MSF file to the disk.

public void Write(string path)

Parameters

path string

The path of the file to write to.