Пример #1
0
        public static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);

            PrintSuccess("[>]=-- Zat's CSGO-ESP");
            KeyUtils = new KeyUtils();
            ConfigUtils = new CSGOConfigUtils();

            ConfigUtils.SetValue("espEnabled", true);
            ConfigUtils.SetValue("espBox", false);
            ConfigUtils.SetValue("espSkeleton", true);
            ConfigUtils.SetValue("espName", false);
            ConfigUtils.SetValue("espHealth", true);

            ConfigUtils.SetValue("aimEnabled", true);
            ConfigUtils.SetValue("aimKey", WinAPI.VirtualKeyShort.XBUTTON1);
            ConfigUtils.SetValue("aimToggle", false);
            ConfigUtils.SetValue("aimHold", true);
            ConfigUtils.SetValue("aimFov", 30f);
            ConfigUtils.SetValue("aimSmoothEnabled", true);
            ConfigUtils.SetValue("aimSmoothValue", 0.2f);
            ConfigUtils.SetValue("aimFilterSpotted", false);
            ConfigUtils.SetValue("aimFilterSpottedBy", false);
            ConfigUtils.SetValue("aimFilterEnemies", true);
            ConfigUtils.SetValue("aimFilterAllies", false);

            ConfigUtils.SetValue("rcsEnabled", true);
            ConfigUtils.SetValue("rcsForce", 100f);

            ConfigUtils.ReadSettingsFromFile("euc_csgo.cfg");

            PrintInfo("> Waiting for CSGO to start up...");
            while (!ProcUtils.ProcessIsRunning("csgo"))
                Thread.Sleep(250);

            ProcUtils = new ProcUtils("csgo", WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.VirtualMemoryOperation);
            MemUtils = new ExternalUtilsCSharp.MemUtils();
            MemUtils.Handle = ProcUtils.Handle;

            PrintInfo("> Waiting for CSGOs window to show up...");
            while ((hWnd = WinAPI.FindWindowByCaption(hWnd, "Counter-Strike: Global Offensive")) == IntPtr.Zero)
                Thread.Sleep(250);

            ProcessModule clientDll, engineDll;
            PrintInfo("> Waiting for CSGO to load client.dll...");
            while ((clientDll = ProcUtils.GetModuleByName(@"bin\client.dll")) == null)
                Thread.Sleep(250);
            PrintInfo("> Waiting for CSGO to load engine.dll...");
            while ((engineDll = ProcUtils.GetModuleByName(@"engine.dll")) == null)
                Thread.Sleep(250);

            Framework = new Framework(clientDll, engineDll);

            PrintInfo("> Initializing overlay");
            using (SHDXOverlay = new SharpDXOverlay())
            {
                SHDXOverlay.Attach(hWnd);
                SHDXOverlay.TickEvent += overlay_TickEvent;

                InitializeComponents();
                SharpDXRenderer renderer = SHDXOverlay.Renderer;
                TextFormat smallFont = renderer.CreateFont("smallFont", "Century Gothic", 10f);
                TextFormat largeFont = renderer.CreateFont("largeFont", "Century Gothic", 14f);
                TextFormat heavyFont = renderer.CreateFont("heavyFont", "Century Gothic", 14f, FontStyle.Normal, FontWeight.Heavy);

                windowMenu.Font = smallFont;
                windowMenu.Caption.Font = largeFont;
                windowGraphs.Font = smallFont;
                windowGraphs.Caption.Font = largeFont;
                windowSpectators.Font = smallFont;
                windowSpectators.Caption.Font = largeFont;
                graphMemRead.Font = smallFont;
                graphMemWrite.Font = smallFont;
                for (int i = 0; i < ctrlPlayerESP.Length; i++)
                {
                    ctrlPlayerESP[i].Font = heavyFont;
                    SHDXOverlay.ChildControls.Add(ctrlPlayerESP[i]);
                }
                ctrlRadar.Font = smallFont;

                windowMenu.ApplySettings(ConfigUtils);

                SHDXOverlay.ChildControls.Add(ctrlRadar);
                SHDXOverlay.ChildControls.Add(windowMenu);
                SHDXOverlay.ChildControls.Add(windowGraphs);
                SHDXOverlay.ChildControls.Add(windowSpectators);
                SHDXOverlay.ChildControls.Add(cursor);
                PrintInfo("> Running overlay");
                System.Windows.Forms.Application.Run(SHDXOverlay);
            }
            ConfigUtils.SaveSettingsToFile("euc_csgo.cfg");
        }