static void example() { var overlay = new OverlayWindow(0, 0, 800, 600); var rendererOptions = new Direct2DRendererOptions() { AntiAliasing = true, Hwnd = overlay.WindowHandle, MeasureFps = true, VSync = false }; var d2d = new Direct2DRenderer(rendererOptions); var whiteSmoke = d2d.CreateBrush(0xF5, 0xF5, 0xF5, 100); var blackBrush = d2d.CreateBrush(0, 0, 0, 255); var redBrush = d2d.CreateBrush(255, 0, 0, 255); var greenBrush = d2d.CreateBrush(0, 255, 0, 255); var blueBrush = d2d.CreateBrush(0, 0, 255, 255); var font = d2d.CreateFont("Consolas", 22); while (true) { d2d.BeginScene(); d2d.ClearScene(whiteSmoke); d2d.DrawTextWithBackground("FPS: " + d2d.FPS, 20, 40, font, greenBrush, blackBrush); d2d.BorderedRectangle(300, 40, 100, 200, 4, redBrush, blackBrush); d2d.DrawHorizontalBar(100, 290, 40, 2, 200, 4, greenBrush, blackBrush); d2d.DrawHorizontalBar(100, 280, 40, 2, 200, 4, blueBrush, blackBrush); d2d.DrawCrosshair(CrosshairStyle.Gap, 400, 300, 25, 4, redBrush); d2d.EndScene(); } }
private void Loop() { while (true) { // GC.Collect(); gfx.BeginScene(); gfx.ClearScene(); if (CheatData.panorama) { for (int i = 0; i < 100; i++) { MyBaseAdr = mem.Read <int>(CheatData.bClient + Offsets.New.dwLocalPlayer); mteam = mem.Read <int>(MyBaseAdr + Offsets.New.m_iTeamNum); mycoords = mem.Read <Vector3>(MyBaseAdr + Offsets.New.m_vecOrigin); eBaseAdr = mem.Read <int>(CheatData.bClient + Offsets.New.dwEntityList + (i * Offsets.New.Loop_offset)); eteam = mem.Read <int>(eBaseAdr + Offsets.New.m_iTeamNum); dormant = mem.Read <bool>(eBaseAdr + Offsets.New.m_bDormant); // glowind = mem.Read<int>(eBaseAdr + Offsets.m_iGlowIndex); hp = mem.Read <int>(eBaseAdr + Offsets.New.m_iHealth); coords = mem.Read <Vector3>(eBaseAdr + Offsets.New.m_vecOrigin); head = CalcEnemyHead(eBaseAdr, 8); Gres = mem.Read <int>(CheatData.bClient + Offsets.New.dwPlayerResource); rank = mem.Read <int>(Gres + Offsets.New.m_iCompetitiveRanking + i * 4); int radar = mem.Read <int>(CheatData.bClient + Offsets.New.dwRadarBase); name = mem.Read <char>(radar + (i * 50) + 0x204, 50); string n = string.Empty; for (int j = 0; j < 49; j++) { n += name[j]; } // // angles = mem.Read<Vector2>(eBaseAdr + Offsets.m_angEyeAngles); mt = mteam; et = eteam; if (MyBaseAdr == 0x0) { continue; } VMatrix = mem.Read <Matrix4x4>(CheatData.bClient + Offsets.New.dwViewMatrix); ScreenVector sv = WorldToScreen(coords.X, coords.Y, coords.Z); ScreenVector svh = WorldToScreen(head.X, head.Y, head.Z); if (dormant) { continue; } if (hp == 0) { continue; } if (!sv.Result) { continue; } int ex = (int)sv.X; int ey = (int)sv.Y; int sx = WHwindow.Width / 2; int sy = WHwindow.Height; float h = (svh.Y - sv.Y); float w = 18500 / (float)Vector3.Distance(mycoords, coords); float x = (int)(sv.X - w / 2); float y = (sv.Y); if ((eteam != mteam) && mteam != 1) { if (CheatData.lines_wh) { gfx.DrawLine(sx, sy, ex, ey, 2, new Direct2DColor(pen[0], pen[1], pen[2])); } if (CheatData.hp_wh) { gfx.DrawHorizontalBar(hp, x, y, 2, h, 1, new Direct2DColor(255, 0, 0), new Direct2DColor(0, 0, 0)); } if (CheatData.box) { double d = Vector3.Distance(mycoords, coords); if (d < 1f) { continue; } Drawbox(sv.X, sv.Y, (int)d); } if (CheatData.ranks) { gfx.DrawText(n, svh.X, svh.Y, new Direct2DFont(factory, "Arial", 12), new Direct2DColor(255, 0, 0)); gfx.DrawText(Ranks[rank], ex, ey, new Direct2DFont(factory, "Arial", 12), new Direct2DColor(255, 0, 0)); } } } } else { for (int i = 0; i < 100; i++) { MyBaseAdr = mem.Read <int>(CheatData.bClient + Offsets.Old.dwLocalPlayer); mteam = mem.Read <int>(MyBaseAdr + Offsets.Old.m_iTeamNum); mycoords = mem.Read <Vector3>(MyBaseAdr + Offsets.Old.m_vecOrigin); eBaseAdr = mem.Read <int>(CheatData.bClient + Offsets.Old.dwEntityList + (i * Offsets.New.Loop_offset)); eteam = mem.Read <int>(eBaseAdr + Offsets.Old.m_iTeamNum); dormant = mem.Read <bool>(eBaseAdr + Offsets.New.m_bDormant); // glowind = mem.Read<int>(eBaseAdr + Offsets.m_iGlowIndex); hp = mem.Read <int>(eBaseAdr + Offsets.Old.m_iHealth); coords = mem.Read <Vector3>(eBaseAdr + Offsets.Old.m_vecOrigin); head = CalcEnemyHead(eBaseAdr, 8); Gres = mem.Read <int>(CheatData.bClient + Offsets.Old.dwPlayerResource); rank = mem.Read <int>(Gres + Offsets.Old.m_iCompetitiveRanking + i * 4); int radar = mem.Read <int>(CheatData.bClient + Offsets.Old.dwRadarBase); name = mem.Read <char>(radar + (i * 50) + 0x204, 50); string n = string.Empty; for (int j = 0; j < 49; j++) { n += name[j]; } // // angles = mem.Read<Vector2>(eBaseAdr + Offsets.m_angEyeAngles); mt = mteam; et = eteam; if (MyBaseAdr == 0x0) { continue; } VMatrix = mem.Read <Matrix4x4>(CheatData.bClient + Offsets.Old.dwViewMatrix); ScreenVector sv = WorldToScreen(coords.X, coords.Y, coords.Z); ScreenVector svh = WorldToScreen(head.X, head.Y, head.Z); if (dormant) { continue; } if (hp == 0) { continue; } if (!sv.Result) { continue; } int ex = (int)sv.X; int ey = (int)sv.Y; int sx = WHwindow.Width / 2; int sy = WHwindow.Height; float h = (svh.Y - sv.Y); float w = 18500 / (float)Vector3.Distance(mycoords, coords); float x = (int)(sv.X - w / 2); float y = (sv.Y); if ((eteam != mteam) && mteam != 1) { if (CheatData.lines_wh) { gfx.DrawLine(sx, sy, ex, ey, 2, new Direct2DColor(pen[0], pen[1], pen[2])); } if (CheatData.hp_wh) { gfx.DrawHorizontalBar(hp, x, y, 2, h, 1, new Direct2DColor(255, 0, 0), new Direct2DColor(0, 0, 0)); } if (CheatData.box) { double d = Vector3.Distance(mycoords, coords); if (d < 1f) { continue; } Drawbox(sv.X, sv.Y, (int)d); } if (CheatData.ranks) { gfx.DrawText(n, svh.X, svh.Y, new Direct2DFont(factory, "Arial", 12), new Direct2DColor(255, 0, 0)); gfx.DrawText(Ranks[rank], ex, ey, new Direct2DFont(factory, "Arial", 12), new Direct2DColor(255, 0, 0)); } } } } gfx.EndScene(); //Thread.Sleep(5); } }