Exemple #1
0
        public static void StealName(int id)
        {
            ConVar nick = new ConVar("name");

            nick.ClearCallbacks();
            ClientCMD.Exec("name \" " + new Entity(id).Name2 + " \"");
        }
Exemple #2
0
        private void EnabledOnValueChange(object sender, SwitcherEventArgs e)
        {
            if (e.NewValue)
            {
                if (e.OldValue)
                {
                    //todo delete
                    if (AppDomain.CurrentDomain.GetAssemblies().Any(x => !x.GlobalAssemblyCache && x.GetName().Name.Contains("Zoomhack")))
                    {
                        Hud.DisplayWarning("O9K.Hud // ZoomHack is already included in O9K.Hud");
                    }
                }

                foreach (var cmd in this.consoleCommands)
                {
                    Game.GetConsoleVar(cmd.Key).SetValue(cmd.Value);
                }

                this.zoomVar = Game.GetConsoleVar("dota_camera_distance");

                this.zoom.ValueChange += this.ZoomOnValueChange;
                this.key.ValueChange  += this.KeyOnValueChange;
            }
            else
            {
                this.key.ValueChange         -= this.KeyOnValueChange;
                this.zoom.ValueChange        -= this.ZoomOnValueChange;
                this.inputManager.MouseWheel -= this.OnMouseWheel;

                this.zoomVar.SetValue(GameData.DefaultZoom);
            }
        }
Exemple #3
0
    public static bool GetBool(string strName, bool strDefault)
    {
        bool   num;
        object obj;
        string str = ConVar.GetString(strName, (!strDefault ? bool.FalseString : bool.TrueString));

        try
        {
            num = bool.Parse(str);
        }
        catch
        {
            string str1 = strName;
            if (!strDefault)
            {
                obj = null;
            }
            else
            {
                obj = 1;
            }
            num = ConVar.GetInt(str1, (float)obj) != 0;
        }
        return(num);
    }
Exemple #4
0
        public static void ChangeName(string name)
        {
            ConVar nick = new ConVar("name");

            nick.ClearCallbacks();
            ClientCMD.Exec("name \"" + name + "\"");
        }
Exemple #5
0
        public static void InstantChange()
        {
            ConVar nick = new ConVar("name");

            nick.ClearCallbacks();
            ClientCMD.Exec("name \"\n\xAD\xAD\xAD\"");
        }
Exemple #6
0
        public void TestConvarBool()
        {
            ConVar.Set("convar_bool", "true");
            Assert.AreEqual(true, ConVar.Get("convar_bool"));

            ConVar.Set("convar_bool", false);
            Assert.AreEqual(false, ConVar.Get("convar_bool"));
        }
Exemple #7
0
        public void TestConvarEnum()
        {
            ConVar.Set("convar_enum", "Pizza");
            Assert.AreEqual(Food.Pizza, ConVar.Get <Food>("convar_enum"));

            ConVar.Set("convar_enum", Food.Spaghetti);
            Assert.AreEqual(Food.Spaghetti, ConVar.Get <Food>("convar_enum"));
        }
Exemple #8
0
        protected override void OnActivate()
        {
            this.Hotkey = new HotkeySelector(Key.LeftCtrl, this.KeyPressed, HotkeyFlags.Down | HotkeyFlags.Up);

            this.menuManager.Value.RegisterMenu(this);

            this.rFarZConVar          = Game.GetConsoleVar("r_farz");
            this.cameraDistanceConVar = Game.GetConsoleVar("dota_camera_distance");
            this.ZoomCheatFlagsActive = false;

            this.ZoomSlider.ValueChanging      += this.ZoomSliderValueChanging;
            this.inputManager.Value.MouseWheel += this.InputManagerMouseWheel;
            this.ZoomValue = this.ZoomSlider.Value;
        }
Exemple #9
0
        protected override void OnActivate()
        {
            this.rFarZConVar          = Game.GetConsoleVar("r_farz");
            this.cameraDistanceConVar = Game.GetConsoleVar("dota_camera_distance");
            this.ZoomCheatFlagsActive = false;

            this.factory    = MenuFactory.Create("ZoomHack");
            this.key        = this.factory.Item("Key", new KeyBind(0x11, KeyBindType.Press));
            this.zoomSlider = this.factory.Item("Camera Distance", new Slider(DefaultZoomValue, MinZoomValue, MaxZoomValue));
            this.zoomSlider.Item.ValueChanged  += this.ItemValueChanged;
            this.inputManager.Value.MouseWheel += this.InputManagerMouseWheel;

            this.ZoomValue = this.zoomSlider;
        }
Exemple #10
0
    public static float GetFloat(string strName, float strDefault)
    {
        string str = ConVar.GetString(strName, string.Empty);

        if (str.Length == 0)
        {
            return(strDefault);
        }
        float single = strDefault;

        if (float.TryParse(str, out single))
        {
            return(single);
        }
        return(strDefault);
    }
Exemple #11
0
        /// <summary>
        /// Reads the config file by path into convars
        /// </summary>
        /// <param name="file">Path to the config file</param>
        private static void ReadConfig(string file)
        {
            // todo protection
            var path  = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file);
            var lines = File.ReadAllLines(path);

            foreach (var line in lines)
            {
                var split = line.Split(' ');

                var name  = split[0];
                var value = string.Join(" ", split.Skip(1));

                ConVar.Set(name, value);
            }
        }
Exemple #12
0
        public override void Load()
        {
            AddButton("Exit", () => Engine.CreateYesNoPrompt("Exit Program?", () => Environment.Exit(0)).Center((Engine.Window.WindowSize / 2)));
            AddButton("Stop", RealSenseCamera.Stop);
            AddButton("Start", RealSenseCamera.Start);

            Engine.Camera3D.SetPerspective(Engine.Window.WindowSize, (90.0f).ToRad(), NearClip, 100);

            LegShader = new ShaderProgram(new ShaderStage(ShaderType.VertexShader, "content/shaders/leg.vert"),
                                          new ShaderStage(ShaderType.FragmentShader, "content/shaders/leg.frag"));

            VertsMesh = new Mesh3D();
            VertsMesh.PrimitiveType = PrimitiveType.Points;
            VertsMesh.SetVertices(new Vertex3());

            // Variables
            Sparse        = ConVar.Register(nameof(Sparse).ToLower(), 0);         // 3
            LegLength     = ConVar.Register(nameof(LegLength).ToLower(), 100.0f); // 1.0f
            LegWidth      = ConVar.Register(nameof(LegWidth).ToLower(), 100.0f);  // 0.5f
            PickDistance  = ConVar.Register(nameof(PickDistance).ToLower(), 1.0f);
            PickSize      = ConVar.Register(nameof(PickSize).ToLower(), 0.01f);   // 0.025f
            PickSampleNum = ConVar.Register(nameof(PickSampleNum).ToLower(), 10); // 10

            ConCmd.Register("list", (Argv) => {
                GConsole.WriteLine(Sparse);
                GConsole.WriteLine(LegLength);
                GConsole.WriteLine(LegWidth);
                GConsole.WriteLine(PickDistance);
                GConsole.WriteLine(PickSize);
                GConsole.WriteLine(PickSampleNum);
            });

            Thread PollingThread = new Thread(() => {
                while (true)
                {
                    RealSenseCamera.PollForFrames(OnPointCloud: OnPointCloud);
                    Thread.Sleep(0);
                }
            });

            PollingThread.IsBackground = true;
            PollingThread.Start();

            Engine.Camera3D.Position = new Vector3(0, 0, -1);
            Engine.Camera3D.LookAt(Vector3.Zero);
            Engine.Camera3D.Position = new Vector3(0, 0, -NearClip);
        }
Exemple #13
0
    public void UpdateFromConVar()
    {
        dfSlider component = base.GetComponent <dfSlider>();

        if (component != null)
        {
            component.Value = ConVar.GetFloat(this.convarName, component.Value);
        }
        dfDropdown dropdown = base.GetComponent <dfDropdown>();

        if (dropdown != null)
        {
            if (this.useValuesNotNumbers)
            {
                string str = ConVar.GetString(this.convarName, string.Empty);
                if (!string.IsNullOrEmpty(str))
                {
                    int selectedIndex = dropdown.SelectedIndex;
                    dropdown.SelectedValue = str;
                    if (dropdown.SelectedIndex == -1)
                    {
                        dropdown.SelectedIndex = selectedIndex;
                    }
                }
            }
            else
            {
                int @int = ConVar.GetInt(this.convarName, -1f);
                if (@int != -1)
                {
                    dropdown.SelectedIndex = @int;
                }
            }
        }
        dfCheckbox checkbox = base.GetComponent <dfCheckbox>();

        if (checkbox != null)
        {
            checkbox.IsChecked = ConVar.GetBool(this.convarName, checkbox.IsChecked);
        }
    }
Exemple #14
0
    public void UpdateFromConVar()
    {
        dfSlider component = base.GetComponent <dfSlider>();

        if (component != null)
        {
            component.Value = ConVar.GetFloat(this.convarName, component.Value);
        }
        dfDropdown _dfDropdown = base.GetComponent <dfDropdown>();

        if (_dfDropdown != null)
        {
            if (!this.useValuesNotNumbers)
            {
                int num = ConVar.GetInt(this.convarName, -1f);
                if (num != -1)
                {
                    _dfDropdown.SelectedIndex = num;
                }
            }
            else
            {
                string str = ConVar.GetString(this.convarName, string.Empty);
                if (!string.IsNullOrEmpty(str))
                {
                    int selectedIndex = _dfDropdown.SelectedIndex;
                    _dfDropdown.SelectedValue = str;
                    if (_dfDropdown.SelectedIndex == -1)
                    {
                        _dfDropdown.SelectedIndex = selectedIndex;
                    }
                }
            }
        }
        dfCheckbox flag = base.GetComponent <dfCheckbox>();

        if (flag != null)
        {
            flag.IsChecked = ConVar.GetBool(this.convarName, flag.IsChecked);
        }
    }
Exemple #15
0
        public async Task Convar(CommandContext ctx, string name, string value = null)
        {
            // set or get?
            if (value == null)
            {
                var val = ConVar.Get <string>(name);

                var type   = ConVar.Convars[name].Value;
                var convar = ConVar.Convars[name].Key;

                await ctx.RespondAsync($"\"{name}\" is set to \"{val}\"\n" +
                                       $"type is \"{type.PropertyType}\"\n" +
                                       $"defined in \"{type.DeclaringType.FullName}\"\n" +
                                       $"description is \"{convar.HelpText}\"");

                return;
            }

            ConVar.Set(name, value);
            return;
        }
        public ConsoleCommands(MenuFactory MenuFactory)
        {
            var ConsoleCommandsMenu = MenuFactory.Menu("Console Commands");

            FogItem          = ConsoleCommandsMenu.Item("Fog Disable", true);
            FilteringItem    = ConsoleCommandsMenu.Item("Filtering Disable", true);
            ParticleHackItem = ConsoleCommandsMenu.Item("Particle Hack Enable", true);

            Fog = Game.GetConsoleVar("fog_enable");
            Fog.SetValue(Convert.ToInt32(!FogItem.Value));

            Filtering = Game.GetConsoleVar("fow_client_nofiltering");
            Filtering.SetValue(Convert.ToInt32(FilteringItem.Value));

            ParticleHack = Game.GetConsoleVar("dota_use_particle_fow");
            ParticleHack.SetValue(Convert.ToInt32(!ParticleHackItem.Value));

            FogItem.PropertyChanged          += FogItemChanged;
            FilteringItem.PropertyChanged    += FilteringItemChanged;
            ParticleHackItem.PropertyChanged += ParticleHackItemChanged;
        }
Exemple #17
0
        public WeatherHack(MenuFactory MenuFactory)
        {
            var WeatherHackMenu = MenuFactory.Menu("Weather Hack");

            WeatherItem = WeatherHackMenu.Item("Selected", new StringList(new[]
            {
                "Default",
                "Snow",
                "Rain",
                "Moonbeam",
                "Pestilence",
                "Harvest",
                "Sirocco",
                "Ash",
                "Aurora"
            }));

            Weather = Game.GetConsoleVar("cl_weather");
            Weather.SetValue(WeatherItem.Value.SelectedIndex);

            WeatherItem.PropertyChanged += WeatherItemChanged;
        }
Exemple #18
0
        public static void Start()
        {
            GC.Collect();

            g_EntityList  = new IClientEntityList();
            g_Input       = new CInput();
            g_ConVar      = new CConVarManager();
            g_InputSystem = new CInputSystem();

            var dwMouseEnabled = new ConVar("cl_mouseenable");

            var name = new ConVar("name");


            while (true)
            {
                try
                {
                    g_pEngineClient.Update();

                    if (g_pEngineClient.IsInGame())
                    {
                        if (Config.MiscEnabled && Config.bBhopEnabled)
                        {
                            if (WinAPI.GetAsyncKeyState(32) != 0 && pLocal.IsOnGround())
                            {
                                g_pEngineClient.ForceJUMP();
                            }
                        }

                        bool bMouseEnabled = dwMouseEnabled.GetBool();

                        #region UpdateRegion

                        Update();

                        bool bLocalPlayerAlive = pLocal.GetHealth() > 0;
                        Team iLocalTeamNum     = pLocal.GetTeamNum();

                        Vector localPlayerEyePosition = pLocal.GetEyePosition();

                        Vector viewangles = g_pEngineClient.GetViewAngles();

                        bool FindNewAimBotTarget = false;

                        var LocalWeapon = pLocal.GetActiveWeapon();

                        var LocalWeaponID = LocalWeapon.GetWeaponID();

                        bool bAimBotKey = IsKeyState(Config.iAimbotKey);

                        if (LocalWeapon.IsKnife() || LocalWeapon.IsBomb() || LocalWeapon.IsGrenade())
                        {
                            bAimBotKey = false;
                        }

                        if (!bLocalPlayerAlive)
                        {
                            bAimBotKey = false;
                        }

                        if (LocalWeapon.GetAvailableAmmo() <= 0)
                        {
                            bAimBotKey = false;
                        }

                        if (!WeaponConfig.bAimbotEnabled)
                        {
                            bAimBotKey = false;
                        }

                        if (!bAimBotKey)
                        {
                            WaitBreak   = false;
                            pLastTarget = null;
                        }

                        if (WeaponConfig.bAimbotEnabled && bAimBotKey && pLastTarget == null)
                        {
                            FindNewAimBotTarget = true;
                        }

                        if (pLastTarget != null && WeaponConfig.bVisibleCheck && !pLastTarget.IsSpottedByMask(pLocal))
                        {
                            FindNewAimBotTarget = true;
                        }

                        #endregion

                        #region KeyStateCheck
                        for (int i = 0; i < 255; ++i)
                        {
                            currentKeyState[i] = WinAPI.GetAsyncKeyState(i) != 0;
                        }

                        if (Config.iGlowToogleKey != -1 && IsKeyPress(Config.iGlowToogleKey))
                        {
                            Config.bGlowEnabled = !Config.bGlowEnabled;
                        }
                        if (Config.iPanicKey != -1 && IsKeyPress(Config.iPanicKey))
                        {
                            Globals._csgo.ProcessHandle = IntPtr.Zero;
                            Globals._csgo.CheckHandle();
                            Environment.Exit(0);
                        }
                        #endregion

                        #region GlowESP

                        GlowESP(iLocalTeamNum, bLocalPlayerAlive);

                        #endregion

                        #region ForeachPlayerList
                        CBasePlayer   pTarget        = null;
                        float         fDistance      = -1;
                        List <string> names_to_steal = new List <string>();

                        foreach (var pPointer in g_EntityList.pPlayerList)
                        {
                            CBasePlayer pEntity = new CBasePlayer(pPointer);

                            int EntityHealth = pEntity.GetHealth();

                            Team EntityTeamnum = pEntity.GetTeamNum();


                            #region GlowESPOnlyPlayers
                            if (Config.ESPEnabled && !Config.bGlowWeapons && !Config.bGlowBomb && Config.bGlowEnabled && (!Config.bGlowAfterDeath || !bLocalPlayerAlive))
                            {
                                if (!pEntity.IsDormant() && EntityHealth > 0)
                                {
                                    bool bFillerGood = true;
                                    if (iLocalTeamNum == EntityTeamnum && !Config.bGlowAlly)
                                    {
                                        bFillerGood = false;
                                    }
                                    else if (iLocalTeamNum != EntityTeamnum && !Config.bGlowEnemy)
                                    {
                                        bFillerGood = false;
                                    }
                                    if (bFillerGood)
                                    {
                                        Color color = new Color();
                                        switch (Config.iGlowType)
                                        {
                                        case GlowType.Color:
                                            color = iLocalTeamNum == EntityTeamnum ? Config.bGlowAllyVisibleColor : Config.bGlowEnemyVisibleColor;
                                            break;

                                        case GlowType.Vis_Color:
                                            bool bVisible = pEntity.IsSpottedByMask(pLocal);
                                            if (bVisible)
                                            {
                                                color = iLocalTeamNum == EntityTeamnum ? Config.bGlowAllyVisibleColor : Config.bGlowEnemyVisibleColor;
                                            }
                                            else
                                            {
                                                color = iLocalTeamNum == EntityTeamnum ? Config.bGlowAllyColor : Config.bGlowEnemyColor;
                                            }
                                            break;

                                        case GlowType.Health:
                                            color = new Color(255 - (EntityHealth * 2.55f), EntityHealth * 2.55f, 0, 255);
                                            break;
                                        }
                                        g_GlowObjectManager.RegisterGlowObject(pEntity, color, Config.bInnerGlow, Config.bFullRender);
                                    }
                                }
                            }
                            #endregion

                            #region FindAimBotTarget
                            if (FindNewAimBotTarget)
                            {
                                if (!pEntity.IsDormant() && EntityHealth > 0 && !pEntity.HasGunGameImmunity())
                                {
                                    {
                                        if (!WeaponConfig.bVisibleCheck || pEntity.IsSpottedByMask(pLocal))
                                        {
                                            if (!WeaponConfig.bTargetOnGroundCheck || pEntity.IsOnGround())
                                            {
                                                float cur_distance = MathUtil.FovToPlayer(localPlayerEyePosition, viewangles, pEntity, 0);

                                                if (cur_distance <= WeaponConfig.flAimbotFov)
                                                {
                                                    if (fDistance == -1 || cur_distance < fDistance)
                                                    {
                                                        fDistance = cur_distance;
                                                        pTarget   = pEntity;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            #endregion
                        }
                        #endregion

                        #region LocalPlayerFunctions


                        #endregion

                        #region Aimbot
                        bool b_do_RCS    = false;
                        bool b_do_Aimbot = false;
                        if (FindNewAimBotTarget && fDistance != -1)
                        {
                            pLastTarget = pTarget;
                        }

                        if (WeaponConfig.bAimbotEnabled && bAimBotKey && pLastTarget != null)
                        {
                            if (pLastTarget.GetHealth() <= 0)
                            {
                                if (!WaitBreak)
                                {
                                    BreakTickCount = Environment.TickCount + WeaponConfig.iAimbotDeathBreak;
                                    WaitBreak      = true;
                                }
                                else if (BreakTickCount <= Environment.TickCount)
                                {
                                    WaitBreak   = false;
                                    pLastTarget = null;
                                }
                            }
                            else
                            {
                                float  best    = -1;
                                Vector calcang = new Vector(0, 0, 0);

                                Vector temp_calcang = MathUtil.CalcAngle(localPlayerEyePosition, pLastTarget.GetHitboxPosition((int)HitboxList.HITBOX_HEAD));
                                Vector delta_bone   = viewangles - temp_calcang;
                                delta_bone.NormalizeAngles();
                                float len = (float)delta_bone.Lenght2D();
                                if (best == -1 || len < best)
                                {
                                    best    = len;
                                    calcang = temp_calcang;
                                }


                                Vector current_punch = new Vector(last_vecPunch._x * 2f, last_vecPunch._y * (WeaponConfig.Horizontal / 5f), 0);
                                calcang -= current_punch;
                                calcang.NormalizeAngles();
                                Vector delta = calcang - viewangles;
                                delta.NormalizeAngles();
                                if (WeaponConfig.flAimbotSmooth != 0f)
                                {
                                    calcang = viewangles + (delta / WeaponConfig.flAimbotSmooth);
                                }
                                calcang.NormalizeAngles();
                                viewangles  = calcang;
                                b_do_Aimbot = true;
                            }
                        }
                        #endregion

                        #region Triggerbot

                        foreach (var pPointer in g_EntityList.pPlayerList)
                        {
                            CBasePlayer pEntity = new CBasePlayer(pPointer);
                            if (pEntity.GetTeamNum() != pLocal.GetTeamNum())
                            {
                                if (Config.bTriggerbotEnabled)
                                {
                                    if (MathUtil.FovToPlayer(localPlayerEyePosition, viewangles, pEntity, 0) < 1)
                                    {
                                        if (pEntity.IsSpottedByMask(pLocal))
                                        {
                                            g_pEngineClient.OneTickAttack();
                                        }
                                    }
                                }
                            }
                        }

                        #endregion

                        #region RecoilControlSystem
                        if (Config.AimbotEnabled && WeaponConfig.Vertical != 0f && WeaponConfig.Horizontal != 0f && WeaponConfig.bRCS)
                        {
                            if (pLocal.GetShootsFired() > 1 && IsKeyState(1) && LocalWeapon.GetAvailableAmmo() > 0)
                            {
                                Vector Punch = pLocal.GetPunch();

                                float[] multiple = { WeaponConfig.Vertical / 5f, WeaponConfig.Horizontal / 5f };

                                Vector current_RCS_Punch = new Vector((Punch._x * multiple[0]) - (last_vecPunch._x * multiple[0]), (Punch._y * multiple[1]) - (last_vecPunch._y * multiple[1]), 0);
                                Vector ViewAngle_RCS     = viewangles - current_RCS_Punch;
                                ViewAngle_RCS.NormalizeAngles();
                                Vector delta = (viewangles - ViewAngle_RCS);
                                delta.NormalizeAngles();

                                if ((float)delta.Lenght2D() <= 3.1f)
                                {
                                    viewangles = ViewAngle_RCS;
                                }

                                last_vecPunch = Punch;

                                b_do_RCS = true;
                            }
                            else
                            {
                                last_vecPunch = new Vector(0, 0, 0);
                            }
                        }
                        #endregion

                        #region ShowRanks
                        if (Config.ESPEnabled && Config.bShowRanks)
                        {
                            var Command = g_pEngineClient.GetLastOutGoingCommand();

                            if (Command != lastOutgoingcommand)
                            {
                                var VerifiedCommandSystem = g_Input.GetVerifiedUserCmd();

                                var VerifiedCommand = VerifiedCommandSystem.GetVerifiedUserCmdBySequence(Command);

                                if ((VerifiedCommand.m_cmd.buttons & (1 << 16)) != 0)
                                {
                                    RevealRank.Do();
                                }
                            }

                            lastOutgoingcommand = Command;
                        }
                        #endregion

                        #region SetAngles
                        if (b_do_Aimbot || b_do_RCS)
                        {
                            g_pEngineClient.SetViewAngles(viewangles);
                        }
                        #endregion

                        #region ClanTagChanger
                        if (Config.MiscEnabled && Config.bClanTagChangerEnabled)
                        {
                            if (Environment.TickCount > ClantagTickCount)
                            {
                                if (Config.iClanTagChanger == 0)
                                {
                                    SendClantag.Do(Config.szClanTag, "ozon");
                                }
                                else if (Config.iClanTagChanger == 1)
                                {
                                    if (LastTag != Config.szClanTag)
                                    {
                                        LastTag = Config.szClanTag;
                                        int start = 7 - LastTag.Length / 2;
                                        for (int i = 0; i < 15; i++)
                                        {
                                            if (i < start || i >= start + LastTag.Length)
                                            {
                                                Tag[i] = ' ';
                                            }
                                            else
                                            {
                                                Tag[i] = LastTag[i - start];
                                            }
                                        }
                                        SendClantag.Do(new string(Tag), "ozon");
                                    }
                                    else
                                    {
                                        char temp_var;

                                        for (int i = 0; i < (15 - 1); i++)
                                        {
                                            temp_var    = Tag[15 - 1];
                                            Tag[15 - 1] = Tag[i];
                                            Tag[i]      = temp_var;
                                        }
                                        SendClantag.Do(new string(Tag), "ozon");
                                    }
                                }
                                else if (Config.iClanTagChanger == 3)
                                {
                                    SendClantag.Do(RandomString(5), "ozon");
                                }
                                else if (Config.iClanTagChanger == 2)
                                {
                                    sainttag = SaintwareNext(sainttag);
                                    SendClantag.Do(SaintwareNext(sainttag), "ozon");
                                }
                                ClantagTickCount = Environment.TickCount + Config.iClantTagDelay;
                            }
                        }
                        #endregion

                        #region ForceUpdate
                        if (bDoForceUpdate)
                        {
                            g_pEngineClient.ForceUpdate();
                            bDoForceUpdate = false;
                        }
                        #endregion

                        Buffer.BlockCopy(currentKeyState, 0, lastKeyState, 0, 255);
                    }
                    else
                    {
                        if (!Globals._csgo.CheckHandle())
                        {
                            break;
                        }

                        Thread.Sleep(1000);

                        #region AutoAccept
                        if (Config.MiscEnabled && Config.bAutoAccept)
                        {
                            if (UTILS_GAME.MatchFound())
                            {
                                Thread.Sleep(1500);
                                UTILS_GAME.AcceptMatch();
                            }
                        }
                        #endregion
                    }
                }
                catch
                {
                    if (!Globals._csgo.CheckHandle())
                    {
                        break;
                    }
                }
                Thread.Sleep(5);
            }
            Program.StartCheat();
        }
Exemple #19
0
 public void TestConvarString()
 {
     ConVar.Set("convar_string", "test");
     Assert.AreEqual("test", ConVar.Get("convar_string"));
 }
Exemple #20
0
 public static int GetInt(string strName, float strDefault)
 {
     return((int)ConVar.GetFloat(strName, strDefault));
 }
Exemple #21
0
        public static void Start()
        {
            GC.Collect();

            g_EntityList  = new IClientEntityList();
            g_Input       = new CInput();
            g_ConVar      = new CConVarManager();
            g_InputSystem = new CInputSystem();

            var dwMouseEnabled = new ConVar("cl_mouseenable");

            var name = new ConVar("name");

            TriggerThread = new Thread(new ThreadStart(StartTrigger));
            TriggerThread.IsBackground = true;
            TriggerThread.Start();

            while (true)
            {
                try
                {
                    g_pEngineClient.Update();

                    if (g_pEngineClient.IsInGame())
                    {
                        bool bMouseEnabled = dwMouseEnabled.GetBool();

                        #region UpdateRegion

                        Update();

                        bool bLocalPlayerAlive = pLocal.GetHealth() > 0;
                        Team iLocalTeamNum     = pLocal.GetTeamNum();

                        Vector localPlayerEyePosition = pLocal.GetEyePosition();

                        Vector viewangles = g_pEngineClient.GetViewAngles();

                        bool FindNewAimBotTarget = false;

                        var LocalWeapon = pLocal.GetActiveWeapon();

                        var LocalWeaponID = LocalWeapon.GetWeaponID();

                        var LocalWeaponConfig = Config.GetWeaponConfig(LocalWeaponID);

                        bool bAimBotKey = IsKeyState(Config.iAimbotKey) || IsKeyState(Config.iTriggerBotWorkWithAimKey);

                        if (LocalWeapon.IsKnife() || LocalWeapon.IsBomb() || LocalWeapon.IsGrenade())
                        {
                            bAimBotKey = false;
                        }

                        if (!bLocalPlayerAlive)
                        {
                            bAimBotKey = false;
                        }

                        if (LocalWeapon.GetAvailableAmmo() <= 0)
                        {
                            bAimBotKey = false;
                        }

                        if (!Config.AimbotEnabled)
                        {
                            bAimBotKey = false;
                        }

                        if (!bAimBotKey)
                        {
                            WaitBreak   = false;
                            pLastTarget = null;
                        }

                        if (LocalWeaponConfig.bAimbotEnabled && bAimBotKey && pLastTarget == null)
                        {
                            FindNewAimBotTarget = true;
                        }

                        if (pLastTarget != null && LocalWeaponConfig.bVisibleCheck && !pLastTarget.IsSpottedByMask(pLocal))
                        {
                            FindNewAimBotTarget = true;
                        }

                        #endregion

                        #region KeyStateCheck
                        for (int i = 0; i < 255; ++i)
                        {
                            currentKeyState[i] = WinAPI.GetAsyncKeyState(i) != 0;
                        }

                        if (Config.iGlowToogleKey != -1 && IsKeyPress(Config.iGlowToogleKey))
                        {
                            Config.bGlowEnabled = !Config.bGlowEnabled;
                        }
                        if (Config.iPanicKey != -1 && IsKeyPress(Config.iPanicKey))
                        {
                            Globals._csgo.ProcessHandle = IntPtr.Zero;
                            Globals._csgo.CheckHandle();
                        }
                        #endregion

                        #region GlowESP

                        GlowESP(iLocalTeamNum, bLocalPlayerAlive);

                        #endregion

                        #region ForeachPlayerList
                        CBasePlayer   pTarget        = null;
                        float         fDistance      = -1;
                        List <string> names_to_steal = new List <string>();

                        foreach (var pPointer in g_EntityList.pPlayerList)
                        {
                            CBasePlayer pEntity = new CBasePlayer(pPointer);

                            int EntityHealth = pEntity.GetHealth();

                            Team EntityTeamnum = pEntity.GetTeamNum();

                            #region Namestealer
                            if (Config.MiscEnabled && Config.bNameStealerEnabled && !Config.bNameStealerCustom)
                            {
                                if (Config.iNameStealerType == 0 && EntityTeamnum == iLocalTeamNum)
                                {
                                    names_to_steal.Add(new string(g_pEngineClient.GetPlayerInfo(pEntity.GetIndex()).m_szPlayerName));
                                }
                                else if (Config.iNameStealerType == 1 && EntityTeamnum != iLocalTeamNum)
                                {
                                    names_to_steal.Add(new string(g_pEngineClient.GetPlayerInfo(pEntity.GetIndex()).m_szPlayerName));
                                }
                                else if (Config.iNameStealerType == 2)
                                {
                                    names_to_steal.Add(new string(g_pEngineClient.GetPlayerInfo(pEntity.GetIndex()).m_szPlayerName));
                                }
                            }
                            #endregion

                            #region Radar
                            if (Config.ESPEnabled && Config.bRadarEnabled)
                            {
                                pEntity.SetSpotted(true);
                            }
                            #endregion

                            #region RenderColor
                            if (Config.ESPEnabled && Config.bCHAMSGOWNOPlayer)
                            {
                                if (EntityTeamnum == iLocalTeamNum)
                                {
                                    pEntity.SetRenderColor(Config.bChamsAllyColor);
                                }
                                else
                                {
                                    pEntity.SetRenderColor(Config.bChamsEnemyColor);
                                }
                            }
                            #endregion

                            #region GlowESPOnlyPlayers
                            if (Config.ESPEnabled && !Config.bGlowWeapons && !Config.bGlowBomb && Config.bGlowEnabled && (!Config.bGlowAfterDeath || !bLocalPlayerAlive))
                            {
                                if (!pEntity.IsDormant() && EntityHealth > 0)
                                {
                                    bool bFillerGood = true;
                                    if (iLocalTeamNum == EntityTeamnum && !Config.bGlowAlly)
                                    {
                                        bFillerGood = false;
                                    }
                                    else if (iLocalTeamNum != EntityTeamnum && !Config.bGlowEnemy)
                                    {
                                        bFillerGood = false;
                                    }
                                    if (bFillerGood)
                                    {
                                        Color color = new Color();
                                        switch (Config.iGlowType)
                                        {
                                        case GlowType.Color:
                                            color = iLocalTeamNum == EntityTeamnum ? Config.bGlowAllyVisibleColor : Config.bGlowEnemyVisibleColor;
                                            break;

                                        case GlowType.Vis_Color:
                                            bool bVisible = pEntity.IsSpottedByMask(pLocal);
                                            if (bVisible)
                                            {
                                                color = iLocalTeamNum == EntityTeamnum ? Config.bGlowAllyVisibleColor : Config.bGlowEnemyVisibleColor;
                                            }
                                            else
                                            {
                                                color = iLocalTeamNum == EntityTeamnum ? Config.bGlowAllyColor : Config.bGlowEnemyColor;
                                            }
                                            break;

                                        case GlowType.Health:
                                            color = new Color(255 - (EntityHealth * 2.55f), EntityHealth * 2.55f, 0, 255);
                                            break;
                                        }
                                        g_GlowObjectManager.RegisterGlowObject(pEntity, color, Config.bInnerGlow, Config.bFullRender);
                                    }
                                }
                            }
                            #endregion

                            #region FindAimBotTarget
                            if (FindNewAimBotTarget)
                            {
                                if (!pEntity.IsDormant() && EntityHealth > 0 && !pEntity.HasGunGameImmunity())
                                {
                                    if (LocalWeaponConfig.bFriendlyFire || EntityTeamnum != iLocalTeamNum)
                                    {
                                        if (!LocalWeaponConfig.bVisibleCheck || pEntity.IsSpottedByMask(pLocal))
                                        {
                                            if (!LocalWeaponConfig.bTargetOnGroundCheck || pEntity.IsOnGround())
                                            {
                                                float cur_distance = MathUtil.FovToPlayer(localPlayerEyePosition, viewangles, pEntity, 0);

                                                if (cur_distance <= LocalWeaponConfig.flAimbotFov)
                                                {
                                                    if (fDistance == -1 || cur_distance < fDistance)
                                                    {
                                                        fDistance = cur_distance;
                                                        pTarget   = pEntity;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            #endregion
                        }
                        #endregion

                        #region LocalPlayerFunctions

                        #region BunnyHop

                        bool bLocalIsOnGround = pLocal.IsOnGround();

                        if (bMouseEnabled && Config.MiscEnabled && Config.bBunnyHopEnabled && IsKeyState(Config.iBunnyHopKey) && pLocal.GetVelocity() > 45f)
                        {
                            if (bLocalIsOnGround)
                            {
                                g_pEngineClient.PlusJump();
                            }
                            else if (g_pEngineClient.GetJumpState() == 5)
                            {
                                g_pEngineClient.MinusJump();
                            }
                        }
                        #endregion

                        #region FovChanger

                        if (Config.MiscEnabled && Config.bFovChangerEnabled && !pLocal.IsScoped())
                        {
                            pLocal.SetFov(Config.FovValue);
                        }
                        else if (!pLocal.IsScoped())
                        {
                            pLocal.ResetFov();
                        }
                        #endregion

                        #endregion

                        #region Aimbot
                        bool b_do_RCS    = false;
                        bool b_do_Aimbot = false;
                        if (FindNewAimBotTarget && fDistance != -1)
                        {
                            pLastTarget = pTarget;
                        }

                        if (LocalWeaponConfig.bAimbotEnabled && bAimBotKey && pLastTarget != null)
                        {
                            if (pLastTarget.GetHealth() <= 0)
                            {
                                if (!WaitBreak)
                                {
                                    BreakTickCount = Environment.TickCount + LocalWeaponConfig.iAimbotDeathBreak;
                                    WaitBreak      = true;
                                }
                                else if (BreakTickCount <= Environment.TickCount)
                                {
                                    WaitBreak   = false;
                                    pLastTarget = null;
                                }
                            }
                            else
                            {
                                List <Vector> hitboxes = new List <Vector>();

                                if ((LocalWeaponConfig.iBones & (int)BoneSelector.Head) != 0)
                                {
                                    hitboxes.Add(pLastTarget.GetHitboxPosition((int)HitboxList.HITBOX_HEAD));
                                }
                                if ((LocalWeaponConfig.iBones & (int)BoneSelector.Neck) != 0)
                                {
                                    hitboxes.Add(pLastTarget.GetHitboxPosition((int)HitboxList.HITBOX_NECK));
                                }
                                if ((LocalWeaponConfig.iBones & (int)BoneSelector.Chest) != 0)
                                {
                                    hitboxes.Add(pLastTarget.GetHitboxPosition((int)HitboxList.HITBOX_CHEST));
                                }
                                if ((LocalWeaponConfig.iBones & (int)BoneSelector.Stomach) != 0)
                                {
                                    hitboxes.Add(pLastTarget.GetHitboxPosition((int)HitboxList.HITBOX_BODY));
                                }

                                float  best    = -1;
                                Vector calcang = new Vector(0, 0, 0);

                                for (int i = 0; i < hitboxes.Count(); i++)
                                {
                                    Vector temp_calcang = MathUtil.CalcAngle(localPlayerEyePosition, hitboxes[i]);
                                    Vector delta_bone   = viewangles - temp_calcang;
                                    delta_bone.NormalizeAngles();
                                    float len = (float)delta_bone.Lenght2D();
                                    if (best == -1 || len < best)
                                    {
                                        best    = len;
                                        calcang = temp_calcang;
                                    }
                                }

                                Vector current_punch = new Vector(last_vecPunch._x * 2f, last_vecPunch._y * (LocalWeaponConfig.Horizontal / 5f), 0);
                                calcang -= current_punch;
                                calcang.NormalizeAngles();
                                Vector delta = calcang - viewangles;
                                delta.NormalizeAngles();
                                if (LocalWeaponConfig.flAimbotSmooth != 0f)
                                {
                                    calcang = viewangles + (delta / LocalWeaponConfig.flAimbotSmooth);
                                }
                                calcang.NormalizeAngles();
                                viewangles  = calcang;
                                b_do_Aimbot = true;
                            }
                        }
                        #endregion

                        #region RecoilControlSystem
                        if (Config.AimbotEnabled && LocalWeaponConfig.Vertical != 0f && LocalWeaponConfig.Horizontal != 0f && LocalWeaponConfig.bRCS)
                        {
                            if (pLocal.GetShootsFired() > 1 && IsKeyState(1) && LocalWeapon.GetAvailableAmmo() > 0)
                            {
                                Vector Punch = pLocal.GetPunch();

                                float[] multiple = { LocalWeaponConfig.Vertical / 5f, LocalWeaponConfig.Horizontal / 5f };

                                Vector current_RCS_Punch = new Vector((Punch._x * multiple[0]) - (last_vecPunch._x * multiple[0]), (Punch._y * multiple[1]) - (last_vecPunch._y * multiple[1]), 0);
                                Vector ViewAngle_RCS     = viewangles - current_RCS_Punch;
                                ViewAngle_RCS.NormalizeAngles();
                                Vector delta = (viewangles - ViewAngle_RCS);
                                delta.NormalizeAngles();

                                if ((float)delta.Lenght2D() <= 3.1f)
                                {
                                    viewangles = ViewAngle_RCS;
                                }

                                last_vecPunch = Punch;

                                b_do_RCS = true;
                            }
                            else
                            {
                                last_vecPunch = new Vector(0, 0, 0);
                            }
                        }
                        #endregion

                        #region ShowRanks
                        if (Config.ESPEnabled && Config.bShowRanks)
                        {
                            var Command = g_pEngineClient.GetLastOutGoingCommand();

                            if (Command != lastOutgoingcommand)
                            {
                                var VerifiedCommandSystem = g_Input.GetVerifiedUserCmd();

                                var VerifiedCommand = VerifiedCommandSystem.GetVerifiedUserCmdBySequence(Command);

                                if ((VerifiedCommand.m_cmd.buttons & (1 << 16)) != 0)
                                {
                                    RevealRank.Do();
                                }
                            }

                            lastOutgoingcommand = Command;
                        }
                        #endregion

                        #region FakeLag
                        if (Config.MiscEnabled && Config.bFakeLag)
                        {
                            if (chockedPackets < Config.iFakeLagPower)
                            {
                                g_pEngineClient.SetSendPacket(false);
                                chockedPackets++;
                            }
                            else
                            {
                                g_pEngineClient.SetSendPacket(true);
                                chockedPackets = 0;
                            }
                        }
                        else if (Config.bFakeLag != bLastFakeLag)
                        {
                            g_pEngineClient.SetSendPacket(true);
                        }

                        bLastFakeLag = Config.bFakeLag;
                        #endregion

                        #region SetAngles
                        if (b_do_Aimbot || b_do_RCS)
                        {
                            g_pEngineClient.SetViewAngles(viewangles);
                        }
                        #endregion

                        #region ClanTagChanger
                        if (Config.MiscEnabled && Config.bClanTagChangerEnabled)
                        {
                            if (Environment.TickCount > ClantagTickCount)
                            {
                                if (Config.iClanTagChanger == 0)
                                {
                                    if (bSwapClantag)
                                    {
                                        SendClantag.Do(Config.szClanTag1, "ozon");
                                    }
                                    else
                                    {
                                        SendClantag.Do(Config.szClanTag2, "ozon");
                                    }
                                    bSwapClantag = !bSwapClantag;
                                }
                                else if (Config.iClanTagChanger == 1)
                                {
                                    if (LastTag != Config.szClanTag1)
                                    {
                                        LastTag = Config.szClanTag1;
                                        int start = 7 - LastTag.Length / 2;
                                        for (int i = 0; i < 15; i++)
                                        {
                                            if (i < start || i >= start + LastTag.Length)
                                            {
                                                Tag[i] = ' ';
                                            }
                                            else
                                            {
                                                Tag[i] = LastTag[i - start];
                                            }
                                        }
                                        SendClantag.Do(new string(Tag), "ozon");
                                    }
                                    else
                                    {
                                        char temp_var;

                                        for (int i = 0; i < (15 - 1); i++)
                                        {
                                            temp_var    = Tag[15 - 1];
                                            Tag[15 - 1] = Tag[i];
                                            Tag[i]      = temp_var;
                                        }
                                        SendClantag.Do(new string(Tag), "ozon");
                                    }
                                }
                                else if (Config.iClanTagChanger == 2)
                                {
                                    SendClantag.Do(DateTime.Now.ToString("hh:mm:ss"), "ozon");
                                }
                                ClantagTickCount = Environment.TickCount + Config.iClantTagDelay;
                            }
                        }
                        #endregion

                        #region Namestealer
                        if (Config.MiscEnabled && Config.bNameStealerEnabled)
                        {
                            if (Environment.TickCount > NamestealerTickCount)
                            {
                                if (Config.iNameStealerMode == 0)
                                {
                                    name.ClearCallbacks();
                                    if (Config.bNameStealerCustom)
                                    {
                                        if (bSwapNamestealer)
                                        {
                                            ClientCmd.Do("name \"" + Config.szName1 + "\"");
                                        }
                                        else
                                        {
                                            ClientCmd.Do("name \"" + Config.szName2 + "\"");
                                        }
                                        bSwapNamestealer = !bSwapNamestealer;
                                    }
                                    else
                                    {
                                        ClientCmd.Do("name \"" + names_to_steal[RandomHelper.RandomInt(0, names_to_steal.Count - 1)] + "   \"");
                                    }
                                }
                                NamestealerTickCount = Environment.TickCount + Config.iNameStealerDelay;
                            }
                        }
                        #endregion

                        #region AutoPistol
                        if (Config.MiscEnabled && bMouseEnabled && Config.AutoPistol && IsKeyState(0x01) && LocalWeaponID != 64 && LocalWeapon.IsPistol())
                        {
                            if (g_pEngineClient.GetAttackState() == 5)
                            {
                                g_pEngineClient.MinusAttack();
                            }
                            else
                            {
                                g_pEngineClient.PlusAttack();
                            }
                        }
                        #endregion

                        #region ForceUpdate
                        if (bDoForceUpdate)
                        {
                            g_pEngineClient.ForceUpdate();
                            bDoForceUpdate = false;
                        }
                        #endregion

                        Buffer.BlockCopy(currentKeyState, 0, lastKeyState, 0, 255);
                    }
                    else
                    {
                        if (!Globals._csgo.CheckHandle())
                        {
                            break;
                        }

                        Thread.Sleep(1000);

                        #region AutoAccept
                        if (Config.MiscEnabled && Config.bAutoAccept)
                        {
                            if (UTILS_GAME.MatchFound())
                            {
                                Thread.Sleep(1500);
                                UTILS_GAME.AcceptMatch();
                            }
                        }
                        #endregion
                    }
                }
                catch
                {
                    if (!Globals._csgo.CheckHandle())
                    {
                        break;
                    }
                }
                Thread.Sleep(5);
            }
            Program.StartCheat();
        }