diff --git a/Dalamud/Game/Addon/Lifecycle/AddonLifecycle.cs b/Dalamud/Game/Addon/Lifecycle/AddonLifecycle.cs index d4e45688d..b188095d0 100644 --- a/Dalamud/Game/Addon/Lifecycle/AddonLifecycle.cs +++ b/Dalamud/Game/Addon/Lifecycle/AddonLifecycle.cs @@ -27,6 +27,7 @@ internal unsafe class AddonLifecycle : IDisposable, IServiceType private readonly AddonLifecycleAddressResolver address; private readonly CallHook onAddonSetupHook; + private readonly CallHook onAddonSetup2Hook; private readonly Hook onAddonFinalizeHook; private readonly CallHook onAddonDrawHook; private readonly CallHook onAddonUpdateHook; @@ -46,6 +47,7 @@ internal unsafe class AddonLifecycle : IDisposable, IServiceType this.framework.Update += this.OnFrameworkUpdate; this.onAddonSetupHook = new CallHook(this.address.AddonSetup, this.OnAddonSetup); + this.onAddonSetup2Hook = new CallHook(this.address.AddonSetup2, this.OnAddonSetup); this.onAddonFinalizeHook = Hook.FromAddress(this.address.AddonFinalize, this.OnAddonFinalize); this.onAddonDrawHook = new CallHook(this.address.AddonDraw, this.OnAddonDraw); this.onAddonUpdateHook = new CallHook(this.address.AddonUpdate, this.OnAddonUpdate); @@ -71,6 +73,7 @@ internal unsafe class AddonLifecycle : IDisposable, IServiceType this.framework.Update -= this.OnFrameworkUpdate; this.onAddonSetupHook.Dispose(); + this.onAddonSetup2Hook.Dispose(); this.onAddonFinalizeHook.Dispose(); this.onAddonDrawHook.Dispose(); this.onAddonUpdateHook.Dispose(); @@ -120,6 +123,7 @@ internal unsafe class AddonLifecycle : IDisposable, IServiceType private void ContinueConstruction() { this.onAddonSetupHook.Enable(); + this.onAddonSetup2Hook.Enable(); this.onAddonFinalizeHook.Enable(); this.onAddonDrawHook.Enable(); this.onAddonUpdateHook.Enable(); diff --git a/Dalamud/Game/Addon/Lifecycle/AddonLifecycleAddressResolver.cs b/Dalamud/Game/Addon/Lifecycle/AddonLifecycleAddressResolver.cs index 7b276c903..ff694c84d 100644 --- a/Dalamud/Game/Addon/Lifecycle/AddonLifecycleAddressResolver.cs +++ b/Dalamud/Game/Addon/Lifecycle/AddonLifecycleAddressResolver.cs @@ -7,9 +7,18 @@ internal class AddonLifecycleAddressResolver : BaseAddressResolver { /// /// Gets the address of the addon setup hook invoked by the AtkUnitManager. + /// There are two callsites for this vFunc, we need to hook both of them to catch both normal UI and special UI cases like dialogue. + /// This is called for a majority of all addon OnSetup's. /// public nint AddonSetup { get; private set; } + /// + /// Gets the address of the other addon setup hook invoked by the AtkUnitManager. + /// There are two callsites for this vFunc, we need to hook both of them to catch both normal UI and special UI cases like dialogue. + /// This seems to be called rarely for specific addons. + /// + public nint AddonSetup2 { get; private set; } + /// /// Gets the address of the addon finalize hook invoked by the AtkUnitManager. /// @@ -42,6 +51,7 @@ internal class AddonLifecycleAddressResolver : BaseAddressResolver protected override void Setup64Bit(SigScanner sig) { this.AddonSetup = sig.ScanText("FF 90 ?? ?? ?? ?? 48 8B 93 ?? ?? ?? ?? 80 8B"); + this.AddonSetup2 = sig.ScanText("FF 90 ?? ?? ?? ?? 48 8B 03 48 8B CB 80 8B"); this.AddonFinalize = sig.ScanText("E8 ?? ?? ?? ?? 48 8B 7C 24 ?? 41 8B C6"); this.AddonDraw = sig.ScanText("FF 90 ?? ?? ?? ?? 83 EB 01 79 C1"); this.AddonUpdate = sig.ScanText("FF 90 ?? ?? ?? ?? 40 88 AF");