当前位置:编程学习 > C/C++ >>

扫雷外挂

作者: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;

}

补充:软件开发 , C语言 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,