backend name in hook tracker

This commit is contained in:
goat 2021-10-28 01:27:32 +02:00
parent 6c06645b00
commit 4df62e1607
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
4 changed files with 28 additions and 0 deletions

View file

@ -112,6 +112,9 @@ namespace Dalamud.Hooking
/// </summary> /// </summary>
public bool IsDisposed { get; private set; } public bool IsDisposed { get; private set; }
/// <inheritdoc/>
public string BackendName => "Reloaded/Asm";
/// <summary> /// <summary>
/// Remove a hook from the current process. /// Remove a hook from the current process.
/// </summary> /// </summary>

View file

@ -131,6 +131,18 @@ namespace Dalamud.Hooking
/// </summary> /// </summary>
public bool IsDisposed { get; private set; } public bool IsDisposed { get; private set; }
/// <inheritdoc/>
public string BackendName
{
get
{
if (this.isMinHook)
return "MinHook";
return "Reloaded";
}
}
/// <summary> /// <summary>
/// Creates a hook. Hooking address is inferred by calling to GetProcAddress() function. /// Creates a hook. Hooking address is inferred by calling to GetProcAddress() function.
/// The hook is not activated until Enable() method is called. /// The hook is not activated until Enable() method is called.

View file

@ -21,5 +21,10 @@ namespace Dalamud.Hooking
/// Gets a value indicating whether or not the hook is disposed. /// Gets a value indicating whether or not the hook is disposed.
/// </summary> /// </summary>
public bool IsDisposed { get; } public bool IsDisposed { get; }
/// <summary>
/// Gets the name of the hooking backend used for the hook.
/// </summary>
public string BackendName { get; }
} }
} }

View file

@ -4,6 +4,7 @@ using System.Reflection;
using Dalamud.Game; using Dalamud.Game;
using Dalamud.Game.Internal; using Dalamud.Game.Internal;
using Dalamud.Hooking;
using Dalamud.Hooking.Internal; using Dalamud.Hooking.Internal;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using Dalamud.Plugin.Internal; using Dalamud.Plugin.Internal;
@ -196,6 +197,9 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.Text("Status"); ImGui.Text("Status");
ImGui.NextColumn(); ImGui.NextColumn();
ImGui.Text("Backend");
ImGui.NextColumn();
ImGui.Separator(); ImGui.Separator();
ImGui.Separator(); ImGui.Separator();
@ -240,6 +244,10 @@ namespace Dalamud.Interface.Internal.Windows
} }
ImGui.NextColumn(); ImGui.NextColumn();
ImGui.Text(trackedHook.Hook.BackendName);
ImGui.NextColumn();
} }
catch (Exception ex) catch (Exception ex)
{ {