frmMain.frm
资源名称:00011511.rar [点击查看]
上传用户:xiuanze55
上传日期:2017-08-03
资源大小:1080k
文件大小:3k
源码类别:
Delphi控件源码
开发平台:
Delphi
- 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