学学易语言吧。
QQ:260911561
步骤大致是:
先找窗口句柄,再通过句柄打开进程,就可以直接读了,有的可能有读写保护之类的,就还要提升访问权限了,发个示例代码你参考下:
var
h : HWND;
PId : hwnd;
hProcess : Cardinal;
num : Cardinal;
x : pinteger;
dwErr : dword;
begin
h := FindWindow(nil,'testMem');
if h = 0 then
exit;
GetWindowThreadProcessId (h, @pid);
hProcess := OpenProcess(PROCESS_ALL_ACCESS, false, pid);
if hProcess = 0 then
exit;
getmem(x,4);
if ReadProcessMemory(hprocess,Pointer($00D43810),x,4,num) then
begin
messagebox(0,pchar(inttostr(x^)),'d',0);
end
else
begin
dwErr := getLastError;
messagebox(0,pchar(inttostr(dwerr)),'d',0);
end;
freemem(x);
closehandle(hProcess);