selam,
Mayın tarlasındanki süreyi okutamıyorum yardım edermisiniz
KOD:
Button Click:
Longyaz &H100579C, "Mayın Tarlası", "099"
Â
'Önce Ram'e yazmak için gerekli api'leri deklare edelim.
Module:
Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
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, 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
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
'Şimdi de fonksiyonumuzu yazıyoruz.
Public Function Longyaz(Offset As Long, WindowName As String, Value As Long) As Boolean
Dim hwnd As Long
Dim ProcessID As Long
Dim ProcessHandle As Long
Dim str As Long
'Önce oyunun pencere numarasını bulalım;
hwnd = FindWindow(vbNullString, WindowName)
If hwnd = 0 Then 'Oyun şuanda açık değilse
MsgBox "Oyun şuanda açık değil!", vbCritical, "Yazma Hatası" 'Eğer isterseniz bu satırı kaldırabilirsiniz, oyun açık değilse zaten trainer bi işe yaramaz
Exit Function
End If
GetWindowThreadProcessId hwnd, ProcessID
ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID)
If ProcessHandle = 0 Then
Exit Function
End If
ReadProcessMemory ProcessHandle, &H100579C, str, 8, 0&
MsgBox (str)
CloseHandle ProcessHandle 'Yazma işlemi bitti, pencere kulbunu kapatıyoruz
End Function