注入的代码  自己水平很差,期待批评。HWND hwnd= ::FindWindow(NULL,"YB_OnlineClient");
if(hwnd==NULL)
{
::AfxMessageBox("获取窗口句柄失败");
return;
}
DWORD pid=0;
::GetWindowThreadProcessId(hwnd,&pid);
CString cs;
    OpenProcessPrivate(pid,cs); HANDLE hpid=OpenProcess(PROCESS_CREATE_THREAD|      //允许远程创建线程
 PROCESS_VM_OPERATION | //VM操作
PROCESS_VM_READ|
 PROCESS_VM_WRITE,FALSE,pid);
if(hpid==NULL)
{
DWORD errid=::GetLastError();
LPSTR lpBuffer;    
FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER  | 
FORMAT_MESSAGE_IGNORE_INSERTS  | 
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
errid, // 此乃错误代码,通常在程序中可由 GetLastError()得之
LANG_NEUTRAL,
(LPTSTR) & lpBuffer,
0 ,
NULL );
CString strErrorCause  =  lpBuffer  ?  _T(lpBuffer) : _T( " Sorry, cannot find this error info. " );
this->SetWindowTextA(strErrorCause);
}
LPVOID paddress=::VirtualAllocEx(hpid,NULL,0x3000,MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE); 
BOOL iReturnCode=WriteProcessMemory (hpid,paddress,AddBloog,0x3000,NULL);
if (!iReturnCode) 
{
//::AfxMessageBox("写入内存失败");
}
else
{
//::AfxMessageBox("写入内存成功");
DWORD tid=0;
HANDLE htid=CreateRemoteThread(hpid,NULL,0,(LPTHREAD_START_ROUTINE )paddress,0,0,&tid);
if(htid==NULL)
{
::CloseHandle(htid);
DWORD errid=::GetLastError();
LPSTR lpBuffer;    
FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER  | 
FORMAT_MESSAGE_IGNORE_INSERTS  | 
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
errid, // 此乃错误代码,通常在程序中可由 GetLastError()得之
LANG_NEUTRAL,
(LPTSTR) & lpBuffer,
0 ,
NULL );
CString strErrorCause  =  lpBuffer  ?  _T(lpBuffer) : _T( " Sorry, cannot find this error info. " );
this->SetWindowTextA(strErrorCause);
}
}
 VirtualFreeEx(hpid,paddress,0x3000,MEM_RELEASE);代码下载地址:www.teilihua.com打怪的源码
void CRMainDialog::EMon(void)
{
UpdateData(false);

int *p;
int max=MONLISTBASE+0xffff*4;
float *pt;
int *p2e;
int *p380;
int md=-1;
float ptt=-1;
for(int i=MONLISTBASE;i<max;i+=4)
{
p=(int *)i;
p2e=(int *)(*p+8);
if(*p2e==0x2e)
{
pt=(float *)(*p+0x31);
if (*pt<this->m_mon_dis)
{
p380=(int *)(*p+0x18);
if(*p380==0)
{   
if(ptt<0)
{
ptt=*pt;
int *monid=(int *)(*p+0xc);
md=*monid;
//::AfxMessageBox("if(ptt<-1)");
}
else

if(ptt>*pt)
{
ptt=*pt;
int *monid=(int *)(*p+0xc);
md=*monid;
//::AfxMessageBox("if(ptt>*pt)");
}
}
}
}
}
}
int *pbasese=(int *)(CURRENTMON);
int base=*pbasese;
int* psel;
psel=(int *)(base+0x1cb0);
*psel=md;
}

解决方案 »

  1.   

    论坛要注册才能访问,不如传csdn下载吧。支持下。
      

  2.   

    还有一个原因就是为了自己弄的一个excel做下宣传哈。下周发布。没有混淆的。业余写了三年了。
      

  3.   

    上传到csdn的资源就是不显示。郁闷死了。我的网站注册很简单。随便填一下。就可以注册。
      

  4.   

    断到数值的。向上翻。借助OD。 
    http://www.pudn.com/downloads471/sourcecode/windows/freedic/detail1974539.html
    csdn好象不让上传源码。
    这里可以下载源码。
      

  5.   

    不明白现在还有哪个游戏这么烂,
    还给你用WriteProcessMemory()
      

  6.   

    你的网站是用google联盟吗,怎么通过的呢,好像才刚建不久哦..
      

  7.   

    你的网站是用google联盟吗,怎么通过的呢,好像才刚建不久哦..
      

  8.   

    自己没写过游戏啊。玩的几个游戏都可以这么干的。
    都是通过键盘钩子注入dll。
      

  9.   

    我不是做网站的。如果仅靠广告赚钱。那会饿死的。
    弄这个网站主要为了下周发布的一个类似excel的控件
    (业余做了三年多,自己是从事soho所以时间多些)。下周发布。和开源差不多的发布。
      

  10.   

    可能是我的水平太菜了,看了你的代码,发现第一段代码跟本就没有用到,而且代码也有问题,刚刚用VirtualAllocEx申请的空间,你又马上给释放了,还有就是难点确实是在第二段代码,根本就不知道是在说什么?如果这是游戏里面的逻辑,也麻烦你讲讲啊!害我看你的代码想了半天也不知道为什么这样做,本人愚钝,不过我真的很想学习做外挂,正在努力中