zhangyang 6 lat temu
rodzic
commit
0fad27f138
51 zmienionych plików z 98 dodań i 95 usunięć
  1. BIN
      Debug/zpz.dll
  2. BIN
      Debug/zpz.ilk
  3. BIN
      Debug/zpz.pdb
  4. BIN
      Debug/zpzDll.dll
  5. BIN
      Debug/zpzDll.exp
  6. BIN
      Debug/zpzDll.ilk
  7. BIN
      Debug/zpzDll.lib
  8. BIN
      Debug/zpzDll.pdb
  9. 9 9
      zhipuzi_pay_plugin.sln
  10. BIN
      zpz/Debug/dllmain.obj
  11. BIN
      zpz/Debug/stdafx.obj
  12. BIN
      zpz/Debug/vc141.idb
  13. BIN
      zpz/Debug/vc141.pdb
  14. 0 4
      zpz/Debug/zpz.log
  15. BIN
      zpz/Debug/zpz.pch
  16. BIN
      zpz/Debug/zpz.tlog/CL.command.1.tlog
  17. BIN
      zpz/Debug/zpz.tlog/CL.read.1.tlog
  18. BIN
      zpz/Debug/zpz.tlog/CL.write.1.tlog
  19. BIN
      zpz/Debug/zpz.tlog/link.command.1.tlog
  20. BIN
      zpz/Debug/zpz.tlog/link.read.1.tlog
  21. BIN
      zpz/Debug/zpz.tlog/link.write.1.tlog
  22. 0 0
      zpz/Debug/zpz.tlog/unsuccessfulbuild
  23. 0 2
      zpz/Debug/zpz.tlog/zpz.lastbuildstate
  24. 0 62
      zpz/zpz.cpp
  25. 0 8
      zpz/zpz.vcxproj.user
  26. BIN
      zpzDll/Debug/dllmain.obj
  27. BIN
      zpzDll/Debug/stdafx.obj
  28. BIN
      zpzDll/Debug/vc141.idb
  29. BIN
      zpzDll/Debug/vc141.pdb
  30. 18 0
      zpzDll/Debug/zpzDll.Build.CppClean.log
  31. 3 0
      zpzDll/Debug/zpzDll.log
  32. BIN
      zpzDll/Debug/zpzDll.obj
  33. BIN
      zpzDll/Debug/zpzDll.pch
  34. BIN
      zpzDll/Debug/zpzDll.tlog/CL.command.1.tlog
  35. BIN
      zpzDll/Debug/zpzDll.tlog/CL.read.1.tlog
  36. BIN
      zpzDll/Debug/zpzDll.tlog/CL.write.1.tlog
  37. BIN
      zpzDll/Debug/zpzDll.tlog/link.16612.delete.1.tlog
  38. BIN
      zpzDll/Debug/zpzDll.tlog/link.command.1.tlog
  39. BIN
      zpzDll/Debug/zpzDll.tlog/link.read.1.tlog
  40. BIN
      zpzDll/Debug/zpzDll.tlog/link.write.1.tlog
  41. 2 0
      zpzDll/Debug/zpzDll.tlog/zpzDll.lastbuildstate
  42. BIN
      zpzDll/Debug/zpzDll.tlog/zpzDll.write.1u.tlog
  43. 5 0
      zpz/dllmain.cpp
  44. 0 0
      zpzDll/stdafx.cpp
  45. 0 0
      zpzDll/stdafx.h
  46. 0 0
      zpzDll/targetver.h
  47. 39 0
      zpzDll/zpzDll.cpp
  48. 4 0
      zpzDll/zpzDll.h
  49. 10 9
      zpz/zpz.vcxproj
  50. 4 1
      zpz/zpz.vcxproj.filters
  51. 4 0
      zpzDll/zpzDll.vcxproj.user

BIN
Debug/zpz.dll


BIN
Debug/zpz.ilk


BIN
Debug/zpz.pdb


BIN
Debug/zpzDll.dll


BIN
Debug/zpzDll.exp


BIN
Debug/zpzDll.ilk


BIN
Debug/zpzDll.lib


BIN
Debug/zpzDll.pdb


+ 9 - 9
zhipuzi_pay_plugin.sln

@@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.28010.2016
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zhipuzi_pay_plugin", "zhipuzi_pay_plugin\zhipuzi_pay_plugin.vcxproj", "{1D694BE0-D976-4F29-8997-3308ADFFF413}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zpz", "zpz\zpz.vcxproj", "{E8FD85F1-6858-4CBB-998E-71C0B10F847F}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zpzDll", "zpzDll\zpzDll.vcxproj", "{EBE0468A-D6C8-4E57-9119-478B731FF64E}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,14 +23,14 @@ Global
 		{1D694BE0-D976-4F29-8997-3308ADFFF413}.Release|x64.Build.0 = Release|x64
 		{1D694BE0-D976-4F29-8997-3308ADFFF413}.Release|x86.ActiveCfg = Release|Win32
 		{1D694BE0-D976-4F29-8997-3308ADFFF413}.Release|x86.Build.0 = Release|Win32
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Debug|x64.ActiveCfg = Debug|x64
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Debug|x64.Build.0 = Debug|x64
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Debug|x86.ActiveCfg = Debug|Win32
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Debug|x86.Build.0 = Debug|Win32
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Release|x64.ActiveCfg = Release|x64
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Release|x64.Build.0 = Release|x64
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Release|x86.ActiveCfg = Release|Win32
-		{E8FD85F1-6858-4CBB-998E-71C0B10F847F}.Release|x86.Build.0 = Release|Win32
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Debug|x64.ActiveCfg = Debug|x64
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Debug|x64.Build.0 = Debug|x64
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Debug|x86.ActiveCfg = Debug|Win32
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Debug|x86.Build.0 = Debug|Win32
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Release|x64.ActiveCfg = Release|x64
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Release|x64.Build.0 = Release|x64
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Release|x86.ActiveCfg = Release|Win32
+		{EBE0468A-D6C8-4E57-9119-478B731FF64E}.Release|x86.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

BIN
zpz/Debug/dllmain.obj


BIN
zpz/Debug/stdafx.obj


BIN
zpz/Debug/vc141.idb


BIN
zpz/Debug/vc141.pdb


+ 0 - 4
zpz/Debug/zpz.log

@@ -1,4 +0,0 @@
-D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_xp\Toolset.targets(39,5): warning MSB8051: 面向 Windows XP 的支持已被弃用,将来的 Visual Studio 版本不再提供该支持。请访问 https://go.microsoft.com/fwlink/?linkid=2023588,获取详细信息。
-  zpz.cpp
-e:\work\code\zhipuzi_pay_plugin\zpz\zpz.cpp(10): error C4716: “InstallHook”: 必须返回一个值
-e:\work\code\zhipuzi_pay_plugin\zpz\zpz.cpp(15): error C4716: “UninstallHook”: 必须返回一个值

BIN
zpz/Debug/zpz.pch


BIN
zpz/Debug/zpz.tlog/CL.command.1.tlog


BIN
zpz/Debug/zpz.tlog/CL.read.1.tlog


BIN
zpz/Debug/zpz.tlog/CL.write.1.tlog


BIN
zpz/Debug/zpz.tlog/link.command.1.tlog


BIN
zpz/Debug/zpz.tlog/link.read.1.tlog


BIN
zpz/Debug/zpz.tlog/link.write.1.tlog


+ 0 - 0
zpz/Debug/zpz.tlog/unsuccessfulbuild


+ 0 - 2
zpz/Debug/zpz.tlog/zpz.lastbuildstate

@@ -1,2 +0,0 @@
-#TargetFrameworkVersion=v4.0:PlatformToolSet=v141_xp:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=7.0
-Debug|Win32|E:\work\code\zhipuzi_pay_plugin\|

+ 0 - 62
zpz/zpz.cpp

@@ -1,62 +0,0 @@
-// zpz.cpp : 定义 DLL 应用程序的导出函数。
-//
-
-#include "stdafx.h"
-
-#pragma data_seg("publicdata")
-HHOOK hhook = NULL;
-HINSTANCE pinstance = NULL;
-HANDLE g_Handle;
-#pragma data_seg()
-
-HANDLE WINAPI myCreateFile(
-	__in     LPCWSTR lpFileName,
-	__in     DWORD dwDesiredAccess,
-	__in     DWORD dwShareMode,
-	__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
-	__in     DWORD dwCreationDisposition,
-	__in     DWORD dwFlagsAndAttributes,
-	__in_opt HANDLE hTemplateFile
-)
-{
-	HANDLE hFile = CreateFile(
-		lpFileName,
-		dwDesiredAccess,
-		dwShareMode,
-		lpSecurityAttributes,
-		dwCreationDisposition,
-		dwFlagsAndAttributes,
-		hTemplateFile);
-
-	
-
-	return hFile;
-}
-
-BOOL WINAPI myWriteFile(
-	__in        HANDLE hFile,
-	__in_bcount_opt(nNumberOfBytesToWrite) LPCVOID lpBuffer,
-	__in        DWORD nNumberOfBytesToWrite,
-	__out_opt   LPDWORD lpNumberOfBytesWritten,
-	__inout_opt LPOVERLAPPED lpOverlapped
-)
-{
-	BOOL bRet = WriteFile(hFile,
-			lpBuffer,
-			nNumberOfBytesToWrite,
-			lpNumberOfBytesWritten,
-			lpOverlapped);
-
-	return bRet;
-
-}
-
-__declspec(dllexport) int InstallHook()
-{
-	hhook = SetWindowsHookEx(WH_KEYBOARD, myWriteFile, pinstance, 0);
-}
-
-__declspec(dllexport) int UninstallHook()
-{
-
-}

+ 0 - 8
zpz/zpz.vcxproj.user

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LocalDebuggerCommand>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\$(TargetFileName)</LocalDebuggerCommand>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-    <LocalDebuggerWorkingDirectory>$(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\</LocalDebuggerWorkingDirectory>
-  </PropertyGroup>
-</Project>

BIN
zpzDll/Debug/dllmain.obj


BIN
zpzDll/Debug/stdafx.obj


BIN
zpzDll/Debug/vc141.idb


BIN
zpzDll/Debug/vc141.pdb


+ 18 - 0
zpzDll/Debug/zpzDll.Build.CppClean.log

@@ -0,0 +1,18 @@
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.pch
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\vc141.pdb
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\vc141.idb
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\stdafx.obj
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.obj
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\dllmain.obj
+d:\work\zhipuzi_pay_plugin\debug\zpzdll.dll
+d:\work\zhipuzi_pay_plugin\debug\zpzdll.ilk
+d:\work\zhipuzi_pay_plugin\debug\zpzdll.pdb
+d:\work\zhipuzi_pay_plugin\debug\zpzdll.lib
+d:\work\zhipuzi_pay_plugin\debug\zpzdll.exp
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\cl.command.1.tlog
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\cl.read.1.tlog
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\cl.write.1.tlog
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\link.command.1.tlog
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\link.read.1.tlog
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\link.write.1.tlog
+d:\work\zhipuzi_pay_plugin\zpzdll\debug\zpzdll.tlog\zpzdll.write.1u.tlog

+ 3 - 0
zpzDll/Debug/zpzDll.log

@@ -0,0 +1,3 @@
+  zpzDll.cpp
+    正在创建库 D:\work\zhipuzi_pay_plugin\Debug\zpzDll.lib 和对象 D:\work\zhipuzi_pay_plugin\Debug\zpzDll.exp
+  zpzDll.vcxproj -> D:\work\zhipuzi_pay_plugin\Debug\zpzDll.dll

BIN
zpzDll/Debug/zpzDll.obj


BIN
zpzDll/Debug/zpzDll.pch


BIN
zpzDll/Debug/zpzDll.tlog/CL.command.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/CL.read.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/CL.write.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.16612.delete.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.command.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.read.1.tlog


BIN
zpzDll/Debug/zpzDll.tlog/link.write.1.tlog


+ 2 - 0
zpzDll/Debug/zpzDll.tlog/zpzDll.lastbuildstate

@@ -0,0 +1,2 @@
+#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
+Debug|Win32|D:\work\zhipuzi_pay_plugin\|

BIN
zpzDll/Debug/zpzDll.tlog/zpzDll.write.1u.tlog


+ 5 - 0
zpz/dllmain.cpp

@@ -1,6 +1,8 @@
 // dllmain.cpp : 定义 DLL 应用程序的入口点。
 #include "stdafx.h"
 
+HINSTANCE g_Inst = NULL; //DLL模块句柄
+
 BOOL APIENTRY DllMain( HMODULE hModule,
                        DWORD  ul_reason_for_call,
                        LPVOID lpReserved
@@ -14,6 +16,9 @@ BOOL APIENTRY DllMain( HMODULE hModule,
     case DLL_PROCESS_DETACH:
         break;
     }
+
+	g_Inst = (HINSTANCE)hModule;
+
     return TRUE;
 }
 

zpz/stdafx.cpp → zpzDll/stdafx.cpp


zpz/stdafx.h → zpzDll/stdafx.h


zpz/targetver.h → zpzDll/targetver.h


+ 39 - 0
zpzDll/zpzDll.cpp

@@ -0,0 +1,39 @@
+// zpzDll.cpp : 定义 DLL 应用程序的导出函数。
+//
+
+#include "stdafx.h"
+#include "zpzDll.h"
+
+#include <windows.h>
+
+#pragma data_seg("shared")  
+HWND hWnd = NULL;
+HHOOK g_Hook = NULL;
+#pragma data_seg()  
+
+#pragma comment(linker,"/SECTION:shared,RWS") 
+
+extern HINSTANCE g_Inst;
+
+//鼠标钩子过程
+LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+	if (nCode < 0)
+	{
+		return CallNextHookEx(g_Hook, nCode, wParam, lParam);
+	}
+
+	return 1;
+}
+
+//安装鼠标钩子过程的函数
+void SetHook()
+{
+	g_Hook = SetWindowsHookEx(WH_MOUSE, MouseProc, g_Inst, 0);
+}
+
+void SetHookOff()
+{
+	UnhookWindowsHookEx(g_Hook);
+}
+

+ 4 - 0
zpzDll/zpzDll.h

@@ -0,0 +1,4 @@
+#pragma once
+
+__declspec(dllexport) void SetHook();
+__declspec(dllexport) void SetHookOff();

+ 10 - 9
zpz/zpz.vcxproj

@@ -20,16 +20,16 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <VCProjectVersion>15.0</VCProjectVersion>
-    <ProjectGuid>{E8FD85F1-6858-4CBB-998E-71C0B10F847F}</ProjectGuid>
+    <ProjectGuid>{EBE0468A-D6C8-4E57-9119-478B731FF64E}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
-    <RootNamespace>zpz</RootNamespace>
+    <RootNamespace>zpzDll</RootNamespace>
     <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v141_xp</PlatformToolset>
+    <PlatformToolset>v141</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -88,9 +88,8 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;_DEBUG;ZPZ_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;_DEBUG;ZPZDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -103,7 +102,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>_DEBUG;ZPZ_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;ZPZDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
     </ClCompile>
     <Link>
@@ -119,8 +118,9 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;NDEBUG;ZPZ_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;ZPZDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -137,7 +137,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>NDEBUG;ZPZ_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;ZPZDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
     </ClCompile>
     <Link>
@@ -150,6 +150,7 @@
   <ItemGroup>
     <ClInclude Include="stdafx.h" />
     <ClInclude Include="targetver.h" />
+    <ClInclude Include="zpzDll.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="dllmain.cpp" />
@@ -159,7 +160,7 @@
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
     </ClCompile>
-    <ClCompile Include="zpz.cpp" />
+    <ClCompile Include="zpzDll.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 4 - 1
zpz/zpz.vcxproj.filters

@@ -21,12 +21,15 @@
     <ClInclude Include="targetver.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="zpzDll.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="stdafx.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
-    <ClCompile Include="zpz.cpp">
+    <ClCompile Include="zpzDll.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
     <ClCompile Include="dllmain.cpp">

+ 4 - 0
zpzDll/zpzDll.vcxproj.user

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+</Project>