Código:
Option Explicit
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Private Declare Function GetAsyncKeyState Lib "user32.dll" ( _
ByVal vKey As Long) As Integer
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32.dll" ( _
ByVal hwnd As Long, _
ByRef lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" ( _
ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32.dll" ( _
ByVal hProcess As Long, _
ByRef lpBaseAddress As Any, _
ByRef lpBuffer As Any, _
ByVal nSize As Long, _
ByRef lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" ( _
ByVal hObject As Long) As Long
Private Sub CambiarNombre(Nombre As String)
Dim wHandle As Long
Dim pId As Long
Dim pHandle As Long
wHandle = FindWindow(vbNullString, "Counter-Strike")
If wHandle = 0 Then Exit Sub
GetWindowThreadProcessId wHandle, pId
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pId)
If pHandle = 0 Then Exit Sub
WriteProcessMemory pHandle, &H2F4DC28, StrPtr(Nombre), LenB(Nombre), 0&
CloseHandle pHandle
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyF5) Then CambiarNombre ("NADER")
End Sub
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
Private Declare Function GetAsyncKeyState Lib "user32.dll" ( _
ByVal vKey As Long) As Integer
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32.dll" ( _
ByVal hwnd As Long, _
ByRef lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" ( _
ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32.dll" ( _
ByVal hProcess As Long, _
ByRef lpBaseAddress As Any, _
ByRef lpBuffer As Any, _
ByVal nSize As Long, _
ByRef lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" ( _
ByVal hObject As Long) As Long
Private Sub CambiarNombre(Nombre As String)
Dim wHandle As Long
Dim pId As Long
Dim pHandle As Long
wHandle = FindWindow(vbNullString, "Counter-Strike")
If wHandle = 0 Then Exit Sub
GetWindowThreadProcessId wHandle, pId
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pId)
If pHandle = 0 Then Exit Sub
WriteProcessMemory pHandle, &H2F4DC28, StrPtr(Nombre), LenB(Nombre), 0&
CloseHandle pHandle
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyF5) Then CambiarNombre ("NADER")
End Sub