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
nintThe address of the patch.
patchedBytes
byte[]The bytes that will be written to the patch address.
enable
boolWhether 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
nintThe address of the patch.
asm
IEnumerable<string>The assembly that will be written to the patch address. Each line represented by a string.
enable
boolWhether to enable the patch.
Patch(nint, string, bool)
Creates a new patch.
public Patch(nint address, string asm, bool enable = false)
Parameters
address
nintThe address of the patch.
asm
stringThe assembly that will be written to the patch address.
enable
boolWhether to enable the patch.
Fields
Address
The address of the patch.
public readonly nint Address
Field Value
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
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()