Hi ich habe ein Problem mit der api funktion readprocessmemory...seitdem ich windows7 64bit drauf habe scheint die funktion nichtmehr zu funktionieren unter google habe ich gefunden, das man eine alte Kernel32.dll benutzen kann, was bei mir aber nicht funktioniert hat. Da ich aber gerade die api brauche müsste ich eine alternative/lösung finden...
How can i use the ReadProcessMemory-API in Windows7 64bit?
How can i use the ReadProcessMemory-API in Windows7 64bit?
Quote:
Public Class Form1
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
Public Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
Public myProcesses As Process() = Process.GetProcessesByName("...")
Public processid As Integer = myProcesses(0).Id
Public processHandle = OpenProcess(16, True, processid)
Dim RestlicheHp As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ReadProcessMemory(processHandle, &H..., RestlicheHp, 4, 0)
MsgBox(RestlicheHp)
End Sub
End Class