要求如这样的
ReadMemoryAddr('程序名','内存地址')
函数返回的是可识别的字符串.
写WriteMemoryAddr('程序名','内存地址')
能写出这样的函数请发邮件到我邮箱与我联系
[email protected]

解决方案 »

  1.   

    代码发到你邮箱了,附件为:ReadHP.rar,请查收
      

  2.   

    给我发一个好不好
    [email protected]谢谢了
      

  3.   

    to liumazi(刘麻子) 
      [email protected]
    给我一份好吗,谢谢了
      

  4.   

    To 楼上的兄弟们,其实很简单,调用几个API而已:unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, TLHelp32, StrUtils;type
      TForm1 = class(TForm)
        Button1: TButton;
        NameEdit: TEdit;
        Label1: TLabel;
        Label2: TLabel;
        AddrEdit: TEdit;
        HpVaule: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}   // 返回指定进程ID
    function FindProcess(ExeName: string): DWORD;
    var
      spHandle: THandle;
      Found: Bool;
      PStruct: TProcessEntry32;
    begin
      Result := 0;
                                           
      spHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
      PStruct.dwSize := Sizeof(PStruct);
      Found := Process32First(spHandle, PStruct);  while Found do
      begin
        if AnsiEndsText(ExeName, PStruct.szExefile) then
        begin
          Result := PStruct.th32ProcessID;
          Break;
        end;    Found := Process32Next(spHandle, PStruct);
      end;  CloseHandle(spHandle);
    end;  // 读取指定进程Int
    function ReadProcessInt(ProcessID: DWORD; IntAddr: PInteger): Integer;
    var
      ReadLen: DWORD;
    begin
    //  Result := -1;
      if Toolhelp32ReadProcessMemory(ProcessID, IntAddr, Result, 4, ReadLen) = False then Result := -1;
      //if (ReadProcessMemory(hProcess, IntAAddr, @Result, 4, ReadLen) = False);
    end;procedure TForm1.Button1Click(Sender: TObject);
    var
      PID: DWORD;
      Int: Integer;
    begin
      PID := FindProcess(NameEdit.Text);
      if (PID = 0) then
        ShowMessage('未找到指定进程: ' + NameEdit.Text)
      else begin
        Int := ReadProcessInt(PID, PInteger(StrToInt('$' + AddrEdit.Text)));
        if (Int = -1) then
          HpVaule.Caption := '读取失败!'
        else
          HpVaule.Caption := IntToStr(Int);
      end;
    end;end.