搜索某一个进程的内存地址是否包括某一个数值
搜索某一个进程的内存地址包括某一个数值(4字节),readprocessmemory用得不太熟悉,
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 NextEnd Function