Struct PatchContext
- Namespace
- AsmResolver.Patching
- Assembly
- AsmResolver.dll
Provides members describing the context in which a patch may be situated in.
public readonly struct PatchContext
- Inherited Members
Constructors
PatchContext(ISegment, ulong, ulong, BinaryStreamWriter)
Creates a new instance of the PatchContext structure.
public PatchContext(ISegment segment, ulong imageBase, ulong writerBase, BinaryStreamWriter writer)
Parameters
segment
ISegmentThe segment to be patched.
imageBase
ulongThe image base to assume while patching.
writerBase
ulongThe offset the writer actually started writing the segment at.
writer
BinaryStreamWriterThe object responsible for writing the patches.
Properties
ImageBase
Gets the image base that is assumed while patching.
public ulong ImageBase { get; }
Property Value
Segment
Gets the segment to be patched.
public ISegment Segment { get; }
Property Value
Writer
Gets the object responsible for writing the patches.
public BinaryStreamWriter Writer { get; }
Property Value
WriterBase
Gets the actual offset the writer started writing the segment at.
public ulong WriterBase { get; }
Property Value
Remarks
This property is in most cases equivalent to Segment.Offset
. However, callers may be calling
Write(BinaryStreamWriter) with a BinaryStreamWriter that is not writing the entire
enclosing file (e.g., when calling WriteIntoArray(ISegment)).
Implementations of IPatch should therefore always prefer WriterBase over
Segment.Offset
when adjusting the current offset of Writer.