Table of Contents

Class SerializedDotNetResourcesDirectory

Namespace
AsmResolver.PE.DotNet.Resources
Assembly
AsmResolver.PE.dll

Provides an implementation of a .NET resources directory that obtains blobs from a readable segment in a file.

public class SerializedDotNetResourcesDirectory : DotNetResourcesDirectory, ISegment, IOffsetProvider, IWritable
Inheritance
SerializedDotNetResourcesDirectory
Implements
Inherited Members

Constructors

SerializedDotNetResourcesDirectory(in BinaryStreamReader)

Creates a new instance of the SerializedDotNetResourcesDirectory using an input stream as raw contents of the directory.

public SerializedDotNetResourcesDirectory(in BinaryStreamReader reader)

Parameters

reader BinaryStreamReader

The input stream.

SerializedDotNetResourcesDirectory(IReadableSegment)

Creates a new instance of the SerializedDotNetResourcesDirectory using a readable data segment as raw contents of the directory.

public SerializedDotNetResourcesDirectory(IReadableSegment contents)

Parameters

contents IReadableSegment

The input stream.

Methods

GetManifestResourceData(uint)

Gets the manifest resource data by its offset.

public override byte[]? GetManifestResourceData(uint offset)

Parameters

offset uint

The offset of the resource data, relative to the start of the data directory.

Returns

byte[]

The data, or null if the offset is not a valid offset.

GetPhysicalSize()

Computes the number of bytes that the structure contains.

public override uint GetPhysicalSize()

Returns

uint

The number of bytes.

TryCreateManifestResourceReader(uint, out BinaryStreamReader)

Gets a reader starting at the beginning of the resource data referenced by the provided offset.

public override bool TryCreateManifestResourceReader(uint offset, out BinaryStreamReader reader)

Parameters

offset uint

The offset of the resource data, relative to the start of the data directory.

reader BinaryStreamReader

When this method returns true, this parameter contains the created binary reader.

Returns

bool

true if a blob reader could be created at the provided offset, 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.