Class Util
Class providing various helper methods for use in Dalamud and plugins.
Inheritance
Inherited Members
Namespace: Dalamud.Utility
Assembly: Dalamud.dll
Syntax
public static class Util
Properties
| Improve this Doc View SourceAssemblyVersion
Gets the assembly version of Dalamud.
Declaration
public static string AssemblyVersion { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceByteArrayToHex(Byte[], Int32, Int32)
Create a hexdump of the provided bytes.
Declaration
public static string ByteArrayToHex(byte[] bytes, int offset = 0, int bytesPerLine = 16)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | bytes | The bytes to hexdump. |
| System.Int32 | offset | The offset in the byte array to start at. |
| System.Int32 | bytesPerLine | The amount of bytes to display per line. |
Returns
| Type | Description |
|---|---|
| System.String | The generated hexdump in string form. |
DumpMemory(IntPtr, Int32)
Read memory from an offset and hexdump them via Serilog.
Declaration
public static void DumpMemory(IntPtr offset, int len = 512)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | offset | The offset to read from. |
| System.Int32 | len | The length to read. |
Fatal(String, String)
Display an error MessageBox and exit the current process.
Declaration
public static void Fatal(string message, string caption)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | message | MessageBox body. |
| System.String | caption | MessageBox caption (title). |
GetGitHash()
Gets the git hash value from the assembly or null if it cannot be found.
Declaration
public static string GetGitHash()
Returns
| Type | Description |
|---|---|
| System.String | The git hash of the assembly. |
GetUTF8String(Byte[])
Retrieve a UTF8 string from a null terminated byte array.
Declaration
public static string GetUTF8String(byte[] array)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | array | A null terminated UTF8 byte array. |
Returns
| Type | Description |
|---|---|
| System.String | A UTF8 encoded string. |
ShowObject(Object)
Show all properties and fields of the provided object via ImGui.
Declaration
public static void ShowObject(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The object to show. |