#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;
}
时间: 2024-12-28 15:53:06