Class BytePatch
- Namespace
- SkyrimForge.Hooks
- Assembly
- SkyrimForge.dll
Replaces bytes within the expected bytes, such as the constant of one instruction.
public sealed class BytePatch : CodePatch
- Inheritance
-
BytePatch
- Inherited Members
Constructors
BytePatch(nint, BytePattern, int, ReadOnlySpan<byte>)
Creates a patch writing replacement at offset bytes past address.
The code at address must match expected, which contains the replaced bytes.
public BytePatch(nint address, BytePattern expected, int offset, ReadOnlySpan<byte> replacement)
Parameters
addressnintexpectedBytePatternoffsetintreplacementReadOnlySpan<byte>
Exceptions
- ArgumentOutOfRangeException
addressis 0,offsetis negative,replacementis empty, or the replaced bytes extend past the end ofexpected.- ArgumentNullException
expectedisnull.
Properties
Offset
The position in Expected of the first replaced byte.
public int Offset { get; }
Property Value
Replacement
The bytes written.
public ReadOnlyMemory<byte> Replacement { get; }