Patch

Namespace: SharpPluginLoader.Core.Memory

Represents a patch in memory.

public struct Patch

Inheritance ObjectValueTypePatch
Implements IDisposable

Fields

Address

The address of the patch.

public nint Address;

OriginalBytes

The original bytes at the patch address.

public Byte[] OriginalBytes;

PatchedBytes

The bytes that will be written to the patch address.

public Byte[] PatchedBytes;

Properties

IsEnabled

Whether the patch is currently enabled.

public bool IsEnabled { get; }

Property Value

Boolean

Constructors

Patch(IntPtr, Byte[], Boolean)

Creates a new patch.

Patch(nint address, Byte[] patchedBytes, bool enable)

Parameters

address IntPtr
The address of the patch.

patchedBytes Byte[]
The bytes that will be written to the patch address.

enable Boolean
Whether to enable the patch.

Patch(IntPtr, String, Boolean)

Creates a new patch.

Patch(nint address, string asm, bool enable)

Parameters

address IntPtr
The address of the patch.

asm String
The assembly that will be written to the patch address.

enable Boolean
Whether to enable the patch.

Patch(IntPtr, IEnumerable<String>, Boolean)

Creates a new patch.

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

Parameters

address IntPtr
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 Boolean
Whether to enable the patch.

Methods

Enable()

Enables the patch.

void Enable()

Disable()

Disables the patch.

void Disable()

Dispose()

void Dispose()