├── .gitignore
├── .vs
└── QmsgQ-inject-hook
│ └── v16
│ ├── .suo
│ ├── Browse.VC.db-shm
│ ├── Browse.VC.db-wal
│ └── Browse.VC.opendb
├── Debug
├── HookQQMsg.pdb
├── HookQQMsgDll.pdb
├── QmsgQ-in.51e69fa6.tlog
│ └── QmsgQ-inject-hook.lastbuildstate
├── QmsgQ-inject-hook.exe.recipe
└── QmsgQ-inject-hook.log
├── HookQQMsg
├── HookQQMsg.sln
├── HookQQMsg.suo
└── HookQQMsg
│ ├── Debug
│ ├── HookQQMsg.exe.recipe
│ ├── HookQQMsg.ilk
│ ├── HookQQMsg.log
│ ├── HookQQMsg.tlog
│ │ ├── CL.command.1.tlog
│ │ ├── CL.read.1.tlog
│ │ ├── CL.write.1.tlog
│ │ ├── HookQQMsg.lastbuildstate
│ │ ├── link.command.1.tlog
│ │ ├── link.read.1.tlog
│ │ └── link.write.1.tlog
│ ├── vc142.idb
│ └── vc142.pdb
│ ├── HookQQMsg.cpp
│ ├── HookQQMsg.h
│ ├── HookQQMsg.vcxproj
│ ├── HookQQMsg.vcxproj.filters
│ ├── HookQQMsg.vcxproj.user
│ └── Release
│ ├── HookQQMsg.exe.recipe
│ ├── HookQQMsg.iobj
│ ├── HookQQMsg.ipdb
│ ├── HookQQMsg.log
│ ├── HookQQMsg.tlog
│ ├── CL.command.1.tlog
│ ├── CL.read.1.tlog
│ ├── CL.write.1.tlog
│ ├── HookQQMsg.lastbuildstate
│ ├── link.command.1.tlog
│ ├── link.read.1.tlog
│ └── link.write.1.tlog
│ └── vc142.pdb
├── HookQQMsgDll
├── HookQQMsgDll.sln
├── HookQQMsgDll.suo
└── HookQQMsgDll
│ ├── Debug
│ ├── HookQQMsgDll.dll.recipe
│ ├── HookQQMsgDll.ilk
│ ├── HookQQMsgDll.log
│ ├── HookQQMsgDll.tlog
│ │ ├── CL.command.1.tlog
│ │ ├── CL.read.1.tlog
│ │ ├── CL.write.1.tlog
│ │ ├── HookQQMsgDll.lastbuildstate
│ │ ├── link.command.1.tlog
│ │ ├── link.read.1.tlog
│ │ └── link.write.1.tlog
│ ├── vc142.idb
│ └── vc142.pdb
│ ├── HookQQMsgDll.cpp
│ ├── HookQQMsgDll.h
│ ├── HookQQMsgDll.vcxproj
│ ├── HookQQMsgDll.vcxproj.filters
│ ├── HookQQMsgDll.vcxproj.user
│ ├── Release
│ ├── HookQQMsgDll.dll.recipe
│ ├── HookQQMsgDll.iobj
│ ├── HookQQMsgDll.ipdb
│ ├── HookQQMsgDll.log
│ ├── HookQQMsgDll.tlog
│ │ ├── CL.command.1.tlog
│ │ ├── CL.read.1.tlog
│ │ ├── CL.write.1.tlog
│ │ ├── HookQQMsgDll.lastbuildstate
│ │ ├── link.command.1.tlog
│ │ ├── link.read.1.tlog
│ │ └── link.write.1.tlog
│ └── vc142.pdb
│ ├── Utils.cpp
│ ├── Utils.h
│ ├── VersionHelpers.h
│ └── winapifamily.h
├── LICENSE
├── QmsgQ-inject-hook.sln
├── QmsgQ-inject-hook.vcxproj
├── QmsgQ-inject-hook.vcxproj.filters
├── QmsgQ-inject-hook.vcxproj.user
├── README.md
└── Release
├── HookQQMsg.pdb
├── HookQQMsgDll.pdb
├── QmsgQ-in.51e69fa6.tlog
└── QmsgQ-inject-hook.lastbuildstate
├── QmsgQ-inject-hook.exe.recipe
└── QmsgQ-inject-hook.log
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 | *.VC.db
4 | *.ipch
5 |
6 | # Compiled Object files
7 | *.slo
8 | *.lo
9 | *.o
10 | *.obj
11 |
12 | # Precompiled Headers
13 | *.gch
14 | *.pch
15 |
16 | # Compiled Dynamic libraries
17 | *.so
18 | *.dylib
19 | *.dll
20 |
21 | # Fortran module files
22 | *.mod
23 | *.smod
24 |
25 | # Compiled Static libraries
26 | *.lai
27 | *.la
28 | *.a
29 | *.lib
30 |
31 | # Executables
32 | *.exe
33 | *.out
34 | *.app
35 |
--------------------------------------------------------------------------------
/.vs/QmsgQ-inject-hook/v16/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/.vs/QmsgQ-inject-hook/v16/.suo
--------------------------------------------------------------------------------
/.vs/QmsgQ-inject-hook/v16/Browse.VC.db-shm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/.vs/QmsgQ-inject-hook/v16/Browse.VC.db-shm
--------------------------------------------------------------------------------
/.vs/QmsgQ-inject-hook/v16/Browse.VC.db-wal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/.vs/QmsgQ-inject-hook/v16/Browse.VC.db-wal
--------------------------------------------------------------------------------
/.vs/QmsgQ-inject-hook/v16/Browse.VC.opendb:
--------------------------------------------------------------------------------
1 | A d m i n L J G
--------------------------------------------------------------------------------
/Debug/HookQQMsg.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/Debug/HookQQMsg.pdb
--------------------------------------------------------------------------------
/Debug/HookQQMsgDll.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/Debug/HookQQMsgDll.pdb
--------------------------------------------------------------------------------
/Debug/QmsgQ-in.51e69fa6.tlog/QmsgQ-inject-hook.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.22000.0:
2 | Debug|Win32|D:\project\QmsgQ-inject-hook\|
3 |
--------------------------------------------------------------------------------
/Debug/QmsgQ-inject-hook.exe.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\project\QmsgQ-inject-hook\Debug\QmsgQ-inject-hook.exe
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Debug/QmsgQ-inject-hook.log:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookQQMsg", "HookQQMsg\HookQQMsg.vcxproj", "{9E344DC7-0B7F-44E2-A052-C53640FB7DC4}"
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 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|Win32.Build.0 = Debug|Win32
14 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|Win32.ActiveCfg = Release|Win32
15 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg.suo
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.exe.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\project\QmsgQ-inject-hook\Debug\HookQQMsg.exe
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.ilk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.ilk
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.log:
--------------------------------------------------------------------------------
1 | HookQQMsg.cpp
2 | HookQQMsg.vcxproj -> D:\project\QmsgQ-inject-hook\Debug\HookQQMsg.exe
3 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/CL.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/CL.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/CL.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/CL.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/CL.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/CL.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/HookQQMsg.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.22000.0:
2 | Debug|Win32|D:\project\QmsgQ-inject-hook\|
3 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/link.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/link.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/link.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/link.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/link.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/HookQQMsg.tlog/link.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/vc142.idb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/vc142.idb
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Debug/vc142.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Debug/vc142.pdb
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/HookQQMsg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/HookQQMsg.cpp
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/HookQQMsg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/HookQQMsg.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}
15 | Win32Proj
16 | HookQQMsg
17 | 10.0
18 |
19 |
20 |
21 | Application
22 | true
23 | Unicode
24 | v142
25 |
26 |
27 | Application
28 | false
29 | true
30 | Unicode
31 | v142
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | true
45 |
46 |
47 | false
48 |
49 |
50 |
51 |
52 |
53 | Level3
54 | Disabled
55 | WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
56 |
57 |
58 | Windows
59 | true
60 |
61 |
62 |
63 |
64 | Level3
65 |
66 |
67 | MaxSpeed
68 | true
69 | true
70 | WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
71 | MultiThreaded
72 |
73 |
74 | Windows
75 | true
76 | true
77 | true
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/HookQQMsg.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 源文件
20 |
21 |
22 |
23 |
24 | 头文件
25 |
26 |
27 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/HookQQMsg.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.exe.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\project\QmsgQ-inject-hook\Release\HookQQMsg.exe
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.iobj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.iobj
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.ipdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.ipdb
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.log:
--------------------------------------------------------------------------------
1 | HookQQMsg.cpp
2 | 正在生成代码
3 | 2 of 2 functions (100.0%) were compiled.
4 | 0 functions were new in current compilation
5 | 0 functions had inline decision re-evaluated but remain unchanged
6 | 已完成代码的生成
7 | HookQQMsg.vcxproj -> D:\project\QmsgQ-inject-hook\Release\HookQQMsg.exe
8 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/CL.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/CL.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/CL.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/CL.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/CL.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/CL.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/HookQQMsg.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.22000.0:
2 | Release|Win32|D:\project\QmsgQ-inject-hook\|
3 |
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/link.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/link.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/link.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/link.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/link.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/HookQQMsg.tlog/link.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsg/HookQQMsg/Release/vc142.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsg/HookQQMsg/Release/vc142.pdb
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookQQMsgDll", "HookQQMsgDll\HookQQMsgDll.vcxproj", "{44267637-4607-4B0E-A5A6-387807FF1128}"
5 | EndProject
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookQQMsg", "..\HookQQMsg\HookQQMsg\HookQQMsg.vcxproj", "{9E344DC7-0B7F-44E2-A052-C53640FB7DC4}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Win32 = Debug|Win32
11 | Release|Win32 = Release|Win32
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {44267637-4607-4B0E-A5A6-387807FF1128}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {44267637-4607-4B0E-A5A6-387807FF1128}.Debug|Win32.Build.0 = Debug|Win32
16 | {44267637-4607-4B0E-A5A6-387807FF1128}.Release|Win32.ActiveCfg = Release|Win32
17 | {44267637-4607-4B0E-A5A6-387807FF1128}.Release|Win32.Build.0 = Release|Win32
18 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|Win32.ActiveCfg = Debug|Win32
19 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|Win32.Build.0 = Debug|Win32
20 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|Win32.ActiveCfg = Release|Win32
21 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|Win32.Build.0 = Release|Win32
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | EndGlobal
27 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll.suo
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.dll.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\project\QmsgQ-inject-hook\Debug\HookQQMsgDll.dll
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.ilk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.ilk
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.log:
--------------------------------------------------------------------------------
1 | HookQQMsgDll.cpp
2 | HookQQMsgDll.vcxproj -> D:\project\QmsgQ-inject-hook\Debug\HookQQMsgDll.dll
3 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/CL.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/CL.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/CL.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/CL.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/CL.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/CL.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/HookQQMsgDll.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.22000.0:
2 | Debug|Win32|D:\project\QmsgQ-inject-hook\|
3 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/link.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/link.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/link.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/link.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/link.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/HookQQMsgDll.tlog/link.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/vc142.idb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/vc142.idb
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Debug/vc142.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Debug/vc142.pdb
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/HookQQMsgDll.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include
3 |
4 | #include "Utils.h"
5 |
6 | #include
7 |
8 | #include "HookQQMsgDll.h"
9 |
10 | #pragma comment(lib,"ws2_32.lib")
11 | #pragma comment(lib,"netapi32.lib")
12 |
13 |
14 |
15 | int g_iSysVer = 0;
16 |
17 | QQ_oi_symmetry_decrypt2 my_qq_oi_symmetry_decrypt2 = 0;
18 | QQ_oi_symmetry_encrypt2 my_qq_oi_symmetry_encrypt2 = 0;
19 |
20 | BYTE g_aBackup_oi_symmetry_decrypt2[6] = { 0 };
21 | BYTE g_aOpcode_oi_symmetry_decrypt2[6] = { 0 };
22 | CRITICAL_SECTION g_cs_oi_symmetry_decrypt2;
23 |
24 | BYTE g_aBackup_oi_symmetry_encrypt2[6] = { 0 };
25 | BYTE g_aOpcode_oi_symmetry_encrypt2[6] = { 0 };
26 | CRITICAL_SECTION g_cs_oi_symmetry_encrypt2;
27 |
28 | char SAVE_SEND_PACK_FILE_NAME[MAX_PATH] = { 0 };
29 | char SAVE_RECEIVE_PACK_FILE_NAME[MAX_PATH] = { 0 };
30 | char QQ_MSG_FILE_NAME[MAX_PATH] = { 0 };
31 | char HOOK_QQ_LOG_FILE_NAME[MAX_PATH] = { 0 };
32 | char ERROR_PACKET_FILE_NAME[MAX_PATH] = { 0 };
33 |
34 |
35 | int SendQQMsg(char* pData, int iSize)
36 | {
37 | char* szHttpHdrFormat = \
38 | "POST http://%s/QQGroup/qqMsg/test.php HTTP/1.1\r\n"
39 | "Host: %s:80\r\n"
40 | "Content-Length: %u\r\n"
41 | "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"
42 | "Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3\r\n"
43 | "Accept-Encoding: gzip, deflate\r\n"
44 | "Connection: keep-alive\r\n"
45 | "Cache-Control: no-cache\r\n\r\n%s";
46 |
47 | char szHttpPack[0x1000];
48 | int iLen = sprintf_s(szHttpPack, sizeof(szHttpPack), szHttpHdrFormat, HOST_IP_ADDR, HOST_IP_ADDR, iSize, pData);
49 |
50 | sockaddr_in stAddr = { 0 };
51 | stAddr.sin_family = AF_INET;
52 | stAddr.sin_port = ntohs(80);
53 | stAddr.sin_addr.S_un.S_addr = inet_addr(HOST_IP_ADDR);
54 |
55 | SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
56 | if (sock == INVALID_SOCKET)
57 | {
58 | return FALSE;
59 | }
60 |
61 | int iRet = connect(sock, (sockaddr*)&stAddr, sizeof(sockaddr_in));
62 | if (iRet == INVALID_SOCKET)
63 | {
64 | iRet = closesocket(sock);
65 | return FALSE;
66 | }
67 |
68 | iRet = send(sock, szHttpPack, iLen, 0);
69 | if (iRet == INVALID_SOCKET)
70 | {
71 | iRet = closesocket(sock);
72 | return FALSE;
73 | }
74 |
75 | char szRecvBuf[0x1000];
76 | iRet = recv(sock, szRecvBuf, sizeof(szRecvBuf), 0);
77 | iRet = closesocket(sock);
78 | return TRUE;
79 | }
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | int __stdcall ParseQQDataPack(char* Pack, int PackLen)
90 | {
91 | char* pData = Pack;
92 | unsigned int iToQQ = 0;
93 | unsigned int iSenderQQ = 0;
94 | char strMsgTime[MAX_PATH] = { 0 };
95 |
96 | char strMsg[MAX_MESSAGE_LENGTH] = { 0 };
97 |
98 | DWORD dwHostQQ = ntohl(*(DWORD*)(Pack + 4));
99 |
100 | if (memcmp(pData + 8, "\x00\x00\x00\x08\x00\x01\x00\x04", 8) == 0)
101 | {
102 | iToQQ = ntohl(*(unsigned int*)(Pack + 4));
103 | iSenderQQ = ntohl(*(unsigned int*)Pack);
104 | pData = Pack + 8;
105 | goto TryFindMsg;
106 | }
107 |
108 | pData += 4;
109 | pData += 4;
110 | pData += 2;
111 |
112 | char* pTmp = pData;
113 | //group message
114 | pData = ViolenceSearch("\x00\x01\x00\x01\x01", 5, pData, PackLen - (pData - Pack));
115 | if (pData == 0)
116 | {
117 | pData = pTmp;
118 | pData = ViolenceSearch("\x01\x00\x0a\x00\x04\x01", 6, pData, PackLen - (pData - Pack));
119 | if (pData == 0)
120 | {
121 | iToQQ = ntohl(*(unsigned int*)(Pack + 4));
122 | iSenderQQ = ntohl(*(unsigned int*)Pack);
123 | pData = Pack + 8;
124 | goto TryFindMsg;
125 | //WriteLog(Pack,PackLen);
126 | //return FALSE;
127 | }
128 |
129 | pData = ViolenceSearch("\x03\x00", 2, pData, PackLen - (pData - Pack));
130 | if (pData == 0)
131 | {
132 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
133 | return FALSE;
134 | }
135 | pData += 4;
136 |
137 | iSenderQQ = ntohl(*(unsigned int*)pData);
138 | pData += 4;
139 | iToQQ = ntohl(*(unsigned int*)pData);
140 | pData += 4;
141 |
142 | TryFindMsg:
143 | pData = ViolenceSearch("\x4d\x53\x47", 3, pData, PackLen - (pData - Pack));
144 | if (pData == 0)
145 | {
146 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
147 | return FALSE;
148 | }
149 |
150 | errno_t error_t = 0;
151 | if (memcmp(pData, "\x00\x00\x00\x00\x00", 5) == 0)
152 | {
153 | time_t tmTime = ntohl(*(unsigned long*)(pData + 5));
154 | tm sttmTime;
155 | error_t = localtime_s(&sttmTime, &tmTime);
156 | error_t = asctime_s(strMsgTime, MAX_PATH, (const tm*)&sttmTime);
157 | }
158 | else
159 | {
160 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
161 | return FALSE;
162 | }
163 | pData += 5;
164 | pData += 4;
165 | pData += 4;
166 | pData += 4; //00 00 00 00
167 |
168 | pTmp = pData;
169 | pData = ViolenceSearch("\x86", 1, pData, 32);
170 | if (pData == 0)
171 | {
172 | pData = pTmp;
173 | pData = ViolenceSearch("\x22", 1, pData, 32);
174 | if (pData == 0)
175 | {
176 | pData = pTmp;
177 | pData = ViolenceSearch("\x0a\x00", 2, pData, 32);
178 | if (pData == 0)
179 | {
180 | pData = pTmp;
181 | pData = ViolenceSearch("\x0b\x00", 2, pData, 32);
182 | if (pData == 0)
183 | {
184 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
185 | return FALSE;
186 | }
187 | }
188 | }
189 | }
190 | pData += 8;
191 |
192 | pData = ViolenceSearch("\x00\x00", 2, pData, 32);
193 | if (pData == 0)
194 | {
195 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
196 | return FALSE;
197 | }
198 | pData--;
199 |
200 | int i = 0;
201 | int iFlag = 0;
202 | int iSecLen = ntohs(*(unsigned short*)(pData + 3));
203 | int iFirstLen = ntohs(*(unsigned short*)pData);
204 | if (iFirstLen == 3 || iFirstLen == 2)
205 | {
206 | pData += 2;
207 | pData += iFirstLen;
208 | iSecLen = ntohs(*(unsigned short*)pData);
209 | pData += 2;
210 | }
211 | else
212 | {
213 | for (i = 0; i < PackLen - (pData - Pack); i++)
214 | {
215 | if (*(pData + i + 2) != 1)
216 | {
217 | continue;
218 | }
219 | iSecLen = ntohs(*(unsigned short*)(pData + i + 3));
220 | iFirstLen = ntohs(*(unsigned short*)(pData + i));
221 | if (iFirstLen - iSecLen == 3)
222 | {
223 | iFlag = 1;
224 | break;
225 | }
226 | }
227 |
228 | if (iFlag == 0)
229 | {
230 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
231 | return FALSE;
232 | }
233 |
234 | pData += i;
235 | iSecLen = ntohs(*(unsigned short*)(pData + 3));
236 | iFirstLen = ntohs(*(unsigned short*)pData);
237 | pData += 5;
238 | }
239 |
240 | char strUtf8Msg[MAX_MESSAGE_LENGTH] = { 0 };
241 | memmove(strUtf8Msg, pData, iSecLen);
242 | char* pMsg = ConvertUtf8ToGBK(strUtf8Msg, strMsg);
243 | if (pMsg == 0)
244 | {
245 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
246 | return FALSE;
247 | }
248 | char strqqmsg[MAX_MESSAGE_LENGTH];
249 | int iLen = wsprintfA(strqqmsg, "buddy&cf&%u&cf&%u&cf&%u&cf&%s&cf&%s\r\n", dwHostQQ, iSenderQQ, iToQQ, strMsg, strMsgTime);
250 | if (iLen > 0)
251 | {
252 | //int iRet = SendQQMsg(strqqmsg,iLen);
253 | WriteLog(strqqmsg, iLen, WRITE_LOG_MSG);
254 | return TRUE;
255 | }
256 | }
257 |
258 | if (*(pData + 4) != 1)
259 | {
260 | //here is need to check it
261 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
262 | return FALSE;
263 | }
264 |
265 | iToQQ = ntohl(*(unsigned int*)pData);
266 | pData += 4;
267 | pData += 1;
268 | iSenderQQ = ntohl(*(unsigned int*)pData);
269 | pData += 4;
270 | pData = ViolenceSearch("\x4d\x53\x47", 3, pData, PackLen - (pData - Pack));
271 | if (pData == 0)
272 | {
273 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
274 | return FALSE;
275 | }
276 |
277 | errno_t error_t = 0;
278 | if (memcmp(pData, "\x00\x00\x00\x00\x00", 5) == 0)
279 | {
280 | time_t tmTime = ntohl(*(unsigned long*)(pData + 5));
281 | tm sttmTime = { 0 };
282 | error_t = localtime_s(&sttmTime, &tmTime);
283 | error_t = asctime_s(strMsgTime, MAX_PATH, (const tm*)&sttmTime);
284 | }
285 | else
286 | {
287 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
288 | return FALSE;
289 | }
290 |
291 | pData += 5;
292 | pData += 4;
293 | pData += 4;
294 | pData += 4; //00 00 00 00
295 |
296 | //set show charactors
297 | pTmp = pData;
298 | pData = ViolenceSearch("\x86", 1, pData, 32);
299 | if (pData == 0)
300 | {
301 | pData = pTmp;
302 | pData = ViolenceSearch("\x22", 1, pData, 32);
303 | if (pData == 0)
304 | {
305 | pData = pTmp;
306 | pData = ViolenceSearch("\x0a\x00", 2, pData, 32);
307 | if (pData == 0)
308 | {
309 | pData = pTmp;
310 | pData = ViolenceSearch("\x0b\x00", 2, pData, 32);
311 | if (pData == 0)
312 | {
313 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
314 | return FALSE;
315 | }
316 | }
317 | }
318 | }
319 | pData += 8;
320 |
321 | pData = ViolenceSearch("\x00\x00", 2, pData, 32);
322 | if (pData == 0)
323 | {
324 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
325 | return FALSE;
326 | }
327 | pData--;
328 |
329 | int i = 0;
330 | int iFlag = 0;
331 | int iSecLen = ntohs(*(unsigned short*)(pData + 3));
332 | int iFirstLen = ntohs(*(unsigned short*)pData);
333 | if (iFirstLen == 3 || iFirstLen == 2)
334 | {
335 | pData += 2;
336 | pData += iFirstLen;
337 | iSecLen = ntohs(*(unsigned short*)pData);
338 | pData += 2;
339 | }
340 | else
341 | {
342 | for (i = 0; i < PackLen - (pData - Pack); i++)
343 | {
344 | if (*(pData + i + 2) != 1)
345 | {
346 | continue;
347 | }
348 | iSecLen = ntohs(*(unsigned short*)(pData + i + 3));
349 | iFirstLen = ntohs(*(unsigned short*)(pData + i));
350 | if (iFirstLen - iSecLen == 3)
351 | {
352 | iFlag = 1;
353 | break;
354 | }
355 | }
356 |
357 | if (iFlag == 0)
358 | {
359 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
360 | return FALSE;
361 | }
362 |
363 | pData += i;
364 | iSecLen = ntohs(*(unsigned short*)(pData + 3));
365 | iFirstLen = ntohs(*(unsigned short*)pData);
366 | pData += 5;
367 | }
368 |
369 | char strUtf8Msg[MAX_MESSAGE_LENGTH] = { 0 };
370 | memmove(strUtf8Msg, pData, iSecLen);
371 | char* pMsg = ConvertUtf8ToGBK(strUtf8Msg, strMsg);
372 | if (pMsg == 0)
373 | {
374 | WriteLog(Pack, PackLen, WRITE_LOG_ERROR_PACKET);
375 | return FALSE;
376 | }
377 |
378 | char strNick[QQ_NAME_MAX_SIZE] = { 0 };
379 | pData += iSecLen;
380 | pTmp = pData;
381 | pData = ViolenceSearch("\x00\x00\x02\x02", 4, pData, PackLen - (pData - Pack));
382 | if (pData == 0)
383 | {
384 | pData = pTmp;
385 | pData = ViolenceSearch("\x00\x00\x02\x01", 4, pData, PackLen - (pData - Pack));
386 | if (pData == 0)
387 | {
388 | pData = pTmp;
389 | pData = ViolenceSearch("\x00\x00\x01\x01", 4, pData, PackLen - (pData - Pack));
390 | if (pData == 0)
391 | {
392 | goto _GetNickName;
393 | }
394 | }
395 | }
396 | iFirstLen = ntohs(*(unsigned short*)pData);
397 | if (iFirstLen >= MAX_MESSAGE_LENGTH)
398 | {
399 | goto _GetNickName;
400 | }
401 | pData += 2;
402 | memset(strUtf8Msg, 0, MAX_MESSAGE_LENGTH);
403 | memmove(strUtf8Msg, pData, iFirstLen);
404 |
405 | char* pNick = ConvertUtf8ToGBK(strUtf8Msg, strNick);
406 | if (pNick == 0)
407 | {
408 | goto _GetNickName;
409 | }
410 |
411 | _GetNickName:
412 | char strqqmsg[MAX_MESSAGE_LENGTH];
413 | int iLen = wsprintfA(strqqmsg, "group&cf&%u&cf&%u&cf&%s&cf&%u&cf&%s&cf&%s\r\n", dwHostQQ, iSenderQQ, strNick, iToQQ, strMsg, strMsgTime);
414 | if (iLen > 0)
415 | {
416 | //int iRet = SendQQMsg(strqqmsg,iLen);
417 | WriteLog(strqqmsg, iLen, WRITE_LOG_MSG);
418 | return TRUE;
419 | }
420 | return FALSE;
421 | }
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 | int __stdcall SaveQQMsg(char* strPack, int iPackLen, int iFlag)
438 | {
439 | if (iPackLen <= 32)
440 | {
441 | return FALSE;
442 | }
443 |
444 | int iRet = ParseQQDataPack(strPack, iPackLen);
445 |
446 | #ifdef _DEBUG
447 | if (iFlag == TRUE)
448 | {
449 | HANDLE hf = CreateFileA(SAVE_RECEIVE_PACK_FILE_NAME, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
450 | if (hf == INVALID_HANDLE_VALUE)
451 | {
452 | return FALSE;
453 | }
454 |
455 | DWORD fsize = SetFilePointer(hf, 0, 0, FILE_END);
456 | if (fsize == INVALID_SET_FILE_POINTER)
457 | {
458 | CloseHandle(hf);
459 | return FALSE;
460 | }
461 |
462 | DWORD dwCnt;
463 |
464 | WriteFile(hf, "this is a new packet:", strlen("this is a new packet:"), &dwCnt, 0);
465 |
466 | int iRet = WriteFile(hf, strPack, iPackLen, &dwCnt, 0);
467 | if (iRet == 0 || dwCnt != iPackLen)
468 | {
469 | CloseHandle(hf);
470 | return FALSE;
471 | }
472 |
473 | CloseHandle(hf);
474 | return TRUE;
475 | }
476 | else if (iFlag == FALSE)
477 | {
478 | HANDLE hf = CreateFileA(SAVE_SEND_PACK_FILE_NAME, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
479 | if (hf == INVALID_HANDLE_VALUE)
480 | {
481 | return FALSE;
482 | }
483 |
484 | DWORD fsize = SetFilePointer(hf, 0, 0, FILE_END);
485 | if (fsize == INVALID_SET_FILE_POINTER)
486 | {
487 | CloseHandle(hf);
488 | return FALSE;
489 | }
490 |
491 | DWORD dwCnt;
492 |
493 | WriteFile(hf, "this is a new packet:", strlen("this is a new packet:"), &dwCnt, 0);
494 |
495 | int iRet = WriteFile(hf, strPack, iPackLen, &dwCnt, 0);
496 | if (iRet == 0 || dwCnt != iPackLen)
497 | {
498 | CloseHandle(hf);
499 | return FALSE;
500 | }
501 |
502 | CloseHandle(hf);
503 | return TRUE;
504 | }
505 | #endif
506 |
507 | return FALSE;
508 | }
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 | //Hook the target API
518 | BOOL __stdcall MonitorBase_oi_symmetry_decrypt2()
519 | {
520 | HANDLE g_hProc = GetCurrentProcess();
521 | //Modify the heading 6 bytes opcode in target API to jmp instruction,the jmp instruction will lead the EIP to our fake function
522 | ReadProcessMemory(g_hProc, LPVOID(my_qq_oi_symmetry_decrypt2), LPVOID(g_aBackup_oi_symmetry_decrypt2), sizeof(g_aBackup_oi_symmetry_decrypt2) / sizeof(g_aBackup_oi_symmetry_decrypt2[0]), NULL);
523 | return WriteProcessMemory(g_hProc, LPVOID(my_qq_oi_symmetry_decrypt2), LPVOID(g_aOpcode_oi_symmetry_decrypt2), sizeof(g_aOpcode_oi_symmetry_decrypt2) / sizeof(g_aOpcode_oi_symmetry_decrypt2[0]), NULL);
524 | }
525 |
526 | //Hook the target API
527 | BOOL __stdcall MonitorBase_oi_symmetry_encrypt2()
528 | {
529 | HANDLE g_hProc = GetCurrentProcess();
530 | //Modify the heading 6 bytes opcode in target API to jmp instruction,the jmp instruction will lead the EIP to our fake function
531 | ReadProcessMemory(g_hProc, LPVOID(my_qq_oi_symmetry_encrypt2), LPVOID(g_aBackup_oi_symmetry_encrypt2), sizeof(g_aBackup_oi_symmetry_encrypt2) / sizeof(g_aBackup_oi_symmetry_encrypt2[0]), NULL);
532 | return WriteProcessMemory(g_hProc, LPVOID(my_qq_oi_symmetry_encrypt2), LPVOID(g_aOpcode_oi_symmetry_encrypt2), sizeof(g_aOpcode_oi_symmetry_encrypt2) / sizeof(g_aOpcode_oi_symmetry_encrypt2[0]), NULL);
533 | }
534 |
535 |
536 |
537 | BOOL __stdcall ReleaseBase_oi_symmetry_decrypt2()
538 | {
539 | HANDLE g_hProc = GetCurrentProcess();
540 | //The pseudo handle need not be closed when it is no longer needed.
541 | // Calling the CloseHandle function with a pseudo handle has no effect.
542 | // If the pseudo handle is duplicated by DuplicateHandle, the duplicate handle must be closed.
543 |
544 | return WriteProcessMemory(g_hProc, LPVOID(my_qq_oi_symmetry_decrypt2), LPVOID(g_aBackup_oi_symmetry_decrypt2), sizeof(g_aBackup_oi_symmetry_decrypt2) / sizeof(g_aBackup_oi_symmetry_decrypt2[0]), NULL);
545 | }
546 |
547 | BOOL __stdcall ReleaseBase_oi_symmetry_encrypt2()
548 | {
549 | HANDLE g_hProc = GetCurrentProcess();
550 |
551 | return WriteProcessMemory(g_hProc, LPVOID(my_qq_oi_symmetry_encrypt2), LPVOID(g_aBackup_oi_symmetry_encrypt2), sizeof(g_aBackup_oi_symmetry_encrypt2) / sizeof(g_aBackup_oi_symmetry_encrypt2[0]), NULL);
552 | }
553 |
554 |
555 |
556 |
557 | void __cdecl MonFunc_oi_symmetry_decrypt2(char* strSrc, unsigned int iSrcLen, char* strKey, char* strDst, int* iDstLen)
558 | {
559 | //can not return before call the source function
560 |
561 | //Thread safety
562 | //EnterCriticalSection(&g_cs_oi_symmetry_decrypt2);
563 | //here u can do something u want to do
564 |
565 | //Restore the original API before calling it
566 | ReleaseBase_oi_symmetry_decrypt2();
567 |
568 | //u must restore the api then u can call it
569 | my_qq_oi_symmetry_decrypt2(strSrc, iSrcLen, strKey, strDst, iDstLen);
570 |
571 | int iRet = SaveQQMsg(strDst, *iDstLen, TRUE);
572 |
573 | MonitorBase_oi_symmetry_decrypt2();
574 |
575 | //You can do anything here, and you can call the UninstallMonitor
576 | //when you want to leave.
577 |
578 | //Thread safety
579 | //LeaveCriticalSection(&g_cs_oi_symmetry_decrypt2);
580 |
581 | return;
582 | }
583 |
584 |
585 | //do nothing except u want to do
586 | void __cdecl MonFunc_oi_symmetry_encrypt2(char* strSrc, unsigned int iSrcLen, char* strKey, char* strDst, int* iDstLen)
587 | {
588 | //can not return before call the source function
589 | //Thread safety
590 | //here must cause some problem
591 | //EnterCriticalSection(&g_cs_oi_symmetry_encrypt2);
592 |
593 | //here u can do something u want to do
594 | int iRet = SaveQQMsg(strSrc, iSrcLen, FALSE);
595 |
596 | //Restore the original API before calling it
597 | ReleaseBase_oi_symmetry_encrypt2();
598 |
599 | my_qq_oi_symmetry_encrypt2(strSrc, iSrcLen, strKey, strDst, iDstLen);
600 |
601 | MonitorBase_oi_symmetry_encrypt2();
602 |
603 | //You can do anything here, and you can call the UninstallMonitor
604 | //when you want to leave.
605 |
606 | //Thread safety
607 | //LeaveCriticalSection(&g_cs_oi_symmetry_encrypt2);
608 |
609 | return;
610 | }
611 |
612 |
613 |
614 |
615 |
616 | //SaveMsg194 function is in KernelUtil.dll,but new version qq not use
617 | BOOL __stdcall InstallMonitor_oi_symmetry_decrypt2()
618 | {
619 | char strerror[MAX_PATH] = { 0 };
620 | HINSTANCE hins = GetModuleHandleA(HOOKED_DLL_NAME);
621 | if (hins == 0)
622 | {
623 | hins = LoadLibraryA(HOOKED_DLL_NAME);
624 | if (hins == 0)
625 | {
626 | wsprintfA(strerror, "Common.dll load error code is:%u\r\n", GetLastError());
627 | WriteLog(strerror, lstrlenA(strerror), WRITE_LOG_ERROR);
628 | return FALSE;
629 | }
630 | }
631 |
632 | // my_qq_oi_symmetry_decrypt2 = (QQ_oi_symmetry_decrypt2)GetProcAddress((HMODULE)hins,HOOKED_FUNCTION_NAME_oi_symmetry_decrypt2);
633 | // if (my_qq_oi_symmetry_decrypt2 == 0)
634 | // {
635 | // MessageBoxA(0,"GetProcAddress my_qq_oi_symmetry_decrypt2 error","GetProcAddress my_qq_oi_symmetry_decrypt2 error",MB_OK);
636 | // }
637 | // else
638 | // {
639 | // MessageBoxA(0,"GetProcAddress my_qq_oi_symmetry_decrypt2 ok","GetProcAddress my_qq_oi_symmetry_decrypt2 ok",MB_OK);
640 | // }
641 |
642 | my_qq_oi_symmetry_decrypt2 = (QQ_oi_symmetry_decrypt2)GetApiAddrFromDll((int)hins, HOOKED_FUNCTION_NAME_oi_symmetry_decrypt2,
643 | lstrlenA(HOOKED_FUNCTION_NAME_oi_symmetry_decrypt2));
644 | if (my_qq_oi_symmetry_decrypt2 == 0)
645 | {
646 | wsprintfA(strerror, "GetApiAddrFromDll error code is:%08x\r\n", GetLastError());
647 | WriteLog(strerror, strlen(strerror), WRITE_LOG_ERROR);
648 | return FALSE;
649 | }
650 |
651 | g_aOpcode_oi_symmetry_decrypt2[0] = 0xE9;
652 | //dest - now - 5
653 | *(DWORD*)(&g_aOpcode_oi_symmetry_decrypt2[1]) = (DWORD)MonFunc_oi_symmetry_decrypt2 - (DWORD)my_qq_oi_symmetry_decrypt2 - 5;
654 |
655 | //InitializeCriticalSection(&g_cs_oi_symmetry_decrypt2);
656 | return MonitorBase_oi_symmetry_decrypt2();
657 | }
658 |
659 |
660 |
661 | BOOL __stdcall InstallMonitor_oi_symmetry_encrypt2()
662 | {
663 | char strerror[MAX_PATH] = { 0 };
664 | HINSTANCE hins = GetModuleHandleA(HOOKED_DLL_NAME);
665 | if (hins == 0)
666 | {
667 | hins = LoadLibraryA(HOOKED_DLL_NAME);
668 | if (hins == 0)
669 | {
670 | wsprintfA(strerror, "Common.dll not found,error code is:%u\r\n", GetLastError());
671 | WriteLog(strerror, strlen(strerror), WRITE_LOG_ERROR);
672 | return FALSE;
673 | }
674 | }
675 |
676 | my_qq_oi_symmetry_encrypt2 = (QQ_oi_symmetry_encrypt2)GetApiAddrFromDll((UINT)hins, HOOKED_FUNCTION_NAME_oi_symmetry_encrypt2,
677 | lstrlenA(HOOKED_FUNCTION_NAME_oi_symmetry_encrypt2));
678 | if (my_qq_oi_symmetry_encrypt2 == 0)
679 | {
680 | wsprintfA(strerror, "GetApiAddrFromDll error code is:%08x\r\n", GetLastError());
681 | WriteLog(strerror, strlen(strerror), WRITE_LOG_ERROR);
682 | return FALSE;
683 | }
684 |
685 | g_aOpcode_oi_symmetry_encrypt2[0] = 0xE9;
686 | //offset = dest - now - 5
687 | *(DWORD*)(&g_aOpcode_oi_symmetry_encrypt2[1]) = (DWORD)MonFunc_oi_symmetry_encrypt2 - (DWORD)my_qq_oi_symmetry_encrypt2 - 5;
688 |
689 | //InitializeCriticalSection(&g_cs_oi_symmetry_encrypt2);
690 | return MonitorBase_oi_symmetry_encrypt2();
691 | }
692 |
693 |
694 |
695 | BOOL __stdcall UninstallMonitor_oi_symmetry_decrypt2()
696 | {
697 | //Release monitor
698 | if (!ReleaseBase_oi_symmetry_decrypt2())
699 | {
700 | return FALSE;
701 | }
702 |
703 | //DeleteCriticalSection(&g_cs_oi_symmetry_decrypt2);
704 |
705 | return TRUE;
706 |
707 | //Synchronize to main application, release semaphore to free injector
708 | HANDLE hSema = OpenSemaphoreA(EVENT_ALL_ACCESS, FALSE, SEMPHORE_NAME);
709 | if (hSema == NULL)
710 | {
711 | return TRUE;
712 | }
713 | HANDLE g_hProc = GetCurrentProcess();
714 | return ReleaseSemaphore(hSema, 1, (LPLONG)g_hProc);
715 | }
716 |
717 |
718 | //this must be first one if you want to release inject dll
719 | BOOL __stdcall UninstallMonitor_oi_symmetry_encrypt2()
720 | {
721 |
722 | //Release monitor
723 | if (!ReleaseBase_oi_symmetry_encrypt2())
724 | {
725 | return FALSE;
726 | }
727 |
728 | //DeleteCriticalSection(&g_cs_oi_symmetry_encrypt2);
729 |
730 | return TRUE;
731 |
732 | //Synchronize to main application, release semaphore to free injector
733 | HANDLE hSema = OpenSemaphoreA(EVENT_ALL_ACCESS, FALSE, SEMPHORE_NAME);
734 | if (hSema == NULL)
735 | {
736 | return TRUE;
737 | }
738 | HANDLE g_hProc = GetCurrentProcess();
739 | return ReleaseSemaphore(hSema, 1, (LPLONG)g_hProc);
740 | }
741 |
742 |
743 | int __stdcall InitVariables()
744 | {
745 |
746 | g_iSysVer = GetWindowsVersion();
747 |
748 | char szUserName[MAX_PATH] = { 0 };
749 | DWORD dwBufSize = MAX_PATH;
750 | int iRet = GetUserNameA(szUserName, &dwBufSize);
751 |
752 | char szSysDir[MAX_PATH];
753 | iRet = GetSystemDirectoryA(szSysDir, MAX_PATH);
754 |
755 | char szLogFileName[] = "hooked_qq_log.txt";
756 | char szMsgFileName[] = "hooked_qq_msg.txt";
757 | char szRecvFileName[] = "hooked_qq_recvpack.txt";
758 | char szSendFileName[] = "hooked_qq_sendpack.txt";
759 | char szErrorPacketFileName[] = "hook_qq_error_packet.txt";
760 |
761 | char szPathFormat[] = "C:\\Users\\%s\\AppData\\local\\%s";
762 | char szPathFormatXP[] = "C:\\Documents and Settings\\%s\\Local Settings\\%s";
763 | szPathFormatXP[0] = szSysDir[0];
764 | szPathFormat[0] = szSysDir[0];
765 |
766 | if (g_iSysVer >= SYSTEM_VERSION_VISTA)
767 | {
768 | wsprintfA(QQ_MSG_FILE_NAME, szPathFormat, szUserName, szMsgFileName);
769 | wsprintfA(ERROR_PACKET_FILE_NAME, szPathFormat, szUserName, szErrorPacketFileName);
770 | wsprintfA(SAVE_RECEIVE_PACK_FILE_NAME, szPathFormat, szUserName, szRecvFileName);
771 | wsprintfA(SAVE_SEND_PACK_FILE_NAME, szPathFormat, szUserName, szSendFileName);
772 | wsprintfA(HOOK_QQ_LOG_FILE_NAME, szPathFormat, szUserName, szLogFileName);
773 | }
774 | else
775 | {
776 | wsprintfA(QQ_MSG_FILE_NAME, szPathFormatXP, szUserName, szMsgFileName);
777 | wsprintfA(ERROR_PACKET_FILE_NAME, szPathFormatXP, szUserName, szErrorPacketFileName);
778 | wsprintfA(SAVE_RECEIVE_PACK_FILE_NAME, szPathFormatXP, szUserName, szRecvFileName);
779 | wsprintfA(SAVE_SEND_PACK_FILE_NAME, szPathFormatXP, szUserName, szSendFileName);
780 | wsprintfA(HOOK_QQ_LOG_FILE_NAME, szPathFormatXP, szUserName, szLogFileName);
781 | }
782 |
783 | WSADATA stWsa = { 0 };
784 | iRet = WSAStartup(0x202, &stWsa);
785 | if (iRet)
786 | {
787 | return FALSE;
788 | }
789 |
790 | InitializeCriticalSection(&g_cs_oi_symmetry_encrypt2);
791 | InitializeCriticalSection(&g_cs_oi_symmetry_decrypt2);
792 | return TRUE;
793 | }
794 |
795 |
796 |
797 | BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
798 | {
799 |
800 | switch (fdwReason)
801 | {
802 | case DLL_PROCESS_ATTACH:
803 | {
804 | DisableThreadLibraryCalls(hInstDll);
805 | HMODULE hm = LoadLibraryA("HookQQMsgDll.dll");
806 | //if (hm == 0)
807 | {
808 | InitVariables();
809 | InstallMonitor_oi_symmetry_decrypt2();
810 | InstallMonitor_oi_symmetry_encrypt2();
811 | }
812 | }
813 | break;
814 | case DLL_PROCESS_DETACH:
815 | {
816 | HMODULE hm = LoadLibraryA("HookQQMsgDll.dll");
817 | //if (hm)
818 | {
819 | UninstallMonitor_oi_symmetry_decrypt2();
820 | UninstallMonitor_oi_symmetry_encrypt2();
821 |
822 | DeleteCriticalSection(&g_cs_oi_symmetry_decrypt2);
823 | DeleteCriticalSection(&g_cs_oi_symmetry_encrypt2);
824 | }
825 | }
826 | break;
827 | }
828 |
829 | return TRUE;
830 | }
831 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/HookQQMsgDll.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 |
5 |
6 |
7 | #define MAX_MESSAGE_LENGTH 0x1000
8 |
9 | #define QQ_NAME_MAX_SIZE 256
10 |
11 |
12 | #define HOST_IP_ADDR "192.168.157.40"
13 |
14 | #define HOOKED_DLL_NAME "Common.dll"
15 | #define HOOKED_FUNCTION_NAME_oi_symmetry_decrypt2 "?oi_symmetry_decrypt2"
16 | #define HOOKED_FUNCTION_NAME_oi_symmetry_encrypt2 "?oi_symmetry_encrypt2"
17 | #define SEMPHORE_NAME "HOOK_QQ_MSG_SEMPHORE"
18 |
19 | typedef void(__cdecl* QQ_oi_symmetry_decrypt2)(char* strSrc, unsigned int iSrcLen, char* strKey, char* strDst, int* iDstLen);
20 | typedef void(__cdecl* QQ_oi_symmetry_encrypt2)(char* strSrc, unsigned int iSrcLen, char* strKey, char* strDst, int* iDstLen);
21 |
22 |
23 |
24 | extern char SAVE_SEND_PACK_FILE_NAME[MAX_PATH];
25 | extern char SAVE_RECEIVE_PACK_FILE_NAME[MAX_PATH];
26 | extern char QQ_MSG_FILE_NAME[MAX_PATH];
27 | extern char HOOK_QQ_LOG_FILE_NAME[MAX_PATH];
28 | extern char ERROR_PACKET_FILE_NAME[MAX_PATH];
29 |
30 |
31 |
32 | int __stdcall ParseQQDataPack(char* Pack, int PackLen);
33 |
34 | int __stdcall InitVariables();
35 |
36 | BOOL __stdcall MonitorBase_oi_symmetry_decrypt2();
37 | BOOL __stdcall ReleaseBase_oi_symmetry_decrypt2();
38 | BOOL __stdcall UninstallMonitor_oi_symmetry_decrypt2();
39 | void __cdecl MonFunc_oi_symmetry_decrypt2(char* strSrc, unsigned int iSrcLen, char* strKey, char* strDst, int* iDstLen);
40 | BOOL __stdcall InstallMonitor_oi_symmetry_decrypt2();
41 | BOOL __stdcall MonitorBase_oi_symmetry_encrypt2();
42 | BOOL __stdcall ReleaseBase_oi_symmetry_encrypt2();
43 | BOOL __stdcall UninstallMonitor_oi_symmetry_encrypt2();
44 | void __cdecl MonFunc_oi_symmetry_encrypt2(char* strSrc, unsigned int iSrcLen, char* strKey, char* strDst, int* iDstLen);
45 | BOOL __stdcall InstallMonitor_oi_symmetry_encrypt2();
46 | BOOL __stdcall DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved);
47 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/HookQQMsgDll.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 |
14 | {44267637-4607-4B0E-A5A6-387807FF1128}
15 | Win32Proj
16 | HookQQMsgDll
17 | 10.0
18 |
19 |
20 |
21 | DynamicLibrary
22 | true
23 | Unicode
24 | v142
25 |
26 |
27 | DynamicLibrary
28 | false
29 | true
30 | Unicode
31 | v142
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | true
45 |
46 |
47 | false
48 |
49 |
50 |
51 |
52 |
53 | Level3
54 | Disabled
55 | WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKQQMSGDLL_EXPORTS;%(PreprocessorDefinitions)
56 |
57 |
58 | Windows
59 | true
60 |
61 |
62 |
63 |
64 | Level3
65 |
66 |
67 | MaxSpeed
68 | true
69 | true
70 | WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKQQMSGDLL_EXPORTS;%(PreprocessorDefinitions)
71 |
72 |
73 | Windows
74 | true
75 | true
76 | true
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/HookQQMsgDll.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | 源文件
20 |
21 |
22 | 源文件
23 |
24 |
25 |
26 |
27 | 头文件
28 |
29 |
30 | 头文件
31 |
32 |
33 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/HookQQMsgDll.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | D:\Microsoft Visual Studio 10.0\VSProject\HookQQMsgDll\Debug\hookqqmsg.exe
5 | WindowsLocalDebugger
6 | Auto
7 | D:\Microsoft Visual Studio 10.0\VSProject\HookQQMsgDll\Debug
8 |
9 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.dll.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\project\QmsgQ-inject-hook\Release\HookQQMsgDll.dll
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.iobj:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.iobj
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.ipdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.ipdb
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.log:
--------------------------------------------------------------------------------
1 | HookQQMsgDll.cpp
2 | 正在生成代码
3 | 2 of 21 functions ( 9.5%) were compiled, the rest were copied from previous compilation.
4 | 0 functions were new in current compilation
5 | 1 functions had inline decision re-evaluated but remain unchanged
6 | 已完成代码的生成
7 | HookQQMsgDll.vcxproj -> D:\project\QmsgQ-inject-hook\Release\HookQQMsgDll.dll
8 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/CL.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/CL.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/CL.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/CL.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/CL.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/CL.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/HookQQMsgDll.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.22000.0:
2 | Release|Win32|D:\project\QmsgQ-inject-hook\|
3 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/link.command.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/link.command.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/link.read.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/link.read.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/link.write.1.tlog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/HookQQMsgDll.tlog/link.write.1.tlog
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Release/vc142.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/HookQQMsgDll/HookQQMsgDll/Release/vc142.pdb
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Utils.cpp:
--------------------------------------------------------------------------------
1 |
2 |
3 | #include
4 |
5 | #include
6 |
7 | #include
8 |
9 | #include "Utils.h"
10 |
11 | #include "HookQQMsgDll.h"
12 |
13 | int __stdcall GetWindowsVersion()
14 | {
15 | WKSTA_INFO_100* wkstaInfo = NULL;
16 | NET_API_STATUS netStatus = NetWkstaGetInfo(NULL, 100, (LPBYTE*)&wkstaInfo);
17 | if (netStatus == 0)
18 | {
19 | int iSystemVersion = 0;
20 | DWORD dwMajVer = wkstaInfo->wki100_ver_major;
21 | DWORD dwMinVer = wkstaInfo->wki100_ver_minor;
22 | DWORD dwVersion = (DWORD)MAKELONG(dwMinVer, dwMajVer);
23 | netStatus = NetApiBufferFree(wkstaInfo);
24 |
25 | iSystemVersion = 0;
26 | if (dwVersion < 0x50000)
27 | {
28 | iSystemVersion = SYSTEM_VERSION_WIN9X;
29 | }
30 | else if (dwVersion == 0x50000)
31 | {
32 | iSystemVersion = SYSTEM_VERSION_WIN2000;
33 | }
34 | else if (dwVersion > 0x50000 && dwVersion < 0x60000)
35 | {
36 | iSystemVersion = SYSTEM_VERSION_XP;
37 | }
38 | else if (dwVersion == 0x60000)
39 | {
40 | iSystemVersion = SYSTEM_VERSION_VISTA;
41 | }
42 | else if (dwVersion == 0x60001)
43 | {
44 | iSystemVersion = SYSTEM_VERSION_WIN7;
45 | }
46 | else if (dwVersion >= 0x60002 && dwVersion <= 0x60003)
47 | {
48 | iSystemVersion = SYSTEM_VERSION_WIN8;
49 | }
50 | else if (dwVersion >= 0x60003 || dwVersion >= 0x100000)
51 | {
52 | #ifdef _DEBUG
53 |
54 | char szShowInfo[1024];
55 | int iRet = wsprintfA(szShowInfo, "win10 system version:%u.%u\r\n", dwMajVer, dwMinVer);
56 | WriteLog(szShowInfo, iRet, WRITE_LOG_NORMAL);
57 | #endif
58 | iSystemVersion = SYSTEM_VERSION_WIN10;
59 | }
60 | else
61 | {
62 | iSystemVersion = SYSTEM_VERSION_UNKNOW;
63 | }
64 | return iSystemVersion;
65 | }
66 |
67 | return TRUE;
68 | }
69 |
70 |
71 | char* __stdcall ConvertUtf8ToGBK(char* strUtf8, char* strPlat)
72 | {
73 | try
74 | {
75 | int len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)strUtf8, -1, NULL, 0);
76 | wchar_t* wszGBK = new wchar_t[len];
77 | memset(wszGBK, 0, len);
78 | int iRet = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)strUtf8, -1, wszGBK, len);
79 |
80 | len = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, NULL, 0, NULL, NULL);
81 |
82 | iRet = WideCharToMultiByte(CP_ACP, 0, wszGBK, -1, strPlat, len, NULL, NULL);
83 |
84 | delete[] wszGBK;
85 | return strPlat;
86 | }
87 | catch (...)
88 | {
89 | WriteLog("ConvertUtf8ToGBK error\r\n", strlen("ConvertUtf8ToGBK error\r\n"), WRITE_LOG_ERROR);
90 | return FALSE;
91 | }
92 | }
93 |
94 |
95 | char* __stdcall ViolenceSearch(char Flag[], int FlagLen, char Address[], int TotalLen)
96 | {
97 | try
98 | {
99 | for (int Cnt = 0; Cnt < TotalLen - FlagLen + 1; Cnt++)
100 | {
101 | if (memcmp(Flag, Address + Cnt, FlagLen) == 0)
102 | {
103 | return Address + Cnt + FlagLen;
104 | }
105 | }
106 | return FALSE;
107 | }
108 | catch (...)
109 | {
110 | WriteLog("ViolenceSearch error\r\n", strlen("ViolenceSearch error\r\n"), WRITE_LOG_ERROR);
111 | return FALSE;
112 | }
113 | }
114 |
115 |
116 | int __stdcall WriteLog(char* Pack, int PackLen, DWORD dwFlag)
117 | {
118 | HANDLE hf = INVALID_HANDLE_VALUE;
119 | if (dwFlag == WRITE_LOG_ERROR_PACKET)
120 | {
121 | hf = CreateFileA(ERROR_PACKET_FILE_NAME, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
122 | }
123 | else if (dwFlag == WRITE_LOG_ERROR)
124 | {
125 | hf = CreateFileA(HOOK_QQ_LOG_FILE_NAME, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
126 | }
127 | else if (dwFlag == WRITE_LOG_MSG)
128 | {
129 | hf = CreateFileA(QQ_MSG_FILE_NAME, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
130 | }
131 | else
132 | {
133 | return FALSE;
134 | }
135 |
136 | if (hf == INVALID_HANDLE_VALUE)
137 | {
138 | return FALSE;
139 | }
140 |
141 | DWORD fsize = SetFilePointer(hf, 0, 0, FILE_END);
142 | if (fsize == INVALID_SET_FILE_POINTER)
143 | {
144 | CloseHandle(hf);
145 | return FALSE;
146 | }
147 |
148 | DWORD dwCnt = 0;
149 | int iRet = 0;
150 | if (dwFlag == WRITE_LOG_ERROR_PACKET)
151 | {
152 | iRet = WriteFile(hf, "something has wrong in this packet:", strlen("something has wrong in this packet:"), &dwCnt, 0);
153 | }
154 |
155 | iRet = WriteFile(hf, Pack, PackLen, &dwCnt, 0);
156 | CloseHandle(hf);
157 | if (iRet == 0 || dwCnt != PackLen)
158 | {
159 | return FALSE;
160 | }
161 | return TRUE;
162 | }
163 |
164 |
165 | unsigned int __stdcall GetApiAddrFromDll(unsigned int pIdh, char* lpApiName, int iApiNameLen)
166 | {
167 | IMAGE_NT_HEADERS* pInth = (IMAGE_NT_HEADERS*)(*(unsigned int*)(pIdh + 0x3c) + pIdh);
168 | IMAGE_EXPORT_DIRECTORY* pIed = (IMAGE_EXPORT_DIRECTORY*)(pIdh + pInth->OptionalHeader.DataDirectory->VirtualAddress);
169 | unsigned int pVaAddrOfNames = pIed->AddressOfNames + pIdh;
170 | unsigned int iNumsOfNames = pIed->NumberOfNames;
171 |
172 | while (iNumsOfNames)
173 | {
174 | int pNames = *(unsigned int*)pVaAddrOfNames + pIdh;
175 | int iLen = 0;
176 | for (iLen = 0; iLen < iApiNameLen; iLen++)
177 | {
178 | if (lpApiName[iLen] != *(char*)(pNames + iLen))
179 | {
180 | break;
181 | }
182 | }
183 |
184 | if (iLen != iApiNameLen)
185 | {
186 | pVaAddrOfNames += 4;
187 | iNumsOfNames--;
188 | continue;
189 | }
190 |
191 | pVaAddrOfNames = pVaAddrOfNames - pIed->AddressOfNames;
192 | pVaAddrOfNames = pVaAddrOfNames - pIdh;
193 | pVaAddrOfNames = pVaAddrOfNames >> 1;
194 | pVaAddrOfNames = pVaAddrOfNames + pIed->AddressOfNameOrdinals;
195 | pVaAddrOfNames = pVaAddrOfNames + pIdh;
196 | unsigned int sOrdinals = *(unsigned short*)pVaAddrOfNames;
197 | sOrdinals = sOrdinals << 2;
198 | sOrdinals = sOrdinals + pIed->AddressOfFunctions;
199 | sOrdinals = sOrdinals + pIdh;
200 | unsigned int pVaAddr = *(unsigned int*)sOrdinals + pIdh;
201 | return pVaAddr;
202 | }
203 |
204 | return FALSE;
205 | }
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/Utils.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #define SYSTEM_VERSION_WIN9X 1
6 | #define SYSTEM_VERSION_WIN2000 2
7 | #define SYSTEM_VERSION_XP 3
8 | #define SYSTEM_VERSION_VISTA 4
9 | #define SYSTEM_VERSION_WIN7 5
10 | #define SYSTEM_VERSION_WIN8 6
11 | #define SYSTEM_VERSION_WIN10 7
12 | #define SYSTEM_VERSION_UNKNOW 0
13 |
14 |
15 | #define WRITE_LOG_ERROR_PACKET 1
16 | #define WRITE_LOG_ERROR 2
17 | #define WRITE_LOG_MSG 3
18 | #define WRITE_LOG_NORMAL 4
19 |
20 |
21 | unsigned int __stdcall GetApiAddrFromDll(unsigned int pIdh, char* lpApiName, int iApiNameLen);
22 |
23 | int __stdcall GetWindowsVersion();
24 |
25 | int __stdcall WriteLog(char* Pack, int PackLen, DWORD dwFlag);
26 |
27 | char* __stdcall ViolenceSearch(char Flag[], int FlagLen, char Address[], int TotalLen);
28 |
29 | char* __stdcall ConvertUtf8ToGBK(char* strUtf8, char* strPlat);
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/VersionHelpers.h:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | * *
3 | * VersionHelpers.h -- This module defines helper functions to *
4 | * promote version check with proper *
5 | * comparisons. *
6 | * *
7 | * Copyright (c) Microsoft Corp. All rights reserved. *
8 | * *
9 | ******************************************************************/
10 | #ifndef _versionhelpers_H_INCLUDED_
11 | #define _versionhelpers_H_INCLUDED_
12 |
13 | #include "winapifamily.h"
14 |
15 | #ifdef _MSC_VER
16 | #pragma once
17 | #endif // _MSC_VER
18 |
19 | #pragma region Application Family
20 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
21 |
22 | #include "specstrings.h" // for _In_, etc.
23 |
24 | #if !defined(__midl) && !defined(SORTPP_PASS)
25 |
26 | #if (NTDDI_VERSION >= NTDDI_WINXP)
27 |
28 | #ifdef __cplusplus
29 |
30 | #define VERSIONHELPERAPI inline bool
31 |
32 | #else // __cplusplus
33 |
34 | #define VERSIONHELPERAPI FORCEINLINE BOOL
35 |
36 | #endif // __cplusplus
37 |
38 | #define _WIN32_WINNT_WIN8 0x0602 // Windows 8
39 |
40 | #define _WIN32_WINNT_WINBLUE 0x0603 // Windows 8.1
41 |
42 |
43 | VERSIONHELPERAPI
44 | IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor)
45 | {
46 | OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 };
47 | DWORDLONG const dwlConditionMask = VerSetConditionMask(
48 | VerSetConditionMask(
49 | VerSetConditionMask(
50 | 0, VER_MAJORVERSION, VER_GREATER_EQUAL),
51 | VER_MINORVERSION, VER_GREATER_EQUAL),
52 | VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
53 |
54 | osvi.dwMajorVersion = wMajorVersion;
55 | osvi.dwMinorVersion = wMinorVersion;
56 | osvi.wServicePackMajor = wServicePackMajor;
57 |
58 | return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE;
59 | }
60 |
61 | VERSIONHELPERAPI
62 | IsWindowsXPOrGreater()
63 | {
64 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0);
65 | }
66 |
67 | VERSIONHELPERAPI
68 | IsWindowsXPSP1OrGreater()
69 | {
70 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1);
71 | }
72 |
73 | VERSIONHELPERAPI
74 | IsWindowsXPSP2OrGreater()
75 | {
76 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2);
77 | }
78 |
79 | VERSIONHELPERAPI
80 | IsWindowsXPSP3OrGreater()
81 | {
82 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3);
83 | }
84 |
85 | VERSIONHELPERAPI
86 | IsWindowsVistaOrGreater()
87 | {
88 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
89 | }
90 |
91 | VERSIONHELPERAPI
92 | IsWindowsVistaSP1OrGreater()
93 | {
94 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1);
95 | }
96 |
97 | VERSIONHELPERAPI
98 | IsWindowsVistaSP2OrGreater()
99 | {
100 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2);
101 | }
102 |
103 | VERSIONHELPERAPI
104 | IsWindows7OrGreater()
105 | {
106 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
107 | }
108 |
109 | VERSIONHELPERAPI
110 | IsWindows7SP1OrGreater()
111 | {
112 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1);
113 | }
114 |
115 | VERSIONHELPERAPI
116 | IsWindows8OrGreater()
117 | {
118 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
119 | }
120 |
121 | VERSIONHELPERAPI
122 | IsWindows8Point1OrGreater()
123 | {
124 | return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
125 | }
126 |
127 | VERSIONHELPERAPI
128 | IsWindowsServer()
129 | {
130 | OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION };
131 | DWORDLONG const dwlConditionMask = VerSetConditionMask( 0, VER_PRODUCT_TYPE, VER_EQUAL );
132 |
133 | return !VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask);
134 | }
135 |
136 | #endif // NTDDI_VERSION
137 |
138 | #endif // defined(__midl)
139 |
140 | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
141 | #pragma endregion
142 |
143 | #endif // _VERSIONHELPERS_H_INCLUDED_
144 |
--------------------------------------------------------------------------------
/HookQQMsgDll/HookQQMsgDll/winapifamily.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Module Name:
6 |
7 | winapifamily.h
8 |
9 | Abstract:
10 |
11 | Master include file for API family partitioning.
12 |
13 | */
14 |
15 | #ifndef _INC_WINAPIFAMILY
16 | #define _INC_WINAPIFAMILY
17 |
18 | #if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
19 | #pragma once
20 | #endif // defined(_MSC_VER) && !defined(MOFCOMP_PASS)
21 |
22 | /*
23 | * When compiling C and C++ code using SDK header files, the development
24 | * environment can specify a target platform by #define-ing the
25 | * pre-processor symbol WINAPI_FAMILY to one of the following values.
26 | * Each FAMILY value denotes an application family for which a different
27 | * subset of the total set of header-file-defined APIs are available.
28 | * Setting the WINAPI_FAMILY value will effectively hide from the
29 | * editing and compilation environments the existence of APIs that
30 | * are not applicable to the family of applications targeting a
31 | * specific platform.
32 | */
33 |
34 | /*
35 | * The WINAPI_FAMILY values of 0 and 1 are reserved to ensure that
36 | * an error will occur if WINAPI_FAMILY is set to any
37 | * WINAPI_PARTITION value (which must be 0 or 1, see below).
38 | */
39 | #define WINAPI_FAMILY_PC_APP 2 /* Windows Store Applications */
40 | #define WINAPI_FAMILY_PHONE_APP 3 /* Windows Phone Applications */
41 | #define WINAPI_FAMILY_DESKTOP_APP 100 /* Windows Desktop Applications */
42 | /* The value of WINAPI_FAMILY_DESKTOP_APP may change in future SDKs. */
43 | /* Additional WINAPI_FAMILY values may be defined in future SDKs. */
44 |
45 | /*
46 | * For compatibility with Windows 8 header files, the following
47 | * synonym for WINAPI_FAMILY_PC_APP is temporarily #define'd.
48 | * Use of this symbol should be considered deprecated.
49 | */
50 | #define WINAPI_FAMILY_APP WINAPI_FAMILY_PC_APP
51 |
52 | /*
53 | * If no WINAPI_FAMILY value is specified, then all APIs available to
54 | * Windows desktop applications are exposed.
55 | */
56 | #ifndef WINAPI_FAMILY
57 | #define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
58 | #endif
59 |
60 | /*
61 | * API PARTITONs are part of an indirection mechanism for mapping between
62 | * individual APIs and the FAMILYs to which they apply.
63 | * Each PARTITION is a category or subset of named APIs. PARTITIONs
64 | * are permitted to have overlapping membership -- some single API
65 | * might be part of more than one PARTITION. In support of new
66 | * FAMILYs that might be added in future SDKs, any single current
67 | * PARTITION might in that future SDK be split into two or more new PARTITIONs.
68 | * Accordingly, application developers should avoid taking dependencies on
69 | * PARTITION names; developers' only dependency upon the symbols defined
70 | * in this file should be their reliance on the WINAPI_FAMILY names and values.
71 | */
72 |
73 | /*
74 | * Current PARTITIONS are each #undef'ed below, and then will be #define-ed
75 | * to be either 1 or 0 or depending on the active WINAPI_FAMILY.
76 | */
77 |
78 | #undef WINAPI_PARTITION_DESKTOP /* usable for PC desktop apps (but not store apps) */
79 | #undef WINAPI_PARTITION_APP /* usable for most platforms' store apps */
80 | #undef WINAPI_PARTITION_PC_APP /* specific to PC store apps */
81 | #undef WINAPI_PARTITION_PHONE_APP /* specific to phone store apps */
82 |
83 |
84 | /*
85 | * The mapping between families and partitions is summarized here.
86 | * An X indicates that the given partition is active for the given
87 | * platform/family.
88 | *
89 | * +---------------+
90 | * | *Partition* |
91 | * +---+---+---+---+
92 | * | | | | P |
93 | * | | | | H |
94 | * | D | | | O |
95 | * | E | | P | N |
96 | * | S | | C | E |
97 | * | K | | _ | _ |
98 | * | T | A | A | A |
99 | * +-------------------------+-+ O | P | P | P |
100 | * | *Platform/Family* \| P | P | P | P |
101 | * +---------------------------+---+---+---+---+
102 | * | WINAPI_FAMILY_DESKTOP_APP | X | X | X | |
103 | * +---------------------------+---+---+---+---+
104 | * | WINAPI_FAMILY_PC_APP | | X | X | |
105 | * +---------------------------+---+---+---+---+
106 | * | WINAPI_FAMILY_PHONE_APP | | X | | X |
107 | * +---------------------------+---+---+---+---+
108 | *
109 | * The table above is encoded in the following expressions,
110 | * each of which evaluates to 1 or 0.
111 | *
112 | * Whenever a new family is added, all of these expressions
113 | * need to be reconsidered.
114 | */
115 | #if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP && WINAPI_FAMILY != WINAPI_FAMILY_PC_APP && WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
116 | # error Unknown WINAPI_FAMILY value. Was it defined in terms of a WINAPI_PARTITION_* value?
117 | #endif
118 | #define WINAPI_PARTITION_DESKTOP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
119 | #define WINAPI_PARTITION_APP 1 /* active for all current families */
120 | #define WINAPI_PARTITION_PC_APP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
121 | #define WINAPI_PARTITION_PHONE_APP (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
122 |
123 | /*
124 | * For compatibility with Windows Phone 8 header files, the following
125 | * synonym for WINAPI_PARTITION_PHONE_APP is temporarily #define'd.
126 | * Use of this symbol should be regarded as deprecated.
127 | */
128 | #define WINAPI_PARTITION_PHONE WINAPI_PARTITION_PHONE_APP
129 |
130 | /*
131 | * Header files use the WINAPI_FAMILY_PARTITION macro to assign one or
132 | * more declarations to some group of partitions. The macro chooses
133 | * whether the preprocessor will emit or omit a sequence of declarations
134 | * bracketed by an #if/#endif pair. All header file references to the
135 | * WINAPI_PARTITION_* values should be in the form of occurrences of
136 | * WINAPI_FAMILY_PARTITION(...).
137 | *
138 | * For example, the following usage of WINAPI_FAMILY_PARTITION identifies
139 | * a sequence of declarations that are part of both the Windows Desktop
140 | * Partition and the Windows-Phone-Specific Store Partition:
141 | *
142 | * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
143 | * ...
144 | * #endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
145 | *
146 | * The comment on the closing #endif allow tools as well as people to find the
147 | * matching #ifdef properly.
148 | *
149 | * Usages of WINAPI_FAMILY_PARTITION may be combined, when the partitition definitions are
150 | * related. In particular one might use declarations like
151 | *
152 | * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
153 | *
154 | * or
155 | *
156 | * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
157 | *
158 | * Direct references to WINAPI_PARTITION_ values (eg #if !WINAPI_FAMILY_PARTITION_...)
159 | * should not be used.
160 | */
161 | #define WINAPI_FAMILY_PARTITION(Partitions) (Partitions)
162 |
163 | /*
164 | * Macro used to #define or typedef a symbol used for selective deprecation
165 | * of individual methods of a COM interfaces that are otherwise available
166 | * for a given set of partitions.
167 | */
168 | #define _WINAPI_DEPRECATED_DECLARATION __declspec(deprecated("This API cannot be used in the context of the caller's application type."))
169 |
170 | /*
171 | * For compatibility with Windows 8 header files, the following
172 | * symbol is temporarily conditionally #define'd. Additional symbols
173 | * like this should be not defined in winapifamily.h, but rather should be
174 | * introduced locally to the header files of the component that needs them.
175 | */
176 | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
177 | # define APP_DEPRECATED_HRESULT HRESULT _WINAPI_DEPRECATED_DECLARATION
178 | #endif // WINAPIFAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
179 |
180 | #endif /* !_INC_WINAPIFAMILY */
181 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/QmsgQ-inject-hook.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31624.102
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QmsgQ-inject-hook", "QmsgQ-inject-hook.vcxproj", "{51E69FA6-1116-461A-874C-01DF84106BD9}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookQQMsgDll", "HookQQMsgDll\HookQQMsgDll\HookQQMsgDll.vcxproj", "{44267637-4607-4B0E-A5A6-387807FF1128}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookQQMsg", "HookQQMsg\HookQQMsg\HookQQMsg.vcxproj", "{9E344DC7-0B7F-44E2-A052-C53640FB7DC4}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|x64 = Debug|x64
15 | Debug|x86 = Debug|x86
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Debug|x64.ActiveCfg = Debug|x64
21 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Debug|x64.Build.0 = Debug|x64
22 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Debug|x86.ActiveCfg = Debug|Win32
23 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Debug|x86.Build.0 = Debug|Win32
24 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Release|x64.ActiveCfg = Release|x64
25 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Release|x64.Build.0 = Release|x64
26 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Release|x86.ActiveCfg = Release|Win32
27 | {51E69FA6-1116-461A-874C-01DF84106BD9}.Release|x86.Build.0 = Release|Win32
28 | {44267637-4607-4B0E-A5A6-387807FF1128}.Debug|x64.ActiveCfg = Debug|Win32
29 | {44267637-4607-4B0E-A5A6-387807FF1128}.Debug|x86.ActiveCfg = Debug|Win32
30 | {44267637-4607-4B0E-A5A6-387807FF1128}.Debug|x86.Build.0 = Debug|Win32
31 | {44267637-4607-4B0E-A5A6-387807FF1128}.Release|x64.ActiveCfg = Release|Win32
32 | {44267637-4607-4B0E-A5A6-387807FF1128}.Release|x86.ActiveCfg = Release|Win32
33 | {44267637-4607-4B0E-A5A6-387807FF1128}.Release|x86.Build.0 = Release|Win32
34 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|x64.ActiveCfg = Debug|Win32
35 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|x86.ActiveCfg = Debug|Win32
36 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Debug|x86.Build.0 = Debug|Win32
37 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|x64.ActiveCfg = Release|Win32
38 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|x86.ActiveCfg = Release|Win32
39 | {9E344DC7-0B7F-44E2-A052-C53640FB7DC4}.Release|x86.Build.0 = Release|Win32
40 | EndGlobalSection
41 | GlobalSection(SolutionProperties) = preSolution
42 | HideSolutionNode = FALSE
43 | EndGlobalSection
44 | GlobalSection(ExtensibilityGlobals) = postSolution
45 | SolutionGuid = {BF711C26-226A-438A-9320-C190EFE1D5CD}
46 | EndGlobalSection
47 | EndGlobal
48 |
--------------------------------------------------------------------------------
/QmsgQ-inject-hook.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 16.0
23 | Win32Proj
24 | {51e69fa6-1116-461a-874c-01df84106bd9}
25 | QmsgQinjecthook
26 | 10.0
27 |
28 |
29 |
30 | Application
31 | true
32 | v142
33 | Unicode
34 |
35 |
36 | Application
37 | false
38 | v142
39 | true
40 | Unicode
41 |
42 |
43 | Application
44 | true
45 | v142
46 | Unicode
47 |
48 |
49 | Application
50 | false
51 | v142
52 | true
53 | Unicode
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 |
76 |
77 | false
78 |
79 |
80 | true
81 |
82 |
83 | false
84 |
85 |
86 |
87 | Level3
88 | true
89 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
90 | true
91 |
92 |
93 | Console
94 | true
95 |
96 |
97 |
98 |
99 | Level3
100 | true
101 | true
102 | true
103 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
104 | true
105 |
106 |
107 | Console
108 | true
109 | true
110 | true
111 |
112 |
113 |
114 |
115 | Level3
116 | true
117 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
118 | true
119 |
120 |
121 | Console
122 | true
123 |
124 |
125 |
126 |
127 | Level3
128 | true
129 | true
130 | true
131 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
132 | true
133 |
134 |
135 | Console
136 | true
137 | true
138 | true
139 |
140 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/QmsgQ-inject-hook.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
--------------------------------------------------------------------------------
/QmsgQ-inject-hook.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # qq-hook-msg
2 | qq-hook-msg
3 | hook qq.exe to get QQ message at local machine.
4 |
--------------------------------------------------------------------------------
/Release/HookQQMsg.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/Release/HookQQMsg.pdb
--------------------------------------------------------------------------------
/Release/HookQQMsgDll.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/satadriver/qq-hook-msg/d45e9f1fe643061781cec3bb85c1420b823bcec8/Release/HookQQMsgDll.pdb
--------------------------------------------------------------------------------
/Release/QmsgQ-in.51e69fa6.tlog/QmsgQ-inject-hook.lastbuildstate:
--------------------------------------------------------------------------------
1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.22000.0:
2 | Release|Win32|D:\project\QmsgQ-inject-hook\|
3 |
--------------------------------------------------------------------------------
/Release/QmsgQ-inject-hook.exe.recipe:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | D:\project\QmsgQ-inject-hook\Release\QmsgQ-inject-hook.exe
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Release/QmsgQ-inject-hook.log:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------