Table of Contents

Class ByteArrayInputFile

Namespace
AsmResolver.IO
Assembly
AsmResolver.dll

Represents a file for which the data is represented by a byte array.

public sealed class ByteArrayInputFile : IInputFile, IDisposable
Inheritance
ByteArrayInputFile
Implements
Inherited Members
Extension Methods

Constructors

ByteArrayInputFile(byte[])

Creates a new file for the provided raw contents.

public ByteArrayInputFile(byte[] contents)

Parameters

contents byte[]

The raw contents of the file.

ByteArrayInputFile(string)

Creates a new file for the provided file path.

public ByteArrayInputFile(string filePath)

Parameters

filePath string

The file path.

ByteArrayInputFile(string?, byte[], ulong)

Creates a new file for the provided file path and raw contents.

public ByteArrayInputFile(string? filePath, byte[] data, ulong baseAddress)

Parameters

filePath string

The file path.

data byte[]

The byte array to read from.

baseAddress ulong

The base address to use.

Properties

BaseAddress

Gets the base address of the data in this input.

public ulong BaseAddress { get; }

Property Value

ulong

FilePath

Gets the path to the file on the disk, or null if this file was created from memory.

public string? FilePath { get; }

Property Value

string

Remarks

If this value is null, then the file fully resides in memory.

Length

Gets the maximum length a single binary stream reader produced by this factory can have.

public uint Length { get; }

Property Value

uint

Methods

CreateReader(ulong, uint, uint)

Creates a new binary reader at the provided address.

public BinaryStreamReader CreateReader(ulong address, uint rva, uint length)

Parameters

address ulong

The raw address to start reading from.

rva uint

The virtual address (relative to the image base) that is associated to the raw address.

length uint

The number of bytes to read.

Returns

BinaryStreamReader

The created reader.

Exceptions

ArgumentOutOfRangeException

Occurs if address is not a valid address.

EndOfStreamException

Occurs if length is too long.