Code:
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function OpenProcess(ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
End Function
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function WriteProcessMemory(ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
End Function
<DllImport("kernel32", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
Private Shared Function CloseHandle(ByVal hObject As Integer) As Integer
End Function
Public Function aasw() As Long
Dim processesByName As Process() = Process.GetProcessesByName("")
If (processesByName.Length = 0) Then
Return 0
End If
Return processesByName(0).Id
End Function
Private Function Memory_WriteLong(ByVal Address As Integer, ByVal vBuffer As Long) As Long
Dim num As Long
Dim ptr As IntPtr = DirectCast(Form1.OpenProcess(&H438, 0, CInt(Me.aasw)), IntPtr)
Dim lpBuffer As Integer = CInt(vBuffer)
Dim lpNumberOfBytesWritten As Integer = 0
Form1.WriteProcessMemory(CInt(ptr), Address, lpBuffer, 4, lpNumberOfBytesWritten)
vBuffer = lpBuffer
Return vBuffer
Form1.CloseHandle(CInt(ptr))
Return num
End Function






