Открыл Artmoney, выбрал процесс, нашёл нужное значение по адресу 00B17913.
Как сделать тоже самое на VB, то есть прочитать значение по адресу 00B17913?
Demonx писал(а):потом в вб подставил - ничего не работает
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Function ReadMemory(hWnd As Long, Address As Long, Bytes As Long) As String
On Error Resume Next
Dim pId As Long ' Used to hold the Process Id
Dim pHandle As Long ' Holds the Process Handle
Dim bytValue As Long 'Stores the value of a byte in the memory
Dim i As Long
Dim Text As String
' Get the ProcId of the Window
GetWindowThreadProcessId hWnd, pId
' use the pId to get a handle
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pId)
If (pHandle = 0) Then
'MsgBox "Unable to open process!"
Exit Function
End If
If Address = 0 Then Exit Function
For i = 1 To Bytes Step 2
' Read Byte to Byte
ReadProcessMemory pHandle, Address + i - 1, bytValue, 1, 0&
'value now contains the long value of the byte located in [Address + i - 1] pos.
'ReadMemory is a string...
ReadMemory = ReadMemory & Chr$(bytValue)
Next
CloseHandle pHandle
End Function
Dim bytValue As Byte
For i = 0 To Bytes - 1
ReadProcessMemory pHandle, Address, bytValue, 1, 0&
mdx писал(а):
- Код: Выделить всё
Dim bytValue As Byte
For i = 0 To Bytes - 1
ReadProcessMemory pHandle, Address, bytValue, 1, 0&
Сейчас этот форум просматривают: AhrefsBot, Google-бот и гости: 169