Impl Send Image

This commit is contained in:
Changhua 2022-08-06 21:44:26 +08:00
parent d009d8e294
commit 0a789eaa3e
6 changed files with 31 additions and 26 deletions

View File

@ -1,4 +1,4 @@
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#include <iostream> #include <iostream>
#include <process.h> #include <process.h>
@ -60,12 +60,14 @@ int main()
wcout << L"Message: 接收通知中......" << endl; wcout << L"Message: 接收通知中......" << endl;
WxSetTextMsgCb(onTextMsg); WxSetTextMsgCb(onTextMsg);
// 测试消息发送 // 测试消息发送
wcout << L"测试消息发送" << endl;
WxSendTextMsg(wxid, at_wxid, content); WxSendTextMsg(wxid, at_wxid, content);
#if 0
// 发送照片
WxSendImageMsg(wxid, img_path);
// 发送照片
wcout << L"测试发送照片" << endl;
WxSendImageMsg(wxid, img_path);
#if 0
Sleep(10000); // 等待10秒 Sleep(10000); // 等待10秒
// 测试联系人获取 // 测试联系人获取
auto mContact = WxGetContacts(); auto mContact = WxGetContacts();

View File

@ -1,4 +1,4 @@
#include "Shlwapi.h" #include "Shlwapi.h"
#include "framework.h" #include "framework.h"
#include <process.h> #include <process.h>
#include <queue> #include <queue>

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <functional> #include <functional>
#include <map> #include <map>

View File

@ -1,4 +1,4 @@
#include "Shlwapi.h" #include "Shlwapi.h"
#include "framework.h" #include "framework.h"
#include <string.h> #include <string.h>
#include <strsafe.h> #include <strsafe.h>

View File

@ -11,7 +11,7 @@ WxCalls_t wxCalls = {
/* Receive Message: /* Receive Message:
Hook, call, type, self, id, msgXml, roomId, wxId, content */ Hook, call, type, self, id, msgXml, roomId, wxId, content */
{ 0x550F4C, 0xA94A50, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70 }, { 0x550F4C, 0xA94A50, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70 },
{ 0x5CCB50, 0x6F5C0, 0x3E3490 } // Send Image Message { 0xBD780, 0x770120, 0x521640 } // Send Image Message
}; };
int LoadCalls(const wchar_t* version, WxCalls_t* calls) int LoadCalls(const wchar_t* version, WxCalls_t* calls)

View File

@ -52,9 +52,10 @@ void SendImageMessage(const wchar_t *wxid, const wchar_t *path)
{ {
if (g_WeChatWinDllAddr == 0) { if (g_WeChatWinDllAddr == 0) {
return; return;
} }
char buf1[0x20] = { 0 }; DWORD tmpEAX = 0;
char buf2[0x378] = { 0 }; char buf1[0x48] = { 0 };
char buf2[0x3B0] = { 0 };
TextStruct_t imgWxid = { 0 }; TextStruct_t imgWxid = { 0 };
TextStruct_t imgPath = { 0 }; TextStruct_t imgPath = { 0 };
@ -76,19 +77,21 @@ void SendImageMessage(const wchar_t *wxid, const wchar_t *path)
__asm { __asm {
pushad pushad
sub esp, 0x14 call sendCall1
lea eax, buf1 sub esp, 0x14
mov ecx, esp mov tmpEAX, eax
push eax lea eax, buf1
call sendCall1 mov ecx, esp
lea ebx, imgPath lea edi, imgPath
push ebx push eax
lea eax, imgWxid call sendCall2
push eax mov ecx, dword ptr [tmpEAX]
lea eax, buf2 lea eax, imgWxid
push eax push edi
call sendCall2 push eax
mov ecx, eax lea eax, buf2
call sendCall3 push eax
call sendCall3
popad
} }
} }