目前某大佬已经更新到最新版本微信hook了。
/发送文件
BOOL SendCdnFilePbMsg(string sendId, string cdnkey, string aes_key,string file_name,string md5, int size, string syncKey)
{
FileMessage sfm;
sfm.set_file_id(cdnkey);
sfm.set_size(size);
sfm.set_aes_key(aes_key);
sfm.set_md5(md5);
string msgpb;
sfm.SerializeToString(&msgpb);
SendMsgFun(sendId, StringToHex(msgpb),0xf, syncKey,"");
return TRUE;
}
//发送视频
BOOL SendCdnVideoPbMsg(string sendId, string cdnkey, string aes_key, string md5, int size, string syncKey)
{
VideoMessage sfm;
sfm.set_video_id(cdnkey);
sfm.set_size(size);
sfm.set_video_duration(5);
sfm.set_video_height(0);
sfm.set_video_width(0);
sfm.set_aes_key(aes_key);
string msgpb;
sfm.SerializeToString(&msgpb);
SendMsgFun(sendId, StringToHex(msgpb), 23, syncKey,"");
return TRUE;
}
//发送文本消息
BOOL SendTextPbMsg(string sendId, string msg, string syncKey)
{
TextMsgData tmd;
tmd.set_val(msg);
SendTextMsgList stm;
TextContentData *tcd = stm.add_textcontentdata();
tcd->set_msgtype(0);
tcd->set_msgdatabuf(tmd.SerializeAsString());
string msgpb;
stm.SerializeToString(&msgpb);
SendMsgFun(sendId, StringToHex(msgpb), 2, syncKey,"");
//forwardMsg(sendId, StringToHex(msgpb),2);
return TRUE;
}
//发送表情消息
BOOL SendTextEmjoPbMsg(string sendId,string syncKey, nlohmann::json content)
{
SendTextMsgList stm;
for (int i = 0; i < content.size();i++) {
if (content[i]["msgtype"].is_number()==false) {
return FALSE;
}
int msgType = content[i]["msgtype"];
string msg = content[i]["msg"];
TextMsgData tmd;
tmd.set_val(msg);
TextContentData *tcd = stm.add_textcontentdata();
tcd->set_msgtype(msgType);
tcd->set_msgdatabuf(tmd.SerializeAsString());
}
string msgpb;
stm.SerializeToString(&msgpb);
SendMsgFun(sendId, StringToHex(msgpb), 2, syncKey,"");
//forwardMsg(sendId, StringToHex(msgpb),2);
return TRUE;
}