feat: 头像
This commit is contained in:
1 parent
1b8c3a851c
commit
63ac97c864
6 files changed
+88
-6
No files matched your search
@@ -79,6 +79,7 @@ typedef enum HTTP_API_ROUTE {
|
||||
WECHAT_FORWARD_PUBLIC_MSG_BY_SVRID,
|
||||
WECHAT_SEND_APP_MSG,
|
||||
WECHAT_REFUSE,
|
||||
WECHAT_GET_HEAD_IMG,
|
||||
} WECHAT_HTTP_APIS,
|
||||
*PWECHAT_HTTP_APIS;
|
||||
|
||||
|
||||
@@ -255,4 +255,30 @@ int ContactMgr::AddFriendByWxid(wchar_t *wxid,wchar_t* msg) {
|
||||
success = 1;
|
||||
return success;
|
||||
}
|
||||
|
||||
int ContactMgr::GetHeadImage(wchar_t* wxid,wchar_t* url){
|
||||
int success = -1;
|
||||
WeChatString contact(wxid);
|
||||
WeChatString img_url(url);
|
||||
DWORD head_image_mgr_addr = base_addr_ + WX_HEAD_IMAGE_MGR_OFFSET;
|
||||
DWORD get_img_download_addr = base_addr_ + QUERY_THEN_DOWNLOAD_OFFSET;
|
||||
char temp[0x8] ={0};
|
||||
__asm{
|
||||
PUSHAD
|
||||
PUSHFD
|
||||
CALL head_image_mgr_addr
|
||||
LEA ECX,img_url
|
||||
PUSH ECX
|
||||
LEA ECX,contact
|
||||
PUSH ECX
|
||||
LEA ECX,temp
|
||||
PUSH ECX
|
||||
MOV ECX,EAX
|
||||
CALL get_img_download_addr
|
||||
POPFD
|
||||
POPAD
|
||||
}
|
||||
success = 1;
|
||||
return success;
|
||||
}
|
||||
} // namespace wxhelper
|
||||
@@ -16,6 +16,7 @@ class ContactMgr : public BaseMgr {
|
||||
int AddFriendByWxid(wchar_t* wxid,wchar_t* msg);
|
||||
int VerifyApply(wchar_t *v3, wchar_t *v4,int permission);
|
||||
int GetContactByWxid(wchar_t* wxid,ContactProfile& profile);
|
||||
int GetHeadImage(wchar_t* wxid,wchar_t* url);
|
||||
};
|
||||
} // namespace wxhelper
|
||||
|
||||
|
||||
+12
-4
@@ -429,9 +429,9 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
||||
wstring wxid = GetWStringParam(j_param, "wxid");
|
||||
wstring transcationid = GetWStringParam(j_param, "transcationId");
|
||||
wstring transferid = GetWStringParam(j_param, "transferId");
|
||||
BOOL response =g_context.misc_mgr->DoConfirmReceipt(
|
||||
int success =g_context.misc_mgr->DoConfirmReceipt(
|
||||
WS2LPWS(wxid), WS2LPWS(transcationid), WS2LPWS(transferid));
|
||||
json ret_data = {{"msg", response}, {"result", "OK"}};
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
@@ -654,9 +654,17 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
||||
wstring wxid = GetWStringParam(j_param, "wxid");
|
||||
wstring transcationid = GetWStringParam(j_param, "transcationId");
|
||||
wstring transferid = GetWStringParam(j_param, "transferId");
|
||||
BOOL response =g_context.misc_mgr->DoRefuseReceipt(
|
||||
int success =g_context.misc_mgr->DoRefuseReceipt(
|
||||
WS2LPWS(wxid), WS2LPWS(transcationid), WS2LPWS(transferid));
|
||||
json ret_data = {{"msg", response}, {"result", "OK"}};
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
case WECHAT_GET_HEAD_IMG:{
|
||||
wstring wxid = GetWStringParam(j_param, "wxid");
|
||||
wstring url = GetWStringParam(j_param, "imageUrl");
|
||||
int success =g_context.contact_mgr->GetHeadImage(WS2LPWS(wxid), WS2LPWS(url));
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@
|
||||
// sendMessageMgr
|
||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x768be0
|
||||
// shareRecordMgr
|
||||
#define WX_SHARE_RECORD_MGR_OFFSET 0x78d5f0
|
||||
#define WX_SHARE_RECORD_MGR_OFFSET 0x78d5f0
|
||||
// headImageMgr
|
||||
#define WX_HEAD_IMAGE_MGR_OFFSET 0x808850
|
||||
|
||||
|
||||
// setChatMsgValue
|
||||
@@ -203,6 +205,8 @@
|
||||
#define FREE_WA_UPDATABLE_MSG_INFO_OFFSET 0x79d4c0
|
||||
#define SEND_APP_MSG_OFFSET 0xfe8e40
|
||||
|
||||
// query head image then download
|
||||
#define QUERY_THEN_DOWNLOAD_OFFSET 0xc642f0
|
||||
|
||||
|
||||
/*******************hook*********************************************/
|
||||
|
||||
Reference in new issue
Block a user