Some refactoring and Remote Desktop improvements

This commit is contained in:
MaxXor 2015-07-26 00:10:59 +02:00
parent 0251e42cd3
commit 59eec835dd
90 changed files with 864 additions and 528 deletions

View File

@ -11,8 +11,8 @@ namespace xClient.Tests.Core.Encryption
[TestMethod]
public void EncryptAndDecryptStringTest()
{
var input = Helper.GetRandomName(100);
var password = Helper.GetRandomName(50);
var input = FileHelper.GetRandomFilename(100);
var password = FileHelper.GetRandomFilename(50);
var encrypted = AES.Encrypt(input, password);
Assert.IsNotNull(encrypted);
@ -26,10 +26,10 @@ namespace xClient.Tests.Core.Encryption
[TestMethod]
public void EncryptAndDecryptByteArrayTest()
{
var input = Helper.GetRandomName(100);
var input = FileHelper.GetRandomFilename(100);
var inputByte = Encoding.UTF8.GetBytes(input);
var passwordByte = Encoding.UTF8.GetBytes(Helper.GetRandomName(50));
var passwordByte = Encoding.UTF8.GetBytes(FileHelper.GetRandomFilename(50));
var encryptedByte = AES.Encrypt(inputByte, passwordByte);
Assert.IsNotNull(encryptedByte);

View File

@ -10,7 +10,7 @@ namespace xClient.Tests.Core.Encryption
[TestMethod]
public void ComputeHashTest()
{
var input = Helper.GetRandomName(100);
var input = FileHelper.GetRandomFilename(100);
var result = SHA256.ComputeHash(input);
Assert.IsNotNull(result);

View File

@ -46,6 +46,11 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Core\Helper\FileHelper.cs" />
<Compile Include="Core\Helper\FormatHelper.cs" />
<Compile Include="Core\Helper\NativeMethodsHelper.cs" />
<Compile Include="Core\Helper\PlatformHelper.cs" />
<Compile Include="Core\Helper\RemoteDesktopHelper.cs" />
<Compile Include="Core\Networking\Client.cs" />
<Compile Include="Core\Commands\CommandHandler.cs" />
<Compile Include="Core\Commands\ConnectionHandler.cs" />
@ -66,8 +71,9 @@
<Compile Include="Core\Encryption\AES.cs" />
<Compile Include="Core\Encryption\SHA256.cs" />
<Compile Include="Core\Extensions\RegistryKeyExtensions.cs" />
<Compile Include="Core\Helper\FileSplit.cs" />
<Compile Include="Core\Helper\UnsafeStreamCodec.cs" />
<Compile Include="Core\Utilities\FileSplit.cs" />
<Compile Include="Core\Utilities\NativeMethods.cs" />
<Compile Include="Core\Utilities\UnsafeStreamCodec.cs" />
<Compile Include="Core\Information\OSInfo.cs" />
<Compile Include="Core\Compression\JpgCompression.cs" />
<Compile Include="Core\Extensions\SocketExtensions.cs" />
@ -249,9 +255,12 @@
<Compile Include="Core\ProtoBuf\ServiceModel\XmlProtoSerializer.cs" />
<Compile Include="Core\ProtoBuf\SubItemToken.cs" />
<Compile Include="Core\ProtoBuf\WireType.cs" />
<Compile Include="Core\Helper\Helper.cs" />
<Compile Include="Core\Information\GeoIP.cs" />
<Compile Include="Core\Keylogger\Logger.cs" />
<Compile Include="Enums\PathType.cs" />
<Compile Include="Enums\RemoteDesktopAction.cs" />
<Compile Include="Enums\ShutdownAction.cs" />
<Compile Include="Enums\UserStatus.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Config\Settings.cs" />

View File

@ -1,55 +1,16 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;
using xClient.Core.RemoteShell;
using xClient.Core.Helper;
using xClient.Core.Utilities;
namespace xClient.Core.Commands
{
/* THIS PARTIAL CLASS SHOULD CONTAIN VARIABLES OR P/INVOKES NECESSARY FOR VARIOUS COMMANDS (if needed). */
public static partial class CommandHandler
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool DeleteFile(string name);
[DllImport("user32.dll")]
private static extern bool SetCursorPos(int x, int y);
[DllImport("user32.dll")]
private static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
public static bool IsStreamingDesktop;
public static UnsafeStreamCodec StreamCodec;
private static Shell _shell;
private static Dictionary<int, string> _canceledDownloads = new Dictionary<int, string>();
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
private const int MOUSEEVENTF_RIGHTUP = 0x10;
private const string DELIMITER = "$E$";
public enum UserStatus
{
Idle,
Active
}
public enum ShutdownAction
{
Shutdown,
Restart,
Standby
}
public enum PathType
{
File,
Directory,
Back
}
public enum RemoteDesktopAction
{
Start,
Stop
}
}
}

View File

@ -6,6 +6,7 @@ using System.Threading;
using xClient.Config;
using xClient.Core.Helper;
using xClient.Core.Networking;
using xClient.Core.Utilities;
namespace xClient.Core.Commands
{
@ -50,7 +51,7 @@ namespace xClient.Core.Commands
}
catch (Exception ex)
{
DeleteFile(filePath);
NativeMethods.DeleteFile(filePath);
new Packets.ClientPackets.SetStatus(string.Format("Update failed: {0}", ex.Message)).Execute(client);
}
@ -62,7 +63,7 @@ namespace xClient.Core.Commands
new Packets.ClientPackets.SetStatus("Downloading file...").Execute(client);
string tempFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
Helper.Helper.GetRandomFilename(12, ".exe"));
FileHelper.GetRandomFilename(12, ".exe"));
try
{
@ -93,7 +94,7 @@ namespace xClient.Core.Commands
try
{
string filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
Helper.Helper.GetRandomFilename(12, ".bat"));
FileHelper.GetRandomFilename(12, ".bat"));
string uninstallBatch = (Settings.INSTALL && Settings.HIDEFILE)
? "@echo off" + "\n" +

View File

@ -1,8 +1,9 @@
using System;
using System.IO;
using System.Threading;
using xClient.Core.Helper;
using xClient.Core.Networking;
using xClient.Core.Utilities;
using xClient.Enums;
namespace xClient.Core.Commands
{
@ -101,7 +102,7 @@ namespace xClient.Core.Commands
public static void HandleDoUploadFile(Packets.ServerPackets.DoUploadFile command, Client client)
{
if (command.CurrentBlock == 0 && File.Exists(command.RemotePath))
DeleteFile(command.RemotePath); // delete existing file
NativeMethods.DeleteFile(command.RemotePath); // delete existing file
FileSplit destFile = new FileSplit(command.RemotePath);
destFile.AppendBlock(command.Block, command.CurrentBlock);

View File

@ -6,6 +6,7 @@ using System.Threading;
using System.Windows.Forms;
using xClient.Core.Helper;
using xClient.Core.Networking;
using xClient.Core.Utilities;
namespace xClient.Core.Commands
{
@ -20,7 +21,7 @@ namespace xClient.Core.Commands
new Thread(() =>
{
string tempFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
Helper.Helper.GetRandomFilename(12, ".exe"));
FileHelper.GetRandomFilename(12, ".exe"));
try
{
@ -40,7 +41,7 @@ namespace xClient.Core.Commands
try
{
DeleteFile(tempFile + ":Zone.Identifier");
NativeMethods.DeleteFile(tempFile + ":Zone.Identifier");
var bytes = File.ReadAllBytes(tempFile);
if (bytes[0] != 'M' && bytes[1] != 'Z')
@ -58,7 +59,7 @@ namespace xClient.Core.Commands
}
catch
{
DeleteFile(tempFile);
NativeMethods.DeleteFile(tempFile);
new Packets.ClientPackets.SetStatus("Execution failed!").Execute(client);
return;
}
@ -88,7 +89,7 @@ namespace xClient.Core.Commands
if ((command.CurrentBlock + 1) == command.MaxBlocks) // execute
{
DeleteFile(filePath + ":Zone.Identifier");
NativeMethods.DeleteFile(filePath + ":Zone.Identifier");
ProcessStartInfo startInfo = new ProcessStartInfo();
if (command.RunHidden)
@ -105,7 +106,7 @@ namespace xClient.Core.Commands
}
catch (Exception ex)
{
DeleteFile(filePath);
NativeMethods.DeleteFile(filePath);
new Packets.ClientPackets.SetStatus(string.Format("Execution failed: {0}", ex.Message)).Execute(client);
}
}

View File

@ -6,6 +6,8 @@ using xClient.Core.Helper;
using System.Drawing.Imaging;
using System.Threading;
using xClient.Core.Networking;
using xClient.Core.Utilities;
using xClient.Enums;
namespace xClient.Core.Commands
{
@ -24,9 +26,17 @@ namespace xClient.Core.Commands
IsStreamingDesktop = true;
if (StreamCodec == null || StreamCodec.ImageQuality != command.Quality || StreamCodec.Monitor != command.Monitor)
if (StreamCodec == null)
StreamCodec = new UnsafeStreamCodec(command.Quality, command.Monitor);
if (StreamCodec.ImageQuality != command.Quality || StreamCodec.Monitor != command.Monitor)
{
if (StreamCodec != null)
StreamCodec.Dispose();
StreamCodec = new UnsafeStreamCodec(command.Quality, command.Monitor);
}
new Thread(() =>
{
while (IsStreamingDesktop)
@ -40,7 +50,7 @@ namespace xClient.Core.Commands
Bitmap desktop = null;
try
{
desktop = Helper.Helper.GetDesktop(command.Monitor);
desktop = RemoteDesktopHelper.GetDesktop(command.Monitor);
desktopData = desktop.LockBits(new Rectangle(0, 0, desktop.Width, desktop.Height),
ImageLockMode.ReadWrite, desktop.PixelFormat);
@ -86,25 +96,11 @@ namespace xClient.Core.Commands
if (command.LeftClick)
{
SetCursorPos(p.X, p.Y);
mouse_event(MOUSEEVENTF_LEFTDOWN, p.X, p.Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, p.X, p.Y, 0, 0);
if (command.DoubleClick)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, p.X, p.Y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, p.X, p.Y, 0, 0);
}
NativeMethodsHelper.DoMouseClickLeft(p, command.DoubleClick);
}
else
{
SetCursorPos(p.X, p.Y);
mouse_event(MOUSEEVENTF_RIGHTDOWN, p.X, p.Y, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, p.X, p.Y, 0, 0);
if (command.DoubleClick)
{
mouse_event(MOUSEEVENTF_RIGHTDOWN, p.X, p.Y, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, p.X, p.Y, 0, 0);
}
NativeMethodsHelper.DoMouseClickRight(p, command.DoubleClick);
}
}

View File

@ -8,7 +8,9 @@ using Microsoft.Win32;
using xClient.Core.Information;
using xClient.Core.RemoteShell;
using xClient.Core.Extensions;
using xClient.Core.Helper;
using xClient.Core.Networking;
using xClient.Enums;
namespace xClient.Core.Commands
{
@ -28,12 +30,12 @@ namespace xClient.Core.Commands
if (string.IsNullOrEmpty(volumeLabel))
{
displayName[i] = string.Format("{0} [{1}, {2}]", drives[i].RootDirectory.FullName,
Helper.Helper.DriveTypeName(drives[i].DriveType), drives[i].DriveFormat);
FormatHelper.DriveTypeName(drives[i].DriveType), drives[i].DriveFormat);
}
else
{
displayName[i] = string.Format("{0} ({1}) [{2}, {3}]", drives[i].RootDirectory.FullName, volumeLabel,
Helper.Helper.DriveTypeName(drives[i].DriveType), drives[i].DriveFormat);
FormatHelper.DriveTypeName(drives[i].DriveType), drives[i].DriveFormat);
}
rootDirectory[i] = drives[i].RootDirectory.FullName;
}

View File

@ -1,10 +1,11 @@
using System.Drawing;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
namespace xClient.Core.Compression
{
public class JpgCompression
public class JpgCompression : IDisposable
{
private readonly ImageCodecInfo _encoderInfo;
private readonly EncoderParameters _encoderParams;
@ -15,7 +16,25 @@ namespace xClient.Core.Compression
this._encoderInfo = GetEncoderInfo("image/jpeg");
this._encoderParams = new EncoderParameters(2);
this._encoderParams.Param[0] = parameter;
this._encoderParams.Param[1] = new EncoderParameter(Encoder.Compression, (long) EncoderValue.CompressionRle);
this._encoderParams.Param[1] = new EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionRle);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (_encoderParams != null)
{
_encoderParams.Dispose();
}
}
}
public byte[] Compress(Bitmap bmp)

View File

@ -0,0 +1,20 @@
using System;
using System.Text;
namespace xClient.Core.Helper
{
public static class FileHelper
{
private const string CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private static readonly Random _rnd = new Random(Environment.TickCount);
public static string GetRandomFilename(int length, string extension = "")
{
StringBuilder randomName = new StringBuilder(length);
for (int i = 0; i < length; i++)
randomName.Append(CHARS[_rnd.Next(CHARS.Length)]);
return string.Concat(randomName.ToString(), extension);
}
}
}

View File

@ -0,0 +1,30 @@
using System.IO;
using System.Text.RegularExpressions;
namespace xClient.Core.Helper
{
public static class FormatHelper
{
public static string FormatMacAddress(string macAddress)
{
return (macAddress.Length != 12)
? "00:00:00:00:00:00"
: Regex.Replace(macAddress, "(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})", "$1:$2:$3:$4:$5:$6");
}
public static string DriveTypeName(DriveType type)
{
switch (type)
{
case DriveType.Fixed:
return "Local Disk";
case DriveType.Network:
return "Network Drive";
case DriveType.Removable:
return "Removable Drive";
default:
return type.ToString();
}
}
}
}

View File

@ -1,73 +0,0 @@
using System;
using System.Drawing;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.IO;
namespace xClient.Core.Helper
{
public static class Helper
{
private const string CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private static readonly Random _rnd = new Random(Environment.TickCount);
public static string GetRandomFilename(int length, string extension)
{
StringBuilder randomName = new StringBuilder(length);
for (int i = 0; i < length; i++)
randomName.Append(CHARS[_rnd.Next(CHARS.Length)]);
return string.Concat(randomName.ToString(), extension);
}
public static string GetRandomName(int length)
{
StringBuilder randomName = new StringBuilder(length);
for (int i = 0; i < length; i++)
randomName.Append(CHARS[_rnd.Next(CHARS.Length)]);
return randomName.ToString();
}
public static Bitmap GetDesktop(int screenNumber)
{
var bounds = Screen.AllScreens[screenNumber].Bounds;
var screenshot = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb);
using (Graphics graph = Graphics.FromImage(screenshot))
{
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy);
return screenshot;
}
}
public static bool IsWindowsXP()
{
var osVersion = Environment.OSVersion.Version;
return osVersion.Major == 5 && osVersion.Minor >= 1;
}
public static string FormatMacAddress(string macAddress)
{
return (macAddress.Length != 12)
? "00:00:00:00:00:00"
: Regex.Replace(macAddress, "(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})", "$1:$2:$3:$4:$5:$6");
}
public static string DriveTypeName(DriveType type)
{
switch (type)
{
case DriveType.Fixed:
return "Local Disk";
case DriveType.Network:
return "Network Drive";
case DriveType.Removable:
return "Removable Drive";
default:
return type.ToString();
}
}
}
}

View File

@ -0,0 +1,37 @@
using System.Drawing;
using xClient.Core.Utilities;
namespace xClient.Core.Helper
{
public static class NativeMethodsHelper
{
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
private const int MOUSEEVENTF_RIGHTUP = 0x10;
public static void DoMouseClickLeft(Point p, bool doubleClick)
{
NativeMethods.SetCursorPos(p.X, p.Y);
NativeMethods.mouse_event(MOUSEEVENTF_LEFTDOWN, p.X, p.Y, 0, 0);
NativeMethods.mouse_event(MOUSEEVENTF_LEFTUP, p.X, p.Y, 0, 0);
if (doubleClick)
{
NativeMethods.mouse_event(MOUSEEVENTF_LEFTDOWN, p.X, p.Y, 0, 0);
NativeMethods.mouse_event(MOUSEEVENTF_LEFTUP, p.X, p.Y, 0, 0);
}
}
public static void DoMouseClickRight(Point p, bool doubleClick)
{
NativeMethods.SetCursorPos(p.X, p.Y);
NativeMethods.mouse_event(MOUSEEVENTF_RIGHTDOWN, p.X, p.Y, 0, 0);
NativeMethods.mouse_event(MOUSEEVENTF_RIGHTUP, p.X, p.Y, 0, 0);
if (doubleClick)
{
NativeMethods.mouse_event(MOUSEEVENTF_RIGHTDOWN, p.X, p.Y, 0, 0);
NativeMethods.mouse_event(MOUSEEVENTF_RIGHTUP, p.X, p.Y, 0, 0);
}
}
}
}

View File

@ -0,0 +1,68 @@
using System;
namespace xServer.Core.Helper
{
public static class PlatformHelper
{
/// <summary>
/// Initializes the <see cref="PlatformHelper"/> class.
/// </summary>
static PlatformHelper()
{
Win32NT = Environment.OSVersion.Platform == PlatformID.Win32NT;
XpOrHigher = Win32NT && Environment.OSVersion.Version.Major >= 5;
VistaOrHigher = Win32NT && Environment.OSVersion.Version.Major >= 6;
SevenOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 1));
EightOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 2, 9200));
RunningOnMono = Type.GetType("Mono.Runtime") != null;
}
/// <summary>
/// Returns a indicating whether the application is running in Mono runtime.
/// </summary>
/// <value>
/// <c>true</c> if the application is running in Mono runtime; otherwise, <c>false</c>.
/// </value>
public static bool RunningOnMono { get; private set; }
/// <summary>
/// Returns a indicating whether the Operating System is Windows 32 NT based.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 32 NT based; otherwise, <c>false</c>.
/// </value>
public static bool Win32NT { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows XP or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 8 or higher; otherwise, <c>false</c>.
/// </value>
public static bool XpOrHigher { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows Vista or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows Vista or higher; otherwise, <c>false</c>.
/// </value>
public static bool VistaOrHigher { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows 7 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 7 or higher; otherwise, <c>false</c>.
/// </value>
public static bool SevenOrHigher { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows 8 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 8 or higher; otherwise, <c>false</c>.
/// </value>
public static bool EightOrHigher { get; private set; }
}
}

View File

@ -0,0 +1,20 @@
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace xClient.Core.Helper
{
public static class RemoteDesktopHelper
{
public static Bitmap GetDesktop(int screenNumber)
{
var bounds = Screen.AllScreens[screenNumber].Bounds;
var screenshot = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb);
using (Graphics graph = Graphics.FromImage(screenshot))
{
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy);
return screenshot;
}
}
}
}

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xClient.Core.Networking;
using UserStatus = xClient.Core.Commands.CommandHandler.UserStatus;
using xClient.Enums;
namespace xClient.Core.Packets.ClientPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xClient.Core.Networking;
using PathType = xClient.Core.Commands.CommandHandler.PathType;
using xClient.Enums;
namespace xClient.Core.Packets.ServerPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xClient.Core.Networking;
using PathType = xClient.Core.Commands.CommandHandler.PathType;
using xClient.Enums;
namespace xClient.Core.Packets.ServerPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xClient.Core.Networking;
using ShutdownAction = xClient.Core.Commands.CommandHandler.ShutdownAction;
using xClient.Enums;
namespace xClient.Core.Packets.ServerPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xClient.Core.Networking;
using RemoteDesktopAction = xClient.Core.Commands.CommandHandler.RemoteDesktopAction;
using xClient.Enums;
namespace xClient.Core.Packets.ServerPackets
{

View File

@ -13,8 +13,10 @@ using xClient.Config;
using xClient.Core.Information;
using xClient.Core.Encryption;
using xClient.Core.Extensions;
using xClient.Core.Helper;
using xClient.Core.Networking;
using UserStatus = xClient.Core.Commands.CommandHandler.UserStatus;
using xClient.Enums;
using xServer.Core.Helper;
namespace xClient.Core
{
@ -187,7 +189,7 @@ namespace xClient.Core
try
{
string antivirusName = string.Empty;
string scope = (Helper.Helper.IsWindowsXP()) ? "root\\SecurityCenter" : "root\\SecurityCenter2";
string scope = (PlatformHelper.XpOrHigher) ? "root\\SecurityCenter" : "root\\SecurityCenter2";
string query = "SELECT * FROM AntivirusProduct";
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query))
@ -211,7 +213,7 @@ namespace xClient.Core
try
{
string firewallName = string.Empty;
string scope = (Helper.Helper.IsWindowsXP()) ? "root\\SecurityCenter" : "root\\SecurityCenter2";
string scope = (PlatformHelper.XpOrHigher) ? "root\\SecurityCenter" : "root\\SecurityCenter2";
string query = "SELECT * FROM FirewallProduct";
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query))
@ -288,7 +290,7 @@ namespace xClient.Core
}
if (foundCorrect)
return Helper.Helper.FormatMacAddress(ni.GetPhysicalAddress().ToString());
return FormatHelper.FormatMacAddress(ni.GetPhysicalAddress().ToString());
}
}
@ -540,7 +542,7 @@ namespace xClient.Core
string filename = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
Helper.Helper.GetRandomFilename(12, ".bat"));
FileHelper.GetRandomFilename(12, ".bat"));
string uninstallBatch = (Settings.INSTALL && Settings.HIDEFILE)
? "@echo off" + "\n" +

View File

@ -1,7 +1,7 @@
using System;
using System.IO;
namespace xClient.Core.Helper
namespace xClient.Core.Utilities
{
public class FileSplit
{

View File

@ -0,0 +1,33 @@
using System;
using System.Runtime.InteropServices;
namespace xClient.Core.Utilities
{
/// <summary>
/// Provides some methods from the "user32.dll" and uxtheme libraries.
/// </summary>
public static class NativeMethods
{
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DeleteFile(string name);
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int x, int y);
[DllImport("user32.dll")]
public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcpy(void* dst, void* src, uint count);
}
}

View File

@ -3,15 +3,14 @@ using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
using xClient.Core.Compression;
namespace xClient.Core.Helper
namespace xClient.Core.Utilities
{
public class UnsafeStreamCodec
public class UnsafeStreamCodec : IDisposable
{
private int _imageQuality;
public int Monitor { get; private set; }
public Size CheckBlock { get; private set; }
public int ImageQuality
{
get { return _imageQuality; }
@ -20,14 +19,18 @@ namespace xClient.Core.Helper
lock (_imageProcessLock)
{
_imageQuality = value;
if (_jpgCompression != null)
{
_jpgCompression.Dispose();
}
_jpgCompression = new JpgCompression(_imageQuality);
}
}
}
public int Monitor { get; private set; }
public Size CheckBlock { get; private set; }
private int _imageQuality;
private byte[] _encodeBuffer;
private Bitmap _decodedBitmap;
private PixelFormat _encodedFormat;
@ -36,27 +39,41 @@ namespace xClient.Core.Helper
private readonly object _imageProcessLock = new object();
private JpgCompression _jpgCompression;
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcpy(void* dst, void* src, uint count);
/// <summary>
/// Initialize a new object of UnsafeStreamCodec
/// Initialize a new instance of UnsafeStreamCodec class.
/// </summary>
/// <param name="imageQuality">The quality to use between 0-100</param>
/// <param name="imageQuality">The quality to use between 0-100.</param>
/// <param name="monitor">The monitor used for the images.</param>
public UnsafeStreamCodec(int imageQuality, int monitor)
{
this.CheckBlock = new Size(50, 1);
this.ImageQuality = imageQuality;
this.Monitor = monitor;
this.CheckBlock = new Size(50, 1);
}
public void Dispose()
{
Dispose(true);
// Tell the Garbage Collector to not waste time finalizing this object
// since we took care of it.
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (_decodedBitmap != null)
{
_decodedBitmap.Dispose();
}
if (_jpgCompression != null)
{
_jpgCompression.Dispose();
}
}
}
public unsafe void CodeImage(IntPtr scan0, Rectangle scanArea, Size imageSize, PixelFormat format,
@ -64,7 +81,7 @@ namespace xClient.Core.Helper
{
lock (_imageProcessLock)
{
byte* pScan0 = (byte*) scan0.ToInt32();
byte* pScan0 = (byte*)scan0.ToInt32();
if (!outStream.CanWrite)
{
@ -89,8 +106,8 @@ namespace xClient.Core.Helper
throw new NotSupportedException(format.ToString());
}
stride = imageSize.Width*pixelSize;
rawLength = stride*imageSize.Height;
stride = imageSize.Width * pixelSize;
rawLength = stride * imageSize.Height;
if (_encodeBuffer == null)
{
@ -109,7 +126,7 @@ namespace xClient.Core.Helper
outStream.Write(BitConverter.GetBytes(temp.Length), 0, 4);
outStream.Write(temp, 0, temp.Length);
memcpy(new IntPtr(ptr), scan0, (uint) rawLength);
NativeMethods.memcpy(new IntPtr(ptr), scan0, (uint)rawLength);
}
return;
}
@ -130,7 +147,7 @@ namespace xClient.Core.Helper
List<Rectangle> blocks = new List<Rectangle>();
Size s = new Size(scanArea.Width, CheckBlock.Height);
Size lastSize = new Size(scanArea.Width%CheckBlock.Width, scanArea.Height%CheckBlock.Height);
Size lastSize = new Size(scanArea.Width % CheckBlock.Width, scanArea.Height % CheckBlock.Height);
int lasty = scanArea.Height - lastSize.Height;
int lastx = scanArea.Width - lastSize.Width;
@ -153,9 +170,9 @@ namespace xClient.Core.Helper
cBlock = new Rectangle(scanArea.X, y, scanArea.Width, s.Height);
int offset = (y*stride) + (scanArea.X*pixelSize);
int offset = (y * stride) + (scanArea.X * pixelSize);
if (memcmp(encBuffer + offset, pScan0 + offset, (uint) stride) != 0)
if (NativeMethods.memcmp(encBuffer + offset, pScan0 + offset, (uint)stride) != 0)
{
index = blocks.Count - 1;
@ -185,18 +202,18 @@ namespace xClient.Core.Helper
cBlock = new Rectangle(x, blocks[i].Y, s.Width, blocks[i].Height);
bool foundChanges = false;
uint blockStride = (uint) (pixelSize*cBlock.Width);
uint blockStride = (uint)(pixelSize * cBlock.Width);
for (int j = 0; j < cBlock.Height; j++)
{
int blockOffset = (stride*(cBlock.Y + j)) + (pixelSize*cBlock.X);
int blockOffset = (stride * (cBlock.Y + j)) + (pixelSize * cBlock.X);
if (memcmp(encBuffer + blockOffset, pScan0 + blockOffset, blockStride) != 0)
if (NativeMethods.memcmp(encBuffer + blockOffset, pScan0 + blockOffset, blockStride) != 0)
{
foundChanges = true;
}
memcpy(encBuffer + blockOffset, pScan0 + blockOffset, blockStride);
NativeMethods.memcpy(encBuffer + blockOffset, pScan0 + blockOffset, blockStride);
//copy-changes
}
@ -224,7 +241,7 @@ namespace xClient.Core.Helper
for (int i = 0; i < finalUpdates.Count; i++)
{
Rectangle rect = finalUpdates[i];
int blockStride = pixelSize*rect.Width;
int blockStride = pixelSize * rect.Width;
Bitmap tmpBmp = null;
BitmapData tmpData = null;
@ -238,8 +255,8 @@ namespace xClient.Core.Helper
for (int j = 0, offset = 0; j < rect.Height; j++)
{
int blockOffset = (stride*(rect.Y + j)) + (pixelSize*rect.X);
memcpy((byte*) tmpData.Scan0.ToPointer() + offset, pScan0 + blockOffset, (uint) blockStride);
int blockOffset = (stride * (rect.Y + j)) + (pixelSize * rect.X);
NativeMethods.memcpy((byte*)tmpData.Scan0.ToPointer() + offset, pScan0 + blockOffset, (uint)blockStride);
//copy-changes
offset += blockStride;
}
@ -267,7 +284,7 @@ namespace xClient.Core.Helper
tmpBmp.Dispose();
}
totalDataLength += length + (4*5);
totalDataLength += length + (4 * 5);
}
outStream.Position = oldPos;
@ -282,7 +299,7 @@ namespace xClient.Core.Helper
return _decodedBitmap;
}
int dataSize = *(int*) (codecBuffer);
int dataSize = *(int*)(codecBuffer);
if (_decodedBitmap == null)
{
@ -290,10 +307,10 @@ namespace xClient.Core.Helper
fixed (byte* tempPtr = temp)
{
memcpy(new IntPtr(tempPtr), new IntPtr(codecBuffer.ToInt32() + 4), (uint) dataSize);
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(codecBuffer.ToInt32() + 4), (uint)dataSize);
}
this._decodedBitmap = (Bitmap) Bitmap.FromStream(new MemoryStream(temp));
this._decodedBitmap = (Bitmap)Bitmap.FromStream(new MemoryStream(temp));
return _decodedBitmap;
}
@ -313,7 +330,7 @@ namespace xClient.Core.Helper
{
temp = new byte[dataSize];
inStream.Read(temp, 0, temp.Length);
this._decodedBitmap = (Bitmap) Bitmap.FromStream(new MemoryStream(temp));
this._decodedBitmap = (Bitmap)Bitmap.FromStream(new MemoryStream(temp));
return _decodedBitmap;
}
@ -322,7 +339,7 @@ namespace xClient.Core.Helper
{
while (dataSize > 0)
{
byte[] tempData = new byte[4*5];
byte[] tempData = new byte[4 * 5];
inStream.Read(tempData, 0, tempData.Length);
Rectangle rect = new Rectangle(BitConverter.ToInt32(tempData, 0), BitConverter.ToInt32(tempData, 4),
@ -334,13 +351,13 @@ namespace xClient.Core.Helper
using (MemoryStream m = new MemoryStream(buffer))
{
using (Bitmap tmp = (Bitmap) Image.FromStream(m))
using (Bitmap tmp = (Bitmap)Image.FromStream(m))
{
g.DrawImage(tmp, rect.Location);
}
}
dataSize -= updateLen + (4*5);
dataSize -= updateLen + (4 * 5);
}
}

9
Client/Enums/PathType.cs Normal file
View File

@ -0,0 +1,9 @@
namespace xClient.Enums
{
public enum PathType
{
File,
Directory,
Back
}
}

View File

@ -0,0 +1,8 @@
namespace xClient.Enums
{
public enum RemoteDesktopAction
{
Start,
Stop
}
}

View File

@ -0,0 +1,9 @@
namespace xClient.Enums
{
public enum ShutdownAction
{
Shutdown,
Restart,
Standby
}
}

View File

@ -0,0 +1,8 @@
namespace xClient.Enums
{
public enum UserStatus
{
Idle,
Active
}
}

View File

@ -37,8 +37,9 @@ namespace xClient
private static void Cleanup()
{
CommandHandler.IsStreamingDesktop = false;
CommandHandler.StreamCodec = null;
CommandHandler.CloseShell();
if (CommandHandler.StreamCodec != null)
CommandHandler.StreamCodec.Dispose();
if (Logger.Instance != null)
Logger.Instance.Dispose();
if (_msgLoop != null)

View File

@ -11,8 +11,8 @@ namespace xServer.Tests.Core.Encryption
[TestMethod]
public void EncryptAndDecryptStringTest()
{
var input = Helper.GetRandomName(100);
var password = Helper.GetRandomName(50);
var input = FileHelper.GetRandomFilename(100);
var password = FileHelper.GetRandomFilename(50);
var encrypted = AES.Encrypt(input, password);
Assert.IsNotNull(encrypted);
@ -26,10 +26,10 @@ namespace xServer.Tests.Core.Encryption
[TestMethod]
public void EncryptAndDecryptByteArrayTest()
{
var input = Helper.GetRandomName(100);
var input = FileHelper.GetRandomFilename(100);
var inputByte = Encoding.UTF8.GetBytes(input);
var passwordByte = Encoding.UTF8.GetBytes(Helper.GetRandomName(50));
var passwordByte = Encoding.UTF8.GetBytes(FileHelper.GetRandomFilename(50));
var encryptedByte = AES.Encrypt(inputByte, passwordByte);
Assert.IsNotNull(encryptedByte);

View File

@ -2,7 +2,7 @@
using System.Drawing;
using System.Windows.Forms;
namespace xServer.Core.Misc
namespace xServer.Controls
{
public static class InputBox
{

View File

@ -1,12 +1,46 @@
using System.Windows.Forms;
using System;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Utilities;
namespace xServer.Controls
{
internal class ListViewEx : ListView
internal class AeroListView : ListView
{
public ListViewEx()
private const int LVS_EX_DOUBLEBUFFER = 0x10000;
private const int LVM_SETEXTENDEDLISTVIEWSTYLE = 4150;
private const uint WM_CHANGEUISTATE = 0x127;
private const int UIS_SET = 1;
private const int UISF_HIDEFOCUS = 0x1;
/// <summary>
/// Initializes a new instance of the <see cref="AeroListView"/> class.
/// </summary>
public AeroListView()
: base()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
this.View = View.Details;
this.FullRowSelect = true;
}
/// <summary>
/// Raises the <see cref="E:HandleCreated" /> event.
/// </summary>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
if (!PlatformHelper.RunningOnMono && PlatformHelper.VistaOrHigher)
{
NativeMethods.SetWindowTheme(this.Handle, "explorer", null);
NativeMethods.SendMessage(this.Handle, LVM_SETEXTENDEDLISTVIEWSTYLE, new IntPtr(LVS_EX_DOUBLEBUFFER),
new IntPtr(LVS_EX_DOUBLEBUFFER));
NativeMethods.SendMessage(this.Handle, WM_CHANGEUISTATE, NativeMethodsHelper.MakeLong(UIS_SET, UISF_HIDEFOCUS), 0);
}
}
}
}

View File

@ -4,6 +4,7 @@ using Mono.Cecil;
using Mono.Cecil.Cil;
using Vestris.ResourceLib;
using xServer.Core.Encryption;
using xServer.Core.Helper;
namespace xServer.Core.Build
{
@ -42,7 +43,7 @@ namespace xServer.Core.Build
int installpath, bool adminelevation, string iconpath, string[] asminfo, string version)
{
// PHASE 1 - Settings
string encKey = Helper.Helper.GetRandomName(20);
string encKey = FileHelper.GetRandomFilename(20);
AssemblyDefinition asmDef;
try
{

View File

@ -10,28 +10,5 @@ namespace xServer.Core.Commands
private static bool _isAdding = false;
private static readonly object _isAddingLock = new object();
private const string DELIMITER = "$E$";
public enum UserStatus
{
Idle,
Active
}
public enum ShutdownAction
{
Shutdown,
Restart,
Standby
}
public enum PathType
{
File,
Directory,
Back
}
public enum RemoteDesktopAction
{
Start,
Stop
}
}
}

View File

@ -1,5 +1,6 @@
using System.IO;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Networking;
using xServer.Core.Packets.ClientPackets;
using xServer.Forms;
@ -30,7 +31,7 @@ namespace xServer.Core.Commands
string userAtPc = string.Format("{0}@{1}", client.Value.Username, client.Value.PCName);
client.Value.DownloadDirectory = (!Helper.Helper.CheckPathForIllegalChars(userAtPc)) ?
client.Value.DownloadDirectory = (!FileHelper.CheckPathForIllegalChars(userAtPc)) ?
Path.Combine(Application.StartupPath, string.Format("Clients\\{0}_{1}\\", userAtPc, client.Value.Id.Substring(0, 7))) :
Path.Combine(Application.StartupPath, string.Format("Clients\\{0}_{1}\\", client.EndPoint.Address, client.Value.Id.Substring(0, 7)));

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
using xServer.Core.Helper;
using xServer.Core.Networking;
using xServer.Core.Packets.ClientPackets;
using xServer.Core.Utilities;
using xServer.Forms;
namespace xServer.Core.Commands
@ -35,7 +35,7 @@ namespace xServer.Core.Commands
{
for (int i = 1; i < 100; i++)
{
var newFileName = string.Format("{0}_{1}{2}", Path.GetFileNameWithoutExtension(downloadPath), i, Path.GetExtension(downloadPath));
var newFileName = string.Format("{0} ({1}){2}", Path.GetFileNameWithoutExtension(downloadPath), i, Path.GetExtension(downloadPath));
if (File.Exists(Path.Combine(client.Value.DownloadDirectory, newFileName))) continue;
downloadPath = Path.Combine(client.Value.DownloadDirectory, newFileName);

View File

@ -1,10 +1,9 @@
using System.Drawing;
using System.IO;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Networking;
using xServer.Core.Packets.ClientPackets;
using xServer.Core.Utilities;
namespace xServer.Core.Commands
{
@ -18,69 +17,24 @@ namespace xServer.Core.Commands
if (packet.Image == null)
{
if (client.Value.FrmRdp != null)
client.Value.FrmRdp.UpdateImage(client.Value.LastDesktop);
client.Value.LastDesktop = null;
return;
}
// we can not dispose all bitmaps here, cause they are later used again in `client.Value.LastDesktop`
if (client.Value.LastDesktop == null)
if (client.Value.StreamCodec == null)
client.Value.StreamCodec = new UnsafeStreamCodec(packet.Quality, packet.Monitor);
if (client.Value.StreamCodec.ImageQuality != packet.Quality || client.Value.StreamCodec.Monitor != packet.Monitor)
{
if (client.Value.StreamCodec != null)
{
client.Value.StreamCodec.Dispose();
}
client.Value.StreamCodec = new UnsafeStreamCodec();
if (client.Value.LastQuality != packet.Quality || client.Value.LastMonitor != packet.Monitor)
{
client.Value.LastQuality = packet.Quality;
client.Value.LastMonitor = packet.Monitor;
}
using (MemoryStream ms = new MemoryStream(packet.Image))
{
Bitmap newScreen = client.Value.StreamCodec.DecodeData(ms);
client.Value.LastDesktop = newScreen;
if (client.Value.FrmRdp != null)
client.Value.FrmRdp.UpdateImage(newScreen, true);
newScreen = null;
}
client.Value.StreamCodec = new UnsafeStreamCodec(packet.Quality, packet.Monitor);
}
else
using (MemoryStream ms = new MemoryStream(packet.Image))
{
using (MemoryStream ms = new MemoryStream(packet.Image))
{
lock (client.Value.StreamCodec)
{
if (client.Value.LastQuality != packet.Quality || client.Value.LastMonitor != packet.Monitor)
{
if (client.Value.StreamCodec != null)
{
client.Value.StreamCodec.Dispose();
}
client.Value.StreamCodec = new UnsafeStreamCodec();
client.Value.LastQuality = packet.Quality;
client.Value.LastMonitor = packet.Monitor;
}
Bitmap newScreen = client.Value.StreamCodec.DecodeData(ms);
client.Value.LastDesktop = newScreen;
if (client.Value.FrmRdp != null)
client.Value.FrmRdp.UpdateImage(newScreen, true);
newScreen = null;
}
}
if (client.Value.FrmRdp != null)
client.Value.FrmRdp.UpdateImage(client.Value.StreamCodec.DecodeData(ms), true);
}
packet.Image = null;

View File

@ -3,9 +3,11 @@ using System.IO;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using xServer.Core.Misc;
using xServer.Core.Helper;
using xServer.Core.Networking;
using xServer.Core.Packets.ClientPackets;
using xServer.Core.Utilities;
using xServer.Enums;
using xServer.Forms;
using xServer.Settings;
@ -80,10 +82,10 @@ namespace xServer.Core.Commands
if (packet.Files[i] != DELIMITER)
{
ListViewItem lvi =
new ListViewItem(new string[] { packet.Files[i], Helper.Helper.GetDataSize(packet.FilesSize[i]), PathType.File.ToString() })
new ListViewItem(new string[] { packet.Files[i], FileHelper.GetDataSize(packet.FilesSize[i]), PathType.File.ToString() })
{
Tag = PathType.File,
ImageIndex = Helper.Helper.GetFileIcon(Path.GetExtension(packet.Files[i]))
ImageIndex = FileHelper.GetFileIcon(Path.GetExtension(packet.Files[i]))
};
if (client.Value.FrmFm == null)

View File

@ -1,39 +1,20 @@
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Utilities;
namespace xServer.Core.Extensions
{
public static class ListViewExtensions
{
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
[DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
private static extern int SetWindowTheme(IntPtr hWnd, string pszSubAppName, int pszSubIdList);
private const uint WM_CHANGEUISTATE = 0x127;
private const uint SET_COLUMN_WIDTH = 4126;
private const int AUTOSIZE_USEHEADER = -2;
public static void RemoveDots(this ListView targetListView)
{
if (Helper.Helper.IsRunningOnMono()) return;
SendMessage(targetListView.Handle, WM_CHANGEUISTATE, 65537, 0);
}
public static void ChangeTheme(this ListView targetListView)
{
if (Helper.Helper.IsRunningOnMono()) return;
SetWindowTheme(targetListView.Handle, "Explorer", 0);
}
public static void AutosizeColumns(this ListView targetListView)
{
if (Helper.Helper.IsRunningOnMono()) return;
if (PlatformHelper.RunningOnMono) return;
for (int lngColumn = 0; lngColumn <= (targetListView.Columns.Count - 1); lngColumn++)
{
SendMessage(targetListView.Handle, SET_COLUMN_WIDTH, lngColumn, AUTOSIZE_USEHEADER);
NativeMethods.SendMessage(targetListView.Handle, SET_COLUMN_WIDTH, lngColumn, AUTOSIZE_USEHEADER);
}
}
}

View File

@ -2,15 +2,14 @@
using System.IO;
using System.Linq;
using System.Text;
using xServer.Core.Networking;
namespace xServer.Core.Helper
{
public static class Helper
public static class FileHelper
{
private const string CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private static readonly Random _rnd = new Random(Environment.TickCount);
private static readonly string[] _sizes = {"B", "KB", "MB", "GB"};
private static readonly string[] _sizes = { "B", "KB", "MB", "GB" };
private static readonly char[] _illegalChars = Path.GetInvalidPathChars().Union(Path.GetInvalidFileNameChars()).ToArray();
public static bool CheckPathForIllegalChars(string path)
@ -18,7 +17,7 @@ namespace xServer.Core.Helper
return path.Any(c => _illegalChars.Contains(c));
}
public static string GetRandomFilename(int length, string extension)
public static string GetRandomFilename(int length, string extension = "")
{
StringBuilder randomName = new StringBuilder(length);
for (int i = 0; i < length; i++)
@ -27,15 +26,6 @@ namespace xServer.Core.Helper
return string.Concat(randomName.ToString(), extension);
}
public static string GetRandomName(int length)
{
StringBuilder randomName = new StringBuilder(length);
for (int i = 0; i < length; i++)
randomName.Append(CHARS[_rnd.Next(CHARS.Length)]);
return randomName.ToString();
}
public static int GetNewTransferId(int o = 0)
{
return _rnd.Next(0, int.MaxValue) + o;
@ -48,21 +38,11 @@ namespace xServer.Core.Helper
while (len >= 1024 && order + 1 < _sizes.Length)
{
order++;
len = len/1024;
len = len / 1024;
}
return string.Format("{0:0.##} {1}", len, _sizes[order]);
}
public static string GetWindowTitle(string title, Client c)
{
return string.Format("{0} - {1}@{2} [{3}:{4}]", title, c.Value.Username , c.Value.PCName, c.EndPoint.Address.ToString(), c.EndPoint.Port.ToString());
}
public static string GetWindowTitle(string title, int count)
{
return string.Format("{0} [Selected: {1}]", title, count);
}
public static int GetFileIcon(string extension)
{
if (string.IsNullOrEmpty(extension))
@ -122,10 +102,5 @@ namespace xServer.Core.Helper
return 10;
}
}
public static bool IsRunningOnMono()
{
return Type.GetType("Mono.Runtime") != null;
}
}
}
}

View File

@ -0,0 +1,30 @@
using System.IO;
using System.Text.RegularExpressions;
namespace xServer.Core.Helper
{
public static class FormatHelper
{
public static string FormatMacAddress(string macAddress)
{
return (macAddress.Length != 12)
? "00:00:00:00:00:00"
: Regex.Replace(macAddress, "(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})", "$1:$2:$3:$4:$5:$6");
}
public static string DriveTypeName(DriveType type)
{
switch (type)
{
case DriveType.Fixed:
return "Local Disk";
case DriveType.Network:
return "Network Drive";
case DriveType.Removable:
return "Removable Drive";
default:
return type.ToString();
}
}
}
}

View File

@ -0,0 +1,19 @@
namespace xServer.Core.Helper
{
public static class NativeMethodsHelper
{
public static int MakeLong(int wLow, int wHigh)
{
int low = (int)IntLoWord(wLow);
short high = IntLoWord(wHigh);
int product = 0x10000 * (int)high;
int mkLong = (int)(low | product);
return mkLong;
}
private static short IntLoWord(int word)
{
return (short)(word & short.MaxValue);
}
}
}

View File

@ -0,0 +1,68 @@
using System;
namespace xServer.Core.Helper
{
public static class PlatformHelper
{
/// <summary>
/// Initializes the <see cref="PlatformHelper"/> class.
/// </summary>
static PlatformHelper()
{
Win32NT = Environment.OSVersion.Platform == PlatformID.Win32NT;
XpOrHigher = Win32NT && Environment.OSVersion.Version.Major >= 5;
VistaOrHigher = Win32NT && Environment.OSVersion.Version.Major >= 6;
SevenOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 1));
EightOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 2, 9200));
RunningOnMono = Type.GetType("Mono.Runtime") != null;
}
/// <summary>
/// Returns a indicating whether the application is running in Mono runtime.
/// </summary>
/// <value>
/// <c>true</c> if the application is running in Mono runtime; otherwise, <c>false</c>.
/// </value>
public static bool RunningOnMono { get; private set; }
/// <summary>
/// Returns a indicating whether the Operating System is Windows 32 NT based.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 32 NT based; otherwise, <c>false</c>.
/// </value>
public static bool Win32NT { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows XP or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 8 or higher; otherwise, <c>false</c>.
/// </value>
public static bool XpOrHigher { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows Vista or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows Vista or higher; otherwise, <c>false</c>.
/// </value>
public static bool VistaOrHigher { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows 7 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 7 or higher; otherwise, <c>false</c>.
/// </value>
public static bool SevenOrHigher { get; private set; }
/// <summary>
/// Returns a value indicating whether the Operating System is Windows 8 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 8 or higher; otherwise, <c>false</c>.
/// </value>
public static bool EightOrHigher { get; private set; }
}
}

View File

@ -0,0 +1,20 @@
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace xServer.Core.Helper
{
public static class RemoteDesktopHelper
{
public static Bitmap GetDesktop(int screenNumber)
{
var bounds = Screen.AllScreens[screenNumber].Bounds;
var screenshot = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb);
using (Graphics graph = Graphics.FromImage(screenshot))
{
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy);
return screenshot;
}
}
}
}

View File

@ -0,0 +1,17 @@
using xServer.Core.Networking;
namespace xServer.Core.Helper
{
public static class WindowHelper
{
public static string GetWindowTitle(string title, Client c)
{
return string.Format("{0} - {1}@{2} [{3}:{4}]", title, c.Value.Username, c.Value.PCName, c.EndPoint.Address.ToString(), c.EndPoint.Port.ToString());
}
public static string GetWindowTitle(string title, int count)
{
return string.Format("{0} [Selected: {1}]", title, count);
}
}
}

View File

@ -1,12 +1,12 @@
using System.Drawing;
using System;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.ReverseProxy;
using xServer.Core.Utilities;
using xServer.Forms;
namespace xServer.Core.Networking
{
public class UserState
public class UserState : IDisposable
{
public string Version { get; set; }
public string OperatingSystem { get; set; }
@ -31,9 +31,6 @@ namespace xServer.Core.Networking
public bool IsAuthenticated { get; set; }
public bool LastDirectorySeen { get; set; }
public int LastQuality { get; set; }
public int LastMonitor { get; set; }
public Bitmap LastDesktop { get; set; }
public UnsafeStreamCodec StreamCodec { get; set; }
public ReverseProxyServer ProxyServer { get; set; }
@ -41,28 +38,36 @@ namespace xServer.Core.Networking
{
IsAuthenticated = false;
LastDirectorySeen = true;
LastQuality = -1;
LastMonitor = -1;
}
public void DisposeForms()
public void Dispose()
{
if (FrmRdp != null)
FrmRdp.Invoke((MethodInvoker)delegate { FrmRdp.Close(); });
if (FrmTm != null)
FrmTm.Invoke((MethodInvoker)delegate { FrmTm.Close(); });
if (FrmFm != null)
FrmFm.Invoke((MethodInvoker)delegate { FrmFm.Close(); });
if (FrmSi != null)
FrmSi.Invoke((MethodInvoker)delegate { FrmSi.Close(); });
if (FrmRs != null)
FrmRs.Invoke((MethodInvoker)delegate { FrmRs.Close(); });
if (FrmStm != null)
FrmStm.Invoke((MethodInvoker)delegate { FrmStm.Close(); });
if (FrmKl != null)
FrmKl.Invoke((MethodInvoker)delegate { FrmKl.Close(); });
if (FrmProxy != null)
FrmProxy.Invoke((MethodInvoker)delegate { FrmProxy.Close(); });
Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (FrmRdp != null)
FrmRdp.Invoke((MethodInvoker)delegate { FrmRdp.Close(); });
if (FrmTm != null)
FrmTm.Invoke((MethodInvoker)delegate { FrmTm.Close(); });
if (FrmFm != null)
FrmFm.Invoke((MethodInvoker)delegate { FrmFm.Close(); });
if (FrmSi != null)
FrmSi.Invoke((MethodInvoker)delegate { FrmSi.Close(); });
if (FrmRs != null)
FrmRs.Invoke((MethodInvoker)delegate { FrmRs.Close(); });
if (FrmStm != null)
FrmStm.Invoke((MethodInvoker)delegate { FrmStm.Close(); });
if (FrmKl != null)
FrmKl.Invoke((MethodInvoker)delegate { FrmKl.Close(); });
if (FrmProxy != null)
FrmProxy.Invoke((MethodInvoker)delegate { FrmProxy.Close(); });
if (StreamCodec != null)
StreamCodec.Dispose();
}
}
}
}

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xServer.Core.Networking;
using UserStatus = xServer.Core.Commands.CommandHandler.UserStatus;
using xServer.Enums;
namespace xServer.Core.Packets.ClientPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xServer.Core.Networking;
using PathType = xServer.Core.Commands.CommandHandler.PathType;
using xServer.Enums;
namespace xServer.Core.Packets.ServerPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xServer.Core.Networking;
using PathType = xServer.Core.Commands.CommandHandler.PathType;
using xServer.Enums;
namespace xServer.Core.Packets.ServerPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xServer.Core.Networking;
using ShutdownAction = xServer.Core.Commands.CommandHandler.ShutdownAction;
using xServer.Enums;
namespace xServer.Core.Packets.ServerPackets
{

View File

@ -1,6 +1,6 @@
using ProtoBuf;
using xServer.Core.Networking;
using RemoteDesktopAction = xServer.Core.Commands.CommandHandler.RemoteDesktopAction;
using xServer.Enums;
namespace xServer.Core.Packets.ServerPackets
{

View File

@ -1,7 +1,7 @@
using System;
using System.IO;
namespace xServer.Core.Helper
namespace xServer.Core.Utilities
{
public class FileSplit
{

View File

@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Linq;
namespace xServer.Core.Helper
namespace xServer.Core.Utilities
{
public class FrameCounter
{

View File

@ -1,7 +1,7 @@
using System.Collections;
using System.Windows.Forms;
namespace xServer.Core.Misc
namespace xServer.Core.Utilities
{
public class ListViewColumnSorter : IComparer
{

View File

@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
namespace xServer.Core.Utilities
{
/// <summary>
/// Provides some methods from the "user32.dll" and uxtheme libraries.
/// </summary>
public static class NativeMethods
{
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, string lParam);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SetCursor(IntPtr hCursor);
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType, int cxDesired, int cyDesired, uint fuLoad);
[DllImport("uxtheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcpy(void* dst, void* src, uint count);
}
}

View File

@ -4,7 +4,7 @@ using System.Text;
using System.Threading;
using xServer.Settings;
namespace xServer.Core.Misc
namespace xServer.Core.Utilities
{
public static class NoIpUpdater
{

View File

@ -1,4 +1,4 @@
namespace xServer.Core.Misc
namespace xServer.Core.Utilities
{
public class RemoteDrive
{

View File

@ -1,4 +1,4 @@
namespace xServer.Core.Misc
namespace xServer.Core.Utilities
{
public static class Update
{

View File

@ -3,15 +3,14 @@ using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
using xServer.Core.Compression;
namespace xServer.Core.Helper
namespace xServer.Core.Utilities
{
public class UnsafeStreamCodec : IDisposable
{
private int _imageQuality;
public int Monitor { get; private set; }
public Size CheckBlock { get; private set; }
public int ImageQuality
{
get { return _imageQuality; }
@ -31,7 +30,7 @@ namespace xServer.Core.Helper
}
}
public Size CheckBlock { get; private set; }
private int _imageQuality;
private byte[] _encodeBuffer;
private Bitmap _decodedBitmap;
private PixelFormat _encodedFormat;
@ -40,24 +39,15 @@ namespace xServer.Core.Helper
private readonly object _imageProcessLock = new object();
private JpgCompression _jpgCompression;
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe int memcpy(void* dst, void* src, uint count);
/// <summary>
/// Initialize a new object of UnsafeStreamCodec
/// Initialize a new instance of UnsafeStreamCodec class.
/// </summary>
/// <param name="imageQuality">The quality to use between 0-100</param>
public UnsafeStreamCodec(int imageQuality = 100)
/// <param name="imageQuality">The quality to use between 0-100.</param>
/// <param name="monitor">The monitor used for the images.</param>
public UnsafeStreamCodec(int imageQuality, int monitor)
{
this.ImageQuality = imageQuality;
this.Monitor = monitor;
this.CheckBlock = new Size(50, 1);
}
@ -136,7 +126,7 @@ namespace xServer.Core.Helper
outStream.Write(BitConverter.GetBytes(temp.Length), 0, 4);
outStream.Write(temp, 0, temp.Length);
memcpy(new IntPtr(ptr), scan0, (uint) rawLength);
NativeMethods.memcpy(new IntPtr(ptr), scan0, (uint) rawLength);
}
return;
}
@ -182,7 +172,7 @@ namespace xServer.Core.Helper
int offset = (y*stride) + (scanArea.X*pixelSize);
if (memcmp(encBuffer + offset, pScan0 + offset, (uint) stride) != 0)
if (NativeMethods.memcmp(encBuffer + offset, pScan0 + offset, (uint)stride) != 0)
{
index = blocks.Count - 1;
@ -218,12 +208,12 @@ namespace xServer.Core.Helper
{
int blockOffset = (stride*(cBlock.Y + j)) + (pixelSize*cBlock.X);
if (memcmp(encBuffer + blockOffset, pScan0 + blockOffset, blockStride) != 0)
if (NativeMethods.memcmp(encBuffer + blockOffset, pScan0 + blockOffset, blockStride) != 0)
{
foundChanges = true;
}
memcpy(encBuffer + blockOffset, pScan0 + blockOffset, blockStride);
NativeMethods.memcpy(encBuffer + blockOffset, pScan0 + blockOffset, blockStride);
//copy-changes
}
@ -266,7 +256,7 @@ namespace xServer.Core.Helper
for (int j = 0, offset = 0; j < rect.Height; j++)
{
int blockOffset = (stride*(rect.Y + j)) + (pixelSize*rect.X);
memcpy((byte*) tmpData.Scan0.ToPointer() + offset, pScan0 + blockOffset, (uint) blockStride);
NativeMethods.memcpy((byte*)tmpData.Scan0.ToPointer() + offset, pScan0 + blockOffset, (uint)blockStride);
//copy-changes
offset += blockStride;
}
@ -317,7 +307,7 @@ namespace xServer.Core.Helper
fixed (byte* tempPtr = temp)
{
memcpy(new IntPtr(tempPtr), new IntPtr(codecBuffer.ToInt32() + 4), (uint) dataSize);
NativeMethods.memcpy(new IntPtr(tempPtr), new IntPtr(codecBuffer.ToInt32() + 4), (uint)dataSize);
}
this._decodedBitmap = (Bitmap) Bitmap.FromStream(new MemoryStream(temp));

9
Server/Enums/PathType.cs Normal file
View File

@ -0,0 +1,9 @@
namespace xServer.Enums
{
public enum PathType
{
File,
Directory,
Back
}
}

View File

@ -0,0 +1,8 @@
namespace xServer.Enums
{
public enum RemoteDesktopAction
{
Start,
Stop
}
}

View File

@ -0,0 +1,9 @@
namespace xServer.Enums
{
public enum ShutdownAction
{
Shutdown,
Restart,
Standby
}
}

View File

@ -0,0 +1,8 @@
namespace xServer.Enums
{
public enum UserStatus
{
Idle,
Active
}
}

View File

@ -2,7 +2,7 @@
using System.IO;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Misc;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -53,13 +53,13 @@ namespace xServer.Forms
private void txtName_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || Helper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
e.Handled = ((e.KeyChar == '\\' || FileHelper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
private void txtPath_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || Helper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
e.Handled = ((e.KeyChar == '\\' || FileHelper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
}

View File

@ -102,7 +102,7 @@ namespace xServer.Forms
{
txtPort.Text = XMLSettings.ListenPort.ToString();
txtPassword.Text = XMLSettings.Password;
txtMutex.Text = Helper.GetRandomName(32);
txtMutex.Text = FileHelper.GetRandomFilename(32);
}
UpdateControlStates();
@ -139,13 +139,13 @@ namespace xServer.Forms
private void txtInstallname_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || Helper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
e.Handled = ((e.KeyChar == '\\' || FileHelper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
private void txtInstallsub_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || Helper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
e.Handled = ((e.KeyChar == '\\' || FileHelper.CheckPathForIllegalChars(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
@ -153,7 +153,7 @@ namespace xServer.Forms
{
HasChanged();
txtMutex.Text = Helper.GetRandomName(32);
txtMutex.Text = FileHelper.GetRandomFilename(32);
}
private void chkInstall_CheckedChanged(object sender, EventArgs e)

View File

@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -16,8 +17,8 @@ namespace xServer.Forms
private void btnDownloadAndExecute_Click(object sender, EventArgs e)
{
Core.Misc.DownloadAndExecute.URL = txtURL.Text;
Core.Misc.DownloadAndExecute.RunHidden = chkRunHidden.Checked;
DownloadAndExecute.URL = txtURL.Text;
DownloadAndExecute.RunHidden = chkRunHidden.Checked;
this.DialogResult = DialogResult.OK;
this.Close();
@ -25,9 +26,9 @@ namespace xServer.Forms
private void FrmDownloadAndExecute_Load(object sender, EventArgs e)
{
this.Text = Helper.GetWindowTitle("Download & Execute", _selectedClients);
txtURL.Text = Core.Misc.DownloadAndExecute.URL;
chkRunHidden.Checked = Core.Misc.DownloadAndExecute.RunHidden;
this.Text = WindowHelper.GetWindowTitle("Download & Execute", _selectedClients);
txtURL.Text = DownloadAndExecute.URL;
chkRunHidden.Checked = DownloadAndExecute.RunHidden;
}
}
}

View File

@ -52,7 +52,7 @@ namespace xServer.Forms
this.imgListTransfers = new System.Windows.Forms.ImageList(this.components);
this.TabControlFileManager = new xServer.Controls.DotNetBarTabControl();
this.tabFileExplorer = new System.Windows.Forms.TabPage();
this.lstDirectory = new xServer.Controls.ListViewEx();
this.lstDirectory = new xServer.Controls.AeroListView();
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -60,7 +60,7 @@ namespace xServer.Forms
this.cmbDrives = new System.Windows.Forms.ComboBox();
this.tabTransfers = new System.Windows.Forms.TabPage();
this.btnOpenDLFolder = new System.Windows.Forms.Button();
this.lstTransfers = new xServer.Controls.ListViewEx();
this.lstTransfers = new xServer.Controls.AeroListView();
this.hID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hFilename = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -426,8 +426,8 @@ namespace xServer.Forms
private System.Windows.Forms.ToolStripMenuItem ctxtCancel;
private System.Windows.Forms.ToolStripMenuItem ctxtOpenDirectory;
private System.Windows.Forms.ComboBox cmbDrives;
private ListViewEx lstDirectory;
private ListViewEx lstTransfers;
private AeroListView lstDirectory;
private AeroListView lstTransfers;
private System.Windows.Forms.StatusStrip botStrip;
private System.Windows.Forms.ToolStripMenuItem ctxtRemove;
private System.Windows.Forms.ToolStripStatusLabel stripLblHint;

View File

@ -5,12 +5,12 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using xServer.Controls;
using xServer.Core.Commands;
using xServer.Core.Extensions;
using xServer.Core.Helper;
using xServer.Core.Misc;
using xServer.Core.Networking;
using PathType = xServer.Core.Commands.CommandHandler.PathType;
using xServer.Core.Utilities;
using xServer.Enums;
namespace xServer.Forms
{
@ -29,11 +29,6 @@ namespace xServer.Forms
_lvwColumnSorter = new ListViewColumnSorter();
lstDirectory.ListViewItemSorter = _lvwColumnSorter;
lstDirectory.RemoveDots();
lstDirectory.ChangeTheme();
lstTransfers.RemoveDots();
lstTransfers.ChangeTheme();
}
private string GetAbsolutePath(string item)
@ -45,7 +40,7 @@ namespace xServer.Forms
{
if (_connectClient != null)
{
this.Text = Helper.GetWindowTitle("File Manager", _connectClient);
this.Text = WindowHelper.GetWindowTitle("File Manager", _connectClient);
new Core.Packets.ServerPackets.GetDrives().Execute(_connectClient);
}
}
@ -105,7 +100,7 @@ namespace xServer.Forms
{
string path = GetAbsolutePath(files.SubItems[0].Text);
int id = Helper.GetNewTransferId(files.Index);
int id = FileHelper.GetNewTransferId(files.Index);
if (_connectClient != null)
{
@ -301,7 +296,7 @@ namespace xServer.Forms
string path = filePath;
new Thread(() =>
{
int id = Helper.GetNewTransferId();
int id = FileHelper.GetNewTransferId();
if (string.IsNullOrEmpty(path)) return;

View File

@ -2,8 +2,8 @@
using System.IO;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Misc;
using xServer.Core.Networking;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -28,7 +28,7 @@ namespace xServer.Forms
{
if (_connectClient != null)
{
this.Text = Helper.GetWindowTitle("Keylogger", _connectClient);
this.Text = WindowHelper.GetWindowTitle("Keylogger", _connectClient);
if (!Directory.Exists(_path))
{

View File

@ -65,10 +65,10 @@ namespace xServer.Forms
this.botListen = new System.Windows.Forms.ToolStripStatusLabel();
this.imgFlags = new System.Windows.Forms.ImageList(this.components);
this.nIcon = new System.Windows.Forms.NotifyIcon(this.components);
this.lstClients = new xServer.Controls.ListViewEx();
this.hUserPC = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.lstClients = new xServer.Controls.AeroListView();
this.hIP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hSocket = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hUserPC = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hUserStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -636,7 +636,6 @@ namespace xServer.Forms
this.hAccountType});
this.lstClients.ContextMenuStrip = this.ctxtMenu;
this.lstClients.FullRowSelect = true;
this.lstClients.GridLines = true;
this.lstClients.Location = new System.Drawing.Point(0, 0);
this.lstClients.Name = "lstClients";
this.lstClients.ShowItemToolTips = true;
@ -648,11 +647,6 @@ namespace xServer.Forms
this.lstClients.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lstClients_ColumnClick);
this.lstClients.SelectedIndexChanged += new System.EventHandler(this.lstClients_SelectedIndexChanged);
//
// hUserPC
//
this.hUserPC.Text = "User@PC";
this.hUserPC.Width = 175;
//
// hIP
//
this.hIP.Text = "IP Address";
@ -662,6 +656,11 @@ namespace xServer.Forms
//
this.hSocket.Text = "Socket";
//
// hUserPC
//
this.hUserPC.Text = "User@PC";
this.hUserPC.Width = 175;
//
// hVersion
//
this.hVersion.Text = "Version";
@ -812,7 +811,7 @@ namespace xServer.Forms
private System.Windows.Forms.ToolStripMenuItem ctxtKeylogger;
private System.Windows.Forms.ToolStripMenuItem ctxtReverseProxy;
private System.Windows.Forms.ToolStripMenuItem ctxtRegistryEditor;
private ListViewEx lstClients;
private AeroListView lstClients;
private System.Windows.Forms.NotifyIcon nIcon;
private System.Windows.Forms.ColumnHeader hUserPC;
}

View File

@ -5,14 +5,12 @@ using System.Linq;
using System.Threading;
using System.Windows.Forms;
using xServer.Core.Commands;
using xServer.Core.Extensions;
using xServer.Enums;
using xServer.Core.Helper;
using xServer.Core.Misc;
using xServer.Core.Networking;
using xServer.Core.Networking.Utilities;
using xServer.Core.Utilities;
using xServer.Settings;
using UserStatus = xServer.Core.Commands.CommandHandler.UserStatus;
using ShutdownAction = xServer.Core.Commands.CommandHandler.ShutdownAction;
namespace xServer.Forms
{
@ -76,9 +74,6 @@ namespace xServer.Forms
_lvwColumnSorter = new ListViewColumnSorter();
lstClients.ListViewItemSorter = _lvwColumnSorter;
lstClients.RemoveDots();
lstClients.ChangeTheme();
}
public void UpdateWindowTitle()
@ -176,7 +171,7 @@ namespace xServer.Forms
{
if (client.Value != null)
{
client.Value.DisposeForms();
client.Value.Dispose();
client.Value = null;
}
@ -400,11 +395,11 @@ namespace xServer.Forms
{
if (frm.ShowDialog() == DialogResult.OK)
{
if (Core.Misc.Update.UseDownload)
if (Core.Utilities.Update.UseDownload)
{
foreach (Client c in GetSelectedClients())
{
new Core.Packets.ServerPackets.DoClientUpdate(0, Core.Misc.Update.DownloadURL, string.Empty, new byte[0x00], 0, 0).Execute(c);
new Core.Packets.ServerPackets.DoClientUpdate(0, Core.Utilities.Update.DownloadURL, string.Empty, new byte[0x00], 0, 0).Execute(c);
}
}
else
@ -417,8 +412,8 @@ namespace xServer.Forms
if (c == null) continue;
if (error) continue;
FileSplit srcFile = new FileSplit(Core.Misc.Update.UploadPath);
var fileName = Helper.GetRandomFilename(8, ".exe");
FileSplit srcFile = new FileSplit(Core.Utilities.Update.UploadPath);
var fileName = FileHelper.GetRandomFilename(8, ".exe");
if (srcFile.MaxBlocks < 0)
{
MessageBox.Show(string.Format("Error reading file: {0}", srcFile.LastError),
@ -427,7 +422,7 @@ namespace xServer.Forms
break;
}
int id = Helper.GetNewTransferId();
int id = FileHelper.GetNewTransferId();
CommandHandler.HandleSetStatus(c,
new Core.Packets.ClientPackets.SetStatus("Uploading file..."));
@ -669,7 +664,7 @@ namespace xServer.Forms
break;
}
int id = Helper.GetNewTransferId();
int id = FileHelper.GetNewTransferId();
CommandHandler.HandleSetStatus(c,
new Core.Packets.ClientPackets.SetStatus("Uploading file..."));

View File

@ -408,7 +408,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADY
sQAAAk1TRnQBSQFMAgEB+AEAAYgBBwGIAQcBEAEAAQsBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
sQAAAk1TRnQBSQFMAgEB+AEAAZgBBwGYAQcBEAEAAQsBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAbUBAgIAAQEBAAEIBQABQAGtGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHA
AdwBwAEAAfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANC
AQADOQEAAYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/

View File

@ -4,7 +4,8 @@ using System.Drawing;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Networking;
using RemoteDesktopAction = xServer.Core.Commands.CommandHandler.RemoteDesktopAction;
using xServer.Core.Utilities;
using xServer.Enums;
namespace xServer.Forms
{
@ -25,7 +26,7 @@ namespace xServer.Forms
private void FrmRemoteDesktop_Load(object sender, EventArgs e)
{
this.Text = Helper.GetWindowTitle("Remote Desktop", _connectClient);
this.Text = WindowHelper.GetWindowTitle("Remote Desktop", _connectClient);
panelTop.Left = (this.Width/2) - (panelTop.Width/2);
@ -77,7 +78,7 @@ namespace xServer.Forms
{
this.Invoke((MethodInvoker)delegate
{
this.Text = string.Format("{0} - FPS: {1}", Helper.GetWindowTitle("Remote Desktop", _connectClient), fps.ToString("0.00"));
this.Text = string.Format("{0} - FPS: {1}", WindowHelper.GetWindowTitle("Remote Desktop", _connectClient), fps.ToString("0.00"));
});
}
catch (InvalidOperationException)

View File

@ -31,7 +31,7 @@ namespace xServer.Forms
this.DoubleBuffered = true;
if (_connectClient != null)
this.Text = Helper.GetWindowTitle("Remote Shell", _connectClient);
this.Text = WindowHelper.GetWindowTitle("Remote Shell", _connectClient);
}
private void FrmRemoteShell_FormClosing(object sender, FormClosingEventArgs e)

View File

@ -37,7 +37,7 @@ namespace xServer.Forms
this.nudServerPort = new System.Windows.Forms.NumericUpDown();
this.tabCtrl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.LvConnections = new xServer.Controls.ListViewEx();
this.LvConnections = new xServer.Controls.AeroListView();
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -270,7 +270,7 @@ namespace xServer.Forms
private System.Windows.Forms.NumericUpDown nudServerPort;
private System.Windows.Forms.TabControl tabCtrl;
private System.Windows.Forms.TabPage tabPage1;
private ListViewEx LvConnections;
private AeroListView LvConnections;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;

View File

@ -31,7 +31,7 @@ namespace xServer.Forms
}
else if (_clients.Length == 1)
{
this.Text = Helper.GetWindowTitle("Reverse Proxy", _clients[0]);
this.Text = WindowHelper.GetWindowTitle("Reverse Proxy", _clients[0]);
lblLoadBalance.Text = "The Load Balancer is not active, only 1 client is used, select multiple clients to activate the load balancer";
}
}
@ -134,8 +134,8 @@ namespace xServer.Forms
connection.Client.Value.Country,
(connection.HostName.Length > 0) ? string.Format("{0} ({1})", connection.HostName, connection.TargetServer) : connection.TargetServer,
connection.TargetPort.ToString(),
Helper.GetDataSize(connection.LengthReceived),
Helper.GetDataSize(connection.LengthSent),
FileHelper.GetDataSize(connection.LengthReceived),
FileHelper.GetDataSize(connection.LengthSent),
connection.Type.ToString()
}) { Tag = connection };
}

View File

@ -1,9 +1,9 @@
using System;
using System.Globalization;
using System.Windows.Forms;
using xServer.Core.Misc;
using xServer.Core.Networking;
using xServer.Core.Networking.Utilities;
using xServer.Core.Utilities;
using xServer.Settings;
namespace xServer.Forms

View File

@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -17,7 +18,7 @@ namespace xServer.Forms
private void FrmShowMessagebox_Load(object sender, EventArgs e)
{
this.Text = Helper.GetWindowTitle("Show Messagebox", _selectedClients);
this.Text = WindowHelper.GetWindowTitle("Show Messagebox", _selectedClients);
cmbMsgButtons.Items.AddRange(new string[]
{"AbortRetryIgnore", "OK", "OKCancel", "RetryCancel", "YesNo", "YesNoCancel"});
@ -37,10 +38,10 @@ namespace xServer.Forms
private void btnSend_Click(object sender, EventArgs e)
{
Core.Misc.MessageBoxData.Caption = txtCaption.Text;
Core.Misc.MessageBoxData.Text = txtText.Text;
Core.Misc.MessageBoxData.Button = GetMessageBoxButton(cmbMsgButtons.SelectedIndex);
Core.Misc.MessageBoxData.Icon = GetMessageBoxIcon(cmbMsgButtons.SelectedIndex);
MessageBoxData.Caption = txtCaption.Text;
MessageBoxData.Text = txtText.Text;
MessageBoxData.Button = GetMessageBoxButton(cmbMsgButtons.SelectedIndex);
MessageBoxData.Icon = GetMessageBoxIcon(cmbMsgButtons.SelectedIndex);
this.DialogResult = DialogResult.OK;
this.Close();

View File

@ -33,7 +33,7 @@
this.ctxtMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ctxtAddEntry = new System.Windows.Forms.ToolStripMenuItem();
this.ctxtRemoveEntry = new System.Windows.Forms.ToolStripMenuItem();
this.lstStartupItems = new xServer.Controls.ListViewEx();
this.lstStartupItems = new xServer.Controls.AeroListView();
this.hName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hPath = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ctxtMenu.SuspendLayout();
@ -118,7 +118,7 @@
private System.Windows.Forms.ContextMenuStrip ctxtMenu;
private System.Windows.Forms.ToolStripMenuItem ctxtAddEntry;
private System.Windows.Forms.ToolStripMenuItem ctxtRemoveEntry;
private Controls.ListViewEx lstStartupItems;
private Controls.AeroListView lstStartupItems;
}
}

View File

@ -2,8 +2,8 @@
using System.Linq;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Misc;
using xServer.Core.Networking;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -26,7 +26,7 @@ namespace xServer.Forms
{
if (_connectClient != null)
{
this.Text = Helper.GetWindowTitle("Startup Manager", _connectClient);
this.Text = WindowHelper.GetWindowTitle("Startup Manager", _connectClient);
AddGroups();
new Core.Packets.ServerPackets.GetStartupItems().Execute(_connectClient);
}

View File

@ -49,11 +49,11 @@ namespace xServer.Forms
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Green), 5), new Point(220, 130), new Point(250, 130));
e.Graphics.DrawString(
string.Format("{0} received ({1}%)", Helper.GetDataSize(_bytesReceived), _receivedPercent),
string.Format("{0} received ({1}%)", FileHelper.GetDataSize(_bytesReceived), _receivedPercent),
this.Font, new SolidBrush(Color.Black), new Point(260, 123));
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Blue), 5), new Point(220, 160), new Point(250, 160));
e.Graphics.DrawString(string.Format("{0} sent ({1}%)", Helper.GetDataSize(_bytesSent), _sentPercent),
e.Graphics.DrawString(string.Format("{0} sent ({1}%)", FileHelper.GetDataSize(_bytesSent), _sentPercent),
this.Font, new SolidBrush(Color.Black), new Point(260, 153));
}

View File

@ -32,7 +32,7 @@ namespace xServer.Forms
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSystemInformation));
this.lstSystem = new xServer.Controls.ListViewEx();
this.lstSystem = new xServer.Controls.AeroListView();
this.hComponent = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ctxtMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
@ -107,6 +107,6 @@ namespace xServer.Forms
private System.Windows.Forms.ColumnHeader hValue;
private System.Windows.Forms.ContextMenuStrip ctxtMenu;
private System.Windows.Forms.ToolStripMenuItem ctxtCopy;
private ListViewEx lstSystem;
private AeroListView lstSystem;
}
}

View File

@ -23,7 +23,7 @@ namespace xServer.Forms
{
if (_connectClient != null)
{
this.Text = Helper.GetWindowTitle("System Information", _connectClient);
this.Text = WindowHelper.GetWindowTitle("System Information", _connectClient);
new Core.Packets.ServerPackets.GetSystemInfo().Execute(_connectClient);
if (_connectClient.Value != null)

View File

@ -37,7 +37,7 @@ namespace xServer.Forms
this.ctxtStartProcess = new System.Windows.Forms.ToolStripMenuItem();
this.ctxtLine = new System.Windows.Forms.ToolStripSeparator();
this.ctxtRefresh = new System.Windows.Forms.ToolStripMenuItem();
this.lstTasks = new xServer.Controls.ListViewEx();
this.lstTasks = new xServer.Controls.AeroListView();
this.hProcessname = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hPID = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.hTitle = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -145,6 +145,6 @@ namespace xServer.Forms
private System.Windows.Forms.ColumnHeader hPID;
private System.Windows.Forms.ColumnHeader hTitle;
private System.Windows.Forms.ToolStripSeparator ctxtLine;
private ListViewEx lstTasks;
private AeroListView lstTasks;
}
}

View File

@ -1,8 +1,9 @@
using System;
using System.Windows.Forms;
using xServer.Controls;
using xServer.Core.Helper;
using xServer.Core.Misc;
using xServer.Core.Networking;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -26,7 +27,7 @@ namespace xServer.Forms
{
if (_connectClient != null)
{
this.Text = Helper.GetWindowTitle("Task Manager", _connectClient);
this.Text = WindowHelper.GetWindowTitle("Task Manager", _connectClient);
new Core.Packets.ServerPackets.GetProcesses().Execute(_connectClient);
}
}

View File

@ -17,19 +17,19 @@ namespace xServer.Forms
private void FrmUpdate_Load(object sender, EventArgs e)
{
this.Text = Helper.GetWindowTitle("Update Clients", _selectedClients);
if (Core.Misc.Update.UseDownload)
this.Text = WindowHelper.GetWindowTitle("Update Clients", _selectedClients);
if (Core.Utilities.Update.UseDownload)
radioURL.Checked = true;
txtPath.Text = File.Exists(Core.Misc.Update.UploadPath) ? Core.Misc.Update.UploadPath : string.Empty;
txtURL.Text = Core.Misc.Update.DownloadURL;
txtPath.Text = File.Exists(Core.Utilities.Update.UploadPath) ? Core.Utilities.Update.UploadPath : string.Empty;
txtURL.Text = Core.Utilities.Update.DownloadURL;
btnUpdate.Text = "Update Client" + ((_selectedClients > 1) ? "s" : string.Empty);
}
private void btnUpdate_Click(object sender, EventArgs e)
{
Core.Misc.Update.UseDownload = radioURL.Checked;
Core.Misc.Update.UploadPath = File.Exists(txtPath.Text) ? txtPath.Text : string.Empty;
Core.Misc.Update.DownloadURL = txtURL.Text;
Core.Utilities.Update.UseDownload = radioURL.Checked;
Core.Utilities.Update.UploadPath = File.Exists(txtPath.Text) ? txtPath.Text : string.Empty;
Core.Utilities.Update.DownloadURL = txtURL.Text;
this.DialogResult = DialogResult.OK;
this.Close();

View File

@ -2,6 +2,7 @@
using System.IO;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -17,8 +18,8 @@ namespace xServer.Forms
private void FrmUploadAndExecute_Load(object sender, EventArgs e)
{
this.Text = Helper.GetWindowTitle("Upload & Execute", _selectedClients);
chkRunHidden.Checked = Core.Misc.UploadAndExecute.RunHidden;
this.Text = WindowHelper.GetWindowTitle("Upload & Execute", _selectedClients);
chkRunHidden.Checked = UploadAndExecute.RunHidden;
}
private void btnBrowse_Click(object sender, EventArgs e)
@ -36,8 +37,8 @@ namespace xServer.Forms
private void btnUploadAndExecute_Click(object sender, EventArgs e)
{
Core.Misc.UploadAndExecute.FilePath = File.Exists(txtPath.Text) ? txtPath.Text : string.Empty;
Core.Misc.UploadAndExecute.RunHidden = chkRunHidden.Checked;
UploadAndExecute.FilePath = File.Exists(txtPath.Text) ? txtPath.Text : string.Empty;
UploadAndExecute.RunHidden = chkRunHidden.Checked;
this.DialogResult = DialogResult.OK;
this.Close();

View File

@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using xServer.Core.Helper;
using xServer.Core.Utilities;
namespace xServer.Forms
{
@ -16,15 +17,15 @@ namespace xServer.Forms
private void FrmVisitWebsite_Load(object sender, EventArgs e)
{
this.Text = Helper.GetWindowTitle("Visit Website", _selectedClients);
txtURL.Text = Core.Misc.VisitWebsite.URL;
chkVisitHidden.Checked = Core.Misc.VisitWebsite.Hidden;
this.Text = WindowHelper.GetWindowTitle("Visit Website", _selectedClients);
txtURL.Text = VisitWebsite.URL;
chkVisitHidden.Checked = VisitWebsite.Hidden;
}
private void btnVisitWebsite_Click(object sender, EventArgs e)
{
Core.Misc.VisitWebsite.URL = txtURL.Text;
Core.Misc.VisitWebsite.Hidden = chkVisitHidden.Checked;
VisitWebsite.URL = txtURL.Text;
VisitWebsite.Hidden = chkVisitHidden.Checked;
this.DialogResult = DialogResult.OK;
this.Close();

View File

@ -72,8 +72,15 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Core\Build\IconInjector.cs" />
<Compile Include="Core\Helper\FrameCounter.cs" />
<Compile Include="Core\Misc\RemoteDrive.cs" />
<Compile Include="Core\Helper\FileHelper.cs" />
<Compile Include="Core\Helper\FormatHelper.cs" />
<Compile Include="Core\Utilities\FrameCounter.cs" />
<Compile Include="Core\Helper\NativeMethodsHelper.cs" />
<Compile Include="Core\Helper\PlatformHelper.cs" />
<Compile Include="Core\Helper\RemoteDesktopHelper.cs" />
<Compile Include="Core\Helper\WindowHelper.cs" />
<Compile Include="Core\Utilities\NativeMethods.cs" />
<Compile Include="Core\Utilities\RemoteDrive.cs" />
<Compile Include="Core\Networking\Client.cs" />
<Compile Include="Core\Build\ClientBuilder.cs" />
<Compile Include="Core\Commands\CommandHandler.cs" />
@ -83,15 +90,15 @@
<Compile Include="Core\Commands\SystemHandler.cs" />
<Compile Include="Core\Compression\SafeQuickLZ.cs" />
<Compile Include="Core\Encryption\AES.cs" />
<Compile Include="Core\Helper\FileSplit.cs" />
<Compile Include="Core\Helper\UnsafeStreamCodec.cs" />
<Compile Include="Core\Utilities\FileSplit.cs" />
<Compile Include="Core\Utilities\UnsafeStreamCodec.cs" />
<Compile Include="Core\Networking\Utilities\UPnP.cs" />
<Compile Include="Core\Misc\InputBox.cs" />
<Compile Include="Controls\InputBox.cs" />
<Compile Include="Core\Compression\JpgCompression.cs" />
<Compile Include="Core\Misc\ListViewColumnSorter.cs" />
<Compile Include="Core\Utilities\ListViewColumnSorter.cs" />
<Compile Include="Core\Extensions\ListViewExtensions.cs" />
<Compile Include="Core\Misc\NoIpUpdater.cs" />
<Compile Include="Core\Misc\SavedVariables.cs" />
<Compile Include="Core\Utilities\NoIpUpdater.cs" />
<Compile Include="Core\Utilities\SavedVariables.cs" />
<Compile Include="Core\Networking\ConnectionHandler.cs" />
<Compile Include="Core\Networking\Utilities\PooledBufferManager.cs" />
<Compile Include="Core\Packets\ClientPackets\GetDesktopResponse.cs" />
@ -232,8 +239,11 @@
<Compile Include="Core\ReverseProxy\ReverseProxyClient.cs" />
<Compile Include="Core\ReverseProxy\ReverseProxyServer.cs" />
<Compile Include="Core\Networking\Server.cs" />
<Compile Include="Core\Helper\Helper.cs" />
<Compile Include="Core\Networking\UserState.cs" />
<Compile Include="Enums\PathType.cs" />
<Compile Include="Enums\RemoteDesktopAction.cs" />
<Compile Include="Enums\ShutdownAction.cs" />
<Compile Include="Enums\UserStatus.cs" />
<Compile Include="Forms\FrmAbout.cs">
<SubType>Form</SubType>
</Compile>