【源码备份】XP下扫雷外挂

;--------------------------------------------------------------------------------
;数据段
;--------------------------------------------------------------------------------
		.386
		.model flat, stdcall
		option casemap: none

include		MineKiller.inc

		.const
szWindowName	db	"扫雷", 0
szError		db	"未运行扫雷游戏,是否运行?", 0
szFileName	db	"C:\WINDOWS\system32\winmine.exe", 0
szCannotOpen	db	"无法打开扫雷进程", 0


		.data?
hInstance	dd	?
hWinMain	dd	?
hWinMine	dd	?		;扫雷窗口句柄
dwProcessID	dd	?		;扫雷进程ID
hProcess	dd	?		;扫雷进程句柄
lineMax		dd	?
columnMax	dd	?
unitData	db	1024 dup (?)

;--------------------------------------------------------------------------------
;代码段
;--------------------------------------------------------------------------------
		.code
main:
		invoke	GetModuleHandle, NULL
		mov	hInstance, eax
		invoke	DialogBoxParam, eax, IDD_DLG_MAIN, NULL, offset _ProcMainDlg, NULL
		invoke	ExitProcess, eax
;--------------------------------------------------------------------------------


;--------------------------------------------------------------------------------
;主窗口回调函数
;--------------------------------------------------------------------------------
_ProcMainDlg	proc	uses ebx hWnd:HWND, wMsg:UINT, wParam:WPARAM, lParam:LPARAM
		
		mov	eax, wMsg
		.if	eax == WM_CLOSE
			invoke	EndDialog, hWnd, NULL
		.elseif	eax == WM_INITDIALOG
			push	hWnd
			pop	hWinMain
			invoke	LoadIcon, hInstance, ICO_MAIN
			invoke	SendMessage, hWinMain, WM_SETICON, ICON_BIG, eax
		.elseif	eax == WM_COMMAND
			mov	eax, wParam
			mov	edx, eax
			shr	edx, 16
			movzx	eax, ax
			.if	edx == BN_CLICKED
				.if	eax == IDC_BTN1
					push	ecx
					invoke	CreateThread, NULL, 0, offset _GetMineInfo, NULL, 0, esp
					pop	ecx
				.endif
			.endif
		.else
			mov	eax, FALSE
			ret
		.endif
		
		mov	eax, TRUE
		ret
		
_ProcMainDlg	endp

;--------------------------------------------------------------------------------
;读取扫雷进程内存
;--------------------------------------------------------------------------------
_GetMineInfo	proc
	
	LOCAL	@rect:RECT
	
		;禁用按钮
		invoke	GetDlgItem, hWinMain, IDC_BTN1
		invoke	EnableWindow, eax, FALSE
@@:
		invoke	FindWindow, NULL, offset szWindowName
		.if	!eax
			invoke	MessageBox, NULL, offset szError, NULL, MB_YESNO
			.if	eax == IDYES
				invoke	ShellExecute, NULL, NULL, addr szFileName, NULL, NULL, SW_SHOWNORMAL
				invoke	Sleep, 100
				jmp	@B
			.else
				ret
			.endif
		.endif
		mov	hWinMine, eax
		invoke	GetWindowThreadProcessId, eax, offset dwProcessID
		invoke	OpenProcess, PROCESS_ALL_ACCESS, FALSE, dwProcessID
		.if	!eax
			invoke	MessageBox, NULL, offset szCannotOpen, NULL, MB_OK or MB_ICONSTOP
			ret
		.endif
		mov	hProcess, eax
		invoke	ReadProcessMemory, eax, 01005334h, offset lineMax, sizeof dword, NULL
		invoke	ReadProcessMemory, hProcess, 01005338h, offset columnMax, sizeof dword, NULL
		invoke	ReadProcessMemory, hProcess, 01005340h, offset unitData, 32 * 32, NULL
		invoke	CloseHandle, hProcess		;为何??????
		
		invoke	GetClientRect, hWinMain, addr @rect
		invoke	ClientToScreen, hWinMain, addr @rect
		invoke	ClientToScreen, hWinMain, addr @rect + 2 * sizeof DWORD
		invoke	ClipCursor, addr @rect
		
		push	columnMax
		.while	columnMax > 0
			push	lineMax
			.while	lineMax > 0
				;计算坐标
				mov	edx, columnMax
				shl	edx, 4
				add	edx, 44
				shl	edx, 16
				mov	eax, lineMax
				shl	eax, 4
				add	eax, 6
				add	edx, eax
				
				
				mov	eax, columnMax
				shl	eax, 5
				add	eax, lineMax
				.if	byte ptr unitData[eax] & 80h
					;push	edx
					;invoke	SendMessage, hWinMine, WM_RBUTTONDOWN, MK_RBUTTON, edx
					;pop	edx
					;invoke	SendMessage, hWinMine, WM_RBUTTONUP, MK_RBUTTON, edx
					;invoke	Sleep, 20
				.else
					push	edx
					invoke	SendMessage, hWinMine, WM_LBUTTONDOWN, MK_LBUTTON, edx
					pop	edx
					invoke	SendMessage, hWinMine, WM_LBUTTONUP, MK_LBUTTON, edx
					invoke	Sleep, 20
				.endif
				
				dec	lineMax
			.endw
			pop	lineMax
			dec	columnMax
		.endw
		pop	columnMax
		
		;启用按钮
		invoke	GetDlgItem, hWinMain, IDC_BTN1
		invoke	EnableWindow, eax, TRUE
		;释放鼠标
		invoke	ClipCursor, NULL
		
		ret

_GetMineInfo endp

;5361-555E

;--------------------------------------------------------------------------------
;快速扫雷程序
;--------------------------------------------------------------------------------


end	main

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值