delphi中读取指定内存地址的值


本文整理自网络,侵删。

 procedure TForm1.Button1Click(Sender: TObject);
var
hwnd:cardinal;
pid:Dword;
hProcess:cardinal;
x:string;
Num: cardinal;


begin
setlength(X,$10);
hwnd := FindWindow(nil, 'Cheat Engine 5.3');
GetWindowThreadProcessId (hwnd, @pid);
hProcess := OpenProcess(PROCESS_ALL_ACCESS, false, pid);
If hProcess <> 0 Then
begin
if ReadProcessMemory(hprocess,Pointer($1005334),@x,$10,num) then
label1.Caption := string(x)
else
showmessage('读数失败~!');
end
else
showmessage('未启动游戏');
CloseHandle(hProcess);

end;

相关阅读 >>

Delphi操作多显示器

Delphi windows api判断文件共享锁定状态

Delphi 用代码实现为程序创建快捷方式的二种方法

Delphi opendialog1 打开多个文件

Delphi 给字加边的又一个算法

Delphi原生方法取得文件的md5

Delphi str1.compare 比较两个字符是否相同

Delphi xe5 android获取手机联系人,并用listview显示

Delphi中判断一个字符的位置在字符串开头或者末尾

Delphi sendtextmessage 等方便的消息发送函数

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...