• 1.摘要
  • 2.基本信息
  • 3.英文解释
  • 3.1.原型
  • 3.2.参数
  • 3.3.返回值
  • 3.4.要求
  • 3.5.参考
  • 4.中文解释
  • 5.例子
  • 5.1.C++
  • 5.2.Delphi
  • 5.3.C#

ReadProcessMemory

ReadProcessMemory归属为为编程中的内存操作函数, 其作用为根据进程句柄读入该进程的某个内存空间; 函数原型为BOOL ReadProcessMemory(HANDLE hProcess, LPCVOID lpBaseAddress, LPVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead); 由布尔声明可以看出, 当函数读取成功时返回1, 失败则返回0, 具体参数含义将在下文中指出。

基本信息

  • 中文名称

    ReadProcessMemory

  • 归属

    编程中的内存操作函数

  • 失败

    则返回0

  • 成功

    返回1

英文解释

原型

This function reads memory in a specified process. The entire area to be read must be accessible or the operation fails.

BOOL ReadProcessMemory(

HANDLE hProcess,

LPCVOID lpBaseAddress,

LPVOID lpBuffer,

DWORD nSize,

LPDWORD lpNumberOfBytesRead

);

参数

(1)hProcess

[in] Handle to the process whose memory is being read.

In Windows CE, any call to OpenProcess returns a process handle with the proper access rights.

(2)lpBaseAddress

[in] Pointer to the base address in the specified process to be read.

Before data transfer occurs, the system verifies that all data in the base address and memory of the specified size is accessible for read access. If so, the function proceeds; otherwise, the function fails.

(3)lpBuffer

[out] Pointer to a buffer that receives the contents from the address space of the specified process.