Table of Contents

Class ResourceData

Namespace
AsmResolver.PE.Win32Resources
Assembly
AsmResolver.PE.dll

Represents a single data entry in a Win32 resource directory.

public class ResourceData : IResourceEntry, IOwnedCollectionElement<ResourceDirectory>
Inheritance
ResourceData
Implements
Derived
Inherited Members

Constructors

ResourceData()

Initializes a new resource data entry.

protected ResourceData()

ResourceData(string, ISegment)

Creates a new named data entry.

public ResourceData(string name, ISegment contents)

Parameters

name string

The name of the entry.

contents ISegment

The data to store in the entry.

ResourceData(uint, ISegment)

Creates a new data entry defined by a numerical identifier..

public ResourceData(uint id, ISegment contents)

Parameters

id uint

The identifier.

contents ISegment

The data to store in the entry.

Properties

CanRead

Gets a value indicating whether the Contents is readable using a binary stream reader.

public bool CanRead { get; }

Property Value

bool

CodePage

Gets or sets the code page that is used to decode code point values within the resource data.

public uint CodePage { get; set; }

Property Value

uint

Remarks

Typically, the code page would be the Unicode code page.

Contents

Gets or sets the raw contents of the data entry.

public ISegment? Contents { get; set; }

Property Value

ISegment

Id

Gets or sets the ID of the entry.

public uint Id { get; set; }

Property Value

uint

Name

Gets or sets the name of the entry.

public string? Name { get; set; }

Property Value

string

ParentDirectory

Gets the parent directory the entry is stored in.

public ResourceDirectory? ParentDirectory { get; }

Property Value

ResourceDirectory

Methods

CreateReader()

Creates a new binary stream reader that reads the raw contents of the resource file.

public BinaryStreamReader CreateReader()

Returns

BinaryStreamReader

The reader.

GetContents()

Obtains the contents of the data entry.

protected virtual ISegment? GetContents()

Returns

ISegment

The contents.

Remarks

This method is called upon initializing the value for the Contents property.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.