Table of Contents

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

address nint
expected BytePattern
offset int
replacement ReadOnlySpan<byte>

Exceptions

ArgumentOutOfRangeException

address is 0, offset is negative, replacement is empty, or the replaced bytes extend past the end of expected.

ArgumentNullException

expected is null.

Properties

Offset

The position in Expected of the first replaced byte.

public int Offset { get; }

Property Value

int

Replacement

The bytes written.

public ReadOnlyMemory<byte> Replacement { get; }

Property Value

ReadOnlyMemory<byte>