Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DalamudSystemMenu"/> class.
        /// </summary>
        /// <param name="dalamud">The dalamud instance to act on.</param>
        public DalamudSystemMenu(Dalamud dalamud)
        {
            this.dalamud = dalamud;

            var openSystemMenuAddress = this.dalamud.SigScanner.ScanText("E8 ?? ?? ?? ?? 32 C0 4C 8B AC 24 ?? ?? ?? ?? 48 8B 8D ?? ?? ?? ??");

            this.hookAgentHudOpenSystemMenu = new Hook <AgentHudOpenSystemMenuPrototype>(
                openSystemMenuAddress,
                new AgentHudOpenSystemMenuPrototype(this.AgentHudOpenSystemMenuDetour),
                this);

            var atkValueChangeTypeAddress =
                this.dalamud.SigScanner.ScanText("E8 ?? ?? ?? ?? 45 84 F6 48 8D 4C 24 ??");

            this.atkValueChangeType =
                Marshal.GetDelegateForFunctionPointer <AtkValueChangeType>(atkValueChangeTypeAddress);

            var atkValueSetStringAddress =
                this.dalamud.SigScanner.ScanText("E8 ?? ?? ?? ?? 41 03 ED");

            this.atkValueSetString = Marshal.GetDelegateForFunctionPointer <AtkValueSetString>(atkValueSetStringAddress);

            var uiModuleRequestMainCommandAddress = this.dalamud.SigScanner.ScanText(
                "40 53 56 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B 01 8B DA 48 8B F1 FF 90 ?? ?? ?? ??");

            this.hookUiModuleRequestMainCommand = new Hook <UiModuleRequestMainCommand>(
                uiModuleRequestMainCommandAddress,
                new UiModuleRequestMainCommand(this.UiModuleRequestMainCommandDetour),
                this);
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DalamudAtkTweaks"/> class.
        /// </summary>
        public DalamudAtkTweaks()
        {
            var sigScanner = Service <SigScanner> .Get();

            var openSystemMenuAddress = sigScanner.ScanText("E8 ?? ?? ?? ?? 32 C0 4C 8B AC 24 ?? ?? ?? ?? 48 8B 8D ?? ?? ?? ??");

            this.hookAgentHudOpenSystemMenu = new Hook <AgentHudOpenSystemMenuPrototype>(openSystemMenuAddress, this.AgentHudOpenSystemMenuDetour);

            var atkValueChangeTypeAddress = sigScanner.ScanText("E8 ?? ?? ?? ?? 45 84 F6 48 8D 4C 24 ??");

            this.atkValueChangeType = Marshal.GetDelegateForFunctionPointer <AtkValueChangeType>(atkValueChangeTypeAddress);

            var atkValueSetStringAddress = sigScanner.ScanText("E8 ?? ?? ?? ?? 41 03 ED");

            this.atkValueSetString = Marshal.GetDelegateForFunctionPointer <AtkValueSetString>(atkValueSetStringAddress);

            var uiModuleRequestMainCommandAddress = sigScanner.ScanText("40 53 56 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8B 01 8B DA 48 8B F1 FF 90 ?? ?? ?? ??");

            this.hookUiModuleRequestMainCommand = new Hook <UiModuleRequestMainCommand>(uiModuleRequestMainCommandAddress, this.UiModuleRequestMainCommandDetour);

            var atkUnitBaseReceiveGlobalEventAddress = sigScanner.ScanText("48 89 5C 24 ?? 48 89 7C 24 ?? 55 41 56 41 57 48 8B EC 48 83 EC 50 44 0F B7 F2 ");

            this.hookAtkUnitBaseReceiveGlobalEvent = new Hook <AtkUnitBaseReceiveGlobalEvent>(atkUnitBaseReceiveGlobalEventAddress, this.AtkUnitBaseReceiveGlobalEventDetour);

            this.locDalamudPlugins  = Loc.Localize("SystemMenuPlugins", "Dalamud Plugins");
            this.locDalamudSettings = Loc.Localize("SystemMenuSettings", "Dalamud Settings");

            var contextMenu = Service <ContextMenu> .Get();

            contextMenu.ContextMenuOpened += this.ContextMenuOnContextMenuOpened;
        }