alguien me ayuda??
creo que mi problema radica en esta linea:
printf("Password : %ls\n\n", CredentialCollection->CredentialBlob);
por esto: %ls
como solucionoo?
Código
/* Programa que recupera contraseñas almacenadas con Microsoft Messenger, * basado en el código original de Gregory R. Panakkal, http://www.infogreg.com * modificado para Windows Live Messenger. XP SP2 * Testeado con la versión 8 de Windows Live Messenger y 7.0 - 7.5 MSN Messenger. * Compilar con Visual C++ 6. * By dSx. */ #include<windows.h> #include<stdio.h> #include <fstream.h> using namespace std; typedef struct _CREDENTIAL_ATTRIBUTEA { LPSTR Keyword; DWORD Flags; DWORD ValueSize; LPBYTE Value; } CREDENTIAL_ATTRIBUTEA, *PCREDENTIAL_ATTRIBUTEA; typedef struct _CREDENTIALA { DWORD Flags; DWORD Type; LPSTR TargetName; LPSTR Comment; FILETIME LastWritten; DWORD CredentialBlobSize; LPBYTE CredentialBlob; DWORD Persist; DWORD AttributeCount; PCREDENTIAL_ATTRIBUTEA Attributes; LPSTR TargetAlias; LPSTR UserName; } CREDENTIALA, *PCREDENTIALA; typedef struct _CRYPTOAPI_BLOB { DWORD cbData; BYTE* pbData; } DATA_BLOB; typedef struct _CRYPTPROTECT_PROMPTSTRUCT { DWORD cbSize; DWORD dwPromptFlags; HWND hwndApp; LPCWSTR szPrompt; } CRYPTPROTECT_PROMPTSTRUCT; typedef CREDENTIALA CREDENTIAL; typedef PCREDENTIALA PCREDENTIAL; typedef BOOL (WINAPI *typeCryptUnprotectData)( DATA_BLOB *, LPWSTR *, DATA_BLOB *, PVOID *, CRYPTPROTECT_PROMPTSTRUCT *, DWORD, DATA_BLOB * ); typedef BOOL (WINAPI *typeCredEnumerateA)( LPCTSTR, DWORD, DWORD *, PCREDENTIALA ** ); typedef BOOL (WINAPI *typeCredReadA)( LPCTSTR, DWORD, DWORD, PCREDENTIALA * ); typedef VOID (WINAPI *typeCredFree)(PVOID); typeCredEnumerateA pfCredEnumerateA; typeCredReadA pfCredReadA; typeCredFree pfCredFree; typeCryptUnprotectData pfCryptUnprotectData; void showBanner(void); int main() { showBanner(); PCREDENTIAL *CredentialCollection = NULL; DATA_BLOB blobCrypt, blobPlainText, blobEntropy; char szEntropyStringSeed[37] = "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"; //credui.dll short int EntropyData[37]; short int tmp, pnet, j; HMODULE hDLL, hDLL2; DWORD Count, i; if (hDLL = LoadLibrary("advapi32.dll")) { pfCredEnumerateA = (typeCredEnumerateA)GetProcAddress(hDLL, "CredEnumerateA"); pfCredReadA = (typeCredReadA)GetProcAddress(hDLL, "CredReadA"); pfCredFree = (typeCredFree)GetProcAddress(hDLL, "CredFree"); if (pfCredEnumerateA == NULL || pfCredReadA == NULL || pfCredFree == NULL) { return -1; } } if (hDLL2 = LoadLibrary("crypt32.dll")) { pfCryptUnprotectData = (typeCryptUnprotectData)GetProcAddress(hDLL2, "CryptUnprotectData"); if (pfCryptUnprotectData == NULL) { return -1; } } pfCredEnumerateA(NULL, 0, &Count, &CredentialCollection); //Calculate Entropy Data for (i = 0; i < 37; i++) { // strlen(szEntropyStringSeed) = 37 tmp = (short int)szEntropyStringSeed[i]; tmp <<= 2; EntropyData[i] = tmp; } if (Count) { for (i = 0; i < Count; i++) { if (!pnet) { blobEntropy.pbData = (BYTE *)&EntropyData; blobEntropy.cbData = 74; //sizeof(EntropyData) blobCrypt.pbData = CredentialCollection[i]->CredentialBlob; blobCrypt.cbData = CredentialCollection[i]->CredentialBlobSize; pfCryptUnprotectData(&blobCrypt, NULL, &blobEntropy, NULL, NULL, 1, &blobPlainText); //showBanner(CredentialCollection[i]->UserName); //log << "asdasdasdas"; } else { } } } pfCredFree(CredentialCollection); return EXIT_SUCCESS; } void showBanner() { }