commit 9b255c0234062310254f3f67cfa1d9fe1c2ec464 Author: woni <320753691@qq.com> Date: Tue Jan 23 09:14:36 2024 +0800 first commit diff --git a/.vs/WeChatHook/FileContentIndex/f5536266-2142-4bac-bbef-850a27f0a065.vsidx b/.vs/WeChatHook/FileContentIndex/f5536266-2142-4bac-bbef-850a27f0a065.vsidx new file mode 100644 index 0000000..256555b Binary files /dev/null and b/.vs/WeChatHook/FileContentIndex/f5536266-2142-4bac-bbef-850a27f0a065.vsidx differ diff --git a/.vs/WeChatHook/v17/.suo b/.vs/WeChatHook/v17/.suo new file mode 100644 index 0000000..a4c084c Binary files /dev/null and b/.vs/WeChatHook/v17/.suo differ diff --git a/.vs/WeChatHook/v17/Browse.VC.db b/.vs/WeChatHook/v17/Browse.VC.db new file mode 100644 index 0000000..f409cf3 Binary files /dev/null and b/.vs/WeChatHook/v17/Browse.VC.db differ diff --git a/.vs/WeChatHook/v17/ipch/AutoPCH/8d3dbd78f41be4eb/WECHATHOOK.ipch b/.vs/WeChatHook/v17/ipch/AutoPCH/8d3dbd78f41be4eb/WECHATHOOK.ipch new file mode 100644 index 0000000..c136aa4 Binary files /dev/null and b/.vs/WeChatHook/v17/ipch/AutoPCH/8d3dbd78f41be4eb/WECHATHOOK.ipch differ diff --git a/WeChatHook.cpp b/WeChatHook.cpp new file mode 100644 index 0000000..0d168cb --- /dev/null +++ b/WeChatHook.cpp @@ -0,0 +1,72 @@ +// WeChatHook.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include +#include +#include +#define WeChatProcessName "WeChat.exe" + +VOID InjectDll(); +DWORD ProcessNameFindPID(LPCSTR ProcessName); + +int main() +{ + std::cout << "Hello World!\n"; +} + +DWORD ProcessNameFindPID(LPCSTR ProcessName) +{ + HANDLE ProcesllAll = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + PROCESSENTRY32 processInfo = {0}; + processInfo.dwSize = sizeof(PROCESSENTRY32); + + do + { + if (strcmp(ProcessName, processInfo.szExeFile) == 0) + { + return processInfo.th32ProcessID; + } + } while (Process32Next(ProcesllAll, &processInfo)); + + return 0; +} + +VOID InjectDll() +{ + CHAR pathStr[0x100] = {"C://"}; + + DWORD PID = ProcessNameFindPID(WeChatProcessName); + + if (PID == 0) + { + printf("Can't find the process\n"); + return; + } + + HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID); + if (hProcess == NULL) + { + printf("Can't open the process\n"); + return; + } + + LPVOID pDllPath = VirtualAllocEx(hProcess, NULL, sizeof(pathStr), MEM_COMMIT, PAGE_READWRITE); + if (pDllPath == NULL) + { + printf("Can't allocate memory\n"); + return; + } + + const char *pathStr = "Kernel32.dll"; // your ASCII string + + HMODULE k32 = GetModuleHandle(pathStr); + LPVOID loadAdd = GetProcAddress(k32, "LoadLibraryW"); + + HANDLE exec = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)loadAdd, pDllPath, 0, NULL); + + if (exec == NULL) + { + printf("Can't create remote thread\n"); + return; + } +} diff --git a/WeChatHook.sln b/WeChatHook.sln new file mode 100644 index 0000000..506b979 --- /dev/null +++ b/WeChatHook.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34024.191 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WeChatHook", "WeChatHook.vcxproj", "{35C81794-2548-41A7-90AB-F9325BCDFAC7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Debug|x64.ActiveCfg = Debug|x64 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Debug|x64.Build.0 = Debug|x64 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Debug|x86.ActiveCfg = Debug|Win32 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Debug|x86.Build.0 = Debug|Win32 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Release|x64.ActiveCfg = Release|x64 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Release|x64.Build.0 = Release|x64 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Release|x86.ActiveCfg = Release|Win32 + {35C81794-2548-41A7-90AB-F9325BCDFAC7}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {22BBD662-F4D9-4896-9584-98C0AD8A986C} + EndGlobalSection +EndGlobal diff --git a/WeChatHook.vcxproj b/WeChatHook.vcxproj new file mode 100644 index 0000000..e6d8050 --- /dev/null +++ b/WeChatHook.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {35c81794-2548-41a7-90ab-f9325bcdfac7} + WeChatHook + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + NotSet + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/WeChatHook.vcxproj.filters b/WeChatHook.vcxproj.filters new file mode 100644 index 0000000..39715da --- /dev/null +++ b/WeChatHook.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/WeChatHook.vcxproj.user b/WeChatHook.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/WeChatHook.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/x64/Debug/WeChatHook.exe b/x64/Debug/WeChatHook.exe new file mode 100644 index 0000000..460cc31 Binary files /dev/null and b/x64/Debug/WeChatHook.exe differ diff --git a/x64/Debug/WeChatHook.exe.recipe b/x64/Debug/WeChatHook.exe.recipe new file mode 100644 index 0000000..be5151d --- /dev/null +++ b/x64/Debug/WeChatHook.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\CS\WeChatHook\x64\Debug\WeChatHook.exe + + + + + + \ No newline at end of file diff --git a/x64/Debug/WeChatHook.ilk b/x64/Debug/WeChatHook.ilk new file mode 100644 index 0000000..e76a3c4 Binary files /dev/null and b/x64/Debug/WeChatHook.ilk differ diff --git a/x64/Debug/WeChatHook.log b/x64/Debug/WeChatHook.log new file mode 100644 index 0000000..7b4b803 --- /dev/null +++ b/x64/Debug/WeChatHook.log @@ -0,0 +1,2 @@ + WeChatHook.cpp + WeChatHook.vcxproj -> D:\CS\WeChatHook\x64\Debug\WeChatHook.exe diff --git a/x64/Debug/WeChatHook.obj b/x64/Debug/WeChatHook.obj new file mode 100644 index 0000000..3d1ecfc Binary files /dev/null and b/x64/Debug/WeChatHook.obj differ diff --git a/x64/Debug/WeChatHook.pdb b/x64/Debug/WeChatHook.pdb new file mode 100644 index 0000000..a68995a Binary files /dev/null and b/x64/Debug/WeChatHook.pdb differ diff --git a/x64/Debug/WeChatHook.tlog/CL.command.1.tlog b/x64/Debug/WeChatHook.tlog/CL.command.1.tlog new file mode 100644 index 0000000..4e741d4 Binary files /dev/null and b/x64/Debug/WeChatHook.tlog/CL.command.1.tlog differ diff --git a/x64/Debug/WeChatHook.tlog/CL.read.1.tlog b/x64/Debug/WeChatHook.tlog/CL.read.1.tlog new file mode 100644 index 0000000..d1059f1 Binary files /dev/null and b/x64/Debug/WeChatHook.tlog/CL.read.1.tlog differ diff --git a/x64/Debug/WeChatHook.tlog/CL.write.1.tlog b/x64/Debug/WeChatHook.tlog/CL.write.1.tlog new file mode 100644 index 0000000..2da6e2c Binary files /dev/null and b/x64/Debug/WeChatHook.tlog/CL.write.1.tlog differ diff --git a/x64/Debug/WeChatHook.tlog/Cl.items.tlog b/x64/Debug/WeChatHook.tlog/Cl.items.tlog new file mode 100644 index 0000000..0aed849 --- /dev/null +++ b/x64/Debug/WeChatHook.tlog/Cl.items.tlog @@ -0,0 +1 @@ +D:\CS\WeChatHook\WeChatHook.cpp;D:\CS\WeChatHook\x64\Debug\WeChatHook.obj diff --git a/x64/Debug/WeChatHook.tlog/WeChatHook.lastbuildstate b/x64/Debug/WeChatHook.tlog/WeChatHook.lastbuildstate new file mode 100644 index 0000000..006bfcd --- /dev/null +++ b/x64/Debug/WeChatHook.tlog/WeChatHook.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.37.32822:TargetPlatformVersion=10.0.22621.0: +Debug|x64|D:\CS\WeChatHook\| diff --git a/x64/Debug/WeChatHook.tlog/link.command.1.tlog b/x64/Debug/WeChatHook.tlog/link.command.1.tlog new file mode 100644 index 0000000..b861fef Binary files /dev/null and b/x64/Debug/WeChatHook.tlog/link.command.1.tlog differ diff --git a/x64/Debug/WeChatHook.tlog/link.read.1.tlog b/x64/Debug/WeChatHook.tlog/link.read.1.tlog new file mode 100644 index 0000000..2714cbb Binary files /dev/null and b/x64/Debug/WeChatHook.tlog/link.read.1.tlog differ diff --git a/x64/Debug/WeChatHook.tlog/link.write.1.tlog b/x64/Debug/WeChatHook.tlog/link.write.1.tlog new file mode 100644 index 0000000..7b66c9f Binary files /dev/null and b/x64/Debug/WeChatHook.tlog/link.write.1.tlog differ diff --git a/x64/Debug/WeChatHook.vcxproj.FileListAbsolute.txt b/x64/Debug/WeChatHook.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..258af44 --- /dev/null +++ b/x64/Debug/WeChatHook.vcxproj.FileListAbsolute.txt @@ -0,0 +1 @@ +D:\CS\WeChatHook\x64\Debug\WeChatHook.exe diff --git a/x64/Debug/vc143.idb b/x64/Debug/vc143.idb new file mode 100644 index 0000000..2adf2c1 Binary files /dev/null and b/x64/Debug/vc143.idb differ diff --git a/x64/Debug/vc143.pdb b/x64/Debug/vc143.pdb new file mode 100644 index 0000000..62c2e65 Binary files /dev/null and b/x64/Debug/vc143.pdb differ