diff --git a/Dalamud/Game/Internal/Gui/GameGui.cs b/Dalamud/Game/Internal/Gui/GameGui.cs index cc8cb5b64..431c9ad6e 100644 --- a/Dalamud/Game/Internal/Gui/GameGui.cs +++ b/Dalamud/Game/Internal/Gui/GameGui.cs @@ -8,7 +8,10 @@ using Serilog; using SharpDX; namespace Dalamud.Game.Internal.Gui { - public sealed class GameGui : IDisposable { + public sealed class GameGui : IDisposable + { + private readonly Dalamud dalamud; + private GameGuiAddressResolver Address { get; } public ChatGui Chat { get; private set; } @@ -100,7 +103,10 @@ namespace Dalamud.Game.Internal.Gui { /// public EventHandler HoveredActionChanged { get; set; } - public GameGui(IntPtr baseAddress, SigScanner scanner, Dalamud dalamud) { + public GameGui(IntPtr baseAddress, SigScanner scanner, Dalamud dalamud) + { + this.dalamud = dalamud; + Address = new GameGuiAddressResolver(baseAddress); Address.Setup(scanner); @@ -424,7 +430,7 @@ namespace Dalamud.Game.Internal.Gui { /// IntPtr pointing to UI module public IntPtr GetUIModule() { - return this.getUiModule(Marshal.ReadIntPtr(Address.GetUIModulePtr)); + return this.getUiModule(this.dalamud.Framework.Address.BaseAddress); } /// diff --git a/Dalamud/Game/Internal/Gui/GameGuiAddressResolver.cs b/Dalamud/Game/Internal/Gui/GameGuiAddressResolver.cs index ca617bc84..f163df548 100644 --- a/Dalamud/Game/Internal/Gui/GameGuiAddressResolver.cs +++ b/Dalamud/Game/Internal/Gui/GameGuiAddressResolver.cs @@ -20,7 +20,6 @@ namespace Dalamud.Game.Internal.Gui { public IntPtr GetBaseUIObject { get; private set; } public IntPtr GetUIObjectByName { get; private set; } public IntPtr GetUIModule { get; private set; } - public IntPtr GetUIModulePtr { get; private set; } public GameGuiAddressResolver(IntPtr baseAddress) { BaseAddress = baseAddress; @@ -48,7 +47,6 @@ namespace Dalamud.Game.Internal.Gui { GetBaseUIObject = sig.ScanText("E8 ?? ?? ?? ?? 41 B8 01 00 00 00 48 8D 15 ?? ?? ?? ?? 48 8B 48 20 E8 ?? ?? ?? ?? 48 8B CF"); GetUIObjectByName = sig.ScanText("E8 ?? ?? ?? ?? 48 8B CF 48 89 87 ?? ?? 00 00 E8 ?? ?? ?? ?? 41 B8 01 00 00 00"); GetUIModule = sig.ScanText("E8 ?? ?? ?? ?? 83 3B 01"); - GetUIModulePtr = sig.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 48 8D 54 24 ?? 48 83 C1 10 E8 ?? ?? ?? ??"); } } }