1- #include " framework.h"
1+
2+ #include " framework.h"
23#include < sstream>
34#include < vector>
45
@@ -28,7 +29,7 @@ extern string GetSelfWxid(); // Defined in spy.cpp
2829#define OS_FORWARD_MSG 0x22C60E0
2930#define OS_GET_EMOTION_MGR 0x1BCEF10
3031#define OS_SEND_EMOTION 0x21B52D5
31- #define OS_XML_BUGSIGN 0x24F0D70
32+ #define OS_XML_BUFSIGN 0x24F0D70
3233#define OS_SEND_XML 0x20CF360
3334
3435typedef QWORD (*New_t)(QWORD);
@@ -45,8 +46,8 @@ typedef QWORD (*ForwardMsg_t)(QWORD, QWORD, QWORD, QWORD);
4546typedef QWORD (*GetEmotionMgr_t)();
4647typedef QWORD (*SendEmotion_t)(QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD);
4748
48- typedef QWORD (*__XmlBufSignFunc )(QWORD, QWORD, QWORD);
49- typedef QWORD (*__SendXmlMsgFunc )(QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD);
49+ typedef QWORD (*XmlBufSign_t )(QWORD, QWORD, QWORD);
50+ typedef QWORD (*SendXmlMsg_t )(QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD, QWORD);
5051
5152void SendTextMessage (string wxid, string msg, string atWxids)
5253{
@@ -242,33 +243,31 @@ void SendXmlMessage(string receiver, string xml, string path, QWORD type)
242243 New_t funcNew = (New_t)(g_WeChatWinDllAddr + OS_NEW);
243244 Free_t funcFree = (Free_t)(g_WeChatWinDllAddr + OS_FREE);
244245
245- DWORD xmlBufSign = g_WeChatWinDllAddr + OS_XML_BUGSIGN;
246- DWORD sendXmlMsg = g_WeChatWinDllAddr + OS_SEND_XML;
247- __XmlBufSignFunc xmlBufSignFunc = (__XmlBufSignFunc)xmlBufSign;
248- __SendXmlMsgFunc sendXmlMsgFunc = (__SendXmlMsgFunc)sendXmlMsg;
246+ XmlBufSign_t xmlBufSign = (XmlBufSign_t)(g_WeChatWinDllAddr + OS_XML_BUFSIGN);
247+ SendXmlMsg_t sendXmlMsg = (SendXmlMsg_t)(g_WeChatWinDllAddr + OS_SEND_XML);
249248
250249 char buff[0x500 ] = { 0 };
251250 char buff2[0x500 ] = { 0 };
252251 char nullBuf[0x1C ] = { 0 };
253252
254- DWORD pBuf = (DWORD )(&buff);
255- DWORD pBuf2 = (DWORD )(&buff2);
253+ QWORD pBuf = (QWORD )(&buff);
254+ QWORD pBuf2 = (QWORD )(&buff2);
256255
257256 funcNew (pBuf);
258257 funcNew (pBuf2);
259258
260- DWORD sbuf[4 ] = { 0 , 0 , 0 , 0 };
259+ QWORD sbuf[4 ] = { 0 , 0 , 0 , 0 };
261260
262- DWORD sign = xmlBufSignFunc (pBuf2, (DWORD )(&sbuf), 0x1 );
261+ QWORD sign = xmlBufSign (pBuf2, (QWORD )(&sbuf), 0x1 );
263262
264263 WxString *pReceiver = NewWxStringFromStr (receiver);
265264 WxString *pXml = NewWxStringFromStr (xml);
266265 WxString *pPath = NewWxStringFromStr (path);
267266 WxString *pSender = NewWxStringFromStr (GetSelfWxid ());
268267
269- sendXmlMsgFunc (pBuf, (QWORD)pSender, (QWORD)pReceiver, (QWORD)pXml, (QWORD)pPath, (QWORD)(&nullBuf), type, 0x4 ,
270- sign, pBuf2);
268+ sendXmlMsg (pBuf, (QWORD)pSender, (QWORD)pReceiver, (QWORD)pXml, (QWORD)pPath, (QWORD)(&nullBuf), type, 0x4 , sign ,
269+ pBuf2);
271270
272- funcFree ((QWORD)&buff)) ;
273- funcFree ((QWORD)&buff2)) ;
271+ funcFree ((QWORD)&buff);
272+ funcFree ((QWORD)&buff2);
274273}
0 commit comments