Nabend,
ich habe gerade mal das Tutorial von Cheatengine bis Step 8 gemacht,
wo die Multilevel Pointer Aufgabe kommt.
So sieht mein Quellcode aus:
Code:
GetProcessId(ProcName)
Dim pointerone As Long
Dim pointertwo As Long
Dim pointerthree As Long
Dim pointerfour As Long
Dim value As Long
pointerone = Read_Long(&H460C20)
pointertwo = Read_Long(pointerone + &HC)
pointerthree = Read_Long(pointertwo + &H14)
pointerfour = Read_Long(pointerthree)
value = Read_Long(pointerfour + &H18)
MsgBox(value)
Und es funktioniert 1A ;)
Damit das natürlich so bei dir auch funktioniert, brauchst du folgendes:
Die Deklaration
Code:
Private Declare Function RPM Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Int32, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Int32, ByVal nSize As Int32, ByRef lpNumberOfBytesWritten As Int32) As Int32
und
die Funktionen GetProcessID und Read_Long
Code:
Public Function GetProcessId(ByVal ProcName As String)
Dim Processes() As Process = Process.GetProcesses
Dim process_name As String
Dim i As Byte
For i = LBound(Processes) To UBound(Processes)
process_name = Processes(i).ProcessName
If process_name = ProcName Then
process_id = Processes(i).Id
Return process_id
End If
Next
End Function
Public Function Read_Long(ByVal address As Int32) As Int32
Dim process_handle As Int32, value As Int32
process_handle = OpenProcess(ACCESS_RIGHTS_ALL, False, process_id)
If process_handle <> 0 Then
RPM(process_handle, address, value, 4, 0)
End If
CloseHandle(process_handle)
Return value
End Function
~DNA