delphi中读取指定内存地址的值的问题
我想读取地址为E86E971的值,应该怎么办?我写了个程序可是编译不通过.varwnd:hwnd;pid:hwnd;pHandle:hwnd;hp:pansichar;b...
我想读取地址为E86E971的值,应该怎么办?我写了个程序可是编译不通过.
var
wnd:hwnd;
pid:hwnd;
pHandle:hwnd;
hp:pansichar;
begin
Wnd := FindWindow(nil,'Element Client');
GetWindowThreadProcessId(wnd,@pid);
pHandle:=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
ReadProcessMemory(pHandle,Pointer($E86E971),@hp,sizeof(hp),0);
edit1.text:=strpas(hp);
end; 展开
var
wnd:hwnd;
pid:hwnd;
pHandle:hwnd;
hp:pansichar;
begin
Wnd := FindWindow(nil,'Element Client');
GetWindowThreadProcessId(wnd,@pid);
pHandle:=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
ReadProcessMemory(pHandle,Pointer($E86E971),@hp,sizeof(hp),0);
edit1.text:=strpas(hp);
end; 展开
展开全部
先在每步都作个判断
Wnd := FindWindow(nil,'Element Client');
if Wnd>0 then
begin
GetWindowThreadProcessId(wnd,@pid);
if pid>0 then
begin
pHandle:=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
if pHandle>0 then
begin
ReadProcessMemory(pHandle,Pointer($E86E971),@hp,sizeof(hp),0);
edit1.text:=strpas(hp);
Exit;
end;
end;
end;
ShowMessage('Error');
end;
自己调试哪步数值没得到
Wnd := FindWindow(nil,'Element Client');
if Wnd>0 then
begin
GetWindowThreadProcessId(wnd,@pid);
if pid>0 then
begin
pHandle:=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
if pHandle>0 then
begin
ReadProcessMemory(pHandle,Pointer($E86E971),@hp,sizeof(hp),0);
edit1.text:=strpas(hp);
Exit;
end;
end;
end;
ShowMessage('Error');
end;
自己调试哪步数值没得到
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询