pull/105/head
Apex Liu 2017-12-06 03:10:57 +08:00
parent 09e8ee377e
commit f5b5b12eec
1 changed files with 30 additions and 30 deletions

View File

@ -50,8 +50,8 @@ End Sub
#ifdef RDP_CLIENT_SYSTEM_BUILTIN #ifdef RDP_CLIENT_SYSTEM_BUILTIN
#include <WinCrypt.h> // #include <WinCrypt.h>
#pragma comment(lib, "Crypt32.lib") // #pragma comment(lib, "Crypt32.lib")
std::string rdp_content = "\ std::string rdp_content = "\
connect to console:i:%d\n\ connect to console:i:%d\n\
@ -174,34 +174,34 @@ int ts_url_decode(const char *src, int src_len, char *dst, int dst_len, int is_f
return i >= src_len ? j : -1; return i >= src_len ? j : -1;
} }
#ifdef RDP_CLIENT_SYSTEM_BUILTIN // #ifdef RDP_CLIENT_SYSTEM_BUILTIN
bool calc_psw51b(const char* password, std::string& ret) // bool calc_psw51b(const char* password, std::string& ret)
{ // {
DATA_BLOB DataIn; // DATA_BLOB DataIn;
DATA_BLOB DataOut; // DATA_BLOB DataOut;
//
ex_wstr w_pswd; // ex_wstr w_pswd;
ex_astr2wstr(password, w_pswd, EX_CODEPAGE_ACP); // ex_astr2wstr(password, w_pswd, EX_CODEPAGE_ACP);
//
DataIn.cbData = w_pswd.length() * sizeof(wchar_t); // DataIn.cbData = w_pswd.length() * sizeof(wchar_t);
DataIn.pbData = (BYTE*)w_pswd.c_str(); // DataIn.pbData = (BYTE*)w_pswd.c_str();
//
//
if (!CryptProtectData(&DataIn, L"psw", NULL, NULL, NULL, 0, &DataOut)) // if (!CryptProtectData(&DataIn, L"psw", NULL, NULL, NULL, 0, &DataOut))
return false; // return false;
//
char szRet[5] = {0}; // char szRet[5] = {0};
for (int i = 0; i < DataOut.cbData; ++i) // for (int i = 0; i < DataOut.cbData; ++i)
{ // {
sprintf_s(szRet, 5, "%02X", DataOut.pbData[i]); // sprintf_s(szRet, 5, "%02X", DataOut.pbData[i]);
ret += szRet; // ret += szRet;
} // }
//
LocalFree(DataOut.pbData); // LocalFree(DataOut.pbData);
return true; // return true;
} // }
#endif // #endif
//
TsHttpRpc::TsHttpRpc() TsHttpRpc::TsHttpRpc()
{ {
m_stop = false; m_stop = false;