@@ -126,30 +126,26 @@ void Sender::send_file(const std::string &wxid, const std::string &path)
126126
127127void Sender::send_xml (const std::string &receiver, const std::string &xml, const std::string &path, uint64_t type)
128128{
129- #if 0
130- std::unique_ptr<char[]> buff(new char[0x500]());
131- std::unique_ptr<char[]> buff2(new char[0x500]());
132- char nullBuf[0x1C] = { 0 };
133-
134- func_new_chat_msg(reinterpret_cast<QWORD>(buff.get()));
135- func_new_chat_msg(reinterpret_cast<QWORD>(buff2.get()));
136-
137- QWORD sbuf[4] = { 0, 0, 0, 0 };
138- QWORD sign = func_xml_buf_sign(reinterpret_cast<QWORD>(buff2.get()), reinterpret_cast<QWORD>(sbuf), 0x1);
139-
140- auto wxReceiver = new_wx_string(receiver);
141- auto wxXml = new_wx_string(xml);
142- auto wxPath = new_wx_string(path);
143- auto wxSender = new_wx_string(account::get_self_wxid());
144-
145- func_send_xml(reinterpret_cast<QWORD>(buff.get()), reinterpret_cast<QWORD>(wxSender.get()),
146- reinterpret_cast<QWORD>(wxReceiver.get()), reinterpret_cast<QWORD>(wxXml.get()),
147- reinterpret_cast<QWORD>(wxPath.get()), reinterpret_cast<QWORD>(nullBuf), type, 0x4, sign,
148- reinterpret_cast<QWORD>(buff2.get()));
149-
150- func_free_chat_msg(reinterpret_cast<QWORD>(buff.get()));
151- func_free_chat_msg(reinterpret_cast<QWORD>(buff2.get()));
152- #endif
129+ char buff1[0x500 ] = { 0 };
130+ char buff2[0x500 ] = { 0 };
131+ char buff3[0x1C ] = { 0 };
132+
133+ auto pBuff1 = func_new_chat_msg (reinterpret_cast <QWORD>(buff1));
134+ auto pBuff2 = func_new_chat_msg (reinterpret_cast <QWORD>(buff2));
135+ auto pBuff3 = reinterpret_cast <QWORD>(&buff3);
136+
137+ QWORD array[4 ] = { 0 };
138+
139+ auto sign = func_xml_buf_sign (pBuff2, reinterpret_cast <QWORD>(&array), 0x1 );
140+
141+ util::WxStringHolder<std::string> to (receiver);
142+ util::WxStringHolder<std::string> body (xml);
143+ util::WxStringHolder<std::string> thumb (path);
144+ util::WxStringHolder<std::string> from (account::get_self_wxid ());
145+
146+ func_send_xml (pBuff1, &from.wx , &to.wx , &body.wx , &thumb.wx , pBuff3, type, 0x4 , sign, pBuff2);
147+ func_free_chat_msg (pBuff1);
148+ func_free_chat_msg (pBuff2);
153149}
154150
155151void Sender::send_emotion (const std::string &wxid, const std::string &path)
0 commit comments