Interface IGameInteropProvider
Service responsible for the creation of hooks.
Assembly: Dalamud.dll
public interface IGameInteropProvider : IDalamudService
Methods
InitializeFromAttributes(object)
Initialize Dalamud.Hooking.Hook1` members decorated with the Dalamud.Utility.Signatures.SignatureAttribute.
Initialize any delegate members decorated with the Dalamud.Utility.Signatures.SignatureAttribute.
Fill out any IntPtr members decorated with the Dalamud.Utility.Signatures.SignatureAttribute with the resolved address.
Errors for fallible signatures will be logged.
void InitializeFromAttributes(object self)
Parameters
| Type | Name | Description |
|---|---|---|
System.Object | self | The object to initialize. |
HookFromFunctionPointerVariable<T>(nint, T)
Creates a hook by replacing the original address with an address pointing to a newly created jump to the detour.
Hook<T> HookFromFunctionPointerVariable<T>(nint address, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.IntPtr | address | A memory address to install a hook. |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |
HookFromImport<T>(ProcessModule?, string, string, uint, T)
Creates a hook by rewriting import table address.
Hook<T> HookFromImport<T>(ProcessModule? module, string moduleName, string functionName, uint hintOrOrdinal, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.Diagnostics.ProcessModule | module | Module to check for. Current process' main module if null. |
System.String | moduleName | Name of the DLL, including the extension. |
System.String | functionName | Decorated name of the function. |
System.UInt32 | hintOrOrdinal | Hint or ordinal. 0 to unspecify. |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |
HookFromSymbol<T>(string, string, T)
Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called.
Hook<T> HookFromSymbol<T>(string moduleName, string exportName, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | moduleName | A name of the module currently loaded in the memory. (e.g. ws2_32.dll). |
System.String | exportName | A name of the exported function name (e.g. send). |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |
HookFromAddress<T>(nint, T)
Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called.
Hook<T> HookFromAddress<T>(nint procAddress, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.IntPtr | procAddress | A memory address to install a hook. |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |
HookFromAddress<T>(nuint, T)
Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called.
Hook<T> HookFromAddress<T>(nuint procAddress, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.UIntPtr | procAddress | A memory address to install a hook. |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |
HookFromAddress<T>(void*, T)
Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called.
Hook<T> HookFromAddress<T>(void* procAddress, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.Void* | procAddress | A memory address to install a hook. |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |
HookFromSignature<T>(string, T)
Creates a hook from a signature into the Dalamud target module.
Hook<T> HookFromSignature<T>(string signature, T detour) where T : Delegate
Returns
Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | signature | Signature of function to hook. |
<T> | detour | Callback function. Delegate must have a same original function prototype. |
Type Parameters
| Name | Description |
|---|---|
T | Delegate of detour. |