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
BinaryStreamReaderThe 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
IReadableSegmentThe input stream.
Methods
GetManifestResourceData(uint)
Gets the manifest resource data by its offset.
public override byte[]? GetManifestResourceData(uint offset)
Parameters
offset
uintThe 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
uintThe offset of the resource data, relative to the start of the data directory.
reader
BinaryStreamReaderWhen 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
BinaryStreamWriterThe output stream to write the data to.