diff --git a/Dalamud/Hooking/Hook.cs b/Dalamud/Hooking/Hook.cs index f9892e92f..13b199dea 100644 --- a/Dalamud/Hooking/Hook.cs +++ b/Dalamud/Hooking/Hook.cs @@ -27,7 +27,7 @@ namespace Dalamud.Hooking /// A memory address to install a hook. /// Callback function. Delegate must have a same original function prototype. public Hook(IntPtr address, T detour) - : this(address, detour, false) + : this(address, detour, false, Assembly.GetCallingAssembly()) { } @@ -40,6 +40,11 @@ namespace Dalamud.Hooking /// Callback function. Delegate must have a same original function prototype. /// Use the MinHook hooking library instead of Reloaded. public Hook(IntPtr address, T detour, bool useMinHook) + : this(address, detour, useMinHook, Assembly.GetCallingAssembly()) + { + } + + private Hook(IntPtr address, T detour, bool useMinHook, Assembly callingAssembly) { address = HookManager.FollowJmp(address); this.isMinHook = EnvironmentConfiguration.DalamudForceMinHook || useMinHook; @@ -69,7 +74,7 @@ namespace Dalamud.Hooking this.hookImpl = ReloadedHooks.Instance.CreateHook(detour, address.ToInt64()); } - HookManager.TrackedHooks.Add(new HookInfo(this, detour, Assembly.GetCallingAssembly())); + HookManager.TrackedHooks.Add(new HookInfo(this, detour, callingAssembly)); } ///