コード例 #1
0
        private static void Triggerbot()
        {
            while (Options.TriggerbotIsEnabled)
            {
                if (PinvokeWrapper.GetTheKeyState(KeyCodes.ALT_KEY) == 0)
                {
                    continue;
                }

                //We get the local player
                var localPlayer = Utils.GetLocalPlayer();

                //We get the crosshair ID
                var crosshairId = PinvokeWrapper.ReadAddInt((IntPtr)localPlayer.BaseAddress + Offsets.m_iCrosshairId, Utils.CsgoHandle);

                if (crosshairId > 0 && crosshairId <= 64)
                {
                    //We get the enemy at our crosshair
                    var enemy = new Player(PinvokeWrapper.ReadAddInt(Utils.ClientBaseAddress + Offsets.dwEntityList + ((crosshairId - 1) * 0x10), Utils.CsgoHandle));

                    //If the enemy is alive and is not one of our teammates
                    if (enemy.GetHealth() > 0 && localPlayer.GetTeam() != enemy.GetTeam())
                    {
                        //We shoot
                        PinvokeWrapper.DoubleClick();
                    }
                }

                //Sleep for 3 milliseconds
                Thread.Sleep(3);
            }
        }
コード例 #2
0
ファイル: Utils.cs プロジェクト: michelangelo-s/Zen
        //Credits: 0x2aff
        public static bool WorldToScreen(Vector3 from, Vector2 to)
        {
            var viewMatrix = new float[16];

            for (int i = 0; i < 16; i++)
            {
                viewMatrix[i] = PinvokeWrapper.ReadAddFloat(ClientBaseAddress + Offsets.dwViewMatrix + (i * 0x4), CsgoHandle);
            }

            float w = 0.0f;

            to.X = viewMatrix[0] * from.X + viewMatrix[1] * from.Y + viewMatrix[2] * from.Z + viewMatrix[3];
            to.Y = viewMatrix[4] * from.X + viewMatrix[5] * from.Y + viewMatrix[6] * from.Z + viewMatrix[7];
            w    = viewMatrix[12] * from.X + viewMatrix[13] * from.Y + viewMatrix[14] * from.Z + viewMatrix[15];

            if (w < 0.01f)
            {
                return(false); //Not in FOV, we return false
            }
            float inverse = 1.0f / w;

            to.X *= inverse;
            to.Y *= inverse;

            float x = ScreenWidth / 2;
            float y = ScreenHeight / 2;

            x += 0.5f * to.X * ScreenWidth + 0.5f;
            y -= 0.5f * to.Y * ScreenHeight + 0.5f;

            to.X = x;
            to.Y = y;

            return(true); //Success
        }
コード例 #3
0
ファイル: Utils.cs プロジェクト: michelangelo-s/Zen
        public static List <Player> GetPlayers()
        {
            //Create new list of players
            var playerList = new List <Player>();

            //Get our local player
            var localPlayer = GetLocalPlayer();

            for (int i = 0; i < 64; i++)
            {
                //Get the next player
                var playerBase = PinvokeWrapper.ReadAddInt(ClientBaseAddress + Offsets.dwEntityList + (i * 0x10), CsgoHandle);

                //If the player doesn't exist, we continue looping
                if (playerBase == 0)
                {
                    continue;
                }

                //We make sure we do not include our self in the list
                if (playerBase != localPlayer.BaseAddress)
                {
                    playerList.Add(new Player(playerBase));
                }
            }

            //Return the player list
            return(playerList);
        }
コード例 #4
0
ファイル: Utils.cs プロジェクト: michelangelo-s/Zen
        public static Player GetLocalPlayer()
        {
            //Get the base address of
            var localPlayer = PinvokeWrapper.ReadAddInt(ClientBaseAddress + Offsets.dwLocalPlayer, CsgoHandle);

            //return our new class
            return(new Player(localPlayer));
        }
コード例 #5
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
        public bool IsDormant()
        {
            //Check if player is dormant
            var isDormant = PinvokeWrapper.ReadAddInt((IntPtr)BaseAddress + Offsets.m_bDormant, Utils.CsgoHandle);

            //Return the result
            return(isDormant != 0);
        }
コード例 #6
0
        //Credits: fredaikis
        private static void AimAt(int x, int y)
        {
            float aimSpeed = 5;
            float targetX  = 0;
            float targetY  = 0;

            //X Axis
            if (x != 0)
            {
                if (x > Utils.ScreenWidth / 2)
                {
                    targetX  = -(Utils.ScreenWidth / 2 - x);
                    targetX /= aimSpeed;
                    if (targetX + Utils.ScreenWidth / 2 > Utils.ScreenWidth / 2 * 2)
                    {
                        targetX = 0;
                    }
                }

                if (x < Utils.ScreenWidth / 2)
                {
                    targetX  = x - Utils.ScreenWidth / 2;
                    targetX /= aimSpeed;
                    if (targetX + Utils.ScreenWidth / 2 < 0)
                    {
                        targetX = 0;
                    }
                }
            }

            //Y Axis

            if (y != 0)
            {
                if (y > Utils.ScreenHeight / 2)
                {
                    targetY  = -(Utils.ScreenHeight / 2 - y);
                    targetY /= aimSpeed;
                    if (targetY + Utils.ScreenHeight / 2 > Utils.ScreenHeight / 2 * 2)
                    {
                        targetY = 0;
                    }
                }

                if (y < Utils.ScreenHeight / 2)
                {
                    targetY  = y - Utils.ScreenHeight / 2;
                    targetY /= aimSpeed;
                    if (targetY + Utils.ScreenHeight / 2 < 0)
                    {
                        targetY = 0;
                    }
                }
            }

            PinvokeWrapper.MoveMouseTo((int)targetX, (int)targetY);
        }
コード例 #7
0
        private static void NoFlash()
        {
            while (Options.NoFlashIsEnabled)
            {
                //Get local player
                var localPlayer = Utils.GetLocalPlayer();
                //Set flash interval to zero
                PinvokeWrapper.WriteFloat((IntPtr)localPlayer.BaseAddress + Offsets.m_flFlashDuration, Utils.CsgoHandle, 0);

                //Sleep for 2 milliseconds
                Thread.Sleep(2);
            }
        }
コード例 #8
0
        private static void DrawPlayerGlow(PlayerGlowStruct playerStruct, int glowIndex)
        {
            //We ge the glow object manager
            var glowObjectManager = PinvokeWrapper.ReadAddInt(Utils.ClientBaseAddress + Offsets.dwGlowObjectManager, Utils.CsgoHandle);

            //We write the struct to memory
            PinvokeWrapper.WriteFloat((IntPtr)glowObjectManager + glowIndex * 0x38 + 0x4, Utils.CsgoHandle, playerStruct.Red);
            PinvokeWrapper.WriteFloat((IntPtr)glowObjectManager + glowIndex * 0x38 + 0x8, Utils.CsgoHandle, playerStruct.Green);
            PinvokeWrapper.WriteFloat((IntPtr)glowObjectManager + glowIndex * 0x38 + 0xC, Utils.CsgoHandle, playerStruct.Blue);
            PinvokeWrapper.WriteFloat((IntPtr)glowObjectManager + glowIndex * 0x38 + 0x10, Utils.CsgoHandle, playerStruct.Alpha);
            PinvokeWrapper.WriteFloat((IntPtr)glowObjectManager + glowIndex * 0x38 + 0x10, Utils.CsgoHandle, playerStruct.Alpha);
            PinvokeWrapper.WriteBool((IntPtr)glowObjectManager + glowIndex * 0x38 + 0x24, Utils.CsgoHandle, playerStruct.RenderOccluded);
            PinvokeWrapper.WriteBool((IntPtr)glowObjectManager + glowIndex * 0x38 + 0x25, Utils.CsgoHandle, playerStruct.RenderUnoccluded);
        }
コード例 #9
0
        private static void WallHack()
        {
            //We create a struct with the desired color for the enemy players
            var enemyStruct = new PlayerGlowStruct(255f, 0f, 0f, 1f, true, false);    //Red color
            //We create a struct with the desired color for the allies
            var friendStruct = new PlayerGlowStruct(0f, 255f, 0f, 0.8f, true, false); //Green color

            while (Options.GlowHackIsEnabled)
            {
                var players = Utils.GetPlayers();

                //If there are no players, we continue looping until there is one
                if (players.Count == 0)
                {
                    continue;
                }

                //We get our local player
                var localPlayer = Utils.GetLocalPlayer();

                foreach (var currentPlayer in players)
                {
                    //We exclude players that are dead or they are dormant
                    if (currentPlayer.GetHealth() == 0 || currentPlayer.IsDormant())
                    {
                        continue;
                    }

                    if (currentPlayer.GetTeam() != localPlayer.GetTeam())
                    {
                        //Enable player on radar
                        PinvokeWrapper.WriteBool((IntPtr)currentPlayer.BaseAddress + Offsets.m_bSpotted, Utils.CsgoHandle, true);
                        //Draw enemy glow
                        DrawPlayerGlow(enemyStruct, currentPlayer.GetGlowIndex());
                    }
                    else
                    {
                        //Draw friend
                        DrawPlayerGlow(friendStruct, currentPlayer.GetGlowIndex());
                    }
                }

                Thread.Sleep(2);
            }
        }
コード例 #10
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
        public Vector2 GetPosition()
        {
            //Create a new vector to save the 2d player coordinates later
            var player2DPosition = new Vector2();

            //Get X coordinate
            var x = PinvokeWrapper.ReadAddFloat((IntPtr)BaseAddress + Offsets.m_vecOrigin, Utils.CsgoHandle);
            //Get Y coordinate
            var y = PinvokeWrapper.ReadAddFloat((IntPtr)BaseAddress + Offsets.m_vecOrigin + 0x4, Utils.CsgoHandle);
            //Get Z coordinate
            var z = PinvokeWrapper.ReadAddFloat((IntPtr)BaseAddress + Offsets.m_vecOrigin + 0x8, Utils.CsgoHandle);

            //Convert the world coordinates to screen coordinates
            Utils.WorldToScreen(new Vector3(x, y, z), player2DPosition);

            //Return the result
            return(player2DPosition);
        }
コード例 #11
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
        public Vector2 GetBonePos(int boneId)
        {
            //Create a new vector to save the 2d bone coordinates later
            var player2DPosition = new Vector2();

            //Get the bone matrix
            var boneMatrix = PinvokeWrapper.ReadAddInt((IntPtr)BaseAddress + Offsets.m_dwBoneMatrix, Utils.CsgoHandle);

            //Get the world coordinates of the player's bone
            var playerBoneX = PinvokeWrapper.ReadAddFloat((IntPtr)boneMatrix + 0x30 * boneId + 0x0C, Utils.CsgoHandle);
            var playerBoneY = PinvokeWrapper.ReadAddFloat((IntPtr)boneMatrix + 0x30 * boneId + 0x1C, Utils.CsgoHandle);
            var playerBoneZ = PinvokeWrapper.ReadAddFloat((IntPtr)boneMatrix + 0x30 * boneId + 0x2C, Utils.CsgoHandle);

            //Convert the world coordinates to screen coordinates
            Utils.WorldToScreen(new Vector3(playerBoneX, playerBoneY, playerBoneZ), player2DPosition);

            //Return the result
            return(player2DPosition);
        }
コード例 #12
0
        private static void Aimbot()
        {
            while (Options.AimbotIsEnabled)
            {
                if (PinvokeWrapper.GetTheKeyState(KeyCodes.ALT_KEY) != 0)
                {
                    //We get all players
                    var players = Utils.GetPlayers();

                    //We get the closest player to our crosshair
                    var closestPlayer = GetClosestEnemy(players);

                    //If a player has been found and is not dead
                    if (closestPlayer != null && closestPlayer.GetHealth() > 0)
                    {
                        //We aim at him
                        AimAt((int)closestPlayer.GetBonePos((int)_aimbotBone).X, (int)closestPlayer.GetBonePos((int)_aimbotBone).Y);
                    }
                }

                Thread.Sleep(7);
            }
        }
コード例 #13
0
        private void ESP_Load(object sender, EventArgs e)
        {
            //This way we can click through the window without any problem
            var initialStyle = PinvokeWrapper.GetWindowLng(this.Handle, -20);

            PinvokeWrapper.SetWindowLng(this.Handle, -20, initialStyle | 0x80000 | 0x20);

            SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
                     ControlStyles.Opaque | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor, true);

            _factory     = new Factory();
            _fontFactory = new FontFactory();

            _renderProperties = new HwndRenderTargetProperties
            {
                Hwnd           = Handle,
                PixelSize      = new SharpDX.Size2(Size.Width, Size.Height),
                PresentOptions = PresentOptions.None
            };

            // Initialize DirectX
            _device = new WindowRenderTarget(_factory, new RenderTargetProperties(new PixelFormat(SharpDX.DXGI.Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied)), _renderProperties);

            _brush = new SolidColorBrush(_device, new RawColor4(255, 0, 0, 1f));

            // Initialize Fonts
            _font = new TextFormat(_fontFactory, FontFamily, FontSize);

            _sharpDxThread = new Thread(DirectXThread)
            {
                Priority     = ThreadPriority.Highest,
                IsBackground = true
            };

            _sharpDxThread.Start();
        }
コード例 #14
0
        public static void Main()
        {
            //We get all processes with the name csgo
            var csgoProcesses = Process.GetProcessesByName("csgo");

            //If there is none
            if (!csgoProcesses.Any())
            {
                //we display that the csgo game is not found
                Console.WriteLine("CS:GO Not Found!");
                //We wait for user's approval
                Console.ReadKey();
                //we terminate the program
                return;
            }

            //We get our csgo handle
            Utils.CsgoHandle = csgoProcesses[0].Handle;

            //We loop through all csgo modules
            foreach (ProcessModule module in csgoProcesses[0].Modules)
            {
                //If we find the client_panorama.dll module
                if (Path.GetFileName(module.FileName) == "client_panorama.dll")
                {
                    //We save client_panorama.dll base address
                    Utils.ClientBaseAddress = module.BaseAddress;
                }
            }

            //If the client base address is zero, that means that we didn't find it
            if (Utils.ClientBaseAddress == IntPtr.Zero)
            {
                //We display that to the user
                Console.WriteLine("client_panorama.dll Not Found!");
                //We wait for user's approval
                Console.ReadKey();
                //we terminate the program
                return;
            }

            //Get the screen height
            Utils.ScreenHeight = Convert.ToInt32(SystemParameters.PrimaryScreenHeight);
            //Get the screen width
            Utils.ScreenWidth = Convert.ToInt32(SystemParameters.PrimaryScreenWidth);

            while (true)
            {
                if (PinvokeWrapper.GetTheKeyState(KeyCodes.VK_F1) != 0)
                {
                    if (!Options.EspIsEnabled)
                    {
                        Options.EspIsEnabled = true;
                    }
                    else
                    {
                        Options.EspIsEnabled = false;
                    }

                    Esp();
                }
                else if (PinvokeWrapper.GetTheKeyState(KeyCodes.VK_F2) != 0)
                {
                    if (!Options.GlowHackIsEnabled)
                    {
                        Options.GlowHackIsEnabled = true;

                        Thread wallHack = new Thread(WallHack);
                        wallHack.Start();
                    }
                    else
                    {
                        Options.GlowHackIsEnabled = false;
                    }
                }
                else if (PinvokeWrapper.GetTheKeyState(KeyCodes.VK_F3) != 0)
                {
                    if (!Options.AimbotIsEnabled)
                    {
                        Options.AimbotIsEnabled = true;

                        Thread aimbot = new Thread(Aimbot);
                        aimbot.Start();
                    }
                    else
                    {
                        Options.AimbotIsEnabled = false;
                    }
                }
                else if (PinvokeWrapper.GetTheKeyState(KeyCodes.VK_F4) != 0)
                {
                    if (!Options.TriggerbotIsEnabled)
                    {
                        Options.TriggerbotIsEnabled = true;

                        Thread triggerbot = new Thread(Triggerbot);
                        triggerbot.Start();
                    }
                    else
                    {
                        Options.TriggerbotIsEnabled = false;
                    }
                }
                else if (PinvokeWrapper.GetTheKeyState(KeyCodes.VK_F6) != 0)
                {
                    if (!Options.NoFlashIsEnabled)
                    {
                        Options.NoFlashIsEnabled = true;

                        Thread noFlash = new Thread(NoFlash);
                        noFlash.Start();
                    }
                    else
                    {
                        Options.NoFlashIsEnabled = false;
                    }
                }
                else if (PinvokeWrapper.GetTheKeyState(KeyCodes.VK_F7) != 0)
                {
                    switch (_aimbotBone)
                    {
                    case Utils.PlayerBones.Head:
                        _aimbotBone = Utils.PlayerBones.Body;
                        break;

                    case Utils.PlayerBones.Body:
                        _aimbotBone = Utils.PlayerBones.Pelvis;
                        break;

                    case Utils.PlayerBones.Pelvis:
                        _aimbotBone = Utils.PlayerBones.RightFoot;
                        break;

                    case Utils.PlayerBones.RightFoot:
                        _aimbotBone = Utils.PlayerBones.LeftFoot;
                        break;

                    case Utils.PlayerBones.LeftFoot:
                        _aimbotBone = Utils.PlayerBones.Head;
                        break;
                    }
                }

                //Clear console
                Console.Clear();
                //Print the selected options
                Console.WriteLine(String.Concat($"F1 - ESP: \t\t{Options.EspIsEnabled}"));
                Console.WriteLine(String.Concat($"F2 - Glow Hack: \t{Options.GlowHackIsEnabled}"));
                Console.WriteLine(String.Concat($"F3 - Aimbot: \t\t{Options.AimbotIsEnabled}"));
                Console.WriteLine(String.Concat($"F7 - Aimbot Bone: \t{_aimbotBone.ToString()}"));
                Console.WriteLine(String.Concat($"F4 - Triggerbot: \t{Options.TriggerbotIsEnabled}"));
                Console.WriteLine(String.Concat($"F6 - No Flash: \t\t{Options.NoFlashIsEnabled}"));

                //We sleep for 200 milliseconds
                Thread.Sleep(200);
            }
        }
コード例 #15
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
 public int GetGlowIndex()
 {
     return(PinvokeWrapper.ReadAddInt((IntPtr)BaseAddress + Offsets.m_iGlowIndex, Utils.CsgoHandle));
 }
コード例 #16
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
 public int GetArmor()
 {
     return(PinvokeWrapper.ReadAddInt((IntPtr)BaseAddress + Offsets.m_ArmorValue, Utils.CsgoHandle));
 }
コード例 #17
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
 public int GetHealth()
 {
     return(PinvokeWrapper.ReadAddInt((IntPtr)BaseAddress + Offsets.m_iHealth, Utils.CsgoHandle));
 }
コード例 #18
0
ファイル: Player.cs プロジェクト: michelangelo-s/Zen
 public int GetTeam()
 {
     return(PinvokeWrapper.ReadAddInt((IntPtr)BaseAddress + Offsets.m_iTeamNum, Utils.CsgoHandle));
 }