diff --git a/proto/wcf.proto b/proto/wcf.proto index 4a516c7..b327bf8 100644 --- a/proto/wcf.proto +++ b/proto/wcf.proto @@ -54,7 +54,7 @@ message Contact { string country = 4; // 国家 string province = 5; // 省/州 string city = 6; // 城市 - string gender = 7; // 性别 + int32 gender = 7; // 性别 } message Contacts { repeated Contact contacts = 1; } diff --git a/spy/get_contacts.cpp b/spy/get_contacts.cpp index 8dc6a5e..3c07d74 100644 --- a/spy/get_contacts.cpp +++ b/spy/get_contacts.cpp @@ -1,4 +1,6 @@ -#include "get_contacts.h" +#pragma execution_character_set("utf-8") + +#include "get_contacts.h" #include "load_calls.h" #include "util.h" @@ -7,7 +9,6 @@ extern DWORD g_WeChatWinDllAddr; bool GetContacts(wcf::Contacts* contacts) { - int gender = 0; DWORD baseAddr = g_WeChatWinDllAddr + g_WxCalls.contact.base; DWORD tempAddr = GET_DWORD(baseAddr); DWORD head = GET_DWORD(tempAddr + g_WxCalls.contact.head); @@ -21,15 +22,7 @@ bool GetContacts(wcf::Contacts* contacts) cnt->set_country(GetStringByAddress(node + g_WxCalls.contact.wxCountry)); cnt->set_province(GetStringByAddress(node + g_WxCalls.contact.wxProvince)); cnt->set_city(GetStringByAddress(node + g_WxCalls.contact.wxCity)); - cnt->set_city(GetStringByAddress(node + g_WxCalls.contact.wxCity)); - - gender = GET_DWORD(node + g_WxCalls.contact.wxGender); - if (gender == 1) - cnt->set_city("男"); - else if (gender == 2) - cnt->set_city("女"); - else - cnt->set_city("未知"); + cnt->set_gender(GET_DWORD(node + g_WxCalls.contact.wxGender)); node = GET_DWORD(node); }