0
回答
Windows:利用hook一键禁止所有进程 我是刚学会的,高手请谅解
【腾讯云】校园拼团福利,1核2G服务器10元/月!>>>   

利用hook一键禁止所有进程。软件下载地址http://gualihuala.pc.ev123.com.cn/gualihuala/vip_doc/3335535.html

我是刚学会的,高手请谅解。

VB代码:

Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function MessageBoxA Lib "user32" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type COPYDATASTRUCT
    dwData As Long
    cbData As Long
    lpData As Long
End Type
Public c As Long

Public Function Wndproc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim s As String
Dim cds As COPYDATASTRUCT
    If Msg = &H4A Then
    CopyMemory cds, ByVal lParam, Len(cds)
    s = Space(cds.cbData)
    CopyMemory ByVal s, ByVal cds.lpData, cds.cbData
    s = StrConv(s, vbFromUnicode)
    s = Left(s, InStr(1, s, Chr(0)) - 1)
    s = "进程(Pid:" & wParam & ")要创建新进程: " & s & ",是否允许?"
        If MessageBoxA(0, s, "", 4) = 6 Then
            Wndproc = 1234
        Else
            Wndproc = 0
        End If
        Exit Function
    End If
    Wndproc = CallWindowProc(c, hwnd, Msg, wParam, lParam)
End Function




<无标签>
举报
hupiyingwu
发帖于1年前 0回/340阅
顶部