`
jerry1985
  • 浏览: 30367 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

windows自带扫雷外挂代码(c语言)

c 
阅读更多
windows自带扫雷外挂代码(c语言)
其中几个重要的数值是从网络查询的来,让我省去了很多繁琐的步骤。
现在把代码贴出来备份一下。

#include <windows.h>
#include <stdio.h>

int main()
{
	DWORD processId;
	HWND hWnd;
	HANDLE hProcess;

	DWORD dwAddrA;	
	DWORD dwAddrB;

	int i;
	DWORD j;

	BYTE bRead;
	BYTE bWrite = 0x8e;

	dwAddrA = 0x1005361;
	dwAddrB = 0x1005361 + 30;

	hWnd = FindWindow(NULL, "扫雷");
	if(hWnd == NULL)
	{
		printf("can not find window!\n");
		return 0;
	}
	GetWindowThreadProcessId(hWnd, &processId);
	printf("%d", processId);
	hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processId);
	if(hProcess == NULL)
	{
		printf("error!\n");
		return 0;
	}

	for(i = 0; i < 16; i++)
	{
		for(j = dwAddrA; j < dwAddrB; j++)
		{
			if(ReadProcessMemory(hProcess, (LPVOID)j, &bRead, 1, NULL))
			{
				printf("%x\n", bRead);
				if(bRead == 0x8f)
				{
					printf("write memory\n");
					WriteProcessMemory(hProcess, (LPVOID)j, &bWrite, 1, NULL);
				}
			}
		}
		dwAddrA = dwAddrA + 32;
		dwAddrB = dwAddrB + 32;
	}

	ShowWindow(hWnd, SW_MINIMIZE);
	ShowWindow(hWnd, SW_SHOWNORMAL);
	
	return 1;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics