Dalamud/Dalamud/Game/Gui/GameGuiAddressResolver.cs
Haselnussbomber c0f05614c6
[api11] Some code cleanup and signature replacements (#2066)
* Remove unused code from ChatHandlers

* Replace sigs in DalamudAtkTweaks

* Resolve LocalContentId by using PlayerState.ContentId

* Resolve BuddyList address via UIState.Buddy

* Resolve ObjectTable address via GameObjectManager

* Resolve FateTable address via FateManager

* Resolve GroupManager address via GroupManager

* Resolve JobGauges address via JobGaugeManager.CurrentGauge

* Simplify ItemHover/Out event

* Resolve ToggleUiHide address via RaptureAtkModule.SetUiVisibility

* Resolve PopulateItemLinkObject via InventoryItem.Copy

* Add byte[].AsPointer extension

* Resolve addresses used by ToastGui via UIModule functions

* Use Length from Span as ObjectTableLength

* Replace OpenMapWithMapLink with CS call

* Resolve FrameworkAddressResolver with CS vtable

* Drop unnecessary ToArray in HandlePrintMessage

* Clean up event calls in HandlePrintMessageDetour

* Simplify LocalContentId further

This pointer can't be null, because it's part of the .data section.

* Compare SeStrings in FlyTextGui with SequenceEqual

* Use CS types in FlyTextGuis internal code

* Simplify reading SeStrings internally

* Remove AsPointer again

* Resolve Number/StringArray by type in NamePlateGui

* Fix crashes in HandlePrintMessageDetour

* Resolve InteractableLinkClicked with LogViewer.HandleLinkClick
2024-11-12 08:20:29 -08:00

48 lines
1.7 KiB
C#

namespace Dalamud.Game.Gui;
/// <summary>
/// The address resolver for the <see cref="GameGui"/> class.
/// </summary>
internal sealed class GameGuiAddressResolver : BaseAddressResolver
{
/// <summary>
/// Gets the base address of the native GuiManager class.
/// </summary>
public IntPtr BaseAddress { get; private set; }
/// <summary>
/// Gets the address of the native SetGlobalBgm method.
/// </summary>
public IntPtr SetGlobalBgm { get; private set; }
/// <summary>
/// Gets the address of the native HandleActionHover method.
/// </summary>
public IntPtr HandleActionHover { get; private set; }
/// <summary>
/// Gets the address of the native HandleActionOut method.
/// </summary>
public IntPtr HandleActionOut { get; private set; }
/// <summary>
/// Gets the address of the native HandleImm method.
/// </summary>
public IntPtr HandleImm { get; private set; }
/// <summary>
/// Gets the address of the native Utf8StringFromSequence method.
/// </summary>
public IntPtr Utf8StringFromSequence { get; private set; }
/// <inheritdoc/>
protected override void Setup64Bit(ISigScanner sig)
{
this.SetGlobalBgm = sig.ScanText("E8 ?? ?? ?? ?? 8B 2F");
this.HandleActionHover = sig.ScanText("E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 83 F8 0F");
this.HandleActionOut = sig.ScanText("48 89 5C 24 ?? 57 48 83 EC 20 48 8B DA 48 8B F9 4D 85 C0 74 1F");
this.HandleImm = sig.ScanText("E8 ?? ?? ?? ?? 84 C0 75 10 48 83 FF 09");
this.Utf8StringFromSequence = sig.ScanText("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8D 41 22 66 C7 41 ?? ?? ?? 48 89 01 49 8B D8");
}
}