游戏内存修改器原理
#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;
}
TabbyCloud迎来一周岁的生日啦!在这一年里,感谢您包容我们的不足和缺点,在您的理解与建议下我们也在不断改变与成长。为庆祝TabbyCloud运营一周年和七夕节,TabbyCloud推出以下活动。TabbyCloud周年庆&七夕节活动官方网站:https://tabbycloud.com/香港CN2: https://tabbycloud.com/cart.php?gid=16购买链...
如今我们网友可能较多的会选择云服务器、VPS主机,对于虚拟主机的话可能很多人不会选择。但是我们有些外贸业务用途的建站项目还是会有选择虚拟主机的。今天看到的Stablehost 商家虚拟主机在黑五期间也有四折优惠,对于这个服务商而言不是特别的喜欢,虽然他们商家和我们熟悉的老鹰主机商有些类似,且在后来老鹰主机改版和方案后,Stablehost 商家也会跟随改版,但是性价比认为不如老鹰主机。这次黑色星期...
Pia云是一家2018的开办的国人商家,原名叫哔哔云,目前整合到了魔方云平台上,商家主要销售VPS服务,采用KVM虚拟架构 ,机房有美国洛杉矶、中国香港和深圳地区,洛杉矶为crea机房,三网回程CN2 GIA,带20G防御,常看我测评的朋友应该知道,一般带防御去程都是骨干线路,香港的线路也是CN2直连大陆,目前商家重新开业,价格非常美丽,性价比较非常高,有需要的朋友可以关注一下。活动方案...