Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Function ConvertNumberToString(Number As Double) As String
Dim b1, b2, b3, b4
If Number < 256 Then ConvertNumberToString = Chr(Number): Exit Function
If Number < 65536 Then
ConvertNumberToString = Chr(Number And 255) & Chr((Number And 65280) / 256)
Exit Function
End If
b4 = Number And 255: Number = Int(Number / 256)
b3 = Number And 255: Number = Int(Number / 256)
b2 = Number And 255: Number = Int(Number / 256)
b1 = Number And 255: Number = Int(Number / 256)
ConvertNumberToString = Chr(b4) & Chr(b3) & Chr(b2) & Chr(b1)
End Function
Private Sub cmd01_Click()
Dim hwnd As Long, ProcessID As Long, pHandle As Long
hwnd = FindWindow(vbNullString, "SIMS")
If hwnd = 0 Then
lbl01.Caption = "TS not found"
Exit Sub
End If
GetWindowThreadProcessId hwnd, ProcessID
pHandle = OpenProcess(&H1F0FFF, False, ProcessID)
If pHandle = 0 Then
lbl01.Caption = "No process
handle found!"
Exit Sub
End If
WriteProcessMemory
Handle, &H6F406FCA, ConvertNumberToString(&H33), 1, 0&
WriteProcessMemory
Handle, &H6F406FC9, ConvertNumberToString(&H41), 1, 0&
WriteProcessMemory
Handle, &H6F406FCE, ConvertNumberToString(&H46), 1, 0&
WriteProcessMemory
Handle, &H6F406FCF, ConvertNumberToString(&H33), 1, 0&
WriteProcessMemory
Handle, &H6F406FD0, ConvertNumberToString(&HF6), 1, 0&
WriteProcessMemory
Handle, &H6F406FCB, ConvertNumberToString(&HC9), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A3, ConvertNumberToString(&H40), 1, 0&
WriteProcessMemory
Handle, &H6F148E58, ConvertNumberToString(&HEB), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A4, ConvertNumberToString(&H33), 1, 0&
WriteProcessMemory
Handle, &H6F149D3C, ConvertNumberToString(&HEB), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A3, ConvertNumberToString(&H40), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A5, ConvertNumberToString(&HC0), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A6, ConvertNumberToString(&H42), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A7, ConvertNumberToString(&H33), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A8, ConvertNumberToString(&HD2), 1, 0&
WriteProcessMemory
Handle, &H6F148E58, ConvertNumberToString(&HEB), 1, 0&
Close
Handle, pHandle
lbl01.Caption = "Go get her ;-)"
End Sub
Private Sub cmd02_Click()
Dim hwnd As Long, ProcessID As Long, pHandle As Long
hwnd = FindWindow(vbNullString, "SIMS")
If hwnd = 0 Then
lbl01.Caption = "TS not found"
Exit Sub
End If
GetWindowThreadProcessId hwnd, ProcessID
pHandle = OpenProcess(&H1F0FFF, False, ProcessID)
If pHandle = 0 Then
lbl01.Caption = "No process
handle found!"
Exit Sub
End If
WriteProcessMemory
Handle, &H6F2A22A3, ConvertNumberToString(&H42), 1, 0&
WriteProcessMemory
Handle, &H6F406FCE, ConvertNumberToString(&H70), 1, 0&
WriteProcessMemory
Handle, &H6F2A22A6, ConvertNumberToString(&H52), 1, 0&
WriteProcessMemory
Handle, &H6F148E58, ConvertNumberToString(&H75), 1, 0&
WriteProcessMemory
Handle, &H6F406FC9, ConvertNumberToString(&H48), 1, 0&
WriteProcessMemory
Handle, &H6F149D3C, ConvertNumberToString(&H75), 1, 0&
CloseHandle pHandle
lbl01.Caption = "Hm, she's hating you again (deactivated)"
End Sub