-
Notifications
You must be signed in to change notification settings - Fork 11
/
Program.cs
89 lines (64 loc) · 2.1 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using CS2Cheat.Data.Game;
using CS2Cheat.Features;
using CS2Cheat.Graphics;
using CS2Cheat.Utils;
using static CS2Cheat.Core.User32;
using Application = System.Windows.Application;
namespace CS2Cheat;
public class Program :
Application,
IDisposable
{
private Program()
{
Offsets.UpdateOffsets();
Startup += (_, _) => InitializeComponent();
Exit += (_, _) => Dispose();
}
private GameProcess GameProcess { get; set; } = null!;
private GameData GameData { get; set; } = null!;
private WindowOverlay WindowOverlay { get; set; } = null!;
private Graphics.Graphics Graphics { get; set; } = null!;
private TriggerBot Trigger { get; set; } = null!;
private AimBot AimBot { get; set; } = null!;
private BombTimer BombTimer { get; set; } = null!;
public void Dispose()
{
GameProcess.Dispose();
GameProcess = default!;
GameData.Dispose();
GameData = default!;
WindowOverlay.Dispose();
WindowOverlay = default!;
Graphics.Dispose();
Graphics = default!;
Trigger.Dispose();
Trigger = default!;
AimBot.Dispose();
AimBot = default!;
BombTimer.Dispose();
BombTimer = default!;
}
public static void Main()
{
new Program().Run();
}
private void InitializeComponent()
{
GameProcess = new GameProcess();
GameProcess.Start();
GameData = new GameData(GameProcess);
GameData.Start();
WindowOverlay = new WindowOverlay(GameProcess);
WindowOverlay.Start();
Graphics = new Graphics.Graphics(GameProcess, GameData, WindowOverlay);
Graphics.Start();
Trigger = new TriggerBot(GameProcess, GameData);
Trigger.Start();
AimBot = new AimBot(GameProcess, GameData);
AimBot.Start();
BombTimer = new BombTimer(Graphics);
BombTimer.Start();
SetWindowDisplayAffinity(WindowOverlay!.Window.Handle, 0x00000011); //obs bypass
}
}