Skip to main content

Class Hook<T>

Manages a hook which can be used to intercept a call to native function. This class is basically a thin wrapper around the LocalHook type to provide helper functions.

Assembly: Dalamud.dll
View Source
Declaration
public abstract class Hook<T> : IDalamudHook, IDisposable where T : Delegate

Implements:
Dalamud.Hooking.IDalamudHook, System.IDisposable

Properties

Address

Gets a memory address of the target function.

View Source
Declaration
public nint Address { get; }

Original

Gets a delegate function that can be used to call the actual function as if function is not hooked yet.

View Source
Declaration
public virtual T Original { get; }

OriginalDisposeSafe

Gets a delegate function that can be used to call the actual function as if function is not hooked yet. This can be called even after Dispose.

View Source
Declaration
public T OriginalDisposeSafe { get; }

IsEnabled

Gets a value indicating whether or not the hook is enabled.

View Source
Declaration
public virtual bool IsEnabled { get; }

IsDisposed

Gets a value indicating whether or not the hook has been disposed.

View Source
Declaration
public bool IsDisposed { get; }

BackendName

Gets the name of the hooking backend used for the hook.

View Source
Declaration
public virtual string BackendName { get; }

Methods

Dispose()

Remove a hook from the current process.

View Source
Declaration
public virtual void Dispose()

Enable()

Starts intercepting a call to the function.

View Source
Declaration
public virtual void Enable()

Disable()

Stops intercepting a call to the function.

View Source
Declaration
public virtual void Disable()

CheckDisposed()

Check if this object has been disposed already.

View Source
Declaration
protected void CheckDisposed()

Implements