SHARE
TWEET

Untitled

a guest May 19th, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.     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
  4.     Public Declare Function WriteProcessMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
  5.  
  6.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  7.  
  8.     End Sub
  9.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  10.  
  11.         Dim myProcesses As Process() = Process.GetProcessesByName("S4Client")
  12.         Dim processHandle As IntPtr = myProcesses(0).Handle
  13.         Dim zahl As Integer = 10000
  14.         Dim zahl2 As Integer = 3000
  15.         Dim buffer As Integer
  16.         Dim adresse As Integer = &HC456D8
  17.  
  18.         ReadProcessMemory(processHandle, &HC456D8, buffer, 4, 0)
  19.  
  20.         If adresse = 3000 Then
  21.             WriteProcessMemory(processHandle, zahl, adresse, 4, 0)
  22.         Else
  23.             WriteProcessMemory(processHandle, zahl2, adresse, 4, 0)
  24.         End If
  25.  
  26.         If adresse = 10000 Then
  27.             Label2.Text = "On"
  28.         Else
  29.             Label2.Text = "Off"
  30.         End If
  31.  
  32.         If Label2.Text = "On" Then
  33.             Label2.ForeColor = Color.Green
  34.             If Label2.Text = "Off" Then
  35.                 Label2.ForeColor = Color.Red
  36.             End If
  37.         End If
  38.  
  39.     End Sub
  40. End Class
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top