游戏内存修改器原理
#include "stdafx.h"
#include <windows.h>
#include <tchar.h>
DWORD g_arList[1024] ;int g_nListCnt;
HANDLE g_hProcess;
BOOL Wr iteMemory(DWORD dwAddr, DWORD dwValue) ;void ShowList(void) ;
BOOL CompareAPage(DWORD dwBaseAddr, DWORD dwValue) ;BOOL FindNext(DWORD dwValue) ;
BOOL FindFirst(DWORD dwValue) ;
BOOL FindFirst(DWORD dwValue)
{const DWORD dwOneGB = 1024 * 1024 * 1024;const DWORD dwOnePage = 4 * 1024;if (NULL == g_hProcess)
{return FALSE;
}
DWORD dwBase;
OSVERSIONINFO vi = {si zeof(vi) } ;
: :GetVersionEx(&vi) ;i f (VER_PLATFORM_WIN32_WINDOWS == vi.dwPlatformI d){dwBase = 4 * 1024 * 1024;
}else
{dwBase = 640 * 1024;
}
f or (; dwB as e < 2 * dwOne GB; dwBas e += dwOneP age)
{
CompareAPage(dwBase, dwVa lue) ;
}return TRUE;
}
BOOL CompareAPage(DWORD dwBaseAddr, DWORD dwValue)
{
BYTE arBytes[4096] ;if ( ! : :ReadProcessMemory(g_hProcess, (LPVOID)dwBaseAddr,arBytes, 4096, NULL))
{return FALSE;
}
DWORD* p dw = NUL L;int i = 0;for (i = 0; i < (int)4 * 1024 -3; i++)
{p dw = (DWO RD*)&arBy t e s[i] ;i f (pdw[0] == dwVal ue)
{if (g_nListCnt >= 1024)
{return FALSE;
}g_arList[g_nListCnt++] = dwBaseAddr + i ;
}
}return TRUE;
}void ShowList(void)
{int i;for (i = 0; i < g_nListCnt; i++)
{printf("%08lX/n", g_arList[i]) ;
}
}
BOOL FindNext(DWORD dwValue)
{int nOrgCnt = g_nListCnt;g_nListCnt = 0;
BOOL bRet = FALSE;
DWORD dwReadValue;int i;f or (i = 0; i < nOrgCnt; i++)
{if ( : :ReadProcessMemory(g_hProcess,
(LPVOID)g_arL i st[i] , &dwReadVal ue, s i ze of(DWORD) , NULL))
{i f (dwReadVal ue == dwValue)
{g_arList[g_nListCnt++] = g_arLi st[i] ;bRet = TRUE;
}
}
}return bRet;
}
BOOL Wr iteMemory(DWORD dwAddr, DWORD dwValue)
{return : :WriteProcessMemory(g_hProcess, (LPVOID)dwAddr,
&dwValue, s i z eof(DWORD) , NULL) ;
}int main(int argc, char* argv[] )
{
TCHAR szFileName[] =_T(". ./Debug/Testor0. exe") ;
STARTUPINFO s i = {s izeof(si) } ;
PROCESS_INFORMAT ION pi ;
: :CreateProcess(NULL, szFileName, NULL, NULL, FALSE,C REATE_NEW_CONSOLE, NULL, NULL, &s i, π) ;
: :CloseHandle(pi.hThread) ;g_hProcess = pi.hProcess;int iVal;printf("Input val = ") ;scanf("%d", &iVal) ;
FindFirst(iVal) ;
ShowLi s t() ;if (g_nListCnt > 1)
{printf("Input val = ") ;scanf("%d", &iVal) ;
FindNext(iVal) ;
ShowLi s t() ;
}printf("New value = ") ;scanf("%d", &iVal) ;if (WriteMemory(g_arLi st[0], iVal) )
{printf("Write data success./n") ;
}
: :Cl oseHandle(g_hProce ss) ;return 0;
}
点击进入亚云官方网站(www.asiayun.com)公司名:上海玥悠悠云计算有限公司成都铂金宿主机IO测试图亚洲云Asiayun怎么样?亚洲云Asiayun好不好?亚云由亚云团队运营,拥有ICP/ISP/IDC/CDN等资质,亚云团队成立于2018年,经过多次品牌升级。主要销售主VPS服务器,提供云服务器和物理服务器,机房有成都、美国CERA、中国香港安畅和电信,香港提供CN2 GIA线路,CE...
最近发现一个比较怪异的事情,在访问和登录大部分国外主机商和域名商的时候都需要二次验证。常见的就是需要我们勾选判断是不是真人。以及比如在刚才要访问Namecheap检查前几天送给网友域名的账户域名是否转出的,再次登录网站的时候又需要人机验证。这里有看到"Attention Required"的提示。我们只能手工选择按钮,然后根据验证码进行选择合适的标记。这次我要选择的是船的标识,每次需要选择三个,一...
WHloud Official Notice(鲸云官方通知)(鲸落 梦之终章)]WHloud RouMu Cloud Hosting若木产品线云主机-香港节点上新预售本次线路均为电信CN2 GIA+移动联通BGP,此机型为正常常规机,建站推荐。本次预售定为国庆后开通,据销售状况决定,照以往经验或有咕咕的可能性,但是大多等待时间不长。均赠送2个快照 2个备份,1个默认ipv4官方网站:https:/...