diff --git a/spy/Spy.vcxproj b/spy/Spy.vcxproj index 471d676..88117cd 100644 --- a/spy/Spy.vcxproj +++ b/spy/Spy.vcxproj @@ -226,12 +226,11 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto - - + @@ -251,12 +250,11 @@ $(SolutionDir)rpc\tool\protoc --nanopb_out=. wcf.proto - - + diff --git a/spy/Spy.vcxproj.filters b/spy/Spy.vcxproj.filters index 1f814de..a7ce58b 100644 --- a/spy/Spy.vcxproj.filters +++ b/spy/Spy.vcxproj.filters @@ -27,13 +27,10 @@ 头文件 - - 头文件 - 头文件 - + 头文件 @@ -104,13 +101,10 @@ 源文件 - - 源文件 - 源文件 - + 源文件 diff --git a/spy/accept_new_friend.cpp b/spy/accept_new_friend.cpp deleted file mode 100644 index 97f6ccc..0000000 --- a/spy/accept_new_friend.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "framework.h" - -#include "accept_new_friend.h" -#include "load_calls.h" -#include "log.h" -#include "util.h" - -extern WxCalls_t g_WxCalls; -extern DWORD g_WeChatWinDllAddr; - -int AcceptNewFriend(std::string v3, std::string v4, int scene) -{ - int success = 0; - - DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1; - DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2; - DWORD acceptNewFriendCall3 = g_WeChatWinDllAddr + g_WxCalls.anf.call3; - DWORD acceptNewFriendCall4 = g_WeChatWinDllAddr + g_WxCalls.anf.call4; - - char buffer[0x40] = { 0 }; - char nullbuffer[0x3CC] = { 0 }; - - LOG_DEBUG("\nv3: {}\nv4: {}\nscene: {}", v3, v4, scene); - WxString_t wxV3 = { 0 }; - WxString_t wxV4 = { 0 }; - std::wstring wsV3 = String2Wstring(v3); - std::wstring wsV4 = String2Wstring(v4); - - wxV3.text = (wchar_t *)wsV3.c_str(); - wxV3.size = wsV3.size(); - wxV3.capacity = wsV3.capacity(); - - wxV4.text = (wchar_t *)wsV4.c_str(); - wxV4.size = wsV4.size(); - wxV4.capacity = wsV4.capacity(); - - __asm { - pushad; - pushfd; - lea ecx, buffer; - call acceptNewFriendCall1; - mov esi, 0x0; - mov edi, scene; - push esi; - push edi; - sub esp, 0x14; - mov ecx, esp; - lea eax, wxV4; - push eax; - call acceptNewFriendCall2; - sub esp, 0x8; - push 0x0; - lea eax, nullbuffer; - push eax; - lea eax, wxV3; - push eax; - lea ecx, buffer; - call acceptNewFriendCall3; - mov success, eax; - lea ecx, buffer; - call acceptNewFriendCall4; - popfd; - popad; - } - - return success; // 成功返回 1 -} diff --git a/spy/get_contacts.cpp b/spy/contact_mgmt.cpp similarity index 61% rename from spy/get_contacts.cpp rename to spy/contact_mgmt.cpp index 039a89e..bb9780b 100644 --- a/spy/get_contacts.cpp +++ b/spy/contact_mgmt.cpp @@ -1,7 +1,8 @@ #pragma execution_character_set("utf-8") -#include "get_contacts.h" +#include "contact_mgmt.h" #include "load_calls.h" +#include "log.h" #include "util.h" extern WxCalls_t g_WxCalls; @@ -88,3 +89,61 @@ vector GetContacts() return contacts; } + +int AcceptNewFriend(std::string v3, std::string v4, int scene) +{ + int success = 0; + + DWORD acceptNewFriendCall1 = g_WeChatWinDllAddr + g_WxCalls.anf.call1; + DWORD acceptNewFriendCall2 = g_WeChatWinDllAddr + g_WxCalls.anf.call2; + DWORD acceptNewFriendCall3 = g_WeChatWinDllAddr + g_WxCalls.anf.call3; + DWORD acceptNewFriendCall4 = g_WeChatWinDllAddr + g_WxCalls.anf.call4; + + char buffer[0x40] = { 0 }; + char nullbuffer[0x3CC] = { 0 }; + + LOG_DEBUG("\nv3: {}\nv4: {}\nscene: {}", v3, v4, scene); + WxString_t wxV3 = { 0 }; + WxString_t wxV4 = { 0 }; + std::wstring wsV3 = String2Wstring(v3); + std::wstring wsV4 = String2Wstring(v4); + + wxV3.text = (wchar_t *)wsV3.c_str(); + wxV3.size = wsV3.size(); + wxV3.capacity = wsV3.capacity(); + + wxV4.text = (wchar_t *)wsV4.c_str(); + wxV4.size = wsV4.size(); + wxV4.capacity = wsV4.capacity(); + + __asm { + pushad; + pushfd; + lea ecx, buffer; + call acceptNewFriendCall1; + mov esi, 0x0; + mov edi, scene; + push esi; + push edi; + sub esp, 0x14; + mov ecx, esp; + lea eax, wxV4; + push eax; + call acceptNewFriendCall2; + sub esp, 0x8; + push 0x0; + lea eax, nullbuffer; + push eax; + lea eax, wxV3; + push eax; + lea ecx, buffer; + call acceptNewFriendCall3; + mov success, eax; + lea ecx, buffer; + call acceptNewFriendCall4; + popfd; + popad; + } + + return success; // 成功返回 1 +} diff --git a/spy/accept_new_friend.h b/spy/contact_mgmt.h similarity index 56% rename from spy/accept_new_friend.h rename to spy/contact_mgmt.h index b6b7d70..b045b64 100644 --- a/spy/accept_new_friend.h +++ b/spy/contact_mgmt.h @@ -1,5 +1,9 @@ #pragma once #include "string" +#include +#include "pb_types.h" + +vector GetContacts(); int AcceptNewFriend(std::string v3, std::string v4, int scene); diff --git a/spy/get_contacts.h b/spy/get_contacts.h deleted file mode 100644 index a0ff70d..0000000 --- a/spy/get_contacts.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include - -#include "pb_types.h" - -vector GetContacts(); diff --git a/spy/rpc_server.cpp b/spy/rpc_server.cpp index 6bb21fa..266f046 100644 --- a/spy/rpc_server.cpp +++ b/spy/rpc_server.cpp @@ -16,11 +16,10 @@ #include "wcf.pb.h" -#include "accept_new_friend.h" #include "chatroom_mgmt.h" #include "decrypt_image.h" #include "exec_sql.h" -#include "get_contacts.h" +#include "contact_mgmt.h" #include "log.h" #include "pb_types.h" #include "pb_util.h"