VC系统扫雷游戏外挂源代码程序下载(转帖)
2008-03-04 10:25

经过了多次测试写出了历史上第一个有点意义的MFC程序。效果差强人意。^_^

CODE:
// CrackWinmineDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CrackWinmine.h"
#include "CrackWinmineDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
   // No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/
// CCrackWinmineDlg dialog

CCrackWinmineDlg::CCrackWinmineDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCrackWinmineDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCrackWinmineDlg)
m_searchstats = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CCrackWinmineDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCrackWinmineDlg)
DDX_Control(pDX, IDC_btnOpen, m_btnOpen);
DDX_Control(pDX, IDC_btnCrack, m_btnCrack);
DDX_Text(pDX, IDC_txtSearchWnd, m_searchstats);
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CCrackWinmineDlg, CDialog)
//{{AFX_MSG_MAP(CCrackWinmineDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_TIMER()
ON_BN_CLICKED(IDC_butAbout, OnbutAbout)
ON_BN_CLICKED(IDC_btnOpen, OnbtnOpen)
ON_BN_CLICKED(IDC_btnCrack, OnbtnCrack)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/
// CCrackWinmineDlg message handlers

BOOL CCrackWinmineDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
   CString strAboutMenu;
   strAboutMenu.LoadString(IDS_ABOUTBOX);
   if (!strAboutMenu.IsEmpty())
   {
    pSysMenu->AppendMenu(MF_SEPARATOR);
    pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
   }
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);    // Set big icon
SetIcon(m_hIcon, FALSE);   // Set small icon

// TODO: Add extra initialization here
int iInstallTimer=SetTimer(1,100,NULL);
if(iInstallTimer==0) MessageBox("无法启动定时器");

return TRUE; // return TRUE unless you set the focus to a control
}

void CCrackWinmineDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
   CAboutDlg dlgAbout;
   dlgAbout.DoModal();
}
else
{
   CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CCrackWinmineDlg::OnPaint()
{
if (IsIconic())
{
   CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
   int cxIcon = GetSystemMetrics(SM_CXICON);
   int cyIcon = GetSystemMetrics(SM_CYICON);
   CRect rect;
   GetClientRect(&rect);
   int x = (rect.Width() - cxIcon + 1) / 2;
   int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
   dc.DrawIcon(x, y, m_hIcon);
}
else
{
   CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CCrackWinmineDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

void CCrackWinmineDlg::OnTimer(UINT nIDEvent)
{

UpdateData();
if(SearchProcess()==NULL)
{
   m_searchstats="游戏未启动";
   m_btnOpen.EnableWindow(true);
   m_btnCrack.EnableWindow(false);
}
else
{
   m_searchstats.Format("启动中,PID:%d",proid);
   m_btnOpen.EnableWindow(false);
   m_btnCrack.EnableWindow(true);
}
UpdateData(false);
CDialog::OnTimer(nIDEvent);
}

void CCrackWinmineDlg::OnCancel()
{

CDialog::OnCancel();
}

void CCrackWinmineDlg::OnbutAbout()
{
CAboutDlg dlg;
dlg.DoModal();

}

bool CCrackWinmineDlg::SearchProcess()
{

hwnd=::FindWindow(NULL,"扫雷");
if(hwnd==NULL) return false;
GetWindowThreadProcessId(hwnd,&proid);
handleProc=OpenProcess(PROCESS_ALL_ACCESS,false,proid);
return true;
}

void CCrackWinmineDlg::OnbtnOpen()
{
if(WinExec("c:\\windows\\system32\\winmine.exe",SW_SHOW)<32)
   MessageBox("你系统没有扫雷游戏!");

}

void CCrackWinmineDlg::OnbtnCrack()
{
CPoint clientp;
GetCursorPos(&clientp);
DWORD ads_minenum=0x1005330;
DWORD ads_minew=0x1005334;
DWORD ads_mineh=0x1005338;
DWORD ads_start=0x1005361;
byte hight,weight,num;

ReadProcessMemory(handleProc,(void *)ads_minenum,&num,1,NULL);
ReadProcessMemory(handleProc,(void *)ads_minew,&weight,1,NULL);
ReadProcessMemory(handleProc,(void *)ads_mineh,&hight,1,NULL);
::ShowWindow(hwnd,SW_RESTORE);
::SetForegroundWindow(hwnd);
// return;
CRect rect;
CPoint point;
::GetClientRect(hwnd,&rect);
point.x=rect.left+20;
point.y=rect.top+60;
::ClientToScreen(hwnd,&point);
INPUT lbutton[2],rbutton[2];
ZeroMemory(&lbutton,sizeof(INPUT)*2);
ZeroMemory(&rbutton,sizeof(INPUT)*2);
lbutton[0].type=INPUT_MOUSE;
rbutton[0].type=INPUT_MOUSE;
lbutton[1].type=INPUT_MOUSE;
rbutton[1].type=INPUT_MOUSE;
lbutton[0].mi.dwFlags=MOUSEEVENTF_LEFTDOWN;
lbutton[1].mi.dwFlags=MOUSEEVENTF_LEFTUP;
rbutton[0].mi.dwFlags=MOUSEEVENTF_RIGHTDOWN;
rbutton[1].mi.dwFlags=MOUSEEVENTF_RIGHTUP;

int line,row;
for(row=0;row<hight;row++)
   for (line=0;line<weight;line++)
   {
    byte value;
    ReadProcessMemory(handleProc,(void *)(ads_start+row*32+line),&value,1,NULL);
    SetCursorPos(point.x+line*16,point.y+row*16);
    if(value==0x8f)
    {

SendInput(2,rbutton,sizeof(INPUT));
    }
    if(value!=0x40)
    {

SendInput(2,lbutton,sizeof(INPUT));
    }
   }
SetCursorPos(clientp.x,clientp.y);
CloseHandle(handleProc);

}

转载于:https://www.cnblogs.com/mazhenyu/archive/2009/06/04/1496138.html

VC系统扫雷游戏外挂源代码程序下载(转帖相关推荐

  1. 「 硬核教学」 ❤️ C语言编写扫雷游戏外挂❤️「 完整源码」

    目录 第一步:使用CE找出棋盘的基址 第二步:使用CE/OD查看该地址的数据 第三步:对比棋盘分析数据的含义 第四步:验证猜想 第五步:编写功能 有没有羡慕学霸们在机房里 潇洒如意地玩着扫雷无限通关, ...

  2. Python 扫雷游戏 完整源代码+图片素材

    代码的下载地址 截图 设计需求 基础功能 实现windows扫雷游戏初级的所有功能 扫雷尺寸99 方格 每个方格尺寸3030 游戏初始化时,随机分布10个地雷 当左键点击雷区任意方格时,则游戏开始 鼠 ...

  3. 简易扫雷游戏c语言程序,C++实现简单的扫雷游戏(控制台版)

    C++新手的代码,请各位多包涵. 用C++写的一个简单的控制台版扫雷游戏.玩家通过输入方块的坐标来翻开方块. 只是一个雏形,能够让玩家执行翻开方块的操作并且判断输赢,还未添加标记方块.游戏菜单.记录游 ...

  4. python扫雷游戏设计_Python 扫雷游戏 完整源代码+图片素材

    设计需求 基础功能 实现windows扫雷游戏初级的全部功能 扫雷尺寸99 方格 每一个方格尺寸3030 游戏初始化时,随机分布10个地雷 当左键点击雷区任意方格时,则游戏开始 鼠标左键点击为翻开方格 ...

  5. JS实现扫雷游戏(源代码带注释)

    运行结果: 超级简单,下面直接下面贴上源代码,一共两个文件  扫雷.html 和 saolei.js 扫雷.html  <!DOCTYPE html> <html lang=&quo ...

  6. 基于颜色特征的图像匹配MATLAB,基于颜色特征的图像检索系统 这是个MATLAB程序 - 下载 - 搜珍网...

    压缩包 : 基于颜色特征的图像检索系统.rar 列表 基于颜色特征的图像检索系统\007.bmp 基于颜色特征的图像检索系统\01.bmp 基于颜色特征的图像检索系统\011.BMP 基于颜色特征的图 ...

  7. 5*6的扫雷游戏的MATLAB程序(随机布雷与显示雷数部分)

    1.本程序是为解答QQ群里网友问题而写的 2.代码 clear clc%建立随机的5*6布雷矩阵,雷数为9a=zeros(5,6); %布雷矩阵的预设 while length(find(a))< ...

  8. 扫雷游戏软件测试,暑期社会实践 | 扫雷游戏的测试完善及总结

    原标题:暑期社会实践 | 扫雷游戏的测试完善及总结 在程序的前期准备和代码功能实现的基础上,信息工程学院扫雷少女101团队成员针对已具备基本雏形的扫雷游戏进行全方位仔细的测试,来发现程序现有或是未知的 ...

  9. 游戏外挂的原理及制作 (1)

    转载自: http://www.hackbase.com/tech/2009-09-22/56303.html 在几年前我看到别人玩网络游戏用上了外挂,做为程序员的我心里实在是不爽,想搞清楚这到底是怎 ...

最新文章

  1. SpiderData 2019年2月13日 DApp数据排行榜
  2. [原][osg]osgconv浅析
  3. 清理 zabbix 历史数据, 缩减 mysql 空间
  4. Linux 数据流重定向
  5. 计算机软件不是出租的主要标的时著作权,著作权中出租权的适用对象有哪些?...
  6. C#中调用SSIS包的问题
  7. Windows services相关命令
  8. springcloud工作笔记104---Spring中的InitializingBean接口以及afterPropertiesSet的使用
  9. 声学计算机软件,常用声学仿真软件汇总
  10. 学习:对抗神经网络 - 恶意软件
  11. 我的她 —— 记我的 IBM R51
  12. 微信多开源码 android,微信(WeChat)电脑端多开分析+源码
  13. 股票学习-量柱和k线-第三天
  14. inux下服务器心跳集群脚本
  15. python判断人生阶段
  16. 中国首届微博开发者大会杨卫华演讲
  17. LM358集成运算放大器的简易测量
  18. 让Win11系统更好用的几个设置
  19. Powershell知识点1:开启脚本限制 报错:无法加载文件,因为在此系统中禁止执行脚本
  20. 10038 mysql windows_解决mysql 远程连接出现10038

热门文章

  1. 推荐華麗の真実的小说《The★Sakuray》
  2. java不同垃圾回收器_细述 Java垃圾回收机制→Types of Java Garbage Collectors
  3. vba 提取 json某个值_Excel中提取不重复值的方法汇总(5种基础+VBA+1个自定义函数)...
  4. python 动态规划_DP动态规划(Python实现)
  5. date oracle 显示毫秒_Oracle date timestamp 毫秒 - 时间函数总结
  6. mysql zero fill_mysql zerofill 的使用
  7. centos卸载内核_CentOS 中内核模块的加载和卸载
  8. hadoop学习6 运行map reduce出错
  9. 研一寒假02-指针_new分配内存_使用new来创建动态数组_使用动态数组_使用delete来释放new分配的内存...
  10. Javascript-Switch