c语言 扫雷外挂
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c语言 扫雷外挂相关的知识,希望对你有一定的参考价值。
#include <windows.h>
DWORD x = 0;
DWORD m = 0, n = 0;
DWORD addr_a = 0x1005361, addr_b = 0x1005361+29;
BYTE buffer = 0;
BYTE mark = 142;
int main()
{
HWND hWnd = ::FindWindow("扫雷", NULL);
::GetWindowThreadProcessId(hWnd, &x);
HANDLE hProcess = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, x);
if (hProcess == NULL) return 0;
for (n = 0; n < 16; n++)
{
for (m = addr_a; m <= addr_b; m++)
{
::ReadProcessMemory(hProcess, (LPCVOID)m, (LPVOID)&buffer, 1, NULL);
if (buffer == 143) ::WriteProcessMemory(hProcess, (LPVOID)m, &mark, 1, NULL);
}
addr_a += 32;
addr_b += 32;
}
::CloseHandle(hProcess);
::ShowWindow(hWnd, SW_MINIMIZE);
::ShowWindow(hWnd, SW_SHOWNORMAL);
return 0;
}
以上是关于c语言 扫雷外挂的主要内容,如果未能解决你的问题,请参考以下文章