游戏内存修改器原理
#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;
}
中秋节快到了,spinservers针对中国用户准备了几款圣何塞机房特别独立服务器,大家知道这家服务器都是高配,这次推出的机器除了配置高以外,默认1Gbps不限制流量,解除了常规机器10TB/月的流量限制,价格每月179美元起,机器自动化上架,一般30分钟内,有基本自助管理功能,带IPMI,支持安装Windows或者Linux操作系统。配置一 $179/月CPU:Dual Intel Xeon E...
云基成立于2020年,目前主要提供高防海内外独立服务器用户,欢迎各类追求稳定和高防优质线路的用户。业务可选:洛杉矶CN2-GIA+高防(默认500G高防)、洛杉矶CN2-GIA(默认带50Gbps防御)、香港CN2-GIA高防(双向CN2GIA专线,突发带宽支持,15G-20G DDoS防御,无视CC)、国内高防服务器(广州移动、北京多线、石家庄BGP、保定联通、扬州BGP、厦门BGP、厦门电信、...
2021年9月中秋特惠优惠促销来源:数脉科技 编辑:数脉科技编辑部 发布时间:2021-09-11 03:31尊敬的新老客户:9月优惠促销信息如下,10Mbps、 30Mbps、 50Mbps、100Mbps香港优质或BGPN2、阿里云线路、华为云线路,满足多种项目需求!支持测试。全部线路首月五折起。数脉官网 https://my.shuhost.com/香港特价数脉阿里云华为云 10MbpsCN...