我正在制作Vault Viewer实用程序。因此,我需要解密Windows库。我知道有Policy.vpol
,.vcrd
和.vsch
个文件,但是实际上如何使用C ++对其解密?
答案 0 :(得分:0)
您只能使用CredEnumerate
枚举它们,例如:
void Enumerate()
{
DWORD Count;
PCREDENTIALW *Credential;
//Now enumerate all http stored credentials....
if (CredEnumerateA(NULL, CRED_ENUMERATE_ALL_CREDENTIALS, &Count, &Credential))
{
for (int i = 0; i<Count; i++)
{
//print Credential[i] information
}
CredFree(Credential);
}
}
或使用CredRead
检索凭据:
void Retrieve()
{
PCREDENTIALW pcred;
BOOL ok = ::CredReadW(L"FOO/account", CRED_TYPE_GENERIC, 0, &pcred);
wprintf(L"CredRead() - errno %d\n", ok ? 0 : ::GetLastError());
if (!ok)
return ;
wprintf(L"Read username = '%s', password='%S' (%d bytes)\n",
pcred->UserName, (char*)pcred->CredentialBlob, pcred->CredentialBlobSize);
CredFree(pcred);
}
如果您没有任何密钥,将无法获取域密码的密码信息。