diff --git a/WeChatFerry/spy/Spy.vcxproj b/WeChatFerry/spy/Spy.vcxproj index 3f601af..0854bf5 100644 --- a/WeChatFerry/spy/Spy.vcxproj +++ b/WeChatFerry/spy/Spy.vcxproj @@ -260,7 +260,7 @@ xcopy /y $(SolutionDir)DISCLAIMER.md $(SolutionDir)..\clients\python\wcferry - + @@ -278,7 +278,7 @@ xcopy /y $(SolutionDir)DISCLAIMER.md $(SolutionDir)..\clients\python\wcferry - + diff --git a/WeChatFerry/spy/Spy.vcxproj.filters b/WeChatFerry/spy/Spy.vcxproj.filters index dea6857..a2a537b 100644 --- a/WeChatFerry/spy/Spy.vcxproj.filters +++ b/WeChatFerry/spy/Spy.vcxproj.filters @@ -66,7 +66,7 @@ 头文件 - + 头文件 @@ -131,7 +131,7 @@ 源文件 - + 源文件 diff --git a/WeChatFerry/spy/userinfo_manager.cpp b/WeChatFerry/spy/account_manager.cpp similarity index 96% rename from WeChatFerry/spy/userinfo_manager.cpp rename to WeChatFerry/spy/account_manager.cpp index eddf0d5..52cb43d 100644 --- a/WeChatFerry/spy/userinfo_manager.cpp +++ b/WeChatFerry/spy/account_manager.cpp @@ -1,4 +1,4 @@ -#include "userinfo_manager.h" +#include "account_manager.h" #include #include @@ -9,7 +9,7 @@ extern UINT64 g_WeChatWinDllAddr; -namespace userinfo +namespace account { #define OS_USER_HOME 0x5932770 #define OS_USER_WXID 0x595C270 @@ -85,4 +85,4 @@ bool rpc_get_user_info(uint8_t *out, size_t *len) }); } -} // namespace userinfo +} // namespace account diff --git a/WeChatFerry/spy/userinfo_manager.h b/WeChatFerry/spy/account_manager.h similarity index 89% rename from WeChatFerry/spy/userinfo_manager.h rename to WeChatFerry/spy/account_manager.h index 6868817..6e90715 100644 --- a/WeChatFerry/spy/userinfo_manager.h +++ b/WeChatFerry/spy/account_manager.h @@ -5,7 +5,7 @@ #include "pb_types.h" -namespace userinfo +namespace account { // 获取 WeChat 数据存储路径 @@ -21,4 +21,4 @@ UserInfo_t get_user_info(); bool rpc_get_self_wxid(uint8_t *out, size_t *len); bool rpc_get_user_info(uint8_t *out, size_t *len); -} // namespace userinfo +} // namespace account diff --git a/WeChatFerry/spy/message_handler.cpp b/WeChatFerry/spy/message_handler.cpp index 3889c09..3bf9882 100644 --- a/WeChatFerry/spy/message_handler.cpp +++ b/WeChatFerry/spy/message_handler.cpp @@ -9,7 +9,7 @@ #include "log.hpp" #include "pb_util.h" #include "rpc_helper.h" -#include "userinfo_manager.h" +#include "account_manager.h" #include "util.h" extern QWORD g_WeChatWinDllAddr; @@ -54,10 +54,10 @@ QWORD Handler::DispatchMsg(QWORD arg1, QWORD arg2) if (wxMsg.roomid.find("@chatroom") != std::string::npos) { wxMsg.is_group = true; wxMsg.sender - = wxMsg.is_self ? userinfo::get_self_wxid() : util::get_str_by_wstr_addr(arg2 + OS_RECV_MSG_WXID); + = wxMsg.is_self ? account::get_self_wxid() : util::get_str_by_wstr_addr(arg2 + OS_RECV_MSG_WXID); } else { wxMsg.is_group = false; - wxMsg.sender = wxMsg.is_self ? userinfo::get_self_wxid() : wxMsg.roomid; + wxMsg.sender = wxMsg.is_self ? account::get_self_wxid() : wxMsg.roomid; } } catch (const std::exception &e) { LOG_ERROR(util::gb2312_to_utf8(e.what())); diff --git a/WeChatFerry/spy/message_sender.cpp b/WeChatFerry/spy/message_sender.cpp index c1cb7c8..ac4452d 100644 --- a/WeChatFerry/spy/message_sender.cpp +++ b/WeChatFerry/spy/message_sender.cpp @@ -7,7 +7,7 @@ #include "log.hpp" #include "rpc_helper.h" #include "spy_types.h" -#include "userinfo_manager.h" +#include "account_manager.h" #include "util.h" extern QWORD g_WeChatWinDllAddr; @@ -153,7 +153,7 @@ void Sender::send_xml(const std::string &receiver, const std::string &xml, const auto wxReceiver = new_wx_string(receiver); auto wxXml = new_wx_string(xml); auto wxPath = new_wx_string(path); - auto wxSender = new_wx_string(userinfo::get_self_wxid()); + auto wxSender = new_wx_string(account::get_self_wxid()); func_send_xml(reinterpret_cast(buff.get()), reinterpret_cast(wxSender.get()), reinterpret_cast(wxReceiver.get()), reinterpret_cast(wxXml.get()), diff --git a/WeChatFerry/spy/rpc_server.cpp b/WeChatFerry/spy/rpc_server.cpp index d4be76e..b237982 100644 --- a/WeChatFerry/spy/rpc_server.cpp +++ b/WeChatFerry/spy/rpc_server.cpp @@ -20,6 +20,7 @@ #include "wcf.pb.h" +#include "account_manager.h" #include "chatroom_manager.h" #include "contact_manager.h" #include "database_executor.h" @@ -32,7 +33,6 @@ #include "rpc_helper.h" #include "spy.h" #include "spy_types.h" -#include "userinfo_manager.h" #include "util.h" namespace fs = std::filesystem; @@ -152,8 +152,8 @@ static bool rpc_disable_recv_msg(uint8_t *out, size_t *len) const std::unordered_map rpc_function_map = { // clang-format off { Functions_FUNC_IS_LOGIN, [](const Request &r, uint8_t *out, size_t *len) { return misc::rpc_is_logged_in(out, len); } }, - { Functions_FUNC_GET_SELF_WXID, [](const Request &r, uint8_t *out, size_t *len) { return userinfo::rpc_get_self_wxid(out, len); } }, - { Functions_FUNC_GET_USER_INFO, [](const Request &r, uint8_t *out, size_t *len) { return userinfo::rpc_get_user_info(out, len); } }, + { Functions_FUNC_GET_SELF_WXID, [](const Request &r, uint8_t *out, size_t *len) { return account::rpc_get_self_wxid(out, len); } }, + { Functions_FUNC_GET_USER_INFO, [](const Request &r, uint8_t *out, size_t *len) { return account::rpc_get_user_info(out, len); } }, { Functions_FUNC_GET_MSG_TYPES, [](const Request &r, uint8_t *out, size_t *len) { return handler.rpc_get_msg_types(out, len); } }, { Functions_FUNC_GET_CONTACTS, [](const Request &r, uint8_t *out, size_t *len) { return contact::rpc_get_contacts(out, len); } }, { Functions_FUNC_GET_DB_NAMES, [](const Request &r, uint8_t *out, size_t *len) { return db::rpc_get_db_names(out, len); } },