Couldn't you make it work?
Here is all I used to make it work
In the button:
Code:
System.Diagnostics.Process.Start("C:\Program Files (x86)\Tibia\tibia.exe")
Dim I As Integer = &H14E977 + &H400000
Dim b As Cliente
For Each S As Process In Process.GetProcesses
If S.ProcessName = "Tibia" Then
b = New Cliente(S)
b.WriteBytes(I, New Byte() {&HEB, &H40}, 2)
End If
Next
Class Cliente:
Var's
Code:
<DllImport("kernel32.dll")> _
Public Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("kernel32.dll")> _
Public Function OpenProcess(ByVal dwDesiredAccess As UInt32, ByVal bInheritHandle As Int32, ByVal dwProcessId As UInt32) As IntPtr
End Function
Public PROCESS_ALL_ACCESS = &H1F0FFF
Private ProcessHandle As IntPtr
Private p As Process
COnstructor
Code:
Sub New(ByVal _p As Process)
p = _p
ProcessHandle = WinAPi.OpenProcess(WinAPi.PROCESS_ALL_ACCESS, 0, p.Id)
End Sub
To write bytes
Code:
Public Function WriteBytes(ByVal address As Long, ByVal bytes As Byte(), ByVal length As UInteger) As Boolean
Dim bytesWritten As IntPtr
Dim result As Integer = WinAPi.WriteProcessMemory(ProcessHandle, New IntPtr(address), bytes, length, bytesWritten)
Return result <> 0
End Function