1. #include <iostream>
  2. #define Main main
  3. #define COLOR_GREEN system("color 2");
  4. #include <vector>
  5. #include <list>
  6. #include <string>
  7. #include <WinSock2.h>
  8. #include <WS2tcpip.h>
  9. #include <memory>
  10. #include <VersionHelpers.h>
  11. #include <LM.h>
  12. #include <winnetwk.h>
  13. #include "BitMap.h"
  14. #include <wlanapi.h>
  15. #include "ATBAudioEngine/ATBAudioEngine.h"
  16. #include "Package.h"
  17.  
  18. #pragma comment(lib,"Ws2_32.lib")
  19. #pragma comment(lib,"Mpr.lib")
  20. #pragma comment(lib,"netapi32.lib")
  21. #pragma comment(lib,"Wlanapi.lib")
  22. #include <Windows.h>
  23.  
  24. class disorderly
  25. {
  26. int m_buf[] = { };
  27. public:
  28.  
  29. void initBuf()
  30. {
  31. srand(GetTickCount());
  32. int len = sizeof(m_buf) / sizeof(int);
  33. for (int i = ; i < len; i++)
  34. {
  35. m_buf[i] = rand() % ;
  36. printf("%d, ", m_buf[i]);
  37. }
  38. }
  39.  
  40. //范围
  41. void initBuf(int range)
  42. {
  43. srand(GetTickCount());
  44. int len = sizeof(m_buf) / sizeof(int);
  45. for (int i = ; i < len; i++)
  46. {
  47. m_buf[i] = rand() % range;
  48. printf("%d, ", m_buf[i]);
  49. }
  50. }
  51.  
  52. int *getBuf() { return m_buf; }
  53.  
  54. int getLen() { return sizeof(m_buf) / sizeof(int); }
  55.  
  56. void print()
  57. {
  58. printf("\n");
  59. int len = sizeof(m_buf) / sizeof(int);
  60. for (int i = ; i < len; i++)
  61. {
  62. printf("%d, ", m_buf[i]);
  63. }
  64. printf("\n");
  65. }
  66.  
  67. void C(int *Arr, int Len)
  68. {
  69. int TempData = ;
  70. int i = ;
  71. int j = ;
  72. for (i = ; i < Len; i++)
  73. {
  74. j = i;
  75. TempData = *(Arr + i);
  76. //如果当前的数据小于当前数据的上一个
  77. //那么进行赋值, j--, 然后再判断j--数据是否小于上一个数据
  78. while (j > && TempData < Arr[j - ])
  79. {
  80. Arr[j] = Arr[j - ];
  81. j--;
  82. }
  83. Arr[j] = TempData;
  84. }
  85.  
  86. //for (int i = 0; i < 5; i++)
  87. //{
  88. // std::thread th(C, i);
  89. // th.join();
  90. // //th.detch();
  91. //}
  92. }
  93.  
  94. void M(int *Arr, int Len)
  95. {
  96. for (int i = ; i < Len - ; i++)
  97. {
  98. for (int j = i + ; j < Len; j++)
  99. {
  100. if (Arr[i] > Arr[j])
  101. {
  102. int temp = Arr[i];
  103. Arr[i] = Arr[j];
  104. Arr[j] = temp;
  105. }
  106. }
  107. }
  108. }
  109.  
  110. void X(int *Arr, int Len)
  111. {
  112. int k = -;
  113. for (int i = ; i < Len - ; i++)
  114. {
  115. k = i;
  116. for (int j = i + ; j < Len; j++)
  117. {
  118. //第一波出来的必定是最小的
  119. if (Arr[k] > Arr[j])
  120. {
  121. k = j;
  122. }
  123. }
  124. int temp = Arr[i];
  125. Arr[i] = Arr[k];
  126. Arr[k] = temp;
  127. }
  128. }
  129.  
  130. void GetAllUserName(std::vector<std::wstring> & allUserName)
  131. {
  132. // See more: http://msdn.microsoft.com/en-us/library/windows/desktop/aa370652(v=vs.85).aspx
  133. LPUSER_INFO_1 pBuf = NULL;
  134. LPUSER_INFO_1 pTmpBuf;
  135. DWORD dwLevel = ;
  136. DWORD dwEntriesRead = ;
  137. DWORD dwTotalEntries = ;
  138. DWORD dwResumeHandle = ;
  139. DWORD dwPrefMaxLen = MAX_PREFERRED_LENGTH;
  140. NET_API_STATUS nStatus;
  141. LPTSTR pszServerName = NULL;
  142.  
  143. do
  144. {
  145. nStatus = NetUserEnum((LPCWSTR)pszServerName,
  146. dwLevel,
  147. FILTER_NORMAL_ACCOUNT, // global users
  148. (LPBYTE*)&pBuf,
  149. dwPrefMaxLen,
  150. &dwEntriesRead,
  151. &dwTotalEntries,
  152. &dwResumeHandle);
  153.  
  154. if ((nStatus == NERR_Success) || (nStatus == ERROR_MORE_DATA))
  155. {
  156. if ((pTmpBuf = pBuf) != NULL)
  157. {
  158. for (DWORD i = ; i < dwEntriesRead; i++)
  159. {
  160. if (pTmpBuf == NULL)
  161. {
  162. fprintf(stderr, "An access violation has occurred\n");
  163. break;
  164. }
  165. allUserName.push_back(pTmpBuf->usri1_name);
  166. pTmpBuf++;
  167. }
  168. }
  169. }
  170. else
  171. fprintf(stderr, "A system error has occurred: %d\n", nStatus);
  172.  
  173. if (pBuf != NULL) {
  174. NetApiBufferFree(pBuf);
  175. pBuf = NULL;
  176. }
  177. } while (nStatus == ERROR_MORE_DATA); // end do
  178.  
  179. // Check again for allocated memory.
  180. if (pBuf != NULL)
  181. NetApiBufferFree(pBuf);
  182.  
  183. //std::vector<std::wstring> v;
  184. //GetAllUserName(v);
  185. //for (int i = 0; i < v.size(); i++)
  186. //{
  187. // char buf[256] = { 0 };
  188. // int j = 0;
  189. // while (v[i].c_str()[j])
  190. // {
  191. // buf[j] = v[i].c_str()[j];
  192. // j++;
  193. // }
  194. // printf(buf);
  195. //}
  196. }
  197.  
  198. int getSystemPath()
  199. {
  200. HANDLE hFile;
  201. DWORD dwWrite;
  202. TCHAR path[MAX_PATH];
  203. GetSystemDirectory(path, MAX_PATH);
  204. hFile = CreateFile("syspath.txt", GENERIC_WRITE,
  205. ,
  206. NULL,
  207. CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
  208. if (hFile != INVALID_HANDLE_VALUE)
  209. {
  210. if (!(WriteFile(hFile, path, lstrlen(path), &dwWrite, NULL)))
  211. {
  212. return GetLastError();
  213. }
  214. }
  215. return CloseHandle(hFile);
  216. }
  217.  
  218. //打印环境变量
  219. void printEV()
  220. {
  221. PVOID P = GetEnvironmentStringsA();
  222. LPSTR sz;
  223. for (sz = (LPSTR)P; *sz;)
  224. {
  225. printf("%s\n", sz);
  226. while (*sz++);
  227. }
  228. FreeEnvironmentStringsA((LPCH)P);
  229. P = NULL;
  230.  
  231. }
  232.  
  233. void vectors()
  234. {
  235. std::vector<int> arr;
  236. srand(GetTickCount());
  237. for (unsigned int i = ; i < ; i++)
  238. {
  239. arr.push_back(rand() % );
  240. }
  241. for (unsigned int i = ; i < arr.size(); i++)
  242. {
  243. printf("%d, ", arr[i]);
  244. }
  245. printf("\n");
  246. std::cout << "sort last" << std::endl;
  247. std::cout << "======================" << std::endl;
  248. unsigned int j = ;
  249. int data = ;
  250. for (unsigned int i = ; i < arr.size(); i++)
  251. {
  252. j = i;
  253. data = arr[i];
  254. while (j > && data < arr[j - ])
  255. {
  256. arr[j] = arr[j - ];
  257. j--;
  258. }
  259. arr[j] = data;
  260. }
  261. for (unsigned int i = ; i < arr.size(); i++)
  262. {
  263. printf("%d, ", arr[i]);
  264. }
  265. printf("\n");
  266. arr.clear();
  267. }
  268.  
  269. void ComputerName_Ip()
  270. {
  271. char buf[] = "";
  272. hostent *ph = NULL;//struct hostent *ph = NULL;
  273. WSADATA w;
  274. WSAStartup(0x0101, &w);//这一行必须在使用任何SOCKET函数前写!
  275. std::string hostName = buf;//此处获得本机名称
  276. gethostname(buf, sizeof(buf));
  277. ph = gethostbyname(buf);
  278. int i = ;
  279. while (ph->h_addr_list[i] != NULL)
  280. {
  281. char *IP = inet_ntoa(*((struct in_addr *)ph->h_addr_list[i]));//此处获得本机IP
  282. std::cout << IP << std::endl;
  283. i++;
  284. }
  285. ph = gethostbyname("www.baidu.com");
  286. i = ;
  287. while (ph->h_addr_list[i] != NULL)
  288. {
  289. char *IP = inet_ntoa(*((struct in_addr *)ph->h_addr_list[i]));//此处获得本机IP
  290. std::cout << IP << std::endl;
  291. i++;
  292. }
  293. WSACleanup();
  294. }
  295.  
  296. void gethostsIP(char *hostsbuf)
  297. {
  298.  
  299. WORD wVersion;
  300. WSADATA WSAData;
  301. wVersion = MAKEWORD(, );
  302. WSAStartup(wVersion, &WSAData);
  303. gethostname(hostsbuf, );
  304. addrinfo hints;
  305. struct addrinfo *res, *cur;
  306. int ret;
  307. struct sockaddr_in *addr;
  308. char m_ipaddr[];
  309.  
  310. memset(&hints, , sizeof(struct addrinfo));
  311. hints.ai_family = AF_INET; /* Allow IPv4 */
  312. hints.ai_flags = AI_PASSIVE;/* For wildcard IP address */
  313. hints.ai_protocol = ; /* Any protocol */
  314. hints.ai_socktype = SOCK_STREAM;
  315.  
  316. ret = getaddrinfo(hostsbuf, NULL, &hints, &res);
  317.  
  318. if (ret == -)
  319. {
  320. perror("getaddrinfo");
  321. exit();
  322. }
  323. for (cur = res; cur != NULL; cur = cur->ai_next)
  324. {
  325. addr = (struct sockaddr_in *)cur->ai_addr;
  326. sprintf_s(m_ipaddr, "%d.%d.%d.%d",
  327. (*addr).sin_addr.S_un.S_un_b.s_b1,
  328. (*addr).sin_addr.S_un.S_un_b.s_b2,
  329. (*addr).sin_addr.S_un.S_un_b.s_b3,
  330. (*addr).sin_addr.S_un.S_un_b.s_b4);
  331. printf("%s\n", m_ipaddr);
  332. }
  333. freeaddrinfo(res);
  334. WSACleanup();
  335. }
  336.  
  337. void gethostsIP(const char *hostsName)
  338. {
  339.  
  340. WORD wVersion;
  341. WSADATA WSAData;
  342. wVersion = MAKEWORD(, );
  343. WSAStartup(wVersion, &WSAData);
  344. addrinfo hints;
  345. struct addrinfo *res, *cur;
  346. int ret;
  347. struct sockaddr_in *addr;
  348. char m_ipaddr[];
  349.  
  350. memset(&hints, , sizeof(struct addrinfo));
  351. hints.ai_family = AF_INET; /* Allow IPv4 */
  352. hints.ai_flags = AI_PASSIVE;/* For wildcard IP address */
  353. hints.ai_protocol = ; /* Any protocol */
  354. hints.ai_socktype = SOCK_STREAM;
  355.  
  356. ret = getaddrinfo(hostsName, NULL, &hints, &res);
  357.  
  358. if (ret == -)
  359. {
  360. perror("getaddrinfo");
  361. exit();
  362. }
  363. for (cur = res; cur != NULL; cur = cur->ai_next)
  364. {
  365. addr = (struct sockaddr_in *)cur->ai_addr;
  366. sprintf_s(m_ipaddr, "%d.%d.%d.%d",
  367. (*addr).sin_addr.S_un.S_un_b.s_b1,
  368. (*addr).sin_addr.S_un.S_un_b.s_b2,
  369. (*addr).sin_addr.S_un.S_un_b.s_b3,
  370. (*addr).sin_addr.S_un.S_un_b.s_b4);
  371. printf("%s\n", m_ipaddr);
  372. }
  373. freeaddrinfo(res);
  374. res = NULL;
  375. WSACleanup();
  376. }
  377.  
  378. //无线连接状态
  379. int intlistenStatus()
  380. {
  381. HANDLE hClient = NULL;
  382. DWORD dwMaxClient = ;
  383. DWORD dwCurVersion = ;
  384. DWORD dwResult = ;
  385. int iRet = ;
  386. WCHAR GuidString[] = { };
  387. //ListenthestatusoftheAPyouconnected.
  388. while ()
  389. {
  390. Sleep();
  391. PWLAN_INTERFACE_INFO_LIST pIfList = NULL;
  392. PWLAN_INTERFACE_INFO pIfInfo = NULL;
  393.  
  394. dwResult = WlanOpenHandle(dwMaxClient, NULL, &dwCurVersion, &hClient);
  395. if (dwResult != ERROR_SUCCESS)
  396. {
  397. wprintf(L"WlanOpenHandlefailedwitherror:%u\n", dwResult);
  398. return ;
  399. }
  400. //获取无线网卡列表
  401. dwResult = WlanEnumInterfaces(hClient, NULL, &pIfList);
  402. if (dwResult != ERROR_SUCCESS)
  403. {
  404. wprintf(L"WlanEnumInterfacesfailedwitherror:%u\n", dwResult);
  405. return ;
  406. }
  407. else
  408. {
  409. wprintf(L"NumEntries:%lu\n", pIfList->dwNumberOfItems);
  410. wprintf(L"CurrentIndex:%lu\n\n", pIfList->dwIndex);
  411. int i;
  412. for (i = ; i < (int)pIfList->dwNumberOfItems; i++)
  413. {
  414. pIfInfo = (WLAN_INTERFACE_INFO*)&pIfList->InterfaceInfo[i];
  415. wprintf(L"InterfaceIndex[%u]:\t%lu\n", i, i);
  416. iRet = StringFromGUID2(pIfInfo->InterfaceGuid, (LPOLESTR)&GuidString,
  417. sizeof(GuidString) / sizeof(*GuidString));
  418. if (iRet == )
  419. wprintf(L"StringFromGUID2failed\n");
  420. else
  421. {
  422. wprintf(L"InterfaceGUID[%d]:%S\n", i, GuidString);
  423. }
  424. wprintf(L"InterfaceDescription[%d]:%S", i,
  425. pIfInfo->strInterfaceDescription);
  426. wprintf(L"\n");
  427. wprintf(L"InterfaceState[%d]:\t", i);
  428. switch (pIfInfo->isState)
  429. {
  430. casewlan_interface_state_not_ready:
  431. wprintf(L"Notready\n");
  432. break;
  433. casewlan_interface_state_connected:
  434. wprintf(L"Connected\n");
  435. break;
  436. casewlan_interface_state_ad_hoc_network_formed:
  437. wprintf(L"Firstnodeinaadhocnetwork\n");
  438. break;
  439. casewlan_interface_state_disconnecting:
  440. wprintf(L"Disconnecting\n");
  441. break;
  442. casewlan_interface_state_disconnected:
  443. wprintf(L"Notconnected\n");
  444. break;
  445. casewlan_interface_state_associating:
  446. wprintf(L"Attemptingtoassociatewithanetwork\n");
  447. break;
  448. casewlan_interface_state_discovering:
  449. wprintf(L"Autoconfigurationisdiscoveringsettingsforthenetwork\n");
  450. break;
  451. casewlan_interface_state_authenticating:
  452. wprintf(L"Inprocessofauthenticating\n");
  453. break;
  454. default:
  455. wprintf(L"Unknownstate%ld\n", pIfInfo->isState);
  456. break;
  457. }
  458. }
  459. }
  460. }
  461. }
  462. };
  463.  
  464. #define FF FindFiles::getInstance()
  465. class FindFiles
  466. {
  467. string Path;
  468. string Type;
  469. HANDLE HFinder = NULL;
  470. WIN32_FIND_DATAA FindFileData;
  471. string CurPath;
  472. int num = -;
  473. public:
  474. static FindFiles *getInstance()
  475. {
  476. static FindFiles obj;
  477. return &obj;
  478. }
  479. //D:/Music_s
  480. void setFindPath(const char *Path)
  481. {
  482. if (Path)
  483. {
  484. this->Path = Path;
  485. CurPath = this->Path;
  486. if (this->Path == string("exit")) { exit(); }
  487. }
  488. else
  489. {
  490. printf("input find path .......... \n");
  491. }
  492. }
  493. //D:/Music_s
  494. void setFindPath(string &Path)
  495. {
  496. if (!Path.empty())
  497. {
  498. this->Path = Path;
  499. CurPath = this->Path;
  500. if (this->Path == string("exit")) { exit(); }
  501. }
  502. else
  503. {
  504. printf("input find path .......... \n");
  505. }
  506. }
  507. // mp3 mp4 ...
  508. void setFindType(const char *Type)
  509. {
  510. if (Type)
  511. {
  512. this->Type = Type;
  513. if (this->Type == string("exit")) { exit(); }
  514. }
  515. else
  516. {
  517. printf("input find Type .......... \n");
  518. }
  519. }
  520. // mp3 mp4 ...
  521. void setFindType(string &Type)
  522. {
  523. if (!Type.empty())
  524. {
  525. this->Type = Type;
  526. if (this->Type == string("exit")) { exit(); }
  527.  
  528. FF->strcatFindFile();
  529. }
  530. else
  531. {
  532. printf("input find Type .......... \n");
  533. }
  534. }
  535. string getPath() const
  536. {
  537. return this->Path;
  538. }
  539. string getType() const
  540. {
  541. return this->Type;
  542. }
  543.  
  544. ///=============================================
  545. void run()
  546. {
  547. system("color 2");
  548. char path[] = { };
  549. char type[] = { };
  550. printf("input path suppose <D:/Music>:");
  551. std::cin >> path;
  552. printf("input type or input 0 is any type suppose <bmp,mp3,mp4,0,cpp,h,c,zip,avi> :");
  553. std::cin >> type;
  554. FF->setFindPath(path);
  555. if (string(type) == "")
  556. {
  557. FF->setFindType("*");
  558. }
  559. else
  560. {
  561. FF->setFindType(type);
  562. }
  563. FF->strcatFindFile();
  564. FF->findFirstFile(FF->Path.c_str());
  565. while (true)
  566. {
  567. if (!find())
  568. {
  569. break;
  570. }
  571. }
  572. printf("\n");
  573. printf("number =========== :::::::: %d file \n", num);
  574. }
  575. void run_s()
  576. {
  577. while (true)
  578. {
  579. system("cls");
  580. run();
  581. system("pause");
  582. }
  583. }
  584. ///=============================================
  585.  
  586. bool find()
  587. {
  588. string tmp = FindFileData.cFileName;
  589. if (tmp != "." && tmp != "..")
  590. {
  591. printf("%s , %d\n", FindFileData.cFileName, FindFileData.dwFileAttributes);
  592. }
  593. num++;
  594. int len = strlen(FindFileData.cFileName);
  595. char temp[] = { };
  596. temp[] = FindFileData.cFileName[len - ];
  597. if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
  598. {
  599. if (string(temp) != "" && string(temp) != "." && string(temp) != " " && string(temp) != "..")
  600. {
  601. string lastCurPath = this->CurPath;
  602. string lastCur = this->CurPath;
  603. lastCurPath += "/";
  604. lastCur += "/";
  605. lastCurPath += FindFileData.cFileName;
  606. lastCur += FindFileData.cFileName;
  607. lastCurPath += "/*.";
  608. if (this->Type == string(""))
  609. {
  610. lastCurPath += "*";
  611. }
  612. else
  613. {
  614. lastCurPath += this->Type;
  615. }
  616.  
  617. FF->ergodicFile(lastCurPath, lastCur);
  618. }
  619. }
  620. if (!FF->findNextFile())
  621. {
  622. return false;
  623. }
  624. return true;
  625. }
  626. bool ergodicFile(string path, string lastCur)
  627. {
  628. WIN32_FIND_DATAA temp;
  629. HANDLE HFinder = FindFirstFileA(path.c_str(), &temp);
  630. if (HFinder == INVALID_HANDLE_VALUE)
  631. {
  632. std::cout << "查找失败 !" << std::endl;
  633. return true;
  634. }
  635.  
  636. while (true)
  637. {
  638. string tmp = temp.cFileName;
  639. if (tmp != "." && tmp != "..")
  640. {
  641. printf("%s , %d\n", temp.cFileName, temp.dwFileAttributes);
  642. }
  643. num++;
  644. int len = strlen(temp.cFileName);
  645. char strTemp[] = { };
  646. strTemp[] = temp.cFileName[len - ];
  647. if (temp.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
  648. {
  649. if (string(strTemp) != "" && string(strTemp) != "." && string(strTemp) != " " && string(strTemp) != "..")
  650. {
  651. string CurPaths = lastCur;
  652. string lastCurPath = CurPaths;
  653. lastCurPath += "/";
  654. CurPaths += "/";
  655. lastCurPath += temp.cFileName;
  656. CurPaths += temp.cFileName;
  657. lastCurPath += "/*.";
  658. if (this->Type == string(""))
  659. {
  660. lastCurPath += "*";
  661. }
  662. else
  663. {
  664. lastCurPath += this->Type;
  665. }
  666. ergodicFile(lastCurPath, CurPaths);
  667. }
  668. }
  669.  
  670. if (!(FindNextFileA(HFinder, &temp)))
  671. {
  672. return false;
  673. }
  674. }
  675. return true;
  676. }
  677. void findFirstFile(string path)
  678. {
  679. HFinder = FindFirstFileA(path.c_str(), &FindFileData);
  680. if (HFinder == INVALID_HANDLE_VALUE)
  681. {
  682. char buf[] = { };
  683. for (int i = path.length() - ; i >= ; i--)
  684. {
  685. if (path.c_str()[i] == '.')
  686. {
  687. int len = path.length() - i;
  688. for (int j = ; j <= len + ; j++)
  689. {
  690. buf[j] = path.c_str()[j];
  691. }
  692. }
  693. }
  694. string temp = buf;
  695. temp += "*";
  696. HFinder = FindFirstFileA(temp.c_str(), &FindFileData);
  697. if (HFinder == INVALID_HANDLE_VALUE)
  698. {
  699. std::cout << "查找失败 !" << std::endl;
  700. }
  701. }
  702. }
  703. void closeFind()
  704. {
  705. if (HFinder)
  706. {
  707. FindClose(HFinder);
  708. HFinder = NULL;
  709. }
  710. }
  711. bool findNextFile()
  712. {
  713. if (!(FindNextFileA(HFinder, &FindFileData)))
  714. {
  715. return false;
  716. }
  717. return true;
  718. }
  719. private:
  720. FindFiles()
  721. {
  722.  
  723. }
  724. ~FindFiles()
  725. {
  726. FF->closeFind();
  727. }
  728. //连接查找
  729. void strcatFindFile()
  730. {
  731. if (!Path.empty() && !Type.empty())
  732. {
  733. Path += "/*.";
  734. Path += Type.c_str();
  735. printf("find file path : %s\n", Path.c_str());
  736. }
  737. }
  738. };
  739.  
  740. class Registry
  741. {
  742. public:
  743. void read_dword()//读取操作表,其类型为DWORD
  744. {
  745. HKEY hKEY;//定义有关的键,在查询结束时关闭
  746. //打开与路径data_Set相关的hKEY
  747.  
  748. string data_set = "Software\\Chicony\\Lenovo1";
  749.  
  750. //访问注册表,hKEY则保存此函数所打开的键的句柄
  751. if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set.c_str(), , KEY_READ, &hKEY))
  752. {
  753. DWORD dwValue;//长整型数据,如果是字符串数据用char数组
  754. DWORD dwSize = sizeof(DWORD);
  755. DWORD dwType = REG_DWORD;
  756.  
  757. if (::RegQueryValueEx(hKEY, "", , &dwType, (LPBYTE)&dwValue, &dwSize) != ERROR_SUCCESS)
  758. {
  759. cout << "错误:无法查询有关的注册表信息" << endl;
  760. }
  761.  
  762. cout << dwValue << endl;
  763. }
  764. ::RegCloseKey(hKEY);
  765. }
  766.  
  767. void read_reg_sz()//读取操作表,其类型为REG_SZ
  768. {
  769. HKEY hkey;
  770.  
  771. string data_set = "Software\\Chicony\\Lenovo1";
  772. //LPCWSTR lpwchar = &data_set;
  773.  
  774. if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set.c_str(), , KEY_READ, &hkey))
  775. {
  776. char dwValue[];
  777. DWORD dwSzType = REG_SZ;
  778. DWORD dwSize = sizeof(dwValue);
  779. if (::RegQueryValueEx(hkey, "wangchong", , &dwSzType, (LPBYTE)&dwValue, &dwSize) != ERROR_SUCCESS)
  780. {
  781. cout << "无法查询有关的注册表信息" << endl;
  782. }
  783. cout << dwValue << endl;
  784. }
  785. ::RegCloseKey(hkey);
  786. }
  787.  
  788. void write_dword()//在\Software\\Chicony\\Lenovo1文件夹下写入一个test111的子键,设置其名称为Name,其值为6
  789. {
  790. HKEY hkey;//定义有关的hkey,在查询结束时要关闭
  791. HKEY hTempKey;
  792.  
  793. DWORD dwValue = ;
  794. DWORD dwSize = sizeof(DWORD);
  795. DWORD dwType = REG_DWORD;
  796.  
  797. const char *data_set = "Software\\Chicony\\Lenovo1";
  798. if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CURRENT_USER, data_set, , KEY_SET_VALUE, &hkey))
  799. {
  800. if (ERROR_SUCCESS == ::RegCreateKey(hkey, "test111", &hTempKey))
  801. {
  802. if (ERROR_SUCCESS != ::RegSetValueEx(hTempKey, "Name", , REG_DWORD, (CONST BYTE*)&dwValue, sizeof(DWORD)))
  803. {
  804. cout << "写入注册表失败" << endl;
  805. }
  806. }
  807. }
  808. ::RegCloseKey(hkey);
  809. }
  810.  
  811. void write_reg_sz()
  812. {
  813. HKEY hkey;
  814. HKEY hTempKey;
  815. char m_name_set[] = "China";
  816.  
  817. DWORD len = strlen(m_name_set) + ;
  818. const char *data_set = "Software\\Chicony\\Lenovo1";
  819. if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, , KEY_SET_VALUE, &hkey))
  820. {
  821. if (ERROR_SUCCESS == ::RegCreateKey(hkey, "test1112", &hTempKey))
  822. {
  823. if (ERROR_SUCCESS != ::RegSetValueEx(hTempKey, "Name", , REG_SZ, (const BYTE*)m_name_set, len))
  824. {
  825. cout << "写入错误" << endl;
  826. }
  827. }
  828. }
  829. ::RegCloseKey(hkey);
  830. }
  831.  
  832. void write_binary()
  833. {
  834. HKEY hkey;
  835. HKEY hTempKey;
  836. BYTE m_name[];
  837. memset(m_name, , sizeof(m_name));
  838. m_name[] = 0xff;
  839. m_name[] = 0xac;
  840. m_name[] = 0x05;
  841. m_name[] = 0x4e;
  842.  
  843. const char *data_set = "Software\\Chicony\\Lenovo1";
  844. if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, , KEY_SET_VALUE, &hkey))
  845. {
  846. if (ERROR_SUCCESS == ::RegCreateKey(hkey, "test111", &hTempKey))
  847. {
  848. if (ERROR_SUCCESS != ::RegSetValueEx(hTempKey, "Name", , REG_BINARY, (unsigned char *)m_name, ))
  849. {
  850. cout << "写入错误" << endl;
  851. }
  852. }
  853. }
  854. ::RegCloseKey(hkey);
  855. }
  856.  
  857. void delete_value()
  858. {
  859. HKEY hkey;
  860. const char *data_set = "Software\\Chicony\\Lenovo1\\test1112";
  861.  
  862. if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, , KEY_SET_VALUE, &hkey))
  863. {
  864. if (ERROR_SUCCESS != ::RegDeleteValue(hkey, "Name"))
  865. {
  866. cout << "删除错误" << endl;
  867. }
  868. }
  869. ::RegCloseKey(hkey);
  870. }
  871.  
  872. void delete_key()
  873. {
  874. HKEY hkey;
  875. const char *data_set = "Software\\Chicony\\Lenovo1";
  876.  
  877. if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_CURRENT_USER, data_set, , KEY_SET_VALUE, &hkey))
  878. {
  879. if (ERROR_SUCCESS != ::RegDeleteKey(hkey, "test1112"))
  880. {
  881. cout << "删除错误" << endl;
  882. }
  883. }
  884. ::RegCloseKey(hkey);
  885. }
  886. };
  887.  
  888. #define DB DoubleBuffer::GetInstance()
  889. // 注意 双缓冲中不能使用system("cls");
  890. class DoubleBuffer
  891. {
  892. HANDLE m_hOutBuf = NULL;
  893. HANDLE m_hOutput = NULL;
  894. //双缓冲处理显示
  895. DWORD bytes = ;
  896. COORD coord = { , };
  897. public:
  898. static DoubleBuffer *GetInstance()
  899. {
  900. static DoubleBuffer db;
  901. return &db;
  902. }
  903. HANDLE GetOutBuf() { return m_hOutBuf; }
  904. HANDLE GetOutPut() { return m_hOutput; }
  905. void Begin(char **data, int W_Len)
  906. {
  907. for (int i = ; i < W_Len; i++)
  908. {
  909. coord.Y = i;
  910. BOOL Over = WriteConsoleOutputCharacterA(m_hOutBuf, data[i], W_Len, coord, &bytes);
  911. }
  912. //设置新的缓冲区为活动显示缓冲
  913. BOOL Over = SetConsoleActiveScreenBuffer(m_hOutBuf);
  914. }
  915.  
  916. void Begin(char *data, int Len)
  917. {
  918. // coord 为写入的位置 是直接写入
  919. BOOL Over = WriteConsoleOutputCharacterA(m_hOutBuf, data, Len, coord, &bytes);
  920. //设置新的缓冲区为活动显示缓冲
  921. Over = SetConsoleActiveScreenBuffer(m_hOutBuf);
  922. }
  923.  
  924. // pos 0,0 表示在0,0的位置输出
  925. void Begin(char *data, int Len, COORD pos)
  926. {
  927. // coord 为写入的位置 是直接写入
  928. BOOL Over = WriteConsoleOutputCharacterA(m_hOutBuf, data, Len, pos, &bytes);
  929. //设置新的缓冲区为活动显示缓冲
  930. Over = SetConsoleActiveScreenBuffer(m_hOutBuf);
  931. }
  932.  
  933. void End(char **data, int W_Len)
  934. {
  935. for (int i = ; i < W_Len; i++)
  936. {
  937. coord.Y = i;
  938. BOOL Over = WriteConsoleOutputCharacterA(m_hOutput, data[i], W_Len, coord, &bytes);
  939. }
  940. //设置新的缓冲区为活动显示缓冲
  941. BOOL Over = SetConsoleActiveScreenBuffer(m_hOutput);
  942. }
  943.  
  944. void End(char *data, int Len)
  945. {
  946. BOOL Over = WriteConsoleOutputCharacterA(m_hOutput, data, Len, coord, &bytes);
  947. //设置新的缓冲区为活动显示缓冲
  948. Over = SetConsoleActiveScreenBuffer(m_hOutput);
  949. }
  950.  
  951. void End(char *data, int Len, COORD pos)
  952. {
  953. BOOL Over = WriteConsoleOutputCharacterA(m_hOutput, data, Len, pos, &bytes);
  954. //设置新的缓冲区为活动显示缓冲
  955. Over = SetConsoleActiveScreenBuffer(m_hOutput);
  956. }
  957.  
  958. /*
  959. system("color 2");
  960. char **buf = NULL;
  961. buf = new char*[40];
  962. for (int i = 0; i < 40; i++)
  963. {
  964. buf[i] = new char[40];
  965. for (int j = 0; j < 40; j++)
  966. {
  967. buf[i][j] = 0;
  968. }
  969. }
  970. srand(GetTickCount());
  971. while (true)
  972. {
  973. for (int i = 0; i < 40; i++)
  974. {
  975. for (int j = 0; j < 40 - 1; j++)
  976. {
  977. buf[i][j] = rand() % 48 + 32;
  978. }
  979. }
  980. DB->Begin(buf, 40);
  981. for (int i = 0; i < 40; i++)
  982. {
  983. for (int j = 0; j < 40 - 1; j++)
  984. {
  985. buf[i][j] = rand() % 48 + 32;
  986. }
  987. }
  988. DB->End(buf, 40);
  989.  
  990. for (int i = 0; i < 40; i++)
  991. {
  992. for (int j = 0; j < 40 - 1; j++)
  993. {
  994. buf[i][j] = 0;
  995. }
  996. }
  997. }
  998. */
  999.  
  1000. private:
  1001. DoubleBuffer()
  1002. {
  1003. //创建新的控制台缓冲区
  1004. m_hOutBuf = CreateConsoleScreenBuffer(
  1005. GENERIC_WRITE,//定义进程可以往缓冲区写数据
  1006. FILE_SHARE_WRITE,//定义缓冲区可共享写权限
  1007. NULL,
  1008. CONSOLE_TEXTMODE_BUFFER,
  1009. NULL
  1010. );
  1011. m_hOutput = CreateConsoleScreenBuffer(
  1012. GENERIC_WRITE,//定义进程可以往缓冲区写数据
  1013. FILE_SHARE_WRITE,//定义缓冲区可共享写权限
  1014. NULL,
  1015. CONSOLE_TEXTMODE_BUFFER,
  1016. NULL
  1017. );
  1018.  
  1019. //隐藏两个缓冲区的光标
  1020. CONSOLE_CURSOR_INFO cci;
  1021. cci.bVisible = ;
  1022. cci.dwSize = ;
  1023. SetConsoleCursorInfo(m_hOutput, &cci);
  1024. SetConsoleCursorInfo(m_hOutBuf, &cci);
  1025. }
  1026. ~DoubleBuffer()
  1027. {
  1028. m_hOutBuf = NULL;
  1029. m_hOutput = NULL;
  1030. }
  1031. };
  1032.  
  1033. void MusicDemo()
  1034. {
  1035. //https://github.com/zhmmmm/ANYTOOL-2.0.0.0.2Version
  1036. system("color 2");
  1037. //D:\Audio\YZFHKM-S.mp3
  1038. string AudioName;
  1039. std::cout << "Please Input Audio File Names :";
  1040. std::cin >> AudioName;
  1041. std::cout << "Player Music Name : " << AudioName << std::endl;
  1042. ATA->LoadMusicsAndPlay(AudioName);
  1043.  
  1044. const int H = ;
  1045. const int W = ;
  1046. char MusicName[] = { };
  1047. strcat_s(MusicName, AudioName.c_str());
  1048. char Buf[];
  1049.  
  1050. char **Map = NULL;
  1051. Map = new char*[H];
  1052. for (int i = ; i < H; i++)
  1053. {
  1054. Map[i] = new char[W];
  1055. for (int j = ; j < W; j++)
  1056. {
  1057. Map[i][j] = ;
  1058. }
  1059. }
  1060.  
  1061. while (true)
  1062. {
  1063. ATA->GetAudioStreamData(ATA->GetCurPlayMusic(), Buf);
  1064. for (int i = ; i < H; i++)
  1065. {
  1066. if (Buf[i] <= )
  1067. {
  1068. for (int j = ; j < W; j++)
  1069. {
  1070. Map[i][j] = ' ';
  1071. }
  1072. }
  1073. else if (Buf[i] > W - )
  1074. {
  1075. int temp = Buf[i] % W - ;
  1076. for (int j = ; j < temp; j++)
  1077. {
  1078. Map[i][j] = '@';
  1079. }
  1080. }
  1081. else
  1082. {
  1083. for (int j = ; j < Buf[i]; j++)
  1084. {
  1085. Map[i][j] = '@';
  1086. }
  1087. }
  1088. Map[H - ][W - ] = ;
  1089. }
  1090. DB->Begin(Map, W);
  1091. ATA->GetAudioStreamData(ATA->GetCurPlayMusic(), Buf);
  1092. for (int i = ; i < H; i++)
  1093. {
  1094. if (Buf[i] <= )
  1095. {
  1096. for (int j = ; j < W; j++)
  1097. {
  1098. Map[i][j] = ' ';
  1099. }
  1100. }
  1101. else if (Buf[i] > W - )
  1102. {
  1103. int temp = Buf[i] % W - ;
  1104. for (int j = ; j < temp; j++)
  1105. {
  1106. Map[i][j] = '@';
  1107. }
  1108. }
  1109. else
  1110. {
  1111. for (int j = ; j < Buf[i]; j++)
  1112. {
  1113. Map[i][j] = '@';
  1114. }
  1115. }
  1116. Map[H - ][W - ] = ;
  1117. }
  1118. DB->End(Map, W);
  1119. for (int i = ; i < H; i++)
  1120. {
  1121. for (int j = ; j < W; j++)
  1122. {
  1123. Map[i][j] = ;
  1124. }
  1125. }
  1126.  
  1127. }
  1128.  
  1129. delete[] Map;
  1130. Map = NULL;
  1131. }
  1132.  
  1133. class CodeChange
  1134. {
  1135. public:
  1136. void wcharTochar(char *Buf, const wchar_t* wchar)
  1137. {
  1138. int len = WideCharToMultiByte(CP_ACP, , wchar, wcslen(wchar), NULL, , NULL, NULL);
  1139. WideCharToMultiByte(CP_ACP, , wchar, wcslen(wchar), Buf, len, NULL, NULL);
  1140. }
  1141. void charToWchar(wchar_t *buf, const char* cchar)
  1142. {
  1143. int len = MultiByteToWideChar(CP_ACP, , cchar, strlen(cchar), NULL, );
  1144. MultiByteToWideChar(CP_ACP, , cchar, strlen(cchar), buf, len);
  1145. }
  1146. void UTF_8ToWchar(char *buf, const char* UTF_8)
  1147. {
  1148. int wcsLen = ::MultiByteToWideChar(CP_UTF8, NULL, UTF_8, strlen(UTF_8), NULL, );
  1149. wchar_t wszString[] = { };
  1150. ::MultiByteToWideChar(CP_UTF8, NULL, UTF_8, strlen(UTF_8), wszString, wcsLen);
  1151. wszString[wcsLen] = '\0';
  1152. wcharTochar(buf, wszString);
  1153. }
  1154. void UnicodeToUTF_8(char *buf, const wchar_t* unicode)
  1155. {
  1156. int len = WideCharToMultiByte(CP_UTF8, , unicode, -, NULL, , NULL, NULL);
  1157. WideCharToMultiByte(CP_UTF8, , unicode, -, buf, len, NULL, NULL);
  1158. }
  1159. };
  1160.  
  1161. //char Buf[61] = " ‪‏‪‪‏​‌‎‫‏⁠‌‪‬‌‎‮‬‮‎‍‌‭‏";
  1162.  
  1163. typedef struct _smPROCESSINFO
  1164. {
  1165. DWORD dwPID;
  1166. DWORD dwParentPID;
  1167. DWORD dwSessionID;
  1168. DWORD dwPEBBaseAddress;
  1169. DWORD dwAffinityMask;
  1170. LONG dwBasePriority;
  1171. LONG dwExitStatus;
  1172. BYTE cBeingDebugged;
  1173. TCHAR szImgPath[MAX_PATH];
  1174. TCHAR szCmdLine[MAX_PATH];
  1175. } smPROCESSINFO;
  1176.  
  1177. typedef NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE ProcessHandle, int ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength);
  1178.  
  1179. //NTSTATUS NtQueryInformationProcess(HANDLE ProcessHandle, int ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength)
  1180. //{
  1181. //
  1182. //}
  1183.  
  1184. int Main()
  1185. {
  1186.  
  1187. //提权
  1188. HANDLE hToken = nullptr;
  1189. //打开进程访问令牌
  1190. BOOL ret = OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &hToken);
  1191. if (!ret) { GetLastError(); }
  1192. //查看系统的权限的特权
  1193. LUID luid;
  1194. ret = LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid);
  1195. if (!ret) { GetLastError(); }
  1196.  
  1197. //调整访问令牌特权值
  1198. TOKEN_PRIVILEGES tkp;
  1199. tkp.PrivilegeCount = ;
  1200. tkp.Privileges[].Attributes = SE_PRIVILEGE_ENABLED;
  1201. tkp.Privileges[].Luid = luid;
  1202.  
  1203. TOKEN_PRIVILEGES last;
  1204. DWORD l = sizeof(last);
  1205. //last 为原来的 可以为NULL;
  1206. ret = AdjustTokenPrivileges(hToken, FALSE, &tkp, sizeof(tkp), &last, &l);
  1207. if (!ret) { GetLastError(); }
  1208.  
  1209. //通过进程名获取进程句柄
  1210. HANDLE hProcess = nullptr;
  1211. //lsass.exe
  1212. //某个进程
  1213. const char *szProcessName = "";
  1214.  
  1215. //windows 未公开的函数
  1216. //NtQueryInformationProcess()// in ntdll.dll
  1217.  
  1218. pNtQueryInformationProcess NtQueryInformationProcess = (pNtQueryInformationProcess)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtQueryInformationProcess");
  1219.  
  1220. //进程遍历
  1221. for (DWORD ID = ; ID < ; ID++)
  1222. {
  1223. HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ID);
  1224. if (handle != NULL && handle != nullptr)
  1225. {
  1226. wchar_t buf[MAX_PATH] = { };
  1227. DWORD retlen = ;
  1228. NTSTATUS ret = NtQueryInformationProcess(handle, , buf, sizeof(buf),&retlen);
  1229. if (!ret)
  1230. {
  1231. //L"\\Device\\HarddiskVolume2\\Windows\\SysWOW64\\cmd.exe"
  1232. wchar_t *Buf = (wchar_t*)((char*)buf + );
  1233. if (wcsstr(Buf, L"\\lsass.exe"))
  1234. {
  1235. hProcess = handle;
  1236. break;
  1237. }
  1238. }
  1239. }
  1240. }
  1241.  
  1242. //判断系统版本
  1243. OSVERSIONINFOA VI = { };
  1244. VI.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
  1245. LPOSVERSIONINFOA VersionInfo = &VI;
  1246. ret = GetVersionEx(VersionInfo);
  1247. if (!ret) { GetLastError(); }
  1248. printf("当前系统版本:%d.%d\n",VI.dwMajorVersion,VI.dwMinorVersion);
  1249.  
  1250. //获取解密函数的地址
  1251. /*
  1252. 微软打了这个补丁 在部分win7 是可以的
  1253. */
  1254. HMODULE hLsasrv = LoadLibrary("lsasrv.dll");
  1255. { GetLastError(); }
  1256.  
  1257. system("pause");
  1258. return ;
  1259. }
  1260.  
  1261. //#include <iostream>
  1262. //#include <conio.h>
  1263. //using namespace std;
  1264. //
  1265. //
  1266. //void are7(int(&arr)[3][4]); //引用的方式
  1267. //void are6(int(*arr)[3][4]); //二维数组指针的方式
  1268. //void are5(int *arr, int, int); //一维指针方式
  1269. //void are4(int **arr, int, int); //动态分配
  1270. //void are3(int(*arr)[4], int); //传入高
  1271. //void are2(int arr[][4], int); //传入高
  1272. //void are1(int arr[][4]); //高不用填,但一定要一个列
  1273. //
  1274. //int main()
  1275. //{
  1276. // //int arr2[3][4] = {
  1277. // // { 1, 2, 3 },
  1278. // // { 4, 5, 6, 7 },
  1279. // // { 8, 9, 10, 11 },
  1280. // //};
  1281. // //are1(arr2);//二维数组直接传递,退化为指针
  1282. // //are2(arr2, 3);
  1283. // //are3(arr2,3);
  1284. // //int *p = &arr2[0][0];
  1285. // //are4(&p, 3, 4);
  1286. // //are5((int*)arr2,3,4);
  1287. // //are5(arr2[0],3,4);
  1288. // //are6(&arr2);
  1289. // //are7(arr2);
  1290. // system("pause");
  1291. // return 0;
  1292. //}
  1293. //void are1(int arr[][4])
  1294. //{
  1295. // for (int i = 0; i < 3; i++)
  1296. // {
  1297. // for (int j = 0; j < 4; j++)
  1298. // {
  1299. // cout << arr[i][j] << " ";
  1300. // }
  1301. // cout << endl;
  1302. // }
  1303. //}
  1304. //void are2(int arr[][4], int len)
  1305. //{
  1306. // for (int i = 0; i < len; i++)
  1307. // {
  1308. // for (int j = 0; j < 4; j++)
  1309. // {
  1310. // cout << arr[i][j] << " ";
  1311. // }
  1312. // cout << endl;
  1313. // }
  1314. //}
  1315. //void are3(int(*arr)[4], int len)
  1316. //{
  1317. // for (int i = 0; i < len; i++)
  1318. // {
  1319. // for (int j = 0; j < 4; j++)
  1320. // {
  1321. // std::cout << arr[i][j] << " ";
  1322. // }
  1323. // std::cout << std::endl;
  1324. // }
  1325. //}
  1326. //void are4(int **arr, int len, int row)
  1327. //{
  1328. // arr = new int*[len];
  1329. // for (int i = 0; i < len; i++)
  1330. // {
  1331. // arr[i] = new int[row];
  1332. // }
  1333. // for (int i = 0; i < len; i++)
  1334. // {
  1335. // for (int j = 0; j < row; j++)
  1336. // {
  1337. // std::cout << arr[i][j] << " ";
  1338. // }
  1339. // std::cout << std::endl;
  1340. // }
  1341. //}
  1342. //void are5(int *arr, int len, int row)
  1343. //{
  1344. // for (int i = 0; i < len; i++)
  1345. // {
  1346. // for (int j = 0; j < row; j++)
  1347. // {
  1348. // std::cout << arr[j + i * row] << " ";
  1349. // }
  1350. // std::cout << std::endl;
  1351. // }
  1352. //}
  1353. //void are6(int(*arr)[3][4])
  1354. //{
  1355. // for (int i = 0; i < 3; i++)
  1356. // {
  1357. // for (int j = 0; j < 4; j++)
  1358. // {
  1359. // std::cout << (*arr)[i][j] << " ";
  1360. // }
  1361. // std::cout << std::endl;
  1362. // }
  1363. //}
  1364. //void are7(int(&arr)[3][4])
  1365. //{
  1366. // for (int i = 0; i < 3; i++)
  1367. // {
  1368. // for (int j = 0; j < 4; j++)
  1369. // {
  1370. // std::cout << arr[i][j] << " ";
  1371. // }
  1372. // std::cout << std::endl;
  1373. // }
  1374. //}

Windows 获取windows密码的更多相关文章

  1. 通过PowerShell获取Windows系统密码Hash

    当你拿到了系统控制权之后如何才能更长的时间内控制已经拿到这台机器呢?作为白帽子,已经在对手防线上撕开一个口子,如果你需要进一步扩大战果,你首先需要做的就是潜伏下来,收集更多的信息便于你判断,便于有更大 ...

  2. 获取windows凭证管理器明文密码

    1.运行cmdkey /list查看windows保存凭证 方法1.mimikaz mimikatz vault::cred 2.利用powershell尝试获取 windows 普通凭据类型中的明文 ...

  3. [源码]一键获取windows系统登陆密码vc6版源码

    [源码]一键获取windows系统登陆密码vc6版源码支持:XP/2000/2003/WIN7/2008等 此版本编译出来的程序体积较小几十KB... 而vs版则1点几M,体积整整大了2-30倍对某些 ...

  4. 转:获取windows凭证管理器明文密码

    1.运行cmdkey /list查看windows保存凭证 方法1.mimikaz mimikatz vault::cred 2.利用powershell尝试获取 windows 普通凭据类型中的明文 ...

  5. meterpreter中使用mimikatz获取windows密码

    进去meterpreter后getuid一下 这获得系统管理员权限 开始 加载mimikatz模块 load mimikatz 加载成功. 第一种方法: 获取登录密码的hash值 msv 上面已经是得 ...

  6. Redis For Windows安装及密码

    启动要先开启一个控制台作为服务端,启动服务,然后在重新打开一个控制台,连接服务进行操作. redis-server.exe redis.conf 重新打开一个控制台,刚开始连接服务,因为初始没有密码, ...

  7. c++ windows 获取mac地址

    c++ windows 获取mac地址 GetAdaptersInfo 用windows api获取mac地址和硬盘id编号 aa

  8. [C语言](二)01 获取Windows图形构件大小信息

    SYSMETS.c #include <windows.h> #include "SYSMETS.H"//自定义的单元,所以用"",不是用<& ...

  9. C# 获取windows特殊路径

    虽然是古老的问题,最近用到这个,查一下还不少东东呐 一.使用Environment.SpecialFolder 该方法最简单,直接使用即可,只是提供的特殊路径比较少. (1)使用方法:string p ...

随机推荐

  1. webpack第一节(2)

    安装webpack在文件夹中 安装完成如图所示 牛刀小试 在webpack-test根目录下新建一个hello.js (不新建在node-modules文件夹下面的目的是,该文件夹是webpack的依 ...

  2. linux修改Jvm内存限制

    一.直接通过java 命令去执行class文件的时候,也可以设置JVM参数,eg : java -Xms512m -Xmx1024m HelloWorld在cmd中设置,也必须是执行java命令时 堆 ...

  3. Jquery中的offset()和position()深入剖析(元素定位)

    先看看这两个方法的定义. offset(): 获取匹配元素在当前视口的相对偏移. 返回的对象包含两个整形属性:top 和 left.此方法只对可见元素有效. position(): 获取匹配元素相对父 ...

  4. C#的一些代码

    form读取配置文件 /// <summary> /// 读取配置文件 /// </summary> /// <param name="key"> ...

  5. 【leetcode】835. Image Overlap

    题目如下: 解题思路:抛开移动的过程只看移动完成的结果,记图片左上角为顶点,正方形边长为board,要使得两个图片要有重叠,那么一定其中一张图片的顶点和另外一张图片的某一个点重合.假设图片A的顶点A( ...

  6. Java排序算法 [选择、冒泡、快排]

    选择排序: 简述:从数组的第一个元素开始,依次与其他所有的元素对比,如果比自身大或小(取决于升序或降序)交换位置. package com.sort; import java.util.Arrays; ...

  7. LA 3971 Assemble(二分)

    题目: 给你b元钱,让你组装一台电脑,有n个配件,属性有 种类 名字 价格 品质,每种类型选至少一个,并且最小品质最大.输出这个最大的最小品质. 白书上说了,最小值最大的问题一般是二分来求解答案.在这 ...

  8. BZOJ 2839: 集合计数(二项式反演)

    传送门 解题思路 设\(f(k)\)为交集元素个数为\(k\)的方案数.发现我们并不能直接求出\(f(k)\),就考虑容斥之类的东西,容斥首先要扩大限制,再设\(g(k)\)表示至少有\(k\)个交集 ...

  9. IDEA2019.1.3最新破解方式

    版本2019.1.3 1.下载破解JAR,放入IDEA的bin文件夹中     链接:https://pan.baidu.com/s/1N1BHeJ0-mmFIWbrh5h4k-g     提取码:g ...

  10. PHP【Laravel】delayer基于redis的实现订单超时改变状态

    实现这个功能前你需要知道以下,不然可能会比较吃力:1.服务器的计划任务,shell脚本,或者你有宝塔自带的计划任务会方便很多.2.有所了解Redis.3.会写PHP业务逻辑. 好了进入在正题,这里使用 ...