Ejemplo n.º 1
0
 public ClientInterface(SigScanner scanner, DataManager dataManager)
 {
     DataManager      = dataManager;
     SigScanner       = scanner;
     this.getUiModule = Marshal.GetDelegateForFunctionPointer <GetUiModuleDelegate>(scanner.ScanText("E8 ?? ?? ?? ?? 48 8B C8 48 8B 10 FF 52 40 80 88 ?? ?? ?? ?? 01 E9"));
     ready            = true;
 }
Ejemplo n.º 2
0
        public GameGui(IntPtr baseAddress, SigScanner scanner, Dalamud dalamud)
        {
            this.dalamud = dalamud;

            Address = new GameGuiAddressResolver(baseAddress);
            Address.Setup(scanner);

            Log.Verbose("===== G A M E G U I =====");

            Log.Verbose("GameGuiManager address {Address}", Address.BaseAddress);
            Log.Verbose("SetGlobalBgm address {Address}", Address.SetGlobalBgm);
            Log.Verbose("HandleItemHover address {Address}", Address.HandleItemHover);
            Log.Verbose("HandleItemOut address {Address}", Address.HandleItemOut);
            Log.Verbose("GetUIObject address {Address}", Address.GetUIObject);
            Log.Verbose("GetAgentModule address {Address}", Address.GetAgentModule);

            Chat        = new ChatGui(Address.ChatManager, scanner, dalamud);
            PartyFinder = new PartyFinderGui(scanner, dalamud);
            Toast       = new ToastGui(scanner, dalamud);

            this.setGlobalBgmHook =
                new Hook <SetGlobalBgmDelegate>(Address.SetGlobalBgm,
                                                new SetGlobalBgmDelegate(HandleSetGlobalBgmDetour),
                                                this);
            this.handleItemHoverHook =
                new Hook <HandleItemHoverDelegate>(Address.HandleItemHover,
                                                   new HandleItemHoverDelegate(HandleItemHoverDetour),
                                                   this);

            this.handleItemOutHook =
                new Hook <HandleItemOutDelegate>(Address.HandleItemOut,
                                                 new HandleItemOutDelegate(HandleItemOutDetour),
                                                 this);

            this.handleActionHoverHook =
                new Hook <HandleActionHoverDelegate>(Address.HandleActionHover,
                                                     new HandleActionHoverDelegate(HandleActionHoverDetour),
                                                     this);
            this.handleActionOutHook =
                new Hook <HandleActionOutDelegate>(Address.HandleActionOut,
                                                   new HandleActionOutDelegate(HandleActionOutDetour),
                                                   this);

            this.getUIObject = Marshal.GetDelegateForFunctionPointer <GetUIObjectDelegate>(Address.GetUIObject);

            this.getMatrixSingleton =
                Marshal.GetDelegateForFunctionPointer <GetMatrixSingletonDelegate>(Address.GetMatrixSingleton);

            this.screenToWorldNative =
                Marshal.GetDelegateForFunctionPointer <ScreenToWorldNativeDelegate>(Address.ScreenToWorld);

            this.toggleUiHideHook = new Hook <ToggleUiHideDelegate>(Address.ToggleUiHide, new ToggleUiHideDelegate(ToggleUiHideDetour), this);

            this.GetBaseUIObject   = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjectDelegate>(Address.GetBaseUIObject);
            this.getUIObjectByName = Marshal.GetDelegateForFunctionPointer <GetUIObjectByNameDelegate>(Address.GetUIObjectByName);

            this.getUiModule    = Marshal.GetDelegateForFunctionPointer <GetUiModuleDelegate>(Address.GetUIModule);
            this.getAgentModule = Marshal.GetDelegateForFunctionPointer <GetAgentModuleDelegate>(Address.GetAgentModule);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameGui"/> class.
        /// This class is responsible for many aspects of interacting with the native game UI.
        /// </summary>
        /// <param name="baseAddress">The base address of the native GuiManager class.</param>
        /// <param name="scanner">The SigScanner instance.</param>
        /// <param name="dalamud">The Dalamud instance.</param>
        internal GameGui(IntPtr baseAddress, SigScanner scanner, Dalamud dalamud)
        {
            this.dalamud = dalamud;

            this.address = new GameGuiAddressResolver(baseAddress);
            this.address.Setup(scanner);

            Log.Verbose("===== G A M E G U I =====");

            Log.Verbose($"GameGuiManager address 0x{this.address.BaseAddress.ToInt64():X}");
            Log.Verbose($"SetGlobalBgm address 0x{this.address.SetGlobalBgm.ToInt64():X}");
            Log.Verbose($"HandleItemHover address 0x{this.address.HandleItemHover.ToInt64():X}");
            Log.Verbose($"HandleItemOut address 0x{this.address.HandleItemOut.ToInt64():X}");
            Log.Verbose($"HandleImm address 0x{this.address.HandleImm.ToInt64():X}");
            Log.Verbose($"GetUIObject address 0x{this.address.GetUIObject.ToInt64():X}");
            Log.Verbose($"GetAgentModule address 0x{this.address.GetAgentModule.ToInt64():X}");

            this.Chat        = new ChatGui(this.address.ChatManager, scanner, dalamud);
            this.PartyFinder = new PartyFinderGui(scanner, dalamud);
            this.Toast       = new ToastGui(scanner, dalamud);
            this.FlyText     = new FlyTextGui(scanner, dalamud);

            this.setGlobalBgmHook = new Hook <SetGlobalBgmDelegate>(this.address.SetGlobalBgm, this.HandleSetGlobalBgmDetour);

            this.handleItemHoverHook = new Hook <HandleItemHoverDelegate>(this.address.HandleItemHover, this.HandleItemHoverDetour);
            this.handleItemOutHook   = new Hook <HandleItemOutDelegate>(this.address.HandleItemOut, this.HandleItemOutDetour);

            this.handleActionHoverHook = new Hook <HandleActionHoverDelegate>(this.address.HandleActionHover, this.HandleActionHoverDetour);
            this.handleActionOutHook   = new Hook <HandleActionOutDelegate>(this.address.HandleActionOut, this.HandleActionOutDetour);

            this.handleImmHook = new Hook <HandleImmDelegate>(this.address.HandleImm, this.HandleImmDetour);

            this.getUIObject = Marshal.GetDelegateForFunctionPointer <GetUIObjectDelegate>(this.address.GetUIObject);

            this.getMatrixSingleton = Marshal.GetDelegateForFunctionPointer <GetMatrixSingletonDelegate>(this.address.GetMatrixSingleton);

            this.screenToWorldNative = Marshal.GetDelegateForFunctionPointer <ScreenToWorldNativeDelegate>(this.address.ScreenToWorld);

            this.toggleUiHideHook = new Hook <ToggleUiHideDelegate>(this.address.ToggleUiHide, this.ToggleUiHideDetour);

            this.GetBaseUIObject   = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjectDelegate>(this.address.GetBaseUIObject);
            this.getUIObjectByName = Marshal.GetDelegateForFunctionPointer <GetUIObjectByNameDelegate>(this.address.GetUIObjectByName);

            this.getUiModule    = Marshal.GetDelegateForFunctionPointer <GetUiModuleDelegate>(this.address.GetUIModule);
            this.getAgentModule = Marshal.GetDelegateForFunctionPointer <GetAgentModuleDelegate>(this.address.GetAgentModule);
        }
Ejemplo n.º 4
0
        public GameClient()
        {
            if (Plugin.Dalamud == null)
            {
                return;
            }

            // Get UI module.
            IntPtr getUiModulePointer = Plugin.Dalamud.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? 48 83 7F ?? 00 48 8B F0");

            this.uiModulePointer = Plugin.Dalamud.TargetModuleScanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 48 8D 54 24 ?? 48 83 C1 10 E8 ?? ?? ?? ??");
            this.getUI           = Marshal.GetDelegateForFunctionPointer <GetUiModuleDelegate>(getUiModulePointer);

            // Get chat box module.
            IntPtr chatBoxModulePointer = Plugin.Dalamud.TargetModuleScanner.ScanText("48 89 5C 24 ?? 57 48 83 EC 20 48 8B FA 48 8B D9 45 84 C9");

            this.getChatBox = Marshal.GetDelegateForFunctionPointer <GetChatBoxModuleDelegate>(chatBoxModulePointer);
        }