-
Notifications
You must be signed in to change notification settings - Fork 1
/
GameGuard.cs
164 lines (152 loc) · 5.21 KB
/
GameGuard.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/*
* Creado por SharpDevelop.
* Usuario: GNR092
* Fecha: 06/02/2017
* Hora: 08:04 p.m.
*
* Para cambiar esta plantilla use Herramientas | Opciones | Codificación | Editar Encabezados Estándar
*/
using System;
using System.Diagnostics;
using System.Threading;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Windows.Forms;
namespace SecureGameGuard
{
/// <summary>
/// SecureGameGuard.
///
/// Copyright (C) GNR092, 2016-2017.
/// </summary>
public static class GameGuard
{
static readonly object _Lock = new object();
private static List<string> array { get; set; }
public static void StartSecureGame(List<string> Config, bool error = false)
{
if (error)
{
array = Config;
}
else
{
Config.RemoveAt(0);
array = Config;
}
ThreadPool.QueueUserWorkItem(new WaitCallback(CurrentLoop), 1);
}
private static void CurrentLoop(object o)
{
SecureGame.notify.ShowBalloonTip(1000, "Notificacion", "SecureGameGuard Iniciado Correctamente", ToolTipIcon.Info);
while (!SecureGame.Disconect)
{
lock (_Lock)
{
foreach (var cheat in array)
{
if (string.IsNullOrEmpty(cheat)) continue;
foreach (Process Pitems in Process.GetProcesses())
{
try
{
if (Pitems.ProcessName.ToLower().Contains(cheat.ToLower()))
{
try
{
Pitems.Kill();
Pitems.WaitForExit();
new Thread((() =>
{
SecureGame.notify.ShowBalloonTip(4000,
"SecureGameGuard Hack detected!!",
"Hack Detectado informando Administradores!!\nPrograma: " + Pitems.ProcessName,
ToolTipIcon.Warning
);
}))
{ IsBackground = true}.Start();
continue;
}
catch (Exception e)
{
Console.ForegroundColor = ConsoleColor.DarkCyan;
Console.WriteLine(e);
}
}
var desc = FileVersionInfo.GetVersionInfo(Pitems.MainModule.FileName);
if (desc.FileDescription.ToLower().Contains(cheat.ToLower()))
{
try
{
Pitems.Kill();
Pitems.WaitForExit();
new Thread((() =>
{
SecureGame.notify.ShowBalloonTip(4000,
"SecureGameGuard Hack detected!!",
"Hack Detectado informando Administradores!!\nPrograma: " + Pitems.ProcessName,
ToolTipIcon.Warning
);
}))
{ IsBackground = true }.Start();
continue;
}
catch (Exception e)
{
Console.ForegroundColor = ConsoleColor.DarkCyan;
Console.WriteLine(e);
}
}
}
catch
{
}
}
Thread.Sleep(100);
}
}
}
SecureGame.Start = false;
}
public static string Encrypt(string plainText)
{
byte[] bytes1 = Encoding.UTF8.GetBytes(plainText);
byte[] bytes2 = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(32);
RijndaelManaged rijndaelManaged = new RijndaelManaged();
rijndaelManaged.Mode = CipherMode.CBC;
rijndaelManaged.Padding = PaddingMode.Zeros;
ICryptoTransform encryptor = rijndaelManaged.CreateEncryptor(bytes2, Encoding.ASCII.GetBytes(VIKey));
byte[] inArray;
using (MemoryStream memoryStream = new MemoryStream())
{
using (CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
{
cryptoStream.Write(bytes1, 0, bytes1.Length);
cryptoStream.FlushFinalBlock();
inArray = memoryStream.ToArray();
cryptoStream.Close();
}
memoryStream.Close();
}
return Convert.ToBase64String(inArray);
}
public static string Decrypt(string encryptedText)
{
byte[] buffer = Convert.FromBase64String(encryptedText);
byte[] bytes = new Rfc2898DeriveBytes(PasswordHash, Encoding.ASCII.GetBytes(SaltKey)).GetBytes(32);
RijndaelManaged rijndaelManaged = new RijndaelManaged();
rijndaelManaged.Mode = CipherMode.CBC;
rijndaelManaged.Padding = PaddingMode.None;
ICryptoTransform decryptor = rijndaelManaged.CreateDecryptor(bytes, Encoding.ASCII.GetBytes(VIKey));
MemoryStream memoryStream = new MemoryStream(buffer);
CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read);
byte[] numArray = new byte[buffer.Length];
int count = cryptoStream.Read(numArray, 0, numArray.Length);
memoryStream.Close();
cryptoStream.Close();
return Encoding.UTF8.GetString(numArray, 0, count).TrimEnd("\0".ToCharArray());
}
}
}