From 1fc722448c31893e936544763f78092cd4ee29af Mon Sep 17 00:00:00 2001 From: Fahad Date: Wed, 3 Feb 2021 23:54:16 +0500 Subject: [PATCH] fix access violation --- passcat/libchrome.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/passcat/libchrome.cpp b/passcat/libchrome.cpp index ea3cb25..02adb34 100644 --- a/passcat/libchrome.cpp +++ b/passcat/libchrome.cpp @@ -83,7 +83,7 @@ static void _print_passwords(std::wstring filename, std::wstring folder, std::st cellPosition = (rowCtr * columns) + 1; std::cout << "Username: " << results[cellPosition] << std::endl; cellPosition = (rowCtr * columns) + 2; - sqlite3_free_table(results); + if ((rc = sqlite3_blob_open(db, "main", "logins", "password_value", rowCtr, 0, &blob)) != SQLITE_OK) { sqlite3_close(db); @@ -113,13 +113,17 @@ static void _print_passwords(std::wstring filename, std::wstring folder, std::st DataIn.cbData = len; DataIn.pbData = (BYTE *)block; - + if (CryptUnprotectData(&DataIn, NULL, NULL, NULL, NULL, 0, &DataOut)) { DataOut.pbData[DataOut.cbData] = '\0'; std::cout << "Password: " << DataOut.pbData << std::endl; } + + } + sqlite3_free_table(results); + if (rows > 0) { std::cout << std::endl; }