pull/105/head
Apex Liu 2017-12-05 01:28:31 +08:00
parent 86e95f7a16
commit 09e8ee377e
1 changed files with 40 additions and 20 deletions

View File

@ -56,23 +56,20 @@ End Sub
std::string rdp_content = "\ std::string rdp_content = "\
connect to console:i:%d\n\ connect to console:i:%d\n\
screen mode id:i:%d\n\ screen mode id:i:%d\n\
use multimon:i:0\n\
desktopwidth:i:%d\n\ desktopwidth:i:%d\n\
desktopheight:i:%d\n\ desktopheight:i:%d\n\
winposstr:s:0,1,%d,%d,%d,%d\n\
full address:s:%s:%d\n\
username:s:%s\n\
prompt for credentials:i:0\n\
use multimon:i:0\n\
authentication level:i:3\n\
session bpp:i:16\n\ session bpp:i:16\n\
winposstr:s:0,1,%d,%d,%d,%d\n\
compression:i:1\n\ compression:i:1\n\
keyboardhook:i:2\n\ keyboardhook:i:2\n\
audiocapturemode:i:0\n\ audiocapturemode:i:0\n\
negotiate security layer:i:1\n\
videoplaybackmode:i:1\n\ videoplaybackmode:i:1\n\
connection type:i:2\n\ connection type:i:7\n\
prompt for credentials on client:i:0\n\ networkautodetect:i:1\n\
bandwidthautodetect:i:1\n\
displayconnectionbar:i:1\n\ displayconnectionbar:i:1\n\
enableworkspacereconnect:i:0\n\
disable wallpaper:i:1\n\ disable wallpaper:i:1\n\
allow font smoothing:i:0\n\ allow font smoothing:i:0\n\
allow desktop composition:i:0\n\ allow desktop composition:i:0\n\
@ -81,18 +78,36 @@ disable menu anims:i:1\n\
disable themes:i:1\n\ disable themes:i:1\n\
disable cursor setting:i:0\n\ disable cursor setting:i:0\n\
bitmapcachepersistenable:i:1\n\ bitmapcachepersistenable:i:1\n\
full address:s:%s:%d\n\
audiomode:i:0\n\ audiomode:i:0\n\
redirectprinters:i:0\n\ redirectprinters:i:0\n\
redirectcomports:i:0\n\ redirectcomports:i:0\n\
redirectsmartcards:i:0\n\ redirectsmartcards:i:0\n\
redirectclipboard:i:1\n\ redirectclipboard:i:1\n\
redirectposdevices:i:0\n\ redirectposdevices:i:0\n\
redirectdirectx:i:0\n\
autoreconnection enabled:i:0\n\ autoreconnection enabled:i:0\n\
authentication level:i:2\n\
prompt for credentials:i:0\n\
negotiate security layer:i:1\n\
remoteapplicationmode:i:0\n\
alternate shell:s:\n\
shell working directory:s:\n\
gatewayhostname:s:\n\
gatewayusagemethod:i:4\n\
gatewaycredentialssource:i:4\n\
gatewayprofileusagemethod:i:0\n\
promptcredentialonce:i:0\n\
gatewaybrokeringtype:i:0\n\
use redirection server name:i:0\n\
rdgiskdcproxy:i:0\n\
kdcproxyname:s:\n\
drivestoredirect:s:*\n\ drivestoredirect:s:*\n\
password 51:b:%s\n\ username:s:%s\n\
"; ";
//redirectdirectx:i:0\n\
//prompt for credentials on client:i:0\n\
//password 51:b:%s\n\
//password 51:b:01000000D08C9DDF0115D1118C7A00C04FC297EB0100000052A9E191EA75A948B359790578C9371A0000000008000000700073007700000003660000A8000000100000000A1DCCD2E50775CA25EC3857164B34DC0000000004800000A000000010000000FCE1A645B9B61AA450946BB6F955058108020000D83591CA47562D6DDAA689F050AE145039EBE22E00D1D3AEAA98373C7B63C3E8E7149072DF989EA43EFCE20513AD3D27B11BE7F17066A688E1DCE828AF85460AAC327B38E90776DB962888E4393D19637578984B19A187AAD95F6D2726ADE7DD315FF56C15FF5B3031014EDDCC3C24D1B81779AFDB006EE575F5BEFB8D2D2138D9D9D642BBB251CC5ED7226968764856EC660A646BACE748A13D6002A9A537AA70710615650B9387EED66DE28BD57B304BBDD7B581B943DA628EB0289E30A8BA784B76F7885BECCAB4FEF7820E97EE3C6E036EEAF6EAA669288DF2FCACC9BEC045C907EBBDE87AFB8CC6B07A600BD63AC891B61D95C2265DD9FD5E635D61BFBF5EDC28311375066611C610FB533D64515B643C82F57D9B183B05C156D91BC0974D38E546022B139E82452E6F1EDF76E52F732C3904E5E433F8F3D488DB0698427DBB0791A9F207F8CB6654CB8410BAF4A59C4F9E821E589ABC1E6E6E1D432181B690408F6884FE1007895A4D26D4A5A2C7458EE747DA35D44AC9FB08AB5477EA3E7CCDB3E37EE20FAFD0D0CF9584E420598B7003B347943AC28048F45E0FD21AD08148FFADCE0E7877219259A7BE722FFAE845A429BA2CF0A71F2D19EA7495530FABDB5106E8D404A38A7E6394C38457640EA7398C5D55F0C4D342CC6A39C77E10A2A5145AEA40B14F5C7C3760334D83C9BE748383FADE231248537353817D51F7B44F61B406ABC61400000071C354139F458B02D978015F785B97F7F6B307380\n\ //password 51:b:01000000D08C9DDF0115D1118C7A00C04FC297EB0100000052A9E191EA75A948B359790578C9371A0000000008000000700073007700000003660000A8000000100000000A1DCCD2E50775CA25EC3857164B34DC0000000004800000A000000010000000FCE1A645B9B61AA450946BB6F955058108020000D83591CA47562D6DDAA689F050AE145039EBE22E00D1D3AEAA98373C7B63C3E8E7149072DF989EA43EFCE20513AD3D27B11BE7F17066A688E1DCE828AF85460AAC327B38E90776DB962888E4393D19637578984B19A187AAD95F6D2726ADE7DD315FF56C15FF5B3031014EDDCC3C24D1B81779AFDB006EE575F5BEFB8D2D2138D9D9D642BBB251CC5ED7226968764856EC660A646BACE748A13D6002A9A537AA70710615650B9387EED66DE28BD57B304BBDD7B581B943DA628EB0289E30A8BA784B76F7885BECCAB4FEF7820E97EE3C6E036EEAF6EAA669288DF2FCACC9BEC045C907EBBDE87AFB8CC6B07A600BD63AC891B61D95C2265DD9FD5E635D61BFBF5EDC28311375066611C610FB533D64515B643C82F57D9B183B05C156D91BC0974D38E546022B139E82452E6F1EDF76E52F732C3904E5E433F8F3D488DB0698427DBB0791A9F207F8CB6654CB8410BAF4A59C4F9E821E589ABC1E6E6E1D432181B690408F6884FE1007895A4D26D4A5A2C7458EE747DA35D44AC9FB08AB5477EA3E7CCDB3E37EE20FAFD0D0CF9584E420598B7003B347943AC28048F45E0FD21AD08148FFADCE0E7877219259A7BE722FFAE845A429BA2CF0A71F2D19EA7495530FABDB5106E8D404A38A7E6394C38457640EA7398C5D55F0C4D342CC6A39C77E10A2A5145AEA40B14F5C7C3760334D83C9BE748383FADE231248537353817D51F7B44F61B406ABC61400000071C354139F458B02D978015F785B97F7F6B307380\n\
//password 51:b:01000000"; //password 51:b:01000000";
@ -771,13 +786,13 @@ void TsHttpRpc::_rpc_func_run_client(const ex_astr& func_args, ex_astr& buf)
int split_pos = sid.length() - 2; int split_pos = sid.length() - 2;
std::string real_sid = sid.substr(0, split_pos); std::string real_sid = sid.substr(0, split_pos);
std::string psw51b; // std::string psw51b;
if (!calc_psw51b("Abcd1234", psw51b)) // if (!calc_psw51b("Abcd1234", psw51b))
{ // {
printf("calc password failed.\n"); // printf("calc password failed.\n");
_create_json_ret(buf, TPE_FAILED); // _create_json_ret(buf, TPE_FAILED);
return; // return;
} // }
char sz_rdp_file_content[4096] = { 0 }; char sz_rdp_file_content[4096] = { 0 };
sprintf_s(sz_rdp_file_content, rdp_content.c_str(), sprintf_s(sz_rdp_file_content, rdp_content.c_str(),
@ -785,7 +800,8 @@ void TsHttpRpc::_rpc_func_run_client(const ex_astr& func_args, ex_astr& buf)
, cx, cy, cx + width + 20, cy + higth + 40 , cx, cy, cx + width + 20, cy + higth + 40
, teleport_ip.c_str(), teleport_port , teleport_ip.c_str(), teleport_port
, real_sid.c_str() , real_sid.c_str()
, psw51b.c_str() , "administrator"
// , psw51b.c_str()
); );
char sz_file_name[MAX_PATH] = { 0 }; char sz_file_name[MAX_PATH] = { 0 };
@ -803,7 +819,11 @@ void TsHttpRpc::_rpc_func_run_client(const ex_astr& func_args, ex_astr& buf)
ex_astr temp_host_ip = real_host_ip;// replace_all_distinct(real_host_ip, ("."), "-"); ex_astr temp_host_ip = real_host_ip;// replace_all_distinct(real_host_ip, ("."), "-");
ex_replace_all(temp_host_ip, ".", "-"); ex_replace_all(temp_host_ip, ".", "-");
sprintf_s(sz_file_name, ("%s%s.rdp"), temp_path, temp_host_ip.c_str()); // for debug
sprintf_s(sz_file_name, ("e:\\tmp\\rdp\\%s.rdp"), temp_host_ip.c_str());
//sprintf_s(sz_file_name, ("%s%s.rdp"), temp_path, temp_host_ip.c_str());
//FILE* f = fopen(sz_file_name, ("wt")); //FILE* f = fopen(sz_file_name, ("wt"));
//if (f == NULL) //if (f == NULL)
FILE* f = NULL; FILE* f = NULL;