#include <stdio.h>
#include <windows.h>
void msgtestOK();
void msgtestNO();
int main()
{
HWND hgame=FindWindow(0,"單機連連看 2.0 官方網址 www.lianliank.com");
if(!hgame)
{
msgtestNO();
}
DWORD procid;
DWORD dwProcessId=GetWindowThreadProcessId(hgame,&procid);
HANDLE hopengameproce=OpenProcess(PROCESS_ALL_ACCESS,FALSE,procid);
int iTishi;
ReadProcessMemory(hopengameproce,(LPCVOID)0x0012FE84,(LPCVOID *)&iTishi,4,NULL);
printf("提示次數:%d\n",iTishi);
int iTime ;
ReadProcessMemory(hopengameproce,(LPCVOID)0x0012F49C,(LPCVOID *)&iTime,4,NULL);
printf("時間剩餘:%d\n",iTime);
int itemp = 200 ;
while (1)
{
WriteProcessMemory(hopengameproce,(LPVOID)0x0012FE84,(void *)&itemp,4,NULL);
printf("提示無限開啓!\n");
WriteProcessMemory(hopengameproce,(LPVOID)0x0012F49C,(void *)&itemp,4,NULL);
printf("時間無限開啓!\n");
Sleep(3000);
system("cls");
}
return 0;
}
void msgtestNO()
{
MessageBox(NULL,"失敗","msgtestOK",0);
}
void msgtestOK()
{
MessageBox(NULL,"成功","msgtestOK",0);
}
自己寫了一個連連看外掛程序,瞭解而已,入門很好的。