Dim ptr As New System.IntPtr(pstream) '定义一个地址为流基地址的非托管指针 Dim ReadArray(nLenght - 1) As Byte '定义数组 Marshal.Copy(ptr, ReadArray, 0, nLenght) '将数据从非托管内存指针复制到托管 8 位无符号整数数组
悠悠蝶梦
2025-03-30 19:10:13
Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer() As Byte, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer