200分求教,我只有200分,得到答案给分(200分)

  • 主题发起人 主题发起人 zhoujuncnnb
  • 开始时间 开始时间
要的人这么多,我还是贴出来吧,首先是取得程序的PID<br>public<br>&nbsp; hSnapshot,HDProcess: THandle;<br>&nbsp; sFileName,f,pill: string;<br>&nbsp; iProcessID: Integer;<br>&nbsp; x,y:integer;<br>&nbsp; iOK:Boolean;<br>&nbsp; nSize,lpNumberOfBytesRead:DWORD;<br>&nbsp; s:byte;<br>&nbsp; pid: dword;<br>&nbsp; dataX,dataY:byte;<br>&nbsp; &nbsp; { Public declarations }<br>&nbsp; end;<br><br>var<br>&nbsp; Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>var<br>&nbsp; hw: HWND;<br>begin<br>&nbsp; hw := FindWindow(nil,'幻灵游侠'); &nbsp; &nbsp; &nbsp; //找到窗口句柄 玩一个网络游戏,(外挂)<br><br>&nbsp; if hw &lt;&gt; 0 then<br>&nbsp; &nbsp; &nbsp;GetWindowThreadProcessId(hw, @pid) //找出PID<br>&nbsp; else<br>&nbsp; &nbsp;begin<br>&nbsp; &nbsp; showmessage('没找到');<br>&nbsp; &nbsp; Exit;<br>&nbsp; &nbsp;end;<br>end;<br><br>procedure TForm1.FlatButton1Click(Sender: TObject); &nbsp;<br>var<br>lpBufferX,lpBufferY:pchar;<br>write : dword;<br>begin<br>HDProcess:=OpenProcess(PROCESS_ALL_ACCESS, False, pid ); //得到进程句柄<br>nSize:=1;<br>getmem(lpBufferX,2);<br>getmem(lpBufferY,2);<br><br>y:=$006C22AC; &nbsp;//这是想修改的内存地址 下面也是.<br>x:=$006C22A8;<br>lpBufferX^:=chr(dataX);<br>lpBufferY^:=chr(dataY);<br><br>WriteProcessMemory(HDProcess,Pointer(x),lpBufferX,nSize,Write); &nbsp;//这儿就是写入内存数据,以达到修改游戏的目的.<br>WriteProcessMemory(HDProcess,Pointer(y),lpBufferY,nSize,Write);<br>//写入内存数据<br>FreeMem(lpBufferX); &nbsp; &nbsp; &nbsp; &nbsp; //释放内存<br>FreeMem(lpBufferY);<br>closehandle(HDProcess); &nbsp; &nbsp;//关闭句柄<br><br>end;<br>
 
上面有几步,我忘了贴,就是用EDIT输入的数据存入到DATAX,DATAY 这个是游戏里人物的坐标地址,以这样来实际瞬移.
 
关于楼主的问题就是把WriteProcessMemory 改成 ReadProcessMemory 把写改成读,就可以了,不过首先要知道其内存地址,这个好像比较麻烦.你可以用扫描关键字的方法来定位,这样比较好做些.
 
偏题了。。。。。。
 
我想用消息也应该可以吧。先发送一条EM_SETSEL,0,-1或者EM_EXSETSEL;<br>再发送一条EM_GETSEL。
 
后退
顶部