HACKIS - Hacking Internet Security
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Show & Kill Processes EmptyThu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Show & Kill Processes EmptyThu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Show & Kill Processes EmptyMon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Show & Kill Processes EmptyTue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Show & Kill Processes EmptyTue Apr 17, 2012 10:03 pm by Admin

» Giá của món quà
Show & Kill Processes EmptyFri Apr 13, 2012 6:01 am by Admin

» Sẽ chỉ yêu ai?
Show & Kill Processes EmptyFri Apr 13, 2012 6:01 am by Admin

» Cách đọc bảng chữ cái!
Show & Kill Processes EmptyThu Apr 12, 2012 10:37 pm by Admin

» Gắn trojan, keylog, virus vào website, forum
Show & Kill Processes EmptyTue Apr 10, 2012 1:14 am by Admin

Affiliates
free forum


Show & Kill Processes

Go down

Show & Kill Processes Empty Show & Kill Processes

Post  Admin Mon Jun 13, 2011 4:22 am

Hướng dẫn viết chương trình hiển thị tất cả tiến trình đang chạy
Một số chương trình của Windows hay trojan chạy ẩn mà chúng ta không hay biết, TaskManager chỉ hiển thị một phần nào đó. Chương trình sau sẽ hiện tất cả các tiến trình đang chạy, và có thể tắt tiến trình đó nếu như ta không muốn chạy (Ví dụ Trojan chẳng hạn).

Thành phần của chương trình

- Hàm API:

Code:
Private Declare Function GetWindow Lib "user32" _
(ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetParent Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function GetWindowTextLength Lib _
"user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" _
Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal _
lpString As String, ByVal cch As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As

String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long,

ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const GW_HWNDFIRST = 0
Const GW_HWNDNEXT = 2

- Đối tượng

3 Command Button có thuộc tính (Name) lần lượt là cmdKillProcess, cmdRefresh, cmdQuit
1 ListBox có thuộc tính (Name) là lstTientrinh

Mã nguồn
Private Declare Function GetWindow Lib "user32" _
(ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetParent Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function GetWindowTextLength Lib _
"user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowText Lib "user32" _
Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal _
lpString As String, ByVal cch As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As

String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long,

ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Const GW_HWNDFIRST = 0
Const GW_HWNDNEXT = 2
Dim TenTienTrinh As String
Private Sub cmdKillProcess_Click()
Dim Ret As Long
Dim hwnd As Long
On Error GoTo Refresh
hwnd = FindWindow(vbNullString, TenTienTrinh)
If hwnd <> 0 Then
Ret = PostMessage(hwnd, &H10, 0, 0)
If Ret = 0 Then
MsgBox "Khong the tat chuong trinh " & TenTienTrinh, vbExclamation, "Warning"
Else
MsgBox "Da tat chuong trinh " & TenTienTrinh, vbInformation, "Warning"
End If
End If
Refresh:
HienThiTienTrinh
End Sub

Private Sub cmdQuit_Click()
Unload Me
End Sub

Private Sub Form_Load()
HienThiTienTrinh
End Sub
Sub HienThiTienTrinh()
Dim HwndHienTai As Long
Dim Length As Long, i As Long
Dim Parent As Long
Dim TienTrinh As String

i = 0
lstTientrinh.ListItems.Clear
lstTientrinh.ColumnHeaders.Add , , "STT"
lstTientrinh.ColumnHeaders.Add , , "Processes"
lstTientrinh.ColumnHeaders.Item(1).Width = 500
lstTientrinh.ColumnHeaders.Item(2).Width = lstTientrinh.Width - 400

HwndHienTai = GetWindow(frmShowProcess.hwnd, GW_HWNDFIRST)
While HwndHienTai <> 0
Length = GetWindowTextLength(HwndHienTai)
TienTrinh = Space(Length + 1)
Length = GetWindowText(HwndHienTai, TienTrinh, Length + 1)
TienTrinh = Left(TienTrinh, Len(TienTrinh) - 1)
If Length <> 0 Then
If Me.Caption <> TienTrinh Then
If TienTrinh <> "taskmon" Then
i = i + 1
lstTientrinh.ListItems.Add(, , i).ListSubItems.Add , , TienTrinh
End If
End If
End If
HwndHienTai = GetWindow(HwndHienTai, GW_HWNDNEXT)
DoEvents
Wend
End Sub

Private Sub lstTientrinh_ItemClick(ByVal Item As MSComctlLib.ListItem)
TenTienTrinh = Item.ListSubItems(1).Text
End Sub


Admin
Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

https://hackis.forumvi.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum