Dejo estos codigos
Funcion leer memoria:
Public Declare Function NtReadVirtualMemory Lib "ntdll" (ByVal ProcessHandle As Long, ByVal BaseAddress As Long, pBuffer As Any, ByVal NumberOfBytesToWrite As Long, NumberOfBytesWritten As Long) As Long
Public Declare Function VirtualProtect Lib "kernel32" (lpAddress As Any, ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long
Public Function ReadMem(BaseAddress As Long, nSize As Long) As String
Dim bAsm() As Byte
ReDim bAsm(nSize) As Byte
VirtualProtect ByVal BaseAddress, nSize, &H40, &H0
NtReadVirtualMemory -1, ByVal BaseAddress, ByVal VarPtr(bAsm(0)), nSize, 0&
VirtualProtect ByVal BaseAddress, nSize, &H0, &H0
ReadMem = bAsm()
End Function
Funcion escribir memoria:
Public Declare Function NtWriteVirtualMemory Lib "ntdll" (ByVal ProcessHandle As Long, ByVal BaseAddress As Long, ByVal pBuffer As Long, ByVal NumberOfBytesToWrite As Long, ByRef NumberOfBytesWritten As Long) As Long
Public Declare Function VirtualProtect Lib "kernel32" (lpAddress As Any, ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long
Public Function WriteMem(BaseAddress As Long, BytesToWrite As String, nSize As Long) As String
Dim bAsm() As Byte
ReDim bAsm(nSize) As Byte
For i = 0 To Len(BytesToWrite) - 1 Step 2
bAsm((i / 2)) = CByte("&H" & Mid(BytesToWrite, i + 1, 2))
Next i
VirtualProtect ByVal BaseAddress, nSize, &H40, &H0
NtWriteVirtualMemory -1, ByVal BaseAddress, ByVal VarPtr(bAsm(0)), nSize, 0&
VirtualProtect ByVal BaseAddress, nSize, &H0, &H0
End Function
Saludos!