请举例说明~重点说明下第3个参数!
为什么在buffer那里显示“类型BYTE的1维数组的值无法转换成Integer”
并且用buffer.Length时候显示错误不是SYSTEM.LENTH中的方法
VB.NET中怎么调用ReadProcessMemory?
答案:2 悬赏:20 手机版
解决时间 2021-04-09 12:44
- 提问者网友:临风不自傲
- 2021-04-08 16:41
最佳答案
- 五星知识达人网友:罪歌
- 2021-04-08 17:37
以前有人问过,给你说一下:
声明
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
示例:
Private Const PROCESS_VM_READ As Long = &H10
Sub Main()
Dim ph As Integer
Dim i As Integer
Dim h As Integer
Dim buffer(20) As Byte
Dim bytesRead As Integer
'获得进程
ph = OpenProcess(PROCESS_ALL_ACCESS, False, 1832)
If ph Then
MsgBox.Show("true")
h = ReadProcessMemory(ph, &H403000, buffer, buffer.Length, bytesRead)
For i = 0 To buffer.Length - 1
TempMem =TempMem+buffer(i).ToString
Next
Else
MsgBox.Show("false")
End If
end sub
声明
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
示例:
Private Const PROCESS_VM_READ As Long = &H10
Sub Main()
Dim ph As Integer
Dim i As Integer
Dim h As Integer
Dim buffer(20) As Byte
Dim bytesRead As Integer
'获得进程
ph = OpenProcess(PROCESS_ALL_ACCESS, False, 1832)
If ph Then
MsgBox.Show("true")
h = ReadProcessMemory(ph, &H403000, buffer, buffer.Length, bytesRead)
For i = 0 To buffer.Length - 1
TempMem =TempMem+buffer(i).ToString
Next
Else
MsgBox.Show("false")
End If
end sub
全部回答
- 1楼网友:底特律间谍
- 2021-04-08 18:32
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯