├── KeyMouseClient
├── DriverManage.cpp
├── DriverManage.h
├── KeyMouseClient.cpp
├── KeyMouseClient.h
├── KeyMouseClient.rc
├── KeyMouseClient.sln
├── KeyMouseClient.vcproj
├── KeyMouseClientDlg.cpp
├── KeyMouseClientDlg.h
├── ReadMe.txt
├── WinKM.cpp
├── WinKM.h
├── res
│ ├── KeyMouseClient.ico
│ └── KeyMouseClient.rc2
├── resource.h
├── stdafx.cpp
└── stdafx.h
├── KeyMouseDriver
├── KeyMouse.c
├── KeyMouse.dsp
├── KeyMouse.dsw
├── KeyMouse.h
├── KeyMouse.sln
├── KeyMouse.vcproj
├── KeyMouse.vcxproj
├── WssLockKey.c
├── WssLockKey.h
├── pe.h
└── struct.h
├── README.md
└── doc
├── translate.pdf
└── 键盘扫描码.pdf
/KeyMouseClient/DriverManage.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/DriverManage.cpp
--------------------------------------------------------------------------------
/KeyMouseClient/DriverManage.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
4 | ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
5 | )
6 | #define METHOD_BUFFERED 0
7 | #define METHOD_IN_DIRECT 1
8 | #define METHOD_OUT_DIRECT 2
9 | #define METHOD_NEITHER 3
10 | #define FILE_ANY_ACCESS 0
11 |
12 | #define FILE_DEVICE_KEYMOUSE 0x8000
13 | #define KEYMOUSE_IOCTL_BASE 0x800
14 |
15 | //
16 | // The device driver IOCTLs
17 |
18 | //
19 | #define CTL_CODE_KEYMOUSE(i) CTL_CODE(FILE_DEVICE_KEYMOUSE, KEYMOUSE_IOCTL_BASE + i, METHOD_BUFFERED, FILE_ANY_ACCESS)
20 | #define IOCTL_KEYMOUSE_HELLO CTL_CODE_KEYMOUSE(0)
21 | #define IOCTL_KEYMOUSE_TEST CTL_CODE_KEYMOUSE(1)
22 |
23 | #define IOCTL_SEND_KEY CTL_CODE_KEYMOUSE(20)
24 | #define IOCTL_SEND_MOUSE CTL_CODE_KEYMOUSE(21)
25 | //
26 | // Name that Win32 front end will use to open the KeyMouse device
27 | //
28 | #define KEYMOUSE_WIN32_DEVICE_NAME_A "\\\\.\\KeyMouse"
29 | #define KEYMOUSE_WIN32_DEVICE_NAME_W L"\\\\.\\KeyMouse"
30 | #define KEYMOUSE_DEVICE_NAME_A "\\Device\\KeyMouse"
31 | #define KEYMOUSE_DEVICE_NAME_W L"\\Device\\KeyMouse"
32 | #define KEYMOUSE_DOS_DEVICE_NAME_A "\\DosDevices\\KeyMouse"
33 | #define KEYMOUSE_DOS_DEVICE_NAME_W L"\\DosDevices\\KeyMouse"
34 |
35 | #ifdef _UNICODE
36 | #define KEYMOUSE_WIN32_DEVICE_NAME KEYMOUSE_WIN32_DEVICE_NAME_W
37 | #define KEYMOUSE_DEVICE_NAME KEYMOUSE_DEVICE_NAME_W
38 | #define KEYMOUSE_DOS_DEVICE_NAME KEYMOUSE_DOS_DEVICE_NAME_W
39 | #else
40 | #define KEYMOUSE_WIN32_DEVICE_NAME KEYMOUSE_WIN32_DEVICE_NAME_A
41 | #define KEYMOUSE_DEVICE_NAME KEYMOUSE_DEVICE_NAME_A
42 | #define KEYMOUSE_DOS_DEVICE_NAME KEYMOUSE_DOS_DEVICE_NAME_A
43 | #endif
44 |
45 | #define KEYMOUSE_SERVICE_NAME_A "KeyMouse"
46 | #define KEYMOUSE_DRIVER_NAME_A "KeyMouse.sys"
47 |
48 | class CDriverManage
49 | {
50 | public:
51 | CDriverManage(void);
52 | public:
53 | ~CDriverManage(void);
54 | public:
55 | HANDLE hDriver;
56 | public:
57 | BOOL StartDriver();
58 | BOOL StopDriver();
59 | BOOL SendMsg(ULONG uCmd);
60 | BOOL SendDeviceControl(DWORD dwIoControlCode, LPVOID lpInBuffer = NULL, DWORD nInBufferSize = 0, LPVOID lpOutBuffer = NULL, DWORD nOutBufferSize = 0);
61 | };
62 | extern CDriverManage g_DriverManage;
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClient.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/KeyMouseClient.cpp
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClient.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/KeyMouseClient.h
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClient.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/KeyMouseClient.rc
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClient.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyMouseClient", "KeyMouseClient.vcproj", "{4CCAB00D-40DA-4C46-8BBA-8266C7D9CF04}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4CCAB00D-40DA-4C46-8BBA-8266C7D9CF04}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {4CCAB00D-40DA-4C46-8BBA-8266C7D9CF04}.Debug|Win32.Build.0 = Debug|Win32
14 | {4CCAB00D-40DA-4C46-8BBA-8266C7D9CF04}.Release|Win32.ActiveCfg = Release|Win32
15 | {4CCAB00D-40DA-4C46-8BBA-8266C7D9CF04}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClient.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
26 |
29 |
32 |
35 |
38 |
44 |
56 |
59 |
65 |
68 |
75 |
78 |
81 |
84 |
87 |
90 |
93 |
96 |
99 |
100 |
109 |
112 |
115 |
118 |
121 |
127 |
137 |
140 |
146 |
149 |
158 |
161 |
164 |
167 |
170 |
173 |
176 |
179 |
182 |
183 |
184 |
185 |
186 |
187 |
192 |
195 |
196 |
199 |
200 |
203 |
204 |
207 |
210 |
214 |
215 |
218 |
222 |
223 |
224 |
227 |
228 |
229 |
234 |
237 |
238 |
241 |
242 |
245 |
246 |
249 |
250 |
253 |
254 |
257 |
258 |
259 |
264 |
267 |
268 |
271 |
272 |
275 |
276 |
277 |
280 |
281 |
282 |
283 |
287 |
288 |
289 |
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClientDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/KeyMouseClientDlg.cpp
--------------------------------------------------------------------------------
/KeyMouseClient/KeyMouseClientDlg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/KeyMouseClientDlg.h
--------------------------------------------------------------------------------
/KeyMouseClient/ReadMe.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/ReadMe.txt
--------------------------------------------------------------------------------
/KeyMouseClient/WinKM.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/WinKM.cpp
--------------------------------------------------------------------------------
/KeyMouseClient/WinKM.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/WinKM.h
--------------------------------------------------------------------------------
/KeyMouseClient/res/KeyMouseClient.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/res/KeyMouseClient.ico
--------------------------------------------------------------------------------
/KeyMouseClient/res/KeyMouseClient.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/res/KeyMouseClient.rc2
--------------------------------------------------------------------------------
/KeyMouseClient/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by KeyMouseClient.rc
4 | //
5 | #define IDM_ABOUTBOX 0x0010
6 | #define IDD_ABOUTBOX 100
7 | #define IDS_ABOUTBOX 101
8 | #define IDD_KeyMouseClient_DIALOG 102
9 | #define IDR_MAINFRAME 128
10 | #define IDC_BUTTON_STARTMON 1000
11 | #define IDC_BUTTON_PROCESS_ON 1001
12 | #define IDC_BUTTON_START 1001
13 | #define IDC_BUTTON_PROCESS_OFF 1002
14 | #define IDC_STATIC_STATUS 1003
15 |
16 | // Next default values for new objects
17 | //
18 | #ifdef APSTUDIO_INVOKED
19 | #ifndef APSTUDIO_READONLY_SYMBOLS
20 | #define _APS_NEXT_RESOURCE_VALUE 129
21 | #define _APS_NEXT_COMMAND_VALUE 32771
22 | #define _APS_NEXT_CONTROL_VALUE 1004
23 | #define _APS_NEXT_SYMED_VALUE 101
24 | #endif
25 | #endif
26 |
--------------------------------------------------------------------------------
/KeyMouseClient/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/stdafx.cpp
--------------------------------------------------------------------------------
/KeyMouseClient/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseClient/stdafx.h
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/KeyMouse.c
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.dsp:
--------------------------------------------------------------------------------
1 | # Microsoft Developer Studio Project File - Name="KeyMouse" - Package Owner=<4>
2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00
3 | # ** DO NOT EDIT **
4 |
5 | # TARGTYPE "Win32 (x86) Application" 0x0101
6 |
7 | CFG=KeyMouse - Win32 Debug
8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE,
9 | !MESSAGE use the Export Makefile command and run
10 | !MESSAGE
11 | !MESSAGE NMAKE /f "KeyMouse.mak".
12 | !MESSAGE
13 | !MESSAGE You can specify a configuration when running NMAKE
14 | !MESSAGE by defining the macro CFG on the command line. For example:
15 | !MESSAGE
16 | !MESSAGE NMAKE /f "KeyMouse.mak" CFG="KeyMouse - Win32 Debug"
17 | !MESSAGE
18 | !MESSAGE Possible choices for configuration are:
19 | !MESSAGE
20 | !MESSAGE "KeyMouse - Win32 Release" (based on "Win32 (x86) Application")
21 | !MESSAGE "KeyMouse - Win32 Debug" (based on "Win32 (x86) Application")
22 | !MESSAGE
23 |
24 | # Begin Project
25 | # PROP AllowPerConfigDependencies 0
26 | # PROP Scc_ProjName ""
27 | # PROP Scc_LocalPath ""
28 | CPP=cl.exe
29 | MTL=midl.exe
30 | RSC=rc.exe
31 |
32 | !IF "$(CFG)" == "KeyMouse - Win32 Release"
33 |
34 | # PROP BASE Use_MFC 0
35 | # PROP BASE Use_Debug_Libraries 0
36 | # PROP BASE Output_Dir "Release"
37 | # PROP BASE Intermediate_Dir "Release"
38 | # PROP BASE Target_Dir ""
39 | # PROP Use_MFC 0
40 | # PROP Use_Debug_Libraries 0
41 | # PROP Output_Dir "Release"
42 | # PROP Intermediate_Dir "Release"
43 | # PROP Target_Dir ""
44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
45 | # ADD CPP /nologo /Gz /W3 /GX /Zi /Oi /I "$(ddkroot)\inc\ddk\wxp" /I "$(ddkroot)\inc\wxp" /I "$(ddkroot)\inc\crt" /D "WIN32" /D "NDEBUG" /D "_X86_" /D "i386" /D "STD_CALL" /D "CONDITION_HANDLING" /D "WIN32_LEAN_AND_MEAN" /D "NT_UP" /D "SRVDBG" /D "DBG" /D "_IDWBUILD" /D _WIN32_WINNT=0x0400 /YX /FD /c
46 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
47 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
48 | # ADD BASE RSC /l 0x804 /d "NDEBUG"
49 | # ADD RSC /l 0x804 /d "NDEBUG"
50 | BSC32=bscmake.exe
51 | # ADD BASE BSC32 /nologo
52 | # ADD BSC32 /nologo
53 | LINK32=link.exe
54 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"Release/KeyMouse.sys"
55 | # ADD LINK32 ntoskrnl.lib hal.lib /nologo /entry:"DriverEntry" /machine:I386 /out:"Release/KeyMouse.sys" /libpath:"$(ddkroot)\lib\wxp\i386" /subsystem:native /driver
56 |
57 | !ELSEIF "$(CFG)" == "KeyMouse - Win32 Debug"
58 |
59 | # PROP BASE Use_MFC 0
60 | # PROP BASE Use_Debug_Libraries 1
61 | # PROP BASE Output_Dir "Debug"
62 | # PROP BASE Intermediate_Dir "Debug"
63 | # PROP BASE Target_Dir ""
64 | # PROP Use_MFC 0
65 | # PROP Use_Debug_Libraries 1
66 | # PROP Output_Dir "Debug"
67 | # PROP Intermediate_Dir "Debug"
68 | # PROP Target_Dir ""
69 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
70 | # ADD CPP /nologo /Gz /W3 /GX /Zi /Oi /I "$(ddkroot)\inc\ddk\wxp" /I "$(ddkroot)\inc\wxp" /I "$(ddkroot)\inc\crt" /D "WIN32" /D "_DEBUG" /D "_X86_" /D "i386" /D "STD_CALL" /D "CONDITION_HANDLING" /D "WIN32_LEAN_AND_MEAN" /D "NT_UP" /D "SRVDBG" /D "DBG" /D "_IDWBUILD" /D _WIN32_WINNT=0x0400 /YX /FD /c
71 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
72 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
73 | # ADD BASE RSC /l 0x804 /d "_DEBUG"
74 | # ADD RSC /l 0x804 /d "_DEBUG"
75 | BSC32=bscmake.exe
76 | # ADD BASE BSC32 /nologo
77 | # ADD BSC32 /nologo
78 | LINK32=link.exe
79 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug/KeyMouse.sys" /pdbtype:sept
80 | # ADD LINK32 ntoskrnl.lib hal.lib /nologo /entry:"DriverEntry" /incremental:no /debug /machine:I386 /out:"Debug/KeyMouse.sys" /pdbtype:sept /libpath:"$(ddkroot)\lib\wxp\i386" /subsystem:native /driver
81 |
82 | !ENDIF
83 |
84 | # Begin Target
85 |
86 | # Name "KeyMouse - Win32 Release"
87 | # Name "KeyMouse - Win32 Debug"
88 | # Begin Group "Source Files"
89 |
90 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
91 | # Begin Source File
92 |
93 | SOURCE=.\KeyMouse.c
94 | # End Source File
95 | # End Group
96 | # Begin Group "Header Files"
97 |
98 | # PROP Default_Filter "h;hpp;hxx;hm;inl"
99 | # Begin Source File
100 |
101 | SOURCE=.\KeyMouse.h
102 | # End Source File
103 | # End Group
104 | # Begin Group "Resource Files"
105 |
106 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
107 | # End Group
108 | # End Target
109 | # End Project
110 |
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.dsw:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/KeyMouse.dsw
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | KeyMouse.H
4 |
5 | Author:
6 | Last Updated: 2006-02-12
7 |
8 | This framework is generated by EasySYS 0.3.0
9 | This template file is copying from QuickSYS 0.3.0 written by Chunhua Liu
10 |
11 | */
12 | #ifndef _KEYMOUSE_H
13 | #define _KEYMOUSE_H 1
14 |
15 | //
16 | // Define the various device type values. Note that values used by Microsoft
17 | // Corporation are in the range 0-0x7FFF(32767), and 0x8000(32768)-0xFFFF(65535)
18 | // are reserved for use by customers.
19 | //
20 | #define FILE_DEVICE_KEYMOUSE 0x8000
21 |
22 | //
23 | // Macro definition for defining IOCTL and FSCTL function control codes. Note
24 | // that function codes 0-0x7FF(2047) are reserved for Microsoft Corporation,
25 | // and 0x800(2048)-0xFFF(4095) are reserved for customers.
26 | //
27 | #define KEYMOUSE_IOCTL_BASE 0x800
28 |
29 | //
30 | // The device driver IOCTLs
31 |
32 | //
33 | #define CTL_CODE_KEYMOUSE(i) CTL_CODE(FILE_DEVICE_KEYMOUSE, KEYMOUSE_IOCTL_BASE + i, METHOD_BUFFERED, FILE_ANY_ACCESS)
34 | #define IOCTL_KEYMOUSE_HELLO CTL_CODE_KEYMOUSE(0)
35 | #define IOCTL_KEYMOUSE_TEST CTL_CODE_KEYMOUSE(1)
36 |
37 | #define IOCTL_SEND_KEY CTL_CODE_KEYMOUSE(20)
38 | #define IOCTL_SEND_MOUSE CTL_CODE_KEYMOUSE(21)
39 | //
40 | // Name that Win32 front end will use to open the KeyMouse device
41 | //
42 | #define KEYMOUSE_WIN32_DEVICE_NAME_A "\\\\.\\KeyMouse"
43 | #define KEYMOUSE_WIN32_DEVICE_NAME_W L"\\\\.\\KeyMouse"
44 | #define KEYMOUSE_DEVICE_NAME_A "\\Device\\KeyMouse"
45 | #define KEYMOUSE_DEVICE_NAME_W L"\\Device\\KeyMouse"
46 | #define KEYMOUSE_DOS_DEVICE_NAME_A "\\DosDevices\\KeyMouse"
47 | #define KEYMOUSE_DOS_DEVICE_NAME_W L"\\DosDevices\\KeyMouse"
48 |
49 | #ifdef _UNICODE
50 | #define KEYMOUSE_WIN32_DEVICE_NAME KEYMOUSE_WIN32_DEVICE_NAME_W
51 | #define KEYMOUSE_DEVICE_NAME KEYMOUSE_DEVICE_NAME_W
52 | #define KEYMOUSE_DOS_DEVICE_NAME KEYMOUSE_DOS_DEVICE_NAME_W
53 | #else
54 | #define KEYMOUSE_WIN32_DEVICE_NAME KEYMOUSE_WIN32_DEVICE_NAME_A
55 | #define KEYMOUSE_DEVICE_NAME KEYMOUSE_DEVICE_NAME_A
56 | #define KEYMOUSE_DOS_DEVICE_NAME KEYMOUSE_DOS_DEVICE_NAME_A
57 | #endif
58 | #endif
59 |
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.sln:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/KeyMouse.sln
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
26 |
29 |
32 |
35 |
38 |
47 |
64 |
67 |
72 |
75 |
88 |
91 |
94 |
97 |
102 |
105 |
108 |
111 |
114 |
115 |
124 |
127 |
130 |
133 |
136 |
145 |
162 |
165 |
170 |
173 |
187 |
190 |
193 |
196 |
201 |
204 |
207 |
210 |
213 |
214 |
215 |
216 |
217 |
218 |
222 |
225 |
228 |
233 |
234 |
237 |
242 |
243 |
244 |
245 |
249 |
252 |
253 |
256 |
257 |
260 |
261 |
262 |
266 |
267 |
268 |
269 |
270 |
271 |
--------------------------------------------------------------------------------
/KeyMouseDriver/KeyMouse.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {75F875B0-CB90-477D-94E2-FC2B7753A1B2}
15 |
16 |
17 |
18 | Application
19 | false
20 |
21 |
22 | Application
23 | false
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | <_ProjectFileVersion>10.0.21006.1
39 | .\Release\
40 | .\Release\
41 | false
42 | .\Debug\
43 | .\Debug\
44 | false
45 | AllRules.ruleset
46 |
47 |
48 | AllRules.ruleset
49 |
50 |
51 | ..\..\..\..\..\WINDDK\3790\inc;..\..\..\..\..\WINDDK\3790\inc\wnet;..\..\..\..\..\WINDDK\3790\inc\ddk\wnet;$(IncludePath)
52 | ..\..\..\..\..\WINDDK\3790\lib;..\..\..\..\..\WINDDK\3790\lib\wnet;..\..\..\..\..\WINDDK\3790\lib\wnet\i386;$(LibraryPath)
53 | false
54 |
55 |
56 |
57 | NDEBUG;%(PreprocessorDefinitions)
58 | true
59 | true
60 | Win32
61 | .\Release/KeyMouse.tlb
62 |
63 |
64 |
65 |
66 | Disabled
67 | true
68 | $(ddkroot)\inc\ddk\wxp;$(ddkroot)\inc\wxp;$(ddkroot)\inc\crt;%(AdditionalIncludeDirectories)
69 | WIN32;NDEBUG;_X86_;i386;STD_CALL;CONDITION_HANDLING;WIN32_LEAN_AND_MEAN;NT_UP;SRVDBG;DBG;_IDWBUILD;_WIN32_WINNT=0x0400;%(PreprocessorDefinitions)
70 | MultiThreaded
71 | .\Release/KeyMouse.pch
72 | .\Release/
73 | .\Release/
74 | .\Release/
75 | Level3
76 | true
77 | ProgramDatabase
78 | StdCall
79 |
80 |
81 | NDEBUG;%(PreprocessorDefinitions)
82 | 0x0804
83 |
84 |
85 | /DRIVER /subsystem:native %(AdditionalOptions)
86 | ntoskrnl.lib;hal.lib;%(AdditionalDependencies)
87 | Release/KeyMouse.sys
88 | true
89 | $(ddkroot)\lib\wxp\i386;%(AdditionalLibraryDirectories)
90 | .\Release/KeyMouse.pdb
91 | DriverEntry
92 | MachineX86
93 |
94 |
95 | true
96 | .\Release/KeyMouse.bsc
97 |
98 |
99 |
100 |
101 | _DEBUG;%(PreprocessorDefinitions)
102 | true
103 | true
104 | Win32
105 | .\Debug/KeyMouse.tlb
106 |
107 |
108 |
109 |
110 | Disabled
111 | true
112 | %(AdditionalIncludeDirectories)
113 | WIN32;_DEBUG;_X86_;i386;STD_CALL;CONDITION_HANDLING;WIN32_LEAN_AND_MEAN;NT_UP;SRVDBG;DBG;_IDWBUILD;_WIN32_WINNT=0x0400;%(PreprocessorDefinitions)
114 | MultiThreadedDebug
115 | .\Debug/KeyMouse.pch
116 | .\Debug/
117 | .\Debug/
118 | .\Debug/
119 | Level3
120 | true
121 | ProgramDatabase
122 | StdCall
123 | false
124 | false
125 | CompileAsC
126 |
127 |
128 | _DEBUG;%(PreprocessorDefinitions)
129 | 0x0804
130 |
131 |
132 | ntoskrnl.lib;hal.lib;%(AdditionalDependencies)
133 | Debug/KeyMouse.sys
134 | true
135 | %(AdditionalLibraryDirectories)
136 | true
137 | .\Debug/KeyMouse.pdb
138 | DriverEntry
139 | MachineX86
140 | false
141 | true
142 |
143 |
144 | Native
145 | Driver
146 | 0x10000
147 |
148 |
149 |
150 |
151 | true
152 | .\Debug/KeyMouse.bsc
153 |
154 |
155 |
156 |
157 | %(AdditionalIncludeDirectories)
158 | %(PreprocessorDefinitions)
159 | %(AdditionalIncludeDirectories)
160 | %(PreprocessorDefinitions)
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
--------------------------------------------------------------------------------
/KeyMouseDriver/WssLockKey.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/WssLockKey.c
--------------------------------------------------------------------------------
/KeyMouseDriver/WssLockKey.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/WssLockKey.h
--------------------------------------------------------------------------------
/KeyMouseDriver/pe.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/pe.h
--------------------------------------------------------------------------------
/KeyMouseDriver/struct.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/KeyMouseDriver/struct.h
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 兼容USB和PS2键盘驱动模拟方法
2 | ## 优点:
3 | 可以绕过模拟检测
4 | ## 技术原理:
5 | ### 1、键盘模拟
6 | 通过直接调用Kbdclass的回调函数KeyboardClassServiceCallback直接给上层发送KEYBOARD_INPUT_DATA键盘消息
7 | ### 2、鼠标模拟
8 | 驱动mouclass.sys中的MouseClassServiceCallback函数
9 | 通过直接调用mouclass.sys中的MouseClassServiceCallback函数,发送MOUSE_INPUT_DATA消息鼠标键盘
--------------------------------------------------------------------------------
/doc/translate.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/doc/translate.pdf
--------------------------------------------------------------------------------
/doc/键盘扫描码.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mergerly/KeyMouseSim/4bba8475ecc1e32ea4b8324a5ba564e3e099610b/doc/键盘扫描码.pdf
--------------------------------------------------------------------------------