Table of Contents

Struct Patch

Namespace
SharpPluginLoader.Core.Memory
Assembly
SharpPluginLoader.Core.dll

Represents a patch in memory.

public readonly struct Patch : IDisposable
Implements
Inherited Members

Constructors

Patch(nint, byte[], bool)

Creates a new patch.

public Patch(nint address, byte[] patchedBytes, bool enable = false)

Parameters

address nint

The address of the patch.

patchedBytes byte[]

The bytes that will be written to the patch address.

enable bool

Whether to enable the patch.

Patch(nint, IEnumerable<string>, bool)

Creates a new patch.

public Patch(nint address, IEnumerable<string> asm, bool enable = false)

Parameters

address nint

The address of the patch.

asm IEnumerable<string>

The assembly that will be written to the patch address. Each line represented by a string.

enable bool

Whether to enable the patch.

Patch(nint, string, bool)

Creates a new patch.

public Patch(nint address, string asm, bool enable = false)

Parameters

address nint

The address of the patch.

asm string

The assembly that will be written to the patch address.

enable bool

Whether to enable the patch.

Fields

Address

The address of the patch.

public readonly nint Address

Field Value

nint

OriginalBytes

The original bytes at the patch address.

public readonly byte[] OriginalBytes

Field Value

byte[]

PatchedBytes

The bytes that will be written to the patch address.

public readonly byte[] PatchedBytes

Field Value

byte[]

Properties

IsEnabled

Whether the patch is currently enabled.

public bool IsEnabled { get; }

Property Value

bool

Methods

Disable()

Disables the patch.

public void Disable()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Enable()

Enables the patch.

public void Enable()