var<br> FSnapshotHandle:THandle;<br> FProcessEntry32:TProcessEntry32;<br> Ret : BOOL;<br> ProcessID : integer;<br> ProcessHndle : THandle;<br> lpBuffer
Byte;<br> nSize,Bytes: DWORD;<br> lpNumberOfBytesRead: DWORD;<br> i,u:integer;<br> s:string;<br>begin<br> FSnapshotHandle:=CreateToolhelp32Snapshot(<br>TH32CS_SNAPPROCESS,0);<br> //创建系统快照<br> FProcessEntry32.dwSize:=Sizeof(FProcessEntry32);<br> //先初始化 FProcessEntry32 的大小<br> Ret:=Process32First(FSnapshotHandle,FProcessEntry32);<br> while Ret do<br> begin<br> s:=ExtractFileName(FProcessEntry32.szExeFile);<br> if s='QQGame.exe' then<br> begin<br> ProcessID:=FProcessEntry32.th32ProcessID;<br> s:='';<br> break;<br> end;<br> Ret:=Process32Next(FSnapshotHandle,FProcessEntry32);<br> end;<br> //循环枚举出系统开启的所有进程,找出“QQGame.exe”<br> CloseHandle(FSnapshotHandle);<br> Memo1.Lines.Clear ;<br> memo1.lines.add('Process ID '+IntToHex(<br> FProcessEntry32.th32ProcessID,8));<br> memo1.lines.Add('File name '+FProcessEntry32.szExeFile);<br> ////输出进程的一些信息 <br> nSize:=4;<br> lpBuffer:=AllocMem(nSize);<br> ProcessHndle:=OpenProcess(PROCESS_VM_READ,false,ProcessID);<br> memo1.Lines.Add ('Process Handle '+intTohex(ProcessHndle,8));<br> for i:=$013609A0 to $013609A0 do<br> begin<br> ReadProcessMemory(<br> ProcessHndle,<br> Pointer(i),<br> lpBuffer,<br> nSize,<br> lpNumberOfBytesRead<br>  
;<br><br> copymemory(@u,Ptr($013609A0),4);<br> Memo1.Lines.Add(inttostr(u));<br> //格式化输出<br> end;<br> FreeMem(lpBuffer,nSize);<br> CloseHandle(ProcessHndle);<br> //关闭句柄,释放内存<br>end;<br><br>还是有问题,请大家帮忙看一下程序<br><br>按刘兄的u:=lpBuffer^也不对啊,可能是我太菜了,请大家帮忙看一下程序