forked from ljc545w/ComWeChatRobot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForwardMessage.cpp
More file actions
51 lines (47 loc) · 1.15 KB
/
Copy pathForwardMessage.cpp
File metadata and controls
51 lines (47 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "pch.h"
#define ForwardMessageCall1Offset 0x771980
#define ForwardMessageCall2Offset 0x521760
#ifndef USE_SOCKET
struct ForwardMessageStruct
{
wchar_t *wxid;
unsigned long long localId;
};
BOOL ForwardMessageRemote(LPVOID lpParameter)
{
ForwardMessageStruct *fms = (ForwardMessageStruct *)lpParameter;
return ForwardMessage(fms->wxid, fms->localId);
}
#endif
BOOL __stdcall ForwardMessage(wchar_t *wxid, unsigned long long msgid)
{
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD ForwardMessageCall1 = WeChatWinBase + ForwardMessageCall1Offset;
DWORD ForwardMessageCall2 = WeChatWinBase + ForwardMessageCall2Offset;
int dbIndex = 0;
int localId = GetLocalIdByMsgId(msgid, dbIndex);
if (localId == 0)
return FALSE;
WxString p_wxid(wxid);
int isSuccess = 0;
__asm {
pushad;
pushfd;
mov eax, dword ptr ds:[dbIndex];
push eax;
mov ecx, dword ptr ds:[localId];
push ecx;
lea edi, p_wxid;
sub esp, 0x14;
mov ecx, esp;
push edi;
call ForwardMessageCall1;
call ForwardMessageCall2;
movzx eax,al;
mov isSuccess,eax;
add esp, 0x1C;
popfd;
popad;
}
return isSuccess == 0x1;
}