Class BytePatch
- Namespace
- SkyrimForge
- 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.
public BytePatch(nint address, BytePattern expected, int offset, ReadOnlySpan<byte> replacement)
Parameters
addressnintThe address of the first expected byte.
expectedBytePatternThe bytes the code at
addressmust match, which contain the replaced ones.offsetintThe position in
expectedof the first replaced byte.replacementReadOnlySpan<byte>The bytes written. They are copied.
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; }