Skip to main content
Version: 15.x (API 15) [Current]

Interface IGameInteropProvider

Service responsible for the creation of hooks.

Assembly: Dalamud.dll​
Declaration
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.

Declaration
void InitializeFromAttributes(object self)
Parameters​
TypeNameDescription
System.ObjectselfThe 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.

Declaration
Hook<T> HookFromFunctionPointerVariable<T>(nint address, T detour) where T : Delegate
Returns​

Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.

Parameters​
TypeNameDescription
System.IntPtraddressA memory address to install a hook.
<T>detourCallback function. Delegate must have a same original function prototype.
Type Parameters​
NameDescription
TDelegate of detour.

HookFromImport<T>(ProcessModule?, string, string, uint, T)​

Creates a hook by rewriting import table address.

Declaration
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​
TypeNameDescription
System.Diagnostics.ProcessModulemoduleModule to check for. Current process' main module if null.
System.StringmoduleNameName of the DLL, including the extension.
System.StringfunctionNameDecorated name of the function.
System.UInt32hintOrOrdinalHint or ordinal. 0 to unspecify.
<T>detourCallback function. Delegate must have a same original function prototype.
Type Parameters​
NameDescription
TDelegate of detour.

HookFromSymbol<T>(string, string, T, HookBackend)​

Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called. Please do not use MinHook unless you have thoroughly troubleshot why Reloaded does not work.

Declaration
Hook<T> HookFromSymbol<T>(string moduleName, string exportName, T detour, IGameInteropProvider.HookBackend backend = HookBackend.Automatic) where T : Delegate
Returns​

Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.

Parameters​
TypeNameDescription
System.StringmoduleNameA name of the module currently loaded in the memory. (e.g. ws2_32.dll).
System.StringexportNameA name of the exported function name (e.g. send).
<T>detourCallback function. Delegate must have a same original function prototype.
Dalamud.Plugin.Services.IGameInteropProvider.HookBackendbackendHooking library to use.
Type Parameters​
NameDescription
TDelegate of detour.

HookFromAddress<T>(nint, T, HookBackend)​

Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called. Please do not use MinHook unless you have thoroughly troubleshot why Reloaded does not work.

Declaration
Hook<T> HookFromAddress<T>(nint procAddress, T detour, IGameInteropProvider.HookBackend backend = HookBackend.Automatic) where T : Delegate
Returns​

Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.

Parameters​
TypeNameDescription
System.IntPtrprocAddressA memory address to install a hook.
<T>detourCallback function. Delegate must have a same original function prototype.
Dalamud.Plugin.Services.IGameInteropProvider.HookBackendbackendHooking library to use.
Type Parameters​
NameDescription
TDelegate of detour.

HookFromAddress<T>(nuint, T, HookBackend)​

Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called. Please do not use MinHook unless you have thoroughly troubleshot why Reloaded does not work.

Declaration
Hook<T> HookFromAddress<T>(nuint procAddress, T detour, IGameInteropProvider.HookBackend backend = HookBackend.Automatic) where T : Delegate
Returns​

Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.

Parameters​
TypeNameDescription
System.UIntPtrprocAddressA memory address to install a hook.
<T>detourCallback function. Delegate must have a same original function prototype.
Dalamud.Plugin.Services.IGameInteropProvider.HookBackendbackendHooking library to use.
Type Parameters​
NameDescription
TDelegate of detour.

HookFromAddress<T>(void*, T, HookBackend)​

Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. The hook is not activated until Enable() method is called. Please do not use MinHook unless you have thoroughly troubleshot why Reloaded does not work.

Declaration
Hook<T> HookFromAddress<T>(void* procAddress, T detour, IGameInteropProvider.HookBackend backend = HookBackend.Automatic) where T : Delegate
Returns​

Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.

Parameters​
TypeNameDescription
System.Void*procAddressA memory address to install a hook.
<T>detourCallback function. Delegate must have a same original function prototype.
Dalamud.Plugin.Services.IGameInteropProvider.HookBackendbackendHooking library to use.
Type Parameters​
NameDescription
TDelegate of detour.

HookFromSignature<T>(string, T, HookBackend)​

Creates a hook from a signature into the Dalamud target module.

Declaration
Hook<T> HookFromSignature<T>(string signature, T detour, IGameInteropProvider.HookBackend backend = HookBackend.Automatic) where T : Delegate
Returns​

Dalamud.Hooking.Hook<T>: The hook with the supplied parameters.

Parameters​
TypeNameDescription
System.StringsignatureSignature of function to hook.
<T>detourCallback function. Delegate must have a same original function prototype.
Dalamud.Plugin.Services.IGameInteropProvider.HookBackendbackendHooking library to use.
Type Parameters​
NameDescription
TDelegate of detour.