[Help] WriteALong - theredeyes tutorial
Okay so I am having trouble with the function declarion "WriteALong" sub. Like look as this
Okay so i'm having trouble with phandle
phandle for some weard reason still = 0 when this happends.
Public Function WriteALong(gamewindowtext As String, address As Long, value As Long)
Dim hwnd As Long
Dim pid As Long
Dim phandle As Long
hwnd = FindWindow(vbNullString, gamewindowtext)
If (hwnd = 0) Then
MsgBox "The Game Is Not Working pid=" + pid + " hwnd = " + hwnd
End
Exit Function
End If
GetWindowThreadProcessId hwnd, pid
phandle = OpenProcess(PROCESS_ALL_ACCESS, True, pid)
If (phandle = 0) Then
MsgBox "Can't get ProcessId pid=" & pid & " hwnd = " & hwnd & " Phandle = " & phandle
Exit Function
End If
WriteProcessMemory phandle, address, value, 4, 0&
CloseHandle hProcess
End Function
Dim hwnd As Long
Dim pid As Long
Dim phandle As Long
hwnd = FindWindow(vbNullString, gamewindowtext)
If (hwnd = 0) Then
MsgBox "The Game Is Not Working pid=" + pid + " hwnd = " + hwnd
End
Exit Function
End If
GetWindowThreadProcessId hwnd, pid
phandle = OpenProcess(PROCESS_ALL_ACCESS, True, pid)
If (phandle = 0) Then
MsgBox "Can't get ProcessId pid=" & pid & " hwnd = " & hwnd & " Phandle = " & phandle
Exit Function
End If
WriteProcessMemory phandle, address, value, 4, 0&
CloseHandle hProcess
End Function
phandle = OpenProcess(Process_all_accsess, False, pid)
