Table of Contents

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

address nint

The address of the first expected byte.

expected BytePattern

The bytes the code at address must match, which contain the replaced ones.

offset int

The position in expected of the first replaced byte.

replacement ReadOnlySpan<byte>

The bytes written. They are copied.

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>