T
tripleh
Unregistered / Unconfirmed
GUEST, unregistred user!
我用CE打开了一个游戏进程,然后直接查看$012308EC这个地址的值,查看方式是4 Bytes,显示的值为57714880。<br>那么我想用自己的程序把该值读取出来。<br>下面是我的办法<br>procedure TMainForm.RzBitBtn1Click(Sender: TObject);<br>var<br> pid: Cardinal;<br> pProc: Cardinal;<br> pPos: PDWORD;<br> JZChar;<br> baseAddr, readok: DWORD;<br> mem: TMemoryStream;<br> I:Integer;<br>begin<br> try<br> GetWindowThreadProcessId(GameChr.ZtHwnd, @pid);<br> pProc := OpenProcess(PROCESS_VM_READ, False, pid);<br> mem := TMemoryStream.Create;<br> try<br> mem.clear;<br> mem.SetSize(80);<br> ReadProcessMemory(pProc, Pointer($012308EC), mem.Memory, 80, readok);<br> JZ := mem.Memory;<br> I:=Integer(JZ);//我就是要取得I的值。<br> finally<br> VirtualFreeEx(pProc, Pointer(GameBaseAddr), 0, MEM_RELEASE);<br> CloseHandle(pProc);<br> mem.Free;<br> end;<br>end;<br><br><br>以上代码,我精简过了,只留下了读取内存这部分代码。变量I取得值不是57714880,而是其他数字。不知道怎么回事!大家帮我看看啊