-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessHandler.cs
More file actions
88 lines (75 loc) · 2.68 KB
/
Copy pathProcessHandler.cs
File metadata and controls
88 lines (75 loc) · 2.68 KB
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
using System;
using System.Diagnostics;
namespace AIO
{
class ProcessHandler
{
public static VAMemory vam;
public static int BaseClient;
// Attach to csgo process
public static void attach()
{
vam = new VAMemory("csgo");
if (vam.CheckProcess() == false)
{
Debug.Log("Failed to attach to csgo", "Red");
}
else
{
// Logging that program has sucessfully attached to csgo
Debug.Log("Attached to csgo", "Lime");
Form1._Form1.attachedStatus.Text = "True";
Form1._Form1.attachedStatus.ForeColor = System.Drawing.Color.Lime;
// Disable Attach Button
Form1._Form1.attachCSGOBtn.Enabled = false;
Form1._Form1.attachCSGOBtn.Visible = false;
// Enable Dettach Button
Form1._Form1.DettachBtn.Enabled = true;
Form1._Form1.DettachBtn.Visible = true;
}
}
// Dettach to csgo process
public static void dettach()
{
// Stop cheats
Form1._Form1.backgroundWorker1.CancelAsync();
// Make vam var into nothing
vam = null;
// Log stuff
Debug.Log("Dettached to csgo", "Lime");
Form1._Form1.attachedStatus.Text = "False";
Form1._Form1.attachedStatus.ForeColor = System.Drawing.Color.Red;
// Enable Attach Button
Form1._Form1.attachCSGOBtn.Enabled = true;
Form1._Form1.attachCSGOBtn.Visible = true;
// Disable Dettach Button
Form1._Form1.DettachBtn.Enabled = false;
Form1._Form1.DettachBtn.Visible = false;
}
// Get module client_panorama.dll address of csgo process
public static void getModuleAddress()
{
if (vam.CheckProcess())
{
Process[] p = Process.GetProcessesByName("csgo");
if (p.Length > 0)
{
Debug.Log("Finding process module...");
foreach (ProcessModule m in p[0].Modules)
{
if (m.ModuleName == "client_panorama.dll")
{
Debug.Log($"Found target: client_panorama.dll -> 0x{m.BaseAddress}", "Lime");
BaseClient = (int)m.BaseAddress;
}
}
}
}
else
{
Debug.Log("Failed to get module address", "Red");
return;
}
}
}
}