commit
5503831ca0
@ -61,14 +61,13 @@ class Wcf():
|
||||
self.sender = msg.sender
|
||||
self.roomid = msg.roomid
|
||||
self.content = msg.content
|
||||
self.extra_data = msg.extra_data
|
||||
self.extra = msg.extra
|
||||
|
||||
def __str__(self) -> str:
|
||||
s = f"{'自己发的:' if self._is_self else ''}"
|
||||
s += f"{self.sender}[{self.roomid}]:{self.id}:{self.type}:{self.xml.replace(chr(10), '').replace(chr(9),'')}\n"
|
||||
s += self.content
|
||||
s += "\n"
|
||||
s += self.extra_data
|
||||
s += f"\n{self.extra}" if self.extra else ""
|
||||
return s
|
||||
|
||||
def from_self(self) -> bool:
|
||||
|
@ -43,5 +43,5 @@ typedef struct {
|
||||
string sender;
|
||||
string roomid;
|
||||
string content;
|
||||
string extra_data;
|
||||
string extra;
|
||||
} WxMsg_t;
|
||||
|
@ -3,23 +3,6 @@ syntax = "proto3";
|
||||
package wcf;
|
||||
option java_package = "com.iamteer";
|
||||
|
||||
/*
|
||||
service Wcf {
|
||||
rpc RpcIsLogin(Empty) returns (Response) {}
|
||||
rpc RpcGetSelfWxid(Empty) returns (String) {}
|
||||
rpc RpcEnableRecvMsg(Empty) returns (stream WxMsg) {}
|
||||
rpc RpcDisableRecvMsg(Empty) returns (Response) {}
|
||||
rpc RpcSendTextMsg(TextMsg) returns (Response) {}
|
||||
rpc RpcSendPathMsg(PathMsg) returns (Response) {}
|
||||
rpc RpcGetMsgTypes(Empty) returns (MsgTypes) {}
|
||||
rpc RpcGetContacts(Empty) returns (Contacts) {}
|
||||
rpc RpcGetDbNames(Empty) returns (DbNames) {}
|
||||
rpc RpcGetDbTables(String) returns (DbTables) {}
|
||||
rpc RpcExecDbQuery(DbQuery) returns (DbRows) {}
|
||||
rpc RpcAcceptNewFriend(Verification) returns (Response) {}
|
||||
}
|
||||
*/
|
||||
|
||||
enum Functions {
|
||||
FUNC_RESERVED = 0x00;
|
||||
FUNC_IS_LOGIN = 0x01;
|
||||
@ -84,7 +67,7 @@ message WxMsg
|
||||
string sender = 6; // 消息发送者
|
||||
string roomid = 7; // 群 id(如果是群消息的话)
|
||||
string content = 8; // 消息内容
|
||||
string extra_data = 9; // 附加内容
|
||||
string extra = 9; // 附加内容
|
||||
}
|
||||
|
||||
message TextMsg
|
||||
|
@ -6,10 +6,10 @@
|
||||
#define SUPPORT_VERSION L"3.7.0.30"
|
||||
WxCalls_t wxCalls = {
|
||||
0x2366538, // Login Status
|
||||
{ 0x236607C, 0x23660F4, 0x2366128 }, // User Info: wxid, nickname, mobile
|
||||
{ 0x236607C, 0x23660F4, 0x2366128, 0x2386F7C }, // User Info: wxid, nickname, mobile, home
|
||||
0x521D30, // Send Message
|
||||
/* Receive Message:
|
||||
Hook, call, type, self, id, msgXml, roomId, wxId, content, extra_data */
|
||||
Hook, call, type, self, id, msgXml, roomId, wxId, content, extra */
|
||||
{ 0x550F4C, 0xA96350, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70, 0x1AC },
|
||||
{ 0xBD780, 0x771980, 0x521640 }, // Send Image Message
|
||||
{ 0xC3B70, 0x771980, 0x3ED8C0 }, // Send File Message
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "load_calls.h"
|
||||
#include "receive_msg.h"
|
||||
#include "user_info.h"
|
||||
#include "util.h"
|
||||
|
||||
// Defined in rpc_server.cpp
|
||||
@ -89,6 +90,10 @@ void DispatchMsg(DWORD reg)
|
||||
wxMsg.sender = GetStringByAddress(*p + g_WxCalls.recvMsg.roomId);
|
||||
}
|
||||
wxMsg.content = GetStringByAddress(*p + g_WxCalls.recvMsg.content);
|
||||
wxMsg.extra = GetStringByAddress(*p + g_WxCalls.recvMsg.extra);
|
||||
if (!wxMsg.extra.empty()) {
|
||||
wxMsg.extra = GetHomePath() + "\\" + wxMsg.extra;
|
||||
}
|
||||
|
||||
{
|
||||
unique_lock<mutex> lock(gMutex);
|
||||
|
@ -330,6 +330,7 @@ static void PushMessage()
|
||||
rsp.msg.wxmsg.sender = (char *)wxmsg.sender.c_str();
|
||||
rsp.msg.wxmsg.roomid = (char *)wxmsg.roomid.c_str();
|
||||
rsp.msg.wxmsg.content = (char *)wxmsg.content.c_str();
|
||||
rsp.msg.wxmsg.extra = (char *)wxmsg.extra.c_str();
|
||||
gMsgQueue.pop();
|
||||
LOG_DEBUG("Recv msg: {}", wxmsg.content);
|
||||
pb_ostream_t stream = pb_ostream_from_buffer(buffer, G_BUF_SIZE);
|
||||
|
@ -6,6 +6,7 @@ typedef struct UserInfoCall {
|
||||
DWORD wxid;
|
||||
DWORD nickName;
|
||||
DWORD mobile;
|
||||
DWORD home;
|
||||
} UserInfoCall_t;
|
||||
|
||||
typedef struct RecvMsg {
|
||||
@ -18,7 +19,7 @@ typedef struct RecvMsg {
|
||||
DWORD roomId; // 群聊时,为群ID;私聊时,为微信ID
|
||||
DWORD wxId; // 私聊时,为空;群聊时,为发送者微信ID
|
||||
DWORD content; // 消息内容地址
|
||||
DWORD extra_data; // 附加数据
|
||||
DWORD extra; // 附加数据
|
||||
} RecvMsg_t;
|
||||
|
||||
typedef struct Sendfile {
|
||||
|
@ -6,7 +6,9 @@
|
||||
extern WxCalls_t g_WxCalls;
|
||||
extern DWORD g_WeChatWinDllAddr;
|
||||
|
||||
std::string GetSelfWxid()
|
||||
string GetHomePath() { return GET_STRING(g_WeChatWinDllAddr + g_WxCalls.ui.home); }
|
||||
|
||||
string GetSelfWxid()
|
||||
{
|
||||
DWORD wxidType = 0;
|
||||
try {
|
||||
|
@ -2,4 +2,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string GetSelfWxid();
|
||||
using namespace std;
|
||||
|
||||
string GetHomePath();
|
||||
string GetSelfWxid();
|
||||
|
Loading…
Reference in New Issue
Block a user