游戏内存修改器原理
#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;
}
IMIDC是一家香港本土运营商,商家名为彩虹数据(Rainbow Cloud),全线产品自营,自有IP网络资源等,提供的产品包括VPS主机、独立服务器、站群独立服务器等,数据中心区域包括香港、日本、台湾、美国和南非等地机房,CN2网络直连到中国大陆。目前主机商针对日本独立服务器做促销活动,而且提供/28 IPv4,国内直连带宽优惠后每月仅88美元起。JP Multiple IP Customize...
racknerd发表了2021年美国独立日的促销费用便宜的vps,两种便宜的美国vps位于洛杉矶multacom室,访问了1Gbps的带宽,采用了solusvm管理,硬盘是SSDraid10...近两年来,racknerd的声誉不断积累,服务器的稳定性和售后服务。官方网站:https://www.racknerd.com多种加密数字货币、信用卡、PayPal、支付宝、银联、webmoney,可以付...
pia云怎么样?pia云是一家2018的开办的国人商家,原名叫哔哔云,目前整合到了魔方云平台上,商家主要销售VPS服务,采用KVM虚拟架构 ,机房有美国洛杉矶、中国香港和深圳地区,洛杉矶为crea机房,三网回程CN2 GIA,带20G防御。目前,Pia云优惠促销,年付全场8折起,香港超极速CN2季付活动,4核4G15M云服务器仅240元/季起,香港CN2、美国三网CN2深圳BGP优质云服务器超高性...