 |
|
ช่วยดูโค้ด Suspended Thread หน่อยครับ ต้องการแบบที่สามารถกำหนด Name ID Process ได้ครับ |
|
 |
|
|
 |
 |
|
คือผมจะ Suspended thread โดยใช้ vb.net อ่ะครับโค้ดที่ผมได้มา
ผมไม่แน่ไจว่าในโค้ดนี้สมารถกำหนด ชื่อ Process,ชื่อ Thread,ชื่อ ID
ได้หรือเปล่ายังไงช่วยแนะนำด้วยผมอ่านอังกฤษไม่เก่งหรือจะช่วยอุปการะโค้ดใหม่ไห้ผมก็ได้ครับ
โดยผมต้องการจะ Suspended Thread 4 ตัวครับ
   
Code (VB.NET)
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("kernel32.dll")> _
Private Shared Function SuspendThread(ByVal hThread As IntPtr) As Int32
End Function
Public Function Thread_Suspend(ByVal ThreadHandle As IntPtr) As Integer
Return SuspendThread(ThreadHandle)
End Function
<DllImport("kernel32.dll")> _
Private Shared Function ResumeThread(ByVal hThread As IntPtr) As Integer
End Function
Public Function Thread_Resume(ByVal ThreadHandle As IntPtr) As Integer
Return ResumeThread(ThreadHandle)
End Function
<DllImport("kernel32.dll")> _
Private Shared Function OpenThread(ByVal dwDesiredAccess As ThreadAccess, ByVal bInheritHandle As Boolean, ByVal dwThreadId As Integer) As IntPtr
End Function
Public Function Thread_GetHandle(ByVal ThreadID As Integer) As IntPtr
Return OpenThread(ThreadAccess.SUSPEND_RESUME, False, ThreadID)
End Function
Public Function Thread_GetHandle(ByVal ThreadID As Integer, ByVal DesiredAccess As ThreadAccess) As IntPtr
Return OpenThread(DesiredAccess, False, ThreadID)
End Function
<DllImport("kernel32.dll", SetLastError:=True)> _
Private Shared Function CloseHandle(ByVal hHandle As IntPtr) As Boolean
End Function
Public Function Handle_Close(ByVal OpenedHandle As IntPtr) As Boolean
Return CloseHandle(OpenedHandle)
End Function
<Flags()> _
Public Enum ThreadAccess As Integer
TERMINATE = (&H1)
SUSPEND_RESUME = (&H2)
GET_CONTEXT = (&H8)
SET_CONTEXT = (&H10)
SET_INFORMATION = (&H20)
QUERY_INFORMATION = (&H40)
SET_THREAD_TOKEN = (&H80)
IMPERSONATE = (&H100)
DIRECT_IMPERSONATION = (&H200)
End Enum
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each thread As ProcessThread In Process.GetProcessesByName("Process Name")(0).Threads
Thread_Suspend(Thread_GetHandle(thread.Id))
Next
End Sub
End Class
Tag : .NET, Report Others, Win (Windows App), VB.NET
|
|
 |
 |
 |
 |
Date :
2012-05-12 15:38:25 |
By :
fifazvb |
View :
2805 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีคนมองเห็นกระทู้รี้หรือป่าวครับ
|
 |
 |
 |
 |
Date :
2012-05-12 18:19:57 |
By :
fifazvb |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รับจ้างทำโปรแกรมหยุดเทรด นะครับ 1000 บ. ติดต่อ https://www.facebook.com/S4ProHack/?ref=your_pages
|
 |
 |
 |
 |
Date :
2017-11-10 21:40:34 |
By :
S4 PRO |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ก่อนอื่นเราจะต้องรู้ หมาเลขเทรดที่เรา ต้องการก่อน นะครับ โดยผม จะแบ่งเป็น สองส่วนดังนี้
ส่วน Button1_Click จะเป็นส่วนของ การ หยุด เทรด
ตัวอย่าง
Code (VB.NET)
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Thread1 = 6196
Dim Thread2 = 6644
Dim Thread3 = 6648
For Each thread As ProcessThread In Process.GetProcessesByName("chrome")(0).Threads
Thread_Suspend(Thread_GetHandle(Thread1))
' Thread_Suspend(Thread_GetHandle(Thread2))
' Thread_Suspend(Thread_GetHandle(Thread3))
Next
End Sub
ส่วน Button2_Click จะเป็นส่วนของ การ เล่น เทรด
ตัวอย่าง
Code (VB.NET)
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Thread1 = 6196
Dim Thread2 = 6644
Dim Thread3 = 6648
For Each thread As ProcessThread In Process.GetProcessesByName("chrome")(0).Threads
Thread_Resume(Thread_GetHandle(Thread1))
' Thread_Resume(Thread_GetHandle(Thread2))
'Thread_Resume(Thread_GetHandle(Thread3))
Next
End Sub
ที่มา https://wj32.org/processhacker/forums/viewtopic.php?t=1269
|
 |
 |
 |
 |
Date :
2017-11-11 00:59:14 |
By :
bigsuntat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|