Class MemoryMappedInputFile
- Namespace
- AsmResolver.IO
- Assembly
- AsmResolver.dll
Represents an input file that is mapped in memory.
public sealed class MemoryMappedInputFile : IInputFile, IDisposable
- Inheritance
-
MemoryMappedInputFile
- Implements
- Inherited Members
- Extension Methods
Constructors
MemoryMappedInputFile(string)
Creates a new reader factory for the provided file.
public MemoryMappedInputFile(string filePath)
Parameters
filePathstringThe path to the file to read.
Properties
BaseAddress
Gets the base address of the data in this input.
public ulong BaseAddress { get; }
Property Value
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
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
Methods
CreateReader(ulong, uint, uint)
Creates a new binary reader at the provided address.
public BinaryStreamReader CreateReader(ulong address, uint rva, uint length)
Parameters
addressulongThe raw address to start reading from.
rvauintThe virtual address (relative to the image base) that is associated to the raw address.
lengthuintThe number of bytes to read.
Returns
- BinaryStreamReader
The created reader.
Exceptions
- ArgumentOutOfRangeException
Occurs if
addressis not a valid address.- EndOfStreamException
Occurs if
lengthis too long.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()