İşte Anti Ban Kodu
Option Explicit
Public Type PROCESS
ID As Long
ExeFile As String
End Type
Public Type Thread
ID As Long
OwnerProcess As Long
End Type
Public Type THREADENTRY32
dwSize As Long
cntUsage As Long
th32ThreadID As Long
th32OwnerProcessID As Long
tpBasePri As Long
tpDeltaPri As Long
dwFlags As Long
End Type
Public Declare Function FindWindowH Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Public Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Public Declare Function Thread32First Lib "kernel32" (ByVal hSnapShot As Long, lpte As THREADENTRY32) As Long
Public Declare Function Thread32Next Lib "kernel32" (ByVal hSnapShot As Long, lpte As THREADENTRY32) As Long
Public Declare Function OpenThread Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwThreadId As Long) As Long
Public Declare Function SuspendThread Lib "kernel32" (ByVal hThread As Long) As Long
Public Const THREAD_SUSPEND_RESUME = &H2
Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
Public Const TH32CS_SNAPHEAPLIST = &H1
Public Const TH32CS_SNAPPROCESS = &H2
Public Const TH32CS_SNAPTHREAD = &H4
Public Const TH32CS_SNAPMODULE = &H8
Public Const TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
Public Const TH32CS_INHERIT = &H80000000
Public Const hNull = 0
Public Function ListThreads() As Long
Dim f As Long
Dim hSnap As Long, Thread As THREADENTRY32
Dim Threads() As Thread
ReDim Threads(0)
Dim hwndw As Long
Dim P_pid As Long
GetWindowThreadProcessId FindWindow(vbNullString, "Knight OnLine Client"), P_pid
ListThreads = 0
hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, P_pid)
If hSnap = hNull Then Exit Function
Thread.dwSize = Len(Thread)
f = Thread32First(hSnap, Thread)
Do While f
ListThreads = UBound(Threads)
If Thread.th32OwnerProcessID = P_pid Then
' Form1.ListView1.ListItems.Add(Text:=Hex(Thread.th32ThreadID)).SubItems(1) = Hex(GetThreadPriority(Thread.th32ThreadID))
Form1.List1.AddItem Hex(Thread.th32ThreadID)
End If
f = Thread32Next(hSnap, Thread)
Loop
End Function
Public Function f_SuspendThread(ThreadID As Long) As Long
Dim hThread As Long
f_SuspendThread = -1
hThread = OpenThread(STANDARD_RIGHTS_REQUIRED Or THREAD_SUSPEND_RESUME, 0, ThreadID)
If hThread <> hNull Then
f_SuspendThread = SuspendThread(hThread)
Call CloseHandle(hThread)
End If
End Function