求游戏外挂源代码! RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 其实也很简单我给你看个类你就知道了#include "windows.h"#include "stdio.h"/*************变量声明***************/HANDLE g_hProcess;DWORD g_arList[1024];DWORD g_nListCnt=0;/*************函数声明***************/BOOL FindFirst(DWORD iVal);BOOL CompareAPage(DWORD dwBase,DWORD dwValue);void ShowList();BOOL FindNext(DWORD dwValue);BOOL WriteMemory(DWORD dwAddr,DWORD dwValue);int main(){// char szFileName[]="D:\\game\\连连看.exe";// STARTUPINFO si={sizeof(si)};// PROCESS_INFORMATION pi;// ::CreateProcess(NULL,szFileName,NULL,NULL,FALSE,CREATE_NEW_CONSOLE,NULL,NULL,&si,&pi);// ::CloseHandle(pi.hThread);// g_hProcess=pi.hProcess; DWORD dwProcessId; scanf("%d",&dwProcessId); g_hProcess = ::OpenProcess(PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_VM_OPERATION, FALSE, dwProcessId); int iVal; printf("Input val="); scanf("%d",&iVal);// FindFirst(iVal); ShowList(); while(g_nListCnt>1) { printf("Input val="); scanf("%d",&iVal);// FindNext(iVal); ShowList(); } printf("Input New Ival="); scanf("%d",&iVal); if(WriteMemory(g_arList[0],iVal)) printf("\n修改数据成功!\n"); ::CloseHandle(g_hProcess); return 0;}BOOL FindFirst(DWORD dwValue){ const int dwOneGB=1024*1024*1024; const int dwOnePage=4*1024; if(g_hProcess==NULL) { return FALSE; } DWORD dwBase;/* OSVERSIONINFO vi={sizeof(vi)};//windows 98操作系统为应用程序预留4MB-4GB空间 ::GetVersionEx(&vi); if(vi.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) dwBase=4*1024*1024; else dwBase=640*1024;*/ for(dwBase=0;dwBase<2*dwOneGB;dwBase+=dwOnePage) { CompareAPage(dwBase,dwValue); } return TRUE;}BOOL CompareAPage(DWORD dwBaseAddr,DWORD dwValue){ BYTE arBytes[4096]; if(!::ReadProcessMemory(g_hProcess,(LPVOID)dwBaseAddr,arBytes,4096,NULL)) return FALSE; DWORD* pdw; for(int i=0;i<4*1024-3;i++) { pdw=(DWORD*)&arBytes[i]; if(*pdw==dwValue) { if(g_nListCnt>=1024) return FALSE; g_arList[g_nListCnt]=dwBaseAddr+i; g_nListCnt++; } } return TRUE;}void ShowList(){ for(int i=0;i<g_nListCnt;i++) printf("%08X\n",g_arList[i]);}BOOL FindNext(DWORD dwValue){ int nOrgCnt=g_nListCnt; g_nListCnt=0; BOOL bRet=FALSE; DWORD dwReadValue; for(int i=0;i<nOrgCnt;i++) { if(::ReadProcessMemory(g_hProcess,(LPVOID)g_arList[i],&dwReadValue,sizeof(DWORD),NULL)) { if(dwReadValue==dwValue) { g_arList[g_nListCnt]=g_arList[i]; g_nListCnt++; bRet=TRUE; } } } return bRet;}BOOL WriteMemory(DWORD dwAddr,DWORD dwValue){ BOOL bRet=WriteProcessMemory( g_hProcess, // handle to process whose memory is written to (LPVOID)dwAddr, // address to start writing to &dwValue, // pointer to buffer to write data to sizeof(DWORD), // number of bytes to write NULL // actual number of bytes written); return bRet;} 初学com关于双接口的问题。还请指教 今天说不上是好还是不好的日子 如何做一个开机自启动程序 MFC中怎样屏蔽编辑框的右键菜单?怎样让编辑框内容显示不下时,出现垂直滚动条? 有研究过网络上myiocp的请举手 vc 左右试图之间不能实现拖拉 阿里巴巴(中国)软件有限公司诚招c++工程师!! windows服务程序的问题,买大家回答!!!!!!!! 如何插入一副GIF图片? 类似于flashget点击关闭的按钮。 windows账户权限问题以及windows service问题 jpg图片封装到win32 dll中后,如何提取出来使用?
我给你看个类
你就知道了
#include "windows.h"
#include "stdio.h"/*************变量声明***************/
HANDLE g_hProcess;
DWORD g_arList[1024];
DWORD g_nListCnt=0;/*************函数声明***************/
BOOL FindFirst(DWORD iVal);
BOOL CompareAPage(DWORD dwBase,DWORD dwValue);
void ShowList();
BOOL FindNext(DWORD dwValue);
BOOL WriteMemory(DWORD dwAddr,DWORD dwValue);int main()
{
// char szFileName[]="D:\\game\\连连看.exe";// STARTUPINFO si={sizeof(si)};
// PROCESS_INFORMATION pi;
// ::CreateProcess(NULL,szFileName,NULL,NULL,FALSE,CREATE_NEW_CONSOLE,NULL,NULL,&si,&pi);// ::CloseHandle(pi.hThread);
// g_hProcess=pi.hProcess; DWORD dwProcessId;
scanf("%d",&dwProcessId);
g_hProcess = ::OpenProcess(PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_VM_OPERATION, FALSE, dwProcessId); int iVal;
printf("Input val=");
scanf("%d",&iVal);// FindFirst(iVal);
ShowList();
while(g_nListCnt>1)
{
printf("Input val=");
scanf("%d",&iVal);//
FindNext(iVal);
ShowList();
} printf("Input New Ival=");
scanf("%d",&iVal);
if(WriteMemory(g_arList[0],iVal))
printf("\n修改数据成功!\n");
::CloseHandle(g_hProcess);
return 0;}BOOL FindFirst(DWORD dwValue)
{
const int dwOneGB=1024*1024*1024;
const int dwOnePage=4*1024;
if(g_hProcess==NULL)
{
return FALSE;
} DWORD dwBase;
/* OSVERSIONINFO vi={sizeof(vi)};//windows 98操作系统为应用程序预留4MB-4GB空间
::GetVersionEx(&vi); if(vi.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS)
dwBase=4*1024*1024;
else
dwBase=640*1024;*/ for(dwBase=0;dwBase<2*dwOneGB;dwBase+=dwOnePage)
{
CompareAPage(dwBase,dwValue);
} return TRUE;
}BOOL CompareAPage(DWORD dwBaseAddr,DWORD dwValue)
{
BYTE arBytes[4096];
if(!::ReadProcessMemory(g_hProcess,(LPVOID)dwBaseAddr,arBytes,4096,NULL))
return FALSE; DWORD* pdw;
for(int i=0;i<4*1024-3;i++)
{
pdw=(DWORD*)&arBytes[i];
if(*pdw==dwValue)
{
if(g_nListCnt>=1024)
return FALSE;
g_arList[g_nListCnt]=dwBaseAddr+i;
g_nListCnt++;
}
}
return TRUE;
}void ShowList()
{
for(int i=0;i<g_nListCnt;i++)
printf("%08X\n",g_arList[i]);
}BOOL FindNext(DWORD dwValue)
{
int nOrgCnt=g_nListCnt;
g_nListCnt=0; BOOL bRet=FALSE;
DWORD dwReadValue;
for(int i=0;i<nOrgCnt;i++)
{
if(::ReadProcessMemory(g_hProcess,(LPVOID)g_arList[i],&dwReadValue,sizeof(DWORD),NULL))
{
if(dwReadValue==dwValue)
{
g_arList[g_nListCnt]=g_arList[i];
g_nListCnt++;
bRet=TRUE;
}
}
}
return bRet;
}BOOL WriteMemory(DWORD dwAddr,DWORD dwValue)
{
BOOL bRet=WriteProcessMemory(
g_hProcess, // handle to process whose memory is written to
(LPVOID)dwAddr, // address to start writing to
&dwValue, // pointer to buffer to write data to
sizeof(DWORD), // number of bytes to write
NULL // actual number of bytes written
);
return bRet;}