예제 #1
0
        private void Drawbox(float x, float y, int dist)
        {
            float h, w;

            int flags = 0;

            if (CheatData.panorama)
            {
                flags = mem.Read <int>(eBaseAdr + Offsets.New.m_fFlags);
            }
            else
            {
                flags = mem.Read <int>(eBaseAdr + Offsets.Old.m_fFlags);
            }
            if (flags == 263)
            {
                h = 18500 / dist;
            }
            w = 15000 / dist;
            h = 50000 / dist;
            gfx.DrawRectangle(x - (w / 2), y - h, w, h, 2, new Direct2DColor(pen[0], pen[1], pen[2]));
        }
예제 #2
0
        private void MainScan()
        {
            var font = d2d.CreateFont("Consolas", 11);

            players.Clear();
            targetEnimies.Clear();

            // Read Local
            #region Get Local Player

            // Render View
            Int64 pGameRenderer = RPM.ReadInt64(Offsets.OFFSET_GAMERENDERER);
            Int64 pRenderView   = RPM.ReadInt64(pGameRenderer + Offsets.PZ_GameRenderer.m_pRenderView);

            // Read Screen Matrix
            localPlayer.ViewProj = RPM.ReadMatrix(pRenderView + Offsets.PZ_RenderView.m_viewProj);

            Int64 pGContext = RPM.ReadInt64(Offsets.OFFSET_CLIENTGAMECONTEXT);
            if (!RPM.IsValid(pGContext))
            {
                return;
            }

            Int64 pPlayerManager = RPM.ReadInt64(pGContext + Offsets.PZ_ClientGameContext.m_pPlayerManager);
            if (!RPM.IsValid(pPlayerManager))
            {
                return;
            }

            Int64 plocalPlayer = RPM.ReadInt64(pPlayerManager + Offsets.PZ_ClientPlayerManager.m_pLocalPlayer);
            if (!RPM.IsValid(plocalPlayer))
            {
                return;
            }

            localPlayer.Team = RPM.ReadInt32(plocalPlayer + Offsets.PZ_ClientPlayer.m_teamId);

            Int64 pLocalSoldier = GetClientSoldierEntity(plocalPlayer, localPlayer);
            if (!RPM.IsValid(pLocalSoldier))
            {
                return;
            }

            Int64 pHealthComponent = RPM.ReadInt64(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_pHealthComponent);
            if (!RPM.IsValid(pHealthComponent))
            {
                return;
            }

            Int64 pPredictedController = RPM.ReadInt64(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_pPredictedController);
            if (!RPM.IsValid(pPredictedController))
            {
                return;
            }

            // Health
            localPlayer.Health    = RPM.ReadFloat(pHealthComponent + Offsets.PZ_HealthComponent.m_Health);
            localPlayer.MaxHealth = RPM.ReadFloat(pHealthComponent + Offsets.PZ_HealthComponent.m_MaxHealth);

            if (localPlayer.IsDead())
            {
                return;
            }

            // Origin
            localPlayer.Origin   = RPM.ReadVector3(pPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Position);
            localPlayer.Velocity = RPM.ReadVector3(pPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Velocity);

            // Other
            localPlayer.Pose = RPM.ReadInt32(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_poseType);
            localPlayer.Yaw  = RPM.ReadFloat(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_authorativeYaw);

            localPlayer.IsOccluded = RPM.ReadByte(pLocalSoldier + Offsets.PZ_ClientSoldierEntity.m_occluded);

            #endregion

            // Pointer to Players Array
            Int64 m_ppPlayer = RPM.ReadInt64(pPlayerManager + Offsets.PZ_ClientPlayerManager.m_ppPlayer);
            if (!RPM.IsValid(m_ppPlayer))
            {
                return;
            }


            #region Get Other Players by Id
            for (uint i = 0; i < 64; i++)
            {
                // Create new Player
                GPlayer player = new GPlayer();

                // Pointer to ClientPlayer class (Player Array + (Id * Size of Pointer))
                Int64 pEnemyPlayer = RPM.ReadInt64(m_ppPlayer + (i * sizeof(Int64)));
                if (!RPM.IsValid(pEnemyPlayer))
                {
                    continue;
                }

                player.Name = RPM.ReadString(pEnemyPlayer + Offsets.PZ_ClientPlayer.szName, 10);

                Int64 pEnemySoldier = GetClientSoldierEntity(pEnemyPlayer, player);
                if (!RPM.IsValid(pEnemySoldier))
                {
                    continue;
                }

                Int64 pEnemyHealthComponent = RPM.ReadInt64(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_pHealthComponent);
                if (!RPM.IsValid(pEnemyHealthComponent))
                {
                    continue;
                }

                Int64 pEnemyPredictedController = RPM.ReadInt64(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_pPredictedController);
                if (!RPM.IsValid(pEnemyPredictedController))
                {
                    continue;
                }

                // Health
                player.Health    = RPM.ReadFloat(pEnemyHealthComponent + Offsets.PZ_HealthComponent.m_Health);
                player.MaxHealth = RPM.ReadFloat(pEnemyHealthComponent + Offsets.PZ_HealthComponent.m_MaxHealth);

                if (player.Health <= 0.1f) // DEAD
                {
                    continue;
                }

                // Origin (Position in Game X, Y, Z)
                player.Origin   = RPM.ReadVector3(pEnemyPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Position);
                player.Velocity = RPM.ReadVector3(pEnemyPredictedController + Offsets.PZ_ClientSoldierPrediction.m_Velocity);

                // Other
                player.Team       = RPM.ReadInt32(pEnemyPlayer + Offsets.PZ_ClientPlayer.m_teamId);
                player.Pose       = RPM.ReadInt32(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_poseType);
                player.Yaw        = RPM.ReadFloat(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_authorativeYaw);
                player.IsOccluded = RPM.ReadByte(pEnemySoldier + Offsets.PZ_ClientSoldierEntity.m_occluded);

                // Distance to You
                player.Distance = Vector3.Distance(localPlayer.Origin, player.Origin);

                players.Add(player);

                if (player.IsValid())
                {
                    // Player Bone
                    bBoneOk = (GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_HEAD, out player.Bone.BONE_HEAD) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTELBOWROLL, out player.Bone.BONE_LEFTELBOWROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTFOOT, out player.Bone.BONE_LEFTFOOT) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTHAND, out player.Bone.BONE_LEFTHAND) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTKNEEROLL, out player.Bone.BONE_LEFTKNEEROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_LEFTSHOULDER, out player.Bone.BONE_LEFTSHOULDER) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_NECK, out player.Bone.BONE_NECK) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTELBOWROLL, out player.Bone.BONE_RIGHTELBOWROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTFOOT, out player.Bone.BONE_RIGHTFOOT) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTHAND, out player.Bone.BONE_RIGHTHAND) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTKNEEROLL, out player.Bone.BONE_RIGHTKNEEROLL) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_RIGHTSHOULDER, out player.Bone.BONE_RIGHTSHOULDER) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_SPINE, out player.Bone.BONE_SPINE) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_SPINE1, out player.Bone.BONE_SPINE1) &&
                               GetBoneById(pEnemySoldier, (int)Offsets.PZ_UpdatePoseResultData.BONES.BONE_SPINE2, out player.Bone.BONE_SPINE2));



                    #region Drawing ESP on Overlay

                    // Desconsidera Aliados
                    if (!bEspAllies && (player.Team == localPlayer.Team))
                    {
                        continue;
                    }

                    // Desconsidera os "Não Visíveis"
                    if (bEspVisiblesOnly && (!player.IsVisible() || player.Distance > 75) && !player.InVehicle)
                    {
                        continue;
                    }

                    #region ESP Bone
                    if (bBoneOk && ESP_Bone)
                    {
                        DrawBone(player);
                    }
                    #endregion

                    Vector3 w2sFoot, w2sHead;
                    if (WorldToScreen(player.Origin, out w2sFoot) && WorldToScreen(player.Origin, player.Pose, out w2sHead))
                    {
                        float H = w2sFoot.Y - w2sHead.Y;
                        float W = H / 2;
                        float X = w2sHead.X - W / 2;
                        int   iAux;
                        #region ESP Color

                        var color = (player.Team == localPlayer.Team) ? d2d.CreateBrush(0, 0, 255, 255) : player.IsVisible() ? d2d.CreateBrush(0, 255, 0, 255) : d2d.CreateBrush(255, 0, 0, 255);
                        #endregion

                        #region ESP Box
                        // ESP Box
                        if (ESP_Box && !bEspVisiblesOnly)
                        {
                            if (bEsp3D)
                            {
                                DrawAABB(player.GetAABB(), player.Origin, player.Yaw, color); // 3D Box
                            }
                            else
                            {
                                d2d.DrawRectangle((int)X, (int)w2sHead.Y, (int)W, (int)H, 2, color); // 2D Box
                            }
                        }
                        #endregion

                        #region ESP Vehicle
                        if (ESP_Vehicle)
                        {
                            DrawAABB(player.VehicleAABB, player.VehicleTranfsorm, player.Team == localPlayer.Team ? d2d.CreateBrush(64, 154, 200, 255) : d2d.CreateBrush(255, 129, 72, 255));
                        }
                        #endregion

                        #region ESP Name
                        if (ESP_Name && !bEspVisiblesOnly)
                        {
                            d2d.DrawTextWithBackground(player.Name, (int)X, (int)w2sFoot.Y, font, d2d.CreateBrush(240, 240, 240, 255), d2d.CreateBrush(0, 0, 0, 255));
                        }
                        #endregion

                        #region ESP Distance
                        if (ESP_Distance && !bEspVisiblesOnly)
                        {
                            iAux = (int)w2sFoot.Y;
                            if (ESP_Name)
                            {
                                iAux = iAux + 13;
                            }
                            d2d.DrawTextWithBackground((int)player.Distance + "m", (int)X, iAux, font, d2d.CreateBrush(240, 240, 240, 255), d2d.CreateBrush(0, 0, 0, 255));
                        }
                        #endregion

                        #region ESP Health
                        if (ESP_Health && !bEspVisiblesOnly)
                        {
                            DrawHealth((int)X, (int)w2sHead.Y - 6, (int)W, 3, (int)player.Health, (int)player.MaxHealth);
                            if (player.InVehicle && player.IsDriver)
                            {
                                DrawHealth((int)X, (int)w2sHead.Y - 10, (int)W, 3, (int)player.VehicleHealth, (int)player.VehicleMaxHealth);
                            }
                        }
                        #endregion
                    }
                    #endregion
                }
            }
            #endregion
        }
예제 #3
0
        private void drawThread()
        {
            Direct2DRenderer pDevice = overlay.Graphics;

            while (doLoop)
            {
                if (!isGameActive())
                {
                    pDevice.BeginScene();
                    pDevice.ClearScene();
                    pDevice.EndScene();

                    while (!isGameActive() && doLoop)
                    {
                        Thread.Sleep(100);
                    }
                    if (!doLoop)
                    {
                        break;
                    }
                }


                watch.Reset();
                watch.Start();
                if ((GetAsyncKeyState((int)0x01) & 0x8000) != 0)
                {
                    if (!mouseDown)
                    {
                        justToggled = true;
                        mouseDown   = true;
                    }
                    else
                    {
                        justToggled = false;
                    }
                }
                else
                {
                    mouseDown   = false;
                    justToggled = false;
                }
                GetCursorPos(out mousePos);

                handleInput();

                pDevice.BeginScene();
                pDevice.ClearScene();

                if (Master.renderesp)
                {
                    RenderESP();
                }

                pDevice.FillRectangle(5 + Xshift, 5 + Yshift, 170, 210, blackBrush);
                pDevice.DrawRectangle(5 + Xshift, 5 + Yshift, 170, 210, 5, tealBrush);
                pDevice.DrawText("LysDick Hex", titleFont, tealBrush, 15 + Xshift, 10 + Yshift);

                pDevice.DrawRectangle(15 + Xshift, 50 + Yshift, 15, 15, 1, tealBrush);
                pDevice.DrawText("Enable Triggerbot", font, tealBrush, 35 + Xshift, 49 + Yshift);
                pDevice.DrawRectangle(15 + Xshift, 70 + Yshift, 15, 15, 1, tealBrush);
                pDevice.DrawText("Slow Mode", font, tealBrush, 35 + Xshift, 69 + Yshift);
                pDevice.DrawRectangle(15 + Xshift, 90 + Yshift, 15, 15, 1, tealBrush);
                pDevice.DrawText("ESP (15m)", font, tealBrush, 35 + Xshift, 89 + Yshift);
                pDevice.DrawRectangle(15 + Xshift, 110 + Yshift, 15, 15, 1, tealBrush);
                pDevice.DrawText("Bunny Hop (Space)", font, tealBrush, 35 + Xshift, 109 + Yshift);

                if (Master.enabled)
                {
                    pDevice.FillRectangle(16 + Xshift, 51 + Yshift, 12, 12, tealBrush);
                }
                if (Master.mode == 1)
                {
                    pDevice.FillRectangle(16 + Xshift, 71 + Yshift, 12, 12, tealBrush);
                }
                if (Master.renderesp)
                {
                    pDevice.FillRectangle(16 + Xshift, 91 + Yshift, 12, 12, tealBrush);
                }
                if (Master.doBHop)
                {
                    pDevice.FillRectangle(16 + Xshift, 111 + Yshift, 12, 12, tealBrush);
                }

                Yshift += 25;

                pDevice.DrawCircle(22 + Xshift, 117 + Yshift, 8, 1, tealBrush);
                pDevice.DrawText("0ms Delay", font, tealBrush, 35 + Xshift, 109 + Yshift);
                pDevice.DrawCircle(22 + Xshift, 137 + Yshift, 8, 1, tealBrush);
                pDevice.DrawText("20ms Delay", font, tealBrush, 35 + Xshift, 129 + Yshift);
                pDevice.DrawCircle(22 + Xshift, 157 + Yshift, 8, 1, tealBrush);
                pDevice.DrawText("80ms Delay", font, tealBrush, 35 + Xshift, 149 + Yshift);
                if (Master.delay == 0)
                {
                    pDevice.FillCircle(22 + Xshift, 117 + Yshift, 7, tealBrush);
                }
                if (Master.delay == 20)
                {
                    pDevice.FillCircle(22 + Xshift, 137 + Yshift, 7, tealBrush);
                }

                if (Master.delay == 80)
                {
                    pDevice.FillCircle(22 + Xshift, 157 + Yshift, 7, tealBrush);
                }
                while (watch.ElapsedMilliseconds < (50 / 3))
                {
                    Thread.Sleep(1);
                }
                Yshift -= 25;
                pDevice.EndScene();
            }
        }