Table of Contents

Class SerializedGuidStream

Namespace
AsmResolver.PE.DotNet.Metadata
Assembly
AsmResolver.PE.dll

Provides an implementation of a GUID stream that obtains GUIDs from a readable segment in a file.

public class SerializedGuidStream : GuidStream, IMetadataStream, ISegment, IOffsetProvider, IWritable
Inheritance
SerializedGuidStream
Implements
Inherited Members

Constructors

SerializedGuidStream(byte[])

Creates a new GUID stream with the provided byte array as the raw contents of the stream.

public SerializedGuidStream(byte[] rawData)

Parameters

rawData byte[]

The raw contents of the stream.

SerializedGuidStream(string, in BinaryStreamReader)

Creates a new GUID stream with the provided file segment reader as the raw contents of the stream.

public SerializedGuidStream(string name, in BinaryStreamReader reader)

Parameters

name string

The name of the stream.

reader BinaryStreamReader

The raw contents of the stream.

SerializedGuidStream(string, byte[])

Creates a new GUID stream with the provided byte array as the raw contents of the stream.

public SerializedGuidStream(string name, byte[] rawData)

Parameters

name string

The name of the stream.

rawData byte[]

The raw contents of the stream.

Properties

CanRead

Gets a value indicating whether the raw contents of the stream can be read using a binary stream reader.

public override bool CanRead { get; }

Property Value

bool

Methods

CreateReader()

Creates a binary reader that reads the raw contents of the metadata stream.

public override BinaryStreamReader CreateReader()

Returns

BinaryStreamReader

The reader.

Exceptions

InvalidOperationException

Occurs when CanRead is false.

EnumerateGuids()

Performs a linear sweep on the stream and yields all GUIDs that are stored.

public override IEnumerable<Guid> EnumerateGuids()

Returns

IEnumerable<Guid>

The GUID enumerator.

GetGuidByIndex(uint)

Gets a GUID by its GUID index.

public override Guid GetGuidByIndex(uint index)

Parameters

index uint

The offset into the heap to start reading.

Returns

Guid

The GUID.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

TryFindGuidIndex(Guid, out uint)

Searches the stream for the provided GUID.

public override bool TryFindGuidIndex(Guid guid, out uint index)

Parameters

guid Guid

The GUID to search for.

index uint

When the function returns true, contains the index at which the GUID was found.

Returns

bool

true if the GUID index was found, false otherwise.

Write(BinaryStreamWriter)

Serializes the structure to an output stream.

public override void Write(BinaryStreamWriter writer)

Parameters

writer BinaryStreamWriter

The output stream to write the data to.