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;
}