1,486
社区成员
发帖
与我相关
我的任务
分享
processname是进程名findvalue是要搜索的值,findprocessmemoryvalueaddress返回值是这个值所在的内存地址
Function FindProcessMemoryValueAddress(processName As String, FindValue As Long) As Long
Dim ProHandle As Long
If FindProcessHandle > 0 Then CloseHandle (FindProcessHandle)
FindProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, HasProName(processName))
Dim MemBf(3) As Byte
Dim i As Long, l As Long
Dim TmpBuf As Long
Dim LocalAdsIndex As Long
If FindProcessHandle = 0 Then Exit Function
For i = &H14E620 To &H7FFFF000 Step 4
If ReadProcessMemory(FindProcessHandle, ByVal i, MemBf(0), 4, ByVal 0) > 0 Then
CopyMemory TmpBuf, MemBf(3), 4
If TmpBuf = FindValue Then
FindProcessMemoryValueAddress = i
Exit For
End If
End If
Next
End Function