Exemplo n.º 1
0
        public void Update()
        {
            Manipulator.GetClientRect(Manipulator.AttachedProcess.MainWindowHandle, out RECT hWindow);

            if (hWindow.Equals(lhWindow))
            {
                return;
            }

            var uiWidth  = hWindow.Right - hWindow.Left;
            var uiHeight = hWindow.Bottom - hWindow.Top;

            if (uiWidth == 0 || uiHeight == 0)
            {
                return;
            }

            Manipulator.WriteSingle(UI_ASPECT_RATIO, (float)(uiWidth) / (float)(uiHeight));
            Manipulator.WriteDouble(FB_ASPECT_RATIO, (double)(uiWidth) / (double)(uiHeight));
            Manipulator.WriteSingle(UI_WIDTH_ADDRESS, uiWidth);
            Manipulator.WriteSingle(UI_HEIGHT_ADDRESS, uiHeight);
            Manipulator.WriteInt32(FB1_WIDTH_ADDRESS, uiWidth);
            Manipulator.WriteInt32(FB1_HEIGHT_ADDRESS, uiHeight);

            var resWidth  = Manipulator.ReadInt32(0x0000000140EDA8BC);
            var resHeight = Manipulator.ReadInt32(0x0000000140EDA8C0);

            Manipulator.WriteInt32(0x00000001411AD608, 0);                 // Set that f*****g whatever shitty checking flag to 0
            Manipulator.WriteInt32(0x0000000140EDA8E4, resWidth);          // RESOLUTION_WIDTH
            Manipulator.WriteInt32(0x0000000140EDA8E8, resHeight);         // RESOLUTION_HEIGHT

            Manipulator.WriteSingle(0x00000001411A1900, 0);                // WTF FROGGY? 0x00000001411A1870 + 0x90
            Manipulator.WriteSingle(0x00000001411A1904, (float)resWidth);  // RESOLUTION_WIDTH
            Manipulator.WriteSingle(0x00000001411A1908, (float)resHeight); // RESOLUTION_HEIGHT

            lhWindow = hWindow;
        }