Answer the question
In order to leave comments, you need to log in
How to correctly read passwords from Google Chrome database?
The thing is.
I'm here decrypting passwords from the chrome database. And I get only a piece of the password and a bunch of garbage at the output. There is a suspicion that I screwed up somewhere with the definition of the size of the field containing the password. Can anyone help?
Yuzayu about the following construction:
sqlite3_stmt* stmt;
DATA_BLOB in, out;
//open and prepare the database here
while (sqlite3_step(stmt) == SQLITE_ROW)
{
in.pbData = (unsigned char*)sqlite3_column_text(stmt, 2);
in.cbData = sqlite3_column_bytes(stmt, 2);
if(CryptUnprotectData(&in, NULL, NULL, NULL, NULL, 0, &out))
{
DWORD dwPassLen = out.pbData[0];
char* password = new char[dwPassLen];
memcpy(password, &out.pbData[4], dwPassLen);
string strPassword(password, dwPassLen);
f << "Password: " << strPassword << endl;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question