diff --git a/.gitignore b/.gitignore index a57cb7f..39021c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/*.opensdf /*.suo /*.sdf /ipch diff --git a/CredImport/Main.cpp b/CredImport/Main.cpp index f652c1e..394386f 100644 --- a/CredImport/Main.cpp +++ b/CredImport/Main.cpp @@ -43,13 +43,15 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In return -1; } - // Decode password. - vector password; + // Decode password (Base64 >> UTF-8 >> UTF-16). + sanitizing_vector password_utf8; { base64_dec dec; bool is_last; - dec.decode(password, is_last, pwcArglist[2], (size_t)-1); + dec.decode(password_utf8, is_last, pwcArglist[2], (size_t)-1); } + sanitizing_wstring password; + MultiByteToWideChar(CP_UTF8, 0, password_utf8.data(), (int)password_utf8.size(), password); return 0; } diff --git a/CredImport/StdAfx.h b/CredImport/StdAfx.h index bbb3545..f4cea8d 100644 --- a/CredImport/StdAfx.h +++ b/CredImport/StdAfx.h @@ -21,6 +21,7 @@ #pragma once #include +#include #include #include diff --git a/lib/WinStd b/lib/WinStd index 812b746..2cb830b 160000 --- a/lib/WinStd +++ b/lib/WinStd @@ -1 +1 @@ -Subproject commit 812b746ef3ff80f97df9bf36e6e7c8833cd8d431 +Subproject commit 2cb830b341ea49e9c69ec332b060e165ad75e1a7