From b8393e1e74b5f1b1ebeb62d99d2c500596f103ca Mon Sep 17 00:00:00 2001 From: Changhua Date: Mon, 15 Apr 2024 21:42:04 +0800 Subject: [PATCH] Port to x64 --- WeChatFerry/WeChatFerry.sln | 24 +++++------ WeChatFerry/sdk/SDK.vcxproj | 24 +++++++++-- WeChatFerry/spy/Spy.vcxproj | 62 ++++++++++++++++++++++++--- WeChatFerry/spy/chatroom_mgmt.cpp | 3 +- WeChatFerry/spy/contact_mgmt.cpp | 3 +- WeChatFerry/spy/exec_sql.cpp | 3 +- WeChatFerry/spy/funcs.cpp | 3 +- WeChatFerry/spy/receive_msg.cpp | 3 +- WeChatFerry/spy/receive_transfer.cpp | 3 +- WeChatFerry/spy/rpc_server.cpp | 8 ++-- WeChatFerry/spy/send_msg.cpp | 3 +- WeChatFerry/spy/spy.aps | Bin 2612 -> 2612 bytes WeChatFerry/spy/spy.rc | 8 ++-- WeChatFerry/wcf/wcf.vcxproj | 19 +++++++- 14 files changed, 127 insertions(+), 39 deletions(-) diff --git a/WeChatFerry/WeChatFerry.sln b/WeChatFerry/WeChatFerry.sln index 8e49373..4573c46 100644 --- a/WeChatFerry/WeChatFerry.sln +++ b/WeChatFerry/WeChatFerry.sln @@ -17,20 +17,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wcf", "wcf\wcf.vcxproj", "{ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Debug|x86.ActiveCfg = Debug|Win32 - {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Debug|x86.Build.0 = Debug|Win32 - {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Release|x86.ActiveCfg = Release|Win32 - {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Release|x86.Build.0 = Release|Win32 - {ABFCB647-137F-478B-A73E-F0B1E3ADC215}.Debug|x86.ActiveCfg = Release|Win32 - {ABFCB647-137F-478B-A73E-F0B1E3ADC215}.Release|x86.ActiveCfg = Release|Win32 - {ABFCB647-137F-478B-A73E-F0B1E3ADC215}.Release|x86.Build.0 = Release|Win32 - {02747CE0-AD9F-4812-B019-FCF9867F7514}.Debug|x86.ActiveCfg = Release|Win32 - {02747CE0-AD9F-4812-B019-FCF9867F7514}.Release|x86.ActiveCfg = Release|Win32 - {02747CE0-AD9F-4812-B019-FCF9867F7514}.Release|x86.Build.0 = Release|Win32 + {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Debug|x64.ActiveCfg = Debug|x64 + {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Debug|x64.Build.0 = Debug|x64 + {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Release|x64.ActiveCfg = Release|x64 + {4DE80B82-5F6A-4C4C-9D16-1574308110FA}.Release|x64.Build.0 = Release|x64 + {ABFCB647-137F-478B-A73E-F0B1E3ADC215}.Debug|x64.ActiveCfg = Debug|x64 + {ABFCB647-137F-478B-A73E-F0B1E3ADC215}.Release|x64.ActiveCfg = Release|x64 + {ABFCB647-137F-478B-A73E-F0B1E3ADC215}.Release|x64.Build.0 = Release|x64 + {02747CE0-AD9F-4812-B019-FCF9867F7514}.Debug|x64.ActiveCfg = Debug|x64 + {02747CE0-AD9F-4812-B019-FCF9867F7514}.Release|x64.ActiveCfg = Release|x64 + {02747CE0-AD9F-4812-B019-FCF9867F7514}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/WeChatFerry/sdk/SDK.vcxproj b/WeChatFerry/sdk/SDK.vcxproj index d781815..b8bd869 100644 --- a/WeChatFerry/sdk/SDK.vcxproj +++ b/WeChatFerry/sdk/SDK.vcxproj @@ -86,6 +86,10 @@ true x86-windows-static + + true + x64-windows-static + Level3 @@ -154,19 +158,31 @@ true true true - NDEBUG;SDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;SDK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use - pch.h + NotUsing + + + stdcpp17 + $(SolutionDir)spy;C:\Tools\vcpkg\installed\x64-windows-static\include + + true + MultiThreaded Windows true true - true + false false sdk.def + + xcopy /y $(OutDir)$(TargetFileName) $(SolutionDir)Out + + + Copy files + diff --git a/WeChatFerry/spy/Spy.vcxproj b/WeChatFerry/spy/Spy.vcxproj index f3ca5a3..4c1d724 100644 --- a/WeChatFerry/spy/Spy.vcxproj +++ b/WeChatFerry/spy/Spy.vcxproj @@ -94,6 +94,12 @@ true Release + + true + + + true + Level3 @@ -191,10 +197,20 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto Level3 true - _DEBUG;SPY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;SPY_EXPORTS;_WINDOWS;_USRDLL;ENABLE_DEBUG_LOG;%(PreprocessorDefinitions) true - Use - pch.h + NotUsing + + + stdcpp17 + $(SolutionDir)rpc;$(SolutionDir)rpc\nanopb;$(SolutionDir)rpc\proto;$(SolutionDir)smc;$(SolutionDir)spy;C:\Tools\vcpkg\installed\x64-windows-static\include + true + false + MultiThreadedDebug + true + + 4251;4731;4819 + /EHa %(AdditionalOptions) Windows @@ -202,7 +218,28 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto false spy.def /ignore:4099 %(AdditionalOptions) + $(SolutionDir)smc;%(AdditionalLibraryDirectories) + iphlpapi.lib;wsock32.lib;ws2_32.lib;crypt32.lib;Codec.lib;%(AdditionalDependencies) + true + + cd $(SolutionDir)rpc\proto +$(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto + + + Generating PB files + + + if not exist $(SolutionDir)Out md $(SolutionDir)Out +xcopy /y $(OutDir)$(TargetFileName) $(SolutionDir)Out +xcopy /y $(OutDir)$(TargetName).exp $(SolutionDir)Out +xcopy /y $(OutDir)$(TargetName).lib $(SolutionDir)Out +xcopy /y $(OutDir)$(TargetName).pdb $(SolutionDir)Out +xcopy /y $(OutDir)$(TargetFileName) $(SolutionDir)..\clients\python\wcferry + + + Copy spy.dll + @@ -210,18 +247,29 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto true true true - NDEBUG;SPY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;SPY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true - Use - pch.h + NotUsing + + + stdcpp17 + $(SolutionDir)rpc;$(SolutionDir)rpc\nanopb;$(SolutionDir)rpc\proto;$(SolutionDir)smc;$(SolutionDir)spy;C:\Tools\vcpkg\installed\x64-windows-static\include + false + + 4251;4731;4819 + /EHa %(AdditionalOptions) + MultiThreaded Windows true true - true + false false spy.def + $(SolutionDir)smc;%(AdditionalLibraryDirectories) + iphlpapi.lib;wsock32.lib;ws2_32.lib;crypt32.lib;Codec.lib;%(AdditionalDependencies) + /ignore:4099 %(AdditionalOptions) diff --git a/WeChatFerry/spy/chatroom_mgmt.cpp b/WeChatFerry/spy/chatroom_mgmt.cpp index 5b32ffb..25bafcd 100644 --- a/WeChatFerry/spy/chatroom_mgmt.cpp +++ b/WeChatFerry/spy/chatroom_mgmt.cpp @@ -11,7 +11,7 @@ using namespace std; extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; - +#if 0 int AddChatroomMember(string roomid, string wxids) { if (roomid.empty() || wxids.empty()) { @@ -178,3 +178,4 @@ int InviteChatroomMember(string roomid, string wxids) } return 1; } +#endif diff --git a/WeChatFerry/spy/contact_mgmt.cpp b/WeChatFerry/spy/contact_mgmt.cpp index a88a178..28bbaa4 100644 --- a/WeChatFerry/spy/contact_mgmt.cpp +++ b/WeChatFerry/spy/contact_mgmt.cpp @@ -8,7 +8,7 @@ using namespace std; extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; - +#if 0 #define FEAT_LEN 5 static const uint8_t FEAT_COUNTRY[FEAT_LEN] = { 0xA4, 0xD9, 0x02, 0x4A, 0x18 }; static const uint8_t FEAT_PROVINCE[FEAT_LEN] = { 0xE2, 0xEA, 0xA8, 0xD1, 0x18 }; @@ -183,3 +183,4 @@ RpcContact_t GetContactByWxid(string wxid) return contact; } +#endif diff --git a/WeChatFerry/spy/exec_sql.cpp b/WeChatFerry/spy/exec_sql.cpp index 65e886b..04b4521 100644 --- a/WeChatFerry/spy/exec_sql.cpp +++ b/WeChatFerry/spy/exec_sql.cpp @@ -20,7 +20,7 @@ extern DWORD g_WeChatWinDllAddr; typedef map dbMap_t; static dbMap_t dbMap; - +#if 0 static void GetDbHandle(DWORD base, DWORD offset) { wchar_t *wsp; @@ -225,3 +225,4 @@ vector GetAudioData(uint64_t id) return vector(); } +#endif diff --git a/WeChatFerry/spy/funcs.cpp b/WeChatFerry/spy/funcs.cpp index 322133c..eeb63f0 100644 --- a/WeChatFerry/spy/funcs.cpp +++ b/WeChatFerry/spy/funcs.cpp @@ -24,7 +24,7 @@ namespace fs = std::filesystem; extern bool gIsListeningPyq; extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; - +#if 0 static string get_key(uint8_t header1, uint8_t header2, uint8_t *key) { // PNG? @@ -443,3 +443,4 @@ string GetLoginUrl() } return "http://weixin.qq.com/x/" + string(url); } +#endif diff --git a/WeChatFerry/spy/receive_msg.cpp b/WeChatFerry/spy/receive_msg.cpp index 91fa118..b9aba4e 100644 --- a/WeChatFerry/spy/receive_msg.cpp +++ b/WeChatFerry/spy/receive_msg.cpp @@ -31,7 +31,7 @@ static DWORD recvPyqHookAddr = 0; static DWORD recvPyqCallAddr = 0; static DWORD recvPyqJumpBackAddr = 0; static CHAR recvPyqBackupCode[5] = { 0 }; - +#if 0 MsgTypes_t GetMsgTypes() { const MsgTypes_t m = { @@ -259,3 +259,4 @@ void UnListenPyq() UnHookAddress(recvPyqHookAddr, recvPyqBackupCode); gIsListeningPyq = false; } +#endif diff --git a/WeChatFerry/spy/receive_transfer.cpp b/WeChatFerry/spy/receive_transfer.cpp index a31960d..5b66bb9 100644 --- a/WeChatFerry/spy/receive_transfer.cpp +++ b/WeChatFerry/spy/receive_transfer.cpp @@ -7,7 +7,7 @@ using namespace std; extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; - +#if 0 int ReceiveTransfer(string wxid, string transferid, string transactionid) { int rv = 0; @@ -53,3 +53,4 @@ int ReceiveTransfer(string wxid, string transferid, string transactionid) return rv; } +#endif diff --git a/WeChatFerry/spy/rpc_server.cpp b/WeChatFerry/spy/rpc_server.cpp index 72eb6fb..f1816a6 100644 --- a/WeChatFerry/spy/rpc_server.cpp +++ b/WeChatFerry/spy/rpc_server.cpp @@ -53,7 +53,7 @@ static DWORD lThreadId = 0; static bool lIsRunning = false; static nng_socket cmdSock, msgSock; // TODO: 断开检测 static uint8_t gBuffer[G_BUF_SIZE] = { 0 }; - +#if 0 bool func_is_login(uint8_t *out, size_t *len) { Response rsp = Response_init_default; @@ -837,7 +837,7 @@ bool func_invite_room_members(char *roomid, char *wxids, uint8_t *out, size_t *l return true; } - +#endif static bool dispatcher(uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len) { bool ret = false; @@ -850,6 +850,7 @@ static bool dispatcher(uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len } LOG_DEBUG("{:#04x}[{}] length: {}", (uint8_t)req.func, magic_enum::enum_name(req.func), in_len); +#if 0 switch (req.func) { case Functions_FUNC_IS_LOGIN: { ret = func_is_login(out, out_len); @@ -982,6 +983,7 @@ static bool dispatcher(uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len break; } } +#endif pb_release(Request_fields, &req); return ret; } @@ -1065,7 +1067,7 @@ int RpcStopServer() if (lIsRunning) { nng_close(cmdSock); nng_close(msgSock); - UnListenMessage(); + // UnListenMessage(); lIsRunning = false; Sleep(1000); LOG_INFO("Server stoped."); diff --git a/WeChatFerry/spy/send_msg.cpp b/WeChatFerry/spy/send_msg.cpp index ab45561..2e2f57c 100644 --- a/WeChatFerry/spy/send_msg.cpp +++ b/WeChatFerry/spy/send_msg.cpp @@ -12,7 +12,7 @@ extern HANDLE g_hEvent; extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; extern string GetSelfWxid(); // Defined in spy.cpp - +#if 0 void SendTextMessage(string wxid, string msg, string atWxids) { int success = 0; @@ -438,3 +438,4 @@ int ForwardMessage(uint64_t msgid, string receiver) return status; } +#endif diff --git a/WeChatFerry/spy/spy.aps b/WeChatFerry/spy/spy.aps index 5fd638a3d071e3ba543c77d37d7edb4f22fda654..d525acb344e2a225385793d71ba024340800da17 100644 GIT binary patch delta 73 zcmdlYvPEP88$Tn1Is*uBGB7g;GjL7jXS>L3#K1ZEF`F{CA%h-+0T?q(7G!_VYyp&K T=FsFc1dAFnSZ+4u_|FIcx-1NR delta 73 zcmdlYvPEP88$SbsIs*d(F9Rn7GlMt-(`0_Oi_9hrT$3NODRUbz=rI^F7z0Uz$%5?f anavnDCo^+savA|ejDX?{n@u_XGXem>?hJ$g diff --git a/WeChatFerry/spy/spy.rc b/WeChatFerry/spy/spy.rc index f50e642..2aa2b4a 100644 --- a/WeChatFerry/spy/spy.rc +++ b/WeChatFerry/spy/spy.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 39,0,13,0 - PRODUCTVERSION 3,9,2,23 + FILEVERSION 39,1,0,0 + PRODUCTVERSION 3,9,10,19 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "WeChatFerry" VALUE "FileDescription", "WeChatFerry" - VALUE "FileVersion", "39.0.13.0" + VALUE "FileVersion", "39.1.0.0" VALUE "InternalName", "spy.dll" VALUE "LegalCopyright", "Copyright (C) 2023" VALUE "OriginalFilename", "spy.dll" VALUE "ProductName", "WeChatFerry" - VALUE "ProductVersion", "3.9.2.23" + VALUE "ProductVersion", "3.9.10.19" END END BLOCK "VarFileInfo" diff --git a/WeChatFerry/wcf/wcf.vcxproj b/WeChatFerry/wcf/wcf.vcxproj index 1f9b67f..f156940 100644 --- a/WeChatFerry/wcf/wcf.vcxproj +++ b/WeChatFerry/wcf/wcf.vcxproj @@ -86,6 +86,10 @@ true x86-windows-static + + true + x64-windows-static + Level3 @@ -143,15 +147,26 @@ xcopy /y $(OutDir)$(TargetFileName) $(SolutionDir)..\clients\python\wcferrytrue true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;WCF;%(PreprocessorDefinitions) true + stdcpp17 + $(SolutionDir)sdk;$(SolutionDir)spy;C:\Tools\vcpkg\installed\x64-windows-static\include + MultiThreaded + 4996 Console true true - true + false + + xcopy /y $(OutDir)$(TargetFileName) $(SolutionDir)Out +xcopy /y $(OutDir)$(TargetFileName) $(SolutionDir)..\clients\python\wcferry + + + Copy files +