Exemplo n.º 1
0
        private void Nampham()
        {
            rect.left   = 0;    //
            rect.right  = 1366; //
            rect.top    = 21;   //
            rect.bottom = 726;  //
            int Width           = rect.right - rect.left;
            int Height          = rect.bottom - rect.top;
            int Width2          = 1382; //
            int Height2         = 744;  //
            var overlay         = new OverlayWindow(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
            var rendererOptions = new Direct2DRendererOptions()
            {
                AntiAliasing = false,
                Hwnd         = overlay.WindowHandle,
                MeasureFps   = true,
                VSync        = true
            };

            var     d2d         = new Direct2DRenderer(rendererOptions);
            var     trains      = d2d.CreateBrush(0, 0, 0, 0);
            var     blackBrush  = d2d.CreateBrush(0, 0, 0, 255);
            var     redBrush    = d2d.CreateBrush(242, 14, 14, 255);
            var     greenBrush  = d2d.CreateBrush(33, 208, 43, 255);
            var     whiteBrush  = d2d.CreateBrush(255, 255, 255, 200);
            var     blueBrush   = d2d.CreateBrush(0, 0, 255, 255);
            var     grenBrush   = d2d.CreateBrush(33, 208, 43, 180);
            var     greenBrush2 = d2d.CreateBrush(0, 188, 0, 255);
            var     font        = d2d.CreateFont("Tahoma", 8, true);
            var     bigfont     = d2d.CreateFont("Tahoma", 14, true);
            Vector2 center      = new Vector2();

            while (true)
            {
                center.X = Width / 2;
                center.Y = (Height / 2) + 20;
                d2d.BeginScene();
                d2d.ClearScene(trains);
                if (Showbone)
                {
                    var m_pWorld = Mem.ReadMemory <int>(Mem.BaseAddress + Offsets.PyGame + 0x410);
                    List <LUPPI.NP.Word> modal = new List <NP.Word>();
                    var m_pSceneContext        = Mem.ReadMemory <int>(m_pWorld + 0x8);
                    var cameraBase             = Mem.ReadMemory <int>(m_pSceneContext + 0x4);
                    var viewMatrix             = Mem.ReadMatrix <float>(cameraBase + 0xC4, 16);
                    var pSkeletonList          = Mem.ReadMemory <int>(m_pWorld + 0x290);
                    int visibleCount           = Mem.ReadMemory <int>(m_pWorld + 0x278);
                    int coutene = 0;
                    for (int i = 0; i < visibleCount; i++)
                    {
                        int r_pModel    = Mem.ReadMemory <int>(pSkeletonList + i);
                        int m_pAnimator = Mem.ReadMemory <int>(r_pModel + 0x328);
                        if (m_pAnimator > 1)
                        {
                            var intt = Mem.ReadMemory <int>(m_pAnimator + 0x528);
                            //var bon = Mem.ReadMemory<int>(m_pAnimator + 0x970);
                            var name = Mem.ReadString(intt, 35);
                            //float[] b = Mem.ReadMatrix<float>(r_pModel + 0x3B0, 16);
                            if (name.Contains("_male"))
                            {
                                coutene += 1;
                                modal.Add(new NP.Word()
                                {
                                    baseAdd = m_pAnimator, baseModal = r_pModel, isMen = true
                                });
                            }
                            else if (name.Contains("_female"))
                            {
                                coutene += 1;
                                modal.Add(new NP.Word()
                                {
                                    baseAdd = m_pAnimator, baseModal = r_pModel, isMen = false
                                });
                            }
                        }
                    }
                    d2d.DrawTextWithBackground("ENERMY : " + (coutene - 1) + " 💩", 10, 400, bigfont, redBrush, whiteBrush);
                    for (int i = 0; i < modal.Count; i++)
                    {
                        if (i == 0)//LOCALPLAYER POS
                        {
                            var m_Position1 = modal[i].pos;
                            MyPosition.X = m_Position1[12];
                            MyPosition.Y = m_Position1[13];
                            MyPosition.Z = m_Position1[14];
                        }
                        //string name = modal[i].TypeName;
                        //if (name.Contains("dataosha_male") || name.Contains("dataosha_female"))
                        {
                            var     m_Position = modal[i].pos;
                            Vector3 position;
                            position.X = m_Position[12];
                            position.Y = m_Position[13];
                            position.Z = m_Position[14];
                            var p = 0;
                            for (int j = 0; j < 0xE80; j += 0x40)
                            {
                                var ab         = Mem.ReadMemory <int>(modal[i].baseAdd + 0x970);
                                var boneMatrix = Mem.ReadMatrix <float>(ab + j, 16);
                                var bone4      = new LUPPI.NP.Matrix(boneMatrix);
                                var bone24     = new LUPPI.NP.Matrix(m_Position);
                                var result     = LUPPI.NP.Matrix.Multiply(bone4, bone24);
                                var vec3a      = new Vector3(result.M41, result.M42, result.M43);
                                Maths.WorldToScreen3(vec3a, viewMatrix, out var testeee, Width, Height);
                                d2d.DrawText(p.ToString(), testeee.X, testeee.Y, font, whiteBrush);
                                p++;
                            }
                            Maths.WorldToScreen(position, out var testee2, Width, Height);
                            int    khoangCach = Helper.GetDistance(MyPosition, position, 20);
                            string tea        = "[" + khoangCach + "m]";
                            if (khoangCach < 150)
                            {
                                d2d.DrawText(tea, testee2.X - tea.Length, testee2.Y, font, greenBrush2);
                            }
                            else
                            {
                                d2d.DrawText(tea, testee2.X - tea.Length, testee2.Y, font, whiteBrush);
                            }
                        }
                    }
                }
                if (isBoxEsp)
                {
                    Vector2 vector3;
                    LocalPlayer = Mem.ReadMemory <int>(Mem.BaseAddress + Offsets.LocalPlayer);
                    Mem.ReadMemory <int>(Mem.BaseAddress + 0x22);
                    MyPosition = GetEncryptedPosition(LocalPlayer);
                    List <Entity> ls = ReadAllEntity();
                    d2d.DrawTextWithBackground("ENERMY : " + enemyCount.ToString() + " 💩", 10, 400, bigfont, redBrush, whiteBrush);
                    d2d.DrawTextWithBackground("AIM LEG: " + aimLeg.ToString(), 10, 370, bigfont, redBrush, whiteBrush);
                    for (int i = 0; i < ls.Count; i++)
                    {
                        //ls[i].Coordinates.Y += 15f;
                        ls[i].Coordinates = ls[i].GetEncryptedPosition();
                        if (Maths.WorldToScreen(ls[i].Coordinates, out vector3, Width2, Height2))
                        {
                            int   khoangCach = Helper.GetDistance(MyPosition, ls[i].Coordinates, 10);
                            var   widthhp    = 0f;
                            var   widthhp2   = 0f;
                            float numaim     = 2f;
                            if (ls[i].isPlayer && ls[i].hp > 0)
                            {
                                float heiadd = 0f;
                                bool  flag3  = ls[i].pose == Pose.Standing;
                                if (flag3)
                                {
                                    heiadd += 18.5f;
                                }
                                bool flag4 = ls[i].pose == Pose.Prone;
                                if (flag4)
                                {
                                    heiadd += 12.5f;
                                    numaim  = 1.6f;
                                }
                                bool flag5 = ls[i].pose == Pose.Crouching;
                                if (flag5)
                                {
                                    heiadd += 4f;
                                    numaim  = 1.1f;
                                }
                                Vector2 line1, line2, line3, line4, line5, line6, line7, line8;
                                if (isBoxEsp)
                                {
                                    var a1  = ls[i].Coordinates.X;
                                    var a2  = ls[i].Coordinates.Y;
                                    var a3  = ls[i].Coordinates.Z;
                                    var v7  = a1 - 5.5f;
                                    var v8  = a2 - 2.5f;
                                    var v9  = a3 - 5.5f;
                                    var v10 = a1 + 5.5f;
                                    var v12 = a3 + 5.5f;
                                    if (Maths.WorldToScreen(new Vector3(v7, v8, v9), out line1, Width, Height))
                                    {
                                        var v4  = a2 + heiadd;
                                        var v11 = a2 + heiadd;
                                        var v13 = v4;
                                        var v14 = v4;
                                        if (Maths.WorldToScreen(new Vector3(v10, v4, v12), out line2, Width, Height))
                                        {
                                            if (Maths.WorldToScreen(new Vector3(v10, v8, v9), out line3, Width, Height))
                                            {
                                                if (Maths.WorldToScreen(new Vector3(v7, v11, v9), out line4, Width, Height))
                                                {
                                                    if (Maths.WorldToScreen(new Vector3(v7, v8, v12), out line5, Width, Height))
                                                    {
                                                        if (Maths.WorldToScreen(new Vector3(v7, v13, v12), out line6, Width, Height))
                                                        {
                                                            if (Maths.WorldToScreen(new Vector3(v10, v8, v12), out line7, Width, Height))
                                                            {
                                                                if (Maths.WorldToScreen(new Vector3(v10, v14, v9), out line8, Width, Height))
                                                                {
                                                                    d2d.DrawLine(line1.X, line1.Y, line4.X, line4.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line3.X, line3.Y, line8.X, line8.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line7.X, line7.Y, line2.X, line2.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line5.X, line5.Y, line6.X, line6.Y, 1, whiteBrush);

                                                                    //Chan
                                                                    d2d.DrawLine(line1.X, line1.Y, line3.X, line3.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line3.X, line3.Y, line7.X, line7.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line7.X, line7.Y, line5.X, line5.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line5.X, line5.Y, line1.X, line1.Y, 1, whiteBrush);

                                                                    //Dau
                                                                    d2d.DrawLine(line4.X, line4.Y, line8.X, line8.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line8.X, line8.Y, line2.X, line2.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line2.X, line2.Y, line6.X, line6.Y, 1, whiteBrush);
                                                                    d2d.DrawLine(line6.X, line6.Y, line4.X, line4.Y, 1, whiteBrush);

                                                                    widthhp  = (float)Helper.GetDistance2(line4, line2, 1);
                                                                    widthhp2 = (float)Helper.GetDistance2(line6, line8, 1);
                                                                    if (widthhp < widthhp2)
                                                                    {
                                                                        widthhp = widthhp2;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                var     dy = ls[i].Coordinates.X;
                                var     dy_4 = ls[i].Coordinates.Y;
                                var     v46 = ls[i].Coordinates.Z;
                                var     v27 = dy_4 + 27.0f;
                                Vector2 aimpoint, aimpoint2;
                                if (Maths.WorldToScreen(new Vector3(dy, v27, v46), out aimpoint, Width, Height))
                                {
                                    string tea = ls[i].PlayerName + " [" + khoangCach + " m]";
                                    if (khoangCach < 150)
                                    {
                                        d2d.DrawText(tea, aimpoint.X - tea.Length * 2, aimpoint.Y - 10, font, redBrush);
                                    }
                                    else
                                    {
                                        d2d.DrawText(tea, aimpoint.X - tea.Length * 2, aimpoint.Y - 10, font, whiteBrush);
                                    }

                                    //Player HP
                                    if (ls[i].hp == 100)
                                    {
                                        d2d.DrawVerticalBar(ls[i].hp, aimpoint.X - widthhp / 2, aimpoint.Y - 15f, widthhp, 1, 3, greenBrush2, blackBrush);
                                    }
                                    else
                                    {
                                        d2d.DrawVerticalBar(ls[i].hp, aimpoint.X - widthhp / 2, aimpoint.Y - 15f, widthhp, 1, 3, redBrush, blackBrush);
                                    }
                                }

                                if (Maths.WorldToScreen(new Vector3(dy, v27, v46), out aimpoint, Width, Height2))
                                {
                                    var v41 = dy_4 + heiadd;
                                    if (Maths.WorldToScreen(new Vector3(dy, v41, v46), out aimpoint2, Width, Height2))
                                    {
                                        if ((Maths.InsideCircle((int)center.X, (int)center.Y, 80, (int)aimpoint2.X, (int)aimpoint2.Y)))
                                        {
                                            if (Keyboard.IsKeyDown(Keys.LShiftKey))
                                            {
                                                Cursor.Position = new Point((int)(aimpoint2.X), (int)(aimpoint2.Y));
                                                if (Keyboard.IsKeyDown(Keys.LButton))
                                                {
                                                    Cursor.Position = new Point((int)(aimpoint2.X), (int)(aimpoint2.Y + ls[i].Pitch));
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            if (ls[i].isItem)
                            {
                                if (ls[i].dropID == 1001 || ls[i].dropID == 1002 || ls[i].dropID == 1007 || ls[i].dropID == 1026)
                                {
                                    d2d.DrawText2("[GUN]", vector3.X, vector3.Y, font, whiteBrush, greenBrush2);
                                }
                                else if (ls[i].dropID == 1273 || ls[i].dropID == 1274 || ls[i].dropID == 1275)
                                {
                                    d2d.DrawText2("[SCOPE]", vector3.X, vector3.Y, font, whiteBrush, greenBrush2);
                                }
                                else if (khoangCach < 100)
                                {
                                    //d2d.DrawText("[I]", vector3.X, vector3.Y, font, whiteBrush);
                                }
                            }
                            if (ls[i].isItemDie && khoangCach < 100)
                            {
                                d2d.DrawText2("[DIE]", vector3.X, vector3.Y, font, whiteBrush, greenBrush2);
                            }
                        }
                    }
                }

                d2d.EndScene();
                //Thread.Sleep(1);
            }
        }