Skip to main content

Class MemoryHelper

A simple class that provides read/write access to arbitrary memory.

Assembly: Dalamud.dll
View Source
Declaration
public static class MemoryHelper

Methods

Cast<T>(nint)

Casts the given memory address as the reference to the live object.

View Source
Declaration
public static ref T Cast<T>(nint memoryAddress) where T : unmanaged
Returns

<T>: The reference to the live object.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address.
Type Parameters
NameDescription
TThe unmanaged type.

Cast<T>(nint, int)

Casts the given memory address as the span of the live object(s).

View Source
Declaration
public static Span<T> Cast<T>(nint memoryAddress, int length) where T : unmanaged
Returns

System.Span<<T>>: The span containing reference to the live object(s).

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address.
System.Int32lengthThe number of items.
Type Parameters
NameDescription
TThe unmanaged type.

CastNullTerminated<T>(nint, int)

Casts the given memory address as the span of the live object(s), until it encounters a zero.

View Source
Declaration
public static Span<T> CastNullTerminated<T>(nint memoryAddress, int maxLength = 2147483647) where T : unmanaged, IEquatable<T>
Returns

System.Span<<T>>: The span containing reference to the live object(s).

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address.
System.Int32maxLengthThe maximum number of items.
Type Parameters
NameDescription
TThe unmanaged type.

Read<T>(nint)

Reads a generic type from a specified memory address.

View Source
Declaration
public static T Read<T>(nint memoryAddress) where T : unmanaged
Returns

<T>: The read in struct.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

Read<T>(nint, bool)

Reads a generic type from a specified memory address.

View Source
Declaration
public static T Read<T>(nint memoryAddress, bool marshal)
Returns

<T>: The read in struct.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.BooleanmarshalSet this to true to enable struct marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

ReadRaw(nint, int)

Reads a byte array from a specified memory address.

View Source
Declaration
public static byte[] ReadRaw(nint memoryAddress, int length)
Returns

System.Byte[]: The read in byte array.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32lengthThe amount of bytes to read starting from the memoryAddress.

Read<T>(nint, int)

Reads a generic type array from a specified memory address.

View Source
Declaration
public static T[] Read<T>(nint memoryAddress, int arrayLength) where T : unmanaged
Returns

<T>[]: The read in struct array.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32arrayLengthThe amount of array items to read.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

Read<T>(nint, int, bool)

Reads a generic type array from a specified memory address.

View Source
Declaration
public static T[] Read<T>(nint memoryAddress, int arrayLength, bool marshal)
Returns

<T>[]: The read in struct array.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32arrayLengthThe amount of array items to read.
System.BooleanmarshalSet this to true to enable struct marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

ReadRawNullTerminated(nint)

Reads a null-terminated byte array from a specified memory address.

View Source
Declaration
public static byte[] ReadRawNullTerminated(nint memoryAddress)
Returns

System.Byte[]: The read in byte array.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.

Read<T>(nint, out T)

Reads a generic type from a specified memory address.

View Source
Declaration
public static void Read<T>(nint memoryAddress, out T value) where T : unmanaged
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
<T>valueLocal variable to receive the read in struct.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

Read<T>(nint, out T, bool)

Reads a generic type from a specified memory address.

View Source
Declaration
public static void Read<T>(nint memoryAddress, out T value, bool marshal)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
<T>valueLocal variable to receive the read in struct.
System.BooleanmarshalSet this to true to enable struct marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

ReadRaw(nint, int, out byte[])

Reads raw data from a specified memory address.

View Source
Declaration
public static void ReadRaw(nint memoryAddress, int length, out byte[] value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32lengthThe amount of bytes to read starting from the memoryAddress.
System.Byte[]valueLocal variable to receive the read in bytes.

Read<T>(nint, int, out T[])

Reads a generic type array from a specified memory address.

View Source
Declaration
public static void Read<T>(nint memoryAddress, int arrayLength, out T[] value) where T : unmanaged
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32arrayLengthThe amount of array items to read.
<T>[]valueThe read in struct array.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

Read<T>(nint, int, bool, out T[])

Reads a generic type array from a specified memory address.

View Source
Declaration
public static void Read<T>(nint memoryAddress, int arrayLength, bool marshal, out T[] value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32arrayLengthThe amount of array items to read.
System.BooleanmarshalSet this to true to enable struct marshalling.
<T>[]valueThe read in struct array.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

EqualsZeroTerminatedString(ReadOnlySpan<char>, nint, Encoding?, int)

Compares if the given char span equals to the null-terminated string at <code class="paramref">memoryAddress</code>.

View Source
Declaration
public static bool EqualsZeroTerminatedString(ReadOnlySpan<char> charSpan, nint memoryAddress, Encoding? encoding = null, int maxLength = 2147483647)
Returns

System.Boolean: Whether they are equal.

Parameters
TypeNameDescription
System.ReadOnlySpan<System.Char>charSpanThe character span.
System.IntPtrmemoryAddressThe address of null-terminated string.
System.Text.EncodingencodingThe encoding of the null-terminated string.
System.Int32maxLengthThe maximum length of the null-terminated string.

ReadStringNullTerminated(nint)

Read a UTF-8 encoded string from a specified memory address.

View Source
Declaration
public static string ReadStringNullTerminated(nint memoryAddress)
Returns

System.String: The read in string.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.

ReadStringNullTerminated(nint, Encoding)

Read a string with the given encoding from a specified memory address.

View Source
Declaration
public static string ReadStringNullTerminated(nint memoryAddress, Encoding encoding)
Returns

System.String: The read in string.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Text.EncodingencodingThe encoding to use to decode the string.

ReadString(nint, int)

Read a UTF-8 encoded string from a specified memory address.

View Source
Declaration
public static string ReadString(nint memoryAddress, int maxLength)
Returns

System.String: The read in string.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32maxLengthThe maximum number of bytes to read.
Note that this is NOT the maximum length of the returned string. |

ReadString(nint, Encoding, int)

Read a string with the given encoding from a specified memory address.

View Source
Declaration
public static string ReadString(nint memoryAddress, Encoding encoding, int maxLength)
Returns

System.String: The read in string.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Text.EncodingencodingThe encoding to use to decode the string.
System.Int32maxLengthThe maximum number of bytes to read.
Note that this is NOT the maximum length of the returned string. |

ReadSeStringNullTerminated(nint)

Read a null-terminated SeString from a specified memory address.

View Source
Declaration
public static SeString ReadSeStringNullTerminated(nint memoryAddress)
Returns

Dalamud.Game.Text.SeStringHandling.SeString: The read in string.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.

ReadSeString(nint, int)

Read an SeString from a specified memory address.

View Source
Declaration
public static SeString ReadSeString(nint memoryAddress, int maxLength)
Returns

Dalamud.Game.Text.SeStringHandling.SeString: The read in string.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32maxLengthThe maximum length of the string.

ReadSeString(Utf8String*)

Read an SeString from a specified Utf8String structure.

View Source
Declaration
public static SeString ReadSeString(Utf8String* utf8String)
Returns

Dalamud.Game.Text.SeStringHandling.SeString: The read in string.

Parameters
TypeNameDescription
FFXIVClientStructs.FFXIV.Client.System.String.Utf8String*utf8StringThe memory address to read from.

ReadSeStringAsString(out bool, nint, int, bool, string)

Reads an SeString from a specified memory address, and extracts the outermost string.

If the SeString is malformed, behavior is undefined.

View Source
Declaration
public static string ReadSeStringAsString(out bool containsNonRepresentedPayload, nint memoryAddress, int maxLength = 2147483647, bool stopOnFirstNonRepresentedPayload = false, string nonRepresentedPayloadReplacement = "*")
Returns

System.String: The read in string.

Parameters
TypeNameDescription
System.BooleancontainsNonRepresentedPayloadWhether the SeString contained a non-represented payload.
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32maxLengthThe maximum length of the string.
System.BooleanstopOnFirstNonRepresentedPayloadStop reading on encountering the first non-represented payload.
What payloads are represented via this function may change. |

| System.String | nonRepresentedPayloadReplacement | Replacement for non-represented payloads. |

ReadStringNullTerminated(nint, out string)

Read a UTF-8 encoded string from a specified memory address.

View Source
Declaration
public static void ReadStringNullTerminated(nint memoryAddress, out string value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.StringvalueThe read in string.

ReadStringNullTerminated(nint, Encoding, out string)

Read a string with the given encoding from a specified memory address.

View Source
Declaration
public static void ReadStringNullTerminated(nint memoryAddress, Encoding encoding, out string value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Text.EncodingencodingThe encoding to use to decode the string.
System.StringvalueThe read in string.

ReadString(nint, out string, int)

Read a UTF-8 encoded string from a specified memory address.

View Source
Declaration
public static void ReadString(nint memoryAddress, out string value, int maxLength)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.StringvalueThe read in string.
System.Int32maxLengthThe maximum length of the string.

ReadString(nint, Encoding, int, out string)

Read a string with the given encoding from a specified memory address.

View Source
Declaration
public static void ReadString(nint memoryAddress, Encoding encoding, int maxLength, out string value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Text.EncodingencodingThe encoding to use to decode the string.
System.Int32maxLengthThe maximum length of the string.
System.StringvalueThe read in string.

ReadSeStringNullTerminated(nint, out SeString)

Read a null-terminated SeString from a specified memory address.

View Source
Declaration
public static void ReadSeStringNullTerminated(nint memoryAddress, out SeString value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
Dalamud.Game.Text.SeStringHandling.SeStringvalueThe read in SeString.

ReadSeString(nint, int, out SeString)

Read an SeString from a specified memory address.

View Source
Declaration
public static void ReadSeString(nint memoryAddress, int maxLength, out SeString value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32maxLengthThe maximum length of the string.
Dalamud.Game.Text.SeStringHandling.SeStringvalueThe read in SeString.

ReadSeString(Utf8String*, out SeString)

Read an SeString from a specified Utf8String structure.

View Source
Declaration
public static void ReadSeString(Utf8String* utf8String, out SeString value)
Parameters
TypeNameDescription
FFXIVClientStructs.FFXIV.Client.System.String.Utf8String*utf8StringThe memory address to read from.
Dalamud.Game.Text.SeStringHandling.SeStringvalueThe read in string.

Write<T>(nint, T)

Writes a generic type to a specified memory address.

View Source
Declaration
public static void Write<T>(nint memoryAddress, T item) where T : unmanaged
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
<T>itemThe item to write to the address.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

Write<T>(nint, T, bool)

Writes a generic type to a specified memory address.

View Source
Declaration
public static void Write<T>(nint memoryAddress, T item, bool marshal)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
<T>itemThe item to write to the address.
System.BooleanmarshalSet this to true to enable struct marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

WriteRaw(nint, byte[])

Writes raw data to a specified memory address.

View Source
Declaration
public static void WriteRaw(nint memoryAddress, byte[] data)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Byte[]dataThe bytes to write to memoryAddress.

Write<T>(nint, T[])

Writes a generic type array to a specified memory address.

View Source
Declaration
public static void Write<T>(nint memoryAddress, T[] items) where T : unmanaged
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to write to.
<T>[]itemsThe array of items to write to the address.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

Write<T>(nint, T[], bool)

Writes a generic type array to a specified memory address.

View Source
Declaration
public static void Write<T>(nint memoryAddress, T[] items, bool marshal)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to write to.
<T>[]itemsThe array of items to write to the address.
System.BooleanmarshalSet this to true to enable struct marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

WriteString(nint, string?)

Write a UTF-8 encoded string to a specified memory address.

View Source
Declaration
public static void WriteString(nint memoryAddress, string? value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to write to.
System.StringvalueThe string to write.

WriteString(nint, string?, Encoding)

Write a string with the given encoding to a specified memory address.

View Source
Declaration
public static void WriteString(nint memoryAddress, string? value, Encoding encoding)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to write to.
System.StringvalueThe string to write.
System.Text.EncodingencodingThe encoding to use.

WriteSeString(nint, SeString?)

Write an SeString to a specified memory address.

View Source
Declaration
public static void WriteSeString(nint memoryAddress, SeString? value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to write to.
Dalamud.Game.Text.SeStringHandling.SeStringvalueThe SeString to write.

Allocate(int)

Allocates fixed size of memory inside the target memory source via Windows API calls. Returns the address of newly allocated memory.

View Source
Declaration
public static nint Allocate(int length)
Returns

System.IntPtr: Address to the newly allocated memory.

Parameters
TypeNameDescription
System.Int32lengthAmount of bytes to be allocated.

Allocate(int, out nint)

Allocates fixed size of memory inside the target memory source via Windows API calls. Returns the address of newly allocated memory.

View Source
Declaration
public static void Allocate(int length, out nint memoryAddress)
Parameters
TypeNameDescription
System.Int32lengthAmount of bytes to be allocated.
System.IntPtrmemoryAddressAddress to the newly allocated memory.

Free(nint)

Frees memory previously allocated with Allocate via Windows API calls.

View Source
Declaration
public static bool Free(nint memoryAddress)
Returns

System.Boolean: True if the operation is successful.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe address of the memory to free.

ChangePermission(nint, int, MemoryProtection)

Changes the page permissions for a specified combination of address and length via Windows API calls.

View Source
Declaration
public static MemoryProtection ChangePermission(nint memoryAddress, int length, MemoryProtection newPermissions)
Returns

Dalamud.Memory.MemoryProtection: The old page permissions.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address for which to change page permissions for.
System.Int32lengthThe region size for which to change permissions for.
Dalamud.Memory.MemoryProtectionnewPermissionsThe new permissions to set.

ChangePermission(nint, int, MemoryProtection, out MemoryProtection)

Changes the page permissions for a specified combination of address and length via Windows API calls.

View Source
Declaration
public static void ChangePermission(nint memoryAddress, int length, MemoryProtection newPermissions, out MemoryProtection oldPermissions)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address for which to change page permissions for.
System.Int32lengthThe region size for which to change permissions for.
Dalamud.Memory.MemoryProtectionnewPermissionsThe new permissions to set.
Dalamud.Memory.MemoryProtectionoldPermissionsThe old page permissions.

ChangePermission<T>(nint, ref T, MemoryProtection, bool)

Changes the page permissions for a specified combination of address and element from which to deduce size via Windows API calls.

View Source
Declaration
public static MemoryProtection ChangePermission<T>(nint memoryAddress, ref T baseElement, MemoryProtection newPermissions, bool marshal)
Returns

Dalamud.Memory.MemoryProtection: The old page permissions.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address for which to change page permissions for.
<T>baseElementThe struct element from which the region size to change permissions for will be calculated.
Dalamud.Memory.MemoryProtectionnewPermissionsThe new permissions to set.
System.BooleanmarshalSet to true to calculate the size of the struct after marshalling instead of before.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

ReadProcessMemory(nint, int)

Reads raw data from a specified memory address via Windows API calls. This is noticably slower than Unsafe or Marshal.

View Source
Declaration
public static byte[] ReadProcessMemory(nint memoryAddress, int length)
Returns

System.Byte[]: The read in bytes.

Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32lengthThe amount of bytes to read starting from the memoryAddress.

ReadProcessMemory(nint, int, out byte[])

Reads raw data from a specified memory address via Windows API calls. This is noticably slower than Unsafe or Marshal.

View Source
Declaration
public static void ReadProcessMemory(nint memoryAddress, int length, out byte[] value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Int32lengthThe amount of bytes to read starting from the memoryAddress.
System.Byte[]valueThe read in bytes.

ReadProcessMemory(nint, ref byte[])

Reads raw data from a specified memory address via Windows API calls. This is noticably slower than Unsafe or Marshal.

View Source
Declaration
public static void ReadProcessMemory(nint memoryAddress, ref byte[] value)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to read from.
System.Byte[]valueThe read in bytes.

WriteProcessMemory(nint, byte[])

Writes raw data to a specified memory address via Windows API calls. This is noticably slower than Unsafe or Marshal.

View Source
Declaration
public static void WriteProcessMemory(nint memoryAddress, byte[] data)
Parameters
TypeNameDescription
System.IntPtrmemoryAddressThe memory address to write to.
System.Byte[]dataThe bytes to write to memoryAddress.

SizeOf<T>()

Returns the size of a specific primitive or struct type.

View Source
Declaration
public static int SizeOf<T>()
Returns

System.Int32: The size of the primitive or struct.##### Type Parameters

NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

SizeOf<T>(bool)

Returns the size of a specific primitive or struct type.

View Source
Declaration
public static int SizeOf<T>(bool marshal)
Returns

System.Int32: The size of the primitive or struct.

Parameters
TypeNameDescription
System.BooleanmarshalIf set to true; will return the size of an element after marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

SizeOf<T>(int)

Returns the size of a specific primitive or struct type.

View Source
Declaration
public static int SizeOf<T>(int elementCount) where T : unmanaged
Returns

System.Int32: The size of the primitive or struct array.

Parameters
TypeNameDescription
System.Int32elementCountThe number of array elements present.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

SizeOf<T>(int, bool)

Returns the size of a specific primitive or struct type.

View Source
Declaration
public static int SizeOf<T>(int elementCount, bool marshal)
Returns

System.Int32: The size of the primitive or struct array.

Parameters
TypeNameDescription
System.Int32elementCountThe number of array elements present.
System.BooleanmarshalIf set to true; will return the size of an element after marshalling.
Type Parameters
NameDescription
TAn individual struct type of a class with an explicit StructLayout.LayoutKind attribute.

GameAllocateUi(ulong, ulong)

Allocate memory in the game's UI memory space.

View Source
Declaration
public static nint GameAllocateUi(ulong size, ulong alignment = 0)
Returns

System.IntPtr: Pointer to the allocated region.

Parameters
TypeNameDescription
System.UInt64sizeAmount of bytes to allocate.
System.UInt64alignmentThe alignment of the allocation.

GameAllocateDefault(ulong, ulong)

Allocate memory in the game's default memory space.

View Source
Declaration
public static nint GameAllocateDefault(ulong size, ulong alignment = 0)
Returns

System.IntPtr: Pointer to the allocated region.

Parameters
TypeNameDescription
System.UInt64sizeAmount of bytes to allocate.
System.UInt64alignmentThe alignment of the allocation.

GameAllocateAnimation(ulong, ulong)

Allocate memory in the game's animation memory space.

View Source
Declaration
public static nint GameAllocateAnimation(ulong size, ulong alignment = 0)
Returns

System.IntPtr: Pointer to the allocated region.

Parameters
TypeNameDescription
System.UInt64sizeAmount of bytes to allocate.
System.UInt64alignmentThe alignment of the allocation.

GameAllocateApricot(ulong, ulong)

Allocate memory in the game's apricot memory space.

View Source
Declaration
public static nint GameAllocateApricot(ulong size, ulong alignment = 0)
Returns

System.IntPtr: Pointer to the allocated region.

Parameters
TypeNameDescription
System.UInt64sizeAmount of bytes to allocate.
System.UInt64alignmentThe alignment of the allocation.

GameAllocateSound(ulong, ulong)

Allocate memory in the game's sound memory space.

View Source
Declaration
public static nint GameAllocateSound(ulong size, ulong alignment = 0)
Returns

System.IntPtr: Pointer to the allocated region.

Parameters
TypeNameDescription
System.UInt64sizeAmount of bytes to allocate.
System.UInt64alignmentThe alignment of the allocation.

GameFree(ref nint, ulong)

Free memory in the game's memory space.

View Source
Declaration
public static void GameFree(ref nint ptr, ulong size)
Parameters
TypeNameDescription
System.IntPtrptrPosition at which the memory to be freed is located.
System.UInt64sizeAmount of bytes to free.

NullTerminate(byte[])

Null-terminate a byte array.

View Source
Declaration
public static byte[] NullTerminate(this byte[] bytes)
Returns

System.Byte[]: The terminated byte array.

Parameters
TypeNameDescription
System.Byte[]bytesThe byte array to terminate.