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
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
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
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
public T OriginalDisposeSafe { get; }
IsEnabled
Gets a value indicating whether or not the hook is enabled.
View Source
public virtual bool IsEnabled { get; }
IsDisposed
Gets a value indicating whether or not the hook has been disposed.
View Source
public bool IsDisposed { get; }
BackendName
Gets the name of the hooking backend used for the hook.
View Source
public virtual string BackendName { get; }
Methods
Dispose()
Remove a hook from the current process.
View Source
public virtual void Dispose()
Enable()
Starts intercepting a call to the function.
View Source
public virtual void Enable()
Disable()
Stops intercepting a call to the function.
View Source
public virtual void Disable()
CheckDisposed()
Check if this object has been disposed already.
View Source
protected void CheckDisposed()
Implements
- Dalamud.Hooking.IDalamudHook
System.IDisposable