Table of Contents

Class MsfStreamDataSource

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

Implements a data source for a single MSF stream that pulls data from multiple (fragmented) blocks.

public class MsfStreamDataSource : IDataSource
Inheritance
MsfStreamDataSource
Implements
Inherited Members

Constructors

MsfStreamDataSource(ulong, uint, IEnumerable<IDataSource>)

Creates a new MSF stream data source.

public MsfStreamDataSource(ulong length, uint blockSize, IEnumerable<IDataSource> blocks)

Parameters

length ulong

The length of the stream.

blockSize uint

The size of an individual block.

blocks IEnumerable<IDataSource>

The blocks

Exceptions

ArgumentException

Occurs when the total size of the provided blocks is smaller than length * blockSize.

MsfStreamDataSource(ulong, uint, IEnumerable<byte[]>)

Creates a new MSF stream data source.

public MsfStreamDataSource(ulong length, uint blockSize, IEnumerable<byte[]> blocks)

Parameters

length ulong

The length of the stream.

blockSize uint

The size of an individual block.

blocks IEnumerable<byte[]>

The blocks

Exceptions

ArgumentException

Occurs when the total size of the provided blocks is smaller than length * blockSize.

Properties

BaseAddress

Gets the first byte address of the data source that is accessible.

public ulong BaseAddress { get; }

Property Value

ulong

this[ulong]

Reads a single byte at the provided address.

public byte this[ulong address] { get; }

Parameters

address ulong

The address to read from.

Property Value

byte

Length

Gets the number of bytes accessible in the data source.

public ulong Length { get; }

Property Value

ulong

Methods

IsValidAddress(ulong)

Determines whether the provided address is a valid address in the data source.

public bool IsValidAddress(ulong address)

Parameters

address ulong

The address to verify.

Returns

bool

true if the address is valid, false otherwise.

ReadBytes(ulong, byte[], int, int)

Reads a block of data from the data source.

public int ReadBytes(ulong address, byte[] buffer, int index, int count)

Parameters

address ulong

The starting address to read from.

buffer byte[]

The buffer that receives the read bytes.

index int

The index into the buffer to start writing at.

count int

The number of bytes to read.

Returns

int

The number of bytes that were read.