前几天warisa、foolish一直在玩挖地雷,不亦乐乎!不过他们水平确实很高,想通过正常途径超过他们估计这辈子不可能了,只能走歪门邪道了。今天晚上跟了20分钟,哈哈终于被我跟出时间属性的地址了,公布一下x0100579c,赶紧写了个小东西。恩,果然如有神助,打败了foolish与warisa! 赶紧截个图。
附上代码一小段:
#include ,,windows.h,,
#include ,,stdio.h,,
#include ,,stdlib.h,,
const int addr=0x0100579c; //时间属性地址
const wchar_t* szTitle=L"扫雷";//窗口标题
int main(int argc,char* argv[])
{
HWND hWnd;
HANDLE hProcess=INVALID_HANDLE_VALUE;
DWORD dwProcessId;
DWORD dwSize;
short time=0;
if(argc,,2)
{
printf("USAGE:ModTime [time]..n");
return -1;
}
else if(argc == 2)
{
time=(short)atoi(argv[1]);
}
__try
{
hWnd=::FindWindow(NULL,szTitle);
if(!hWnd)
{
printf("Can not find the game. Error Code:%d..n",GetLastError());
return -1;
}
::GetWindowThreadProcessId(hWnd,&dwProcessId);
if(!dwProcessId)
{
printf("Can not find the process. Error Code:%d..n",GetLastError());
return -1;
}
else
{
printf("Process Id of the game:%d..n",dwProcessId);
}
hProcess=::OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwProcessId);
if(!hProcess)
{
printf("Can not open process. Error Code:%d..n",GetLastError());
return -1;
}
if(!::WriteProcessMemory(hProcess,(LPVOID)addr,&time,2,&dwSize))
{
printf("Can not write process. Error Code:%d..n",GetLastError());
return -1;
}
else
{
printf("Modification succeed! You are the king of this game!..n");
}
}
__finally
{
if(hProcess!=INVALID_HANDLE_VALUE)
CloseHandle(hProcess);
}
return 0;
}