⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 一款防火墙源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMain 
   Caption         =   "Test"
   ClientHeight    =   1425
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3975
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   1425
   ScaleWidth      =   3975
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdUninject 
      Caption         =   "&Uninject"
      Height          =   495
      Left            =   2280
      TabIndex        =   1
      Top             =   480
      Width           =   1215
   End
   Begin VB.CommandButton cmdInject 
      Caption         =   "&Inject"
      Height          =   495
      Left            =   480
      TabIndex        =   0
      Top             =   480
      Width           =   1215
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function InjectLibraryA Lib "madCHook.dll" (ByVal dwProcessHandleOrSpecialFlags As Long, ByVal pLibFileName As String, Optional ByVal dwTimeOut As Long) As Long
Private Declare Function UninjectLibraryA Lib "madCHook.dll" (ByVal dwProcessHandleOrSpecialFlags As Long, ByVal pLibFileName As String, Optional ByVal dwTimeOut As Long) As Long

' these flags can be used for both UninjectLibrary + InjectLibrary
Private Const ALL_SESSIONS As Long = &HFFFFFFED       ' apps of all sessions
Private Const CURRENT_SESSION As Long = &HFFFFFFEC ' apps of current session
Private Const CURRENT_USER    As Long = &HFFFFFFEB ' apps of current user
Private Const DONT_COUNT As Long = &H1

' the following flags may only be used in combination with the first 3 flags
Private Const SYSTEM_PROCESSES As Long = &H10 ' include this flag to include system processes + services
Private Const CURRENT_PROCESS  As Long = &H8  ' exclude this flag to exclude injection into yourself

Private Sub cmdInject_Click()
  cmdInject.Enabled = False
  'InjectLibraryA ALL_SESSIONS Or SYSTEM_PROCESSES Or DONT_COUNT, "PSMFireW.dll"
  If Not InjectLibraryA(ALL_SESSIONS Or SYSTEM_PROCESSES, "PSMFireW.dll") Then
    If Not InjectLibraryA(CURRENT_USER, "PSMFireW.dll") Then
        MsgBox "Error Inject DLL!"
    End If
  End If
  'InjectLibraryA CURRENT_USER, "PSMFireW.dll"
  cmdInject.Enabled = True
End Sub

Private Sub cmdUninject_Click()
  cmdUninject.Enabled = False
  'UninjectLibraryA ALL_SESSIONS Or SYSTEM_PROCESSES Or DONT_COUNT, "PSMFireW.dll"
  If Not UninjectLibraryA(ALL_SESSIONS Or SYSTEM_PROCESSES, "PSMFireW.dll") Then
    UninjectLibraryA CURRENT_USER, "PSMFireW.dll"
  End If
    
  'UninjectLibraryA CURRENT_USER, "PSMFireW.dll"
  cmdUninject.Enabled = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -