作者:hellotong88(小童)
#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;
}