void _7_SYNCCHECK() { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); bool bRun = true; ThreadPool.QueueUserWorkItem(new WaitCallback(delegate { while (bRun) { try { var response = WEB.SendRequest(@"GET https://webpush{NUMBER}.weixin.qq.com/cgi-bin/mmwebwx-bin/synccheck?r={TIME}&skey={SKEY}&sid={WXSID}&uin={WXUIN}&deviceid={DEVICEID}&synckey={SYNCKEY}&_={TIME} HTTP/1.1 Host: webpush.weixin.qq.com Connection: keep-alive Accept: */* User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: ts_uid=7490200750; o_cookie=7103505; pgv_pvid=4255253068; pt_clientip=4c950af78b5036b4; pt_serverip=feef0abf0662c02f; ptui_loginuin=7103505; ptcz=6a354e61d971ccc416a5d9fa461f67c599f02d19c0bbb5cc8dad6d82c7850721; pt2gguin=o0007103505; uin=o0007103505; skey=@SVm04rrY6; qm_username=7103505; qm_sid=65f2ed6111bef5d92e7dbf710aec3449,qb3BUenJOMmtmUndFenl3MVFmaExsQkJOYmpVLWRqeC1qNG0xeGxGdDZVUV8.; pgv_pvi=9815860224; pgv_si=s1555394560; webwx_data_ticket=AQfiPZdvOnP2C2jMbzfG7DN/ "); bRun = _7_Response(response); } catch { } Thread.Sleep(2000); } })); }
void _10_WEBWXSENDMSG(string fromUserName, string toUserName, string message, int type = 1) { var KEYS = new Dictionary <string, string> { ["FROMUSERNAME"] = toUserName, ["TOUSERNAME"] = fromUserName, ["MSG"] = message, ["TYPE"] = type + "" }; RecordMessage(message, new MessageObject { FromUserName = fromUserName, ToUserName = toUserName, Content = message, MsgType = 1, }); var response = WEB.SendRequest(@"POST https://wx{NUMBER}.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg?lang=zh_CN&pass_ticket={PASS_TICKET} HTTP/1.1 Host: wx.qq.com Connection: keep-alive Content-Length: 411 Accept: application/json, text/plain, */* Origin: https://wx.qq.com User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Content-Type: application/json;charset=UTF-8 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8 Cookie: webwxuvid=bebe27f97a88e8ce573a38b4c48984e8f578650b8ba48b2bacce4ec572e41a3f2b1d021c6656cfeef62091ed7ac2c000; o_cookie=7103505; pgv_pvid=4255253068; pt_clientip=4c950af78b5036b4; pt_serverip=feef0abf0662c02f; ptui_loginuin=7103505; ptcz=6a354e61d971ccc416a5d9fa461f67c599f02d19c0bbb5cc8dad6d82c7850721; pt2gguin=o0007103505; uin=o0007103505; skey=@SVm04rrY6; qm_username=7103505; qm_sid=65f2ed6111bef5d92e7dbf710aec3449,qb3BUenJOMmtmUndFenl3MVFmaExsQkJOYmpVLWRqeC1qNG0xeGxGdDZVUV8.; pgv_pvi=9815860224; pgv_si=s1555394560; MM_WX_NOTIFY_STATE=1; MM_WX_SOUND_STATE=1; mm_lang=zh_CN; wxloadtime=1452518428_expired; wxpluginkey=1452511573; wxuin=840648442; wxsid=BJONNeerx+IW+mmH; webwx_data_ticket=AQfiPZdvOnP2C2jMbzfG7DN/ ", @"{""BaseRequest"":{""Uin"":{WXUIN},""Sid"":""{WXSID}"",""Skey"":""{SKEY}"",""DeviceID"":""{DEVICEID}""},""Msg"":{""Type"":{TYPE},""Content"":""{MSG}"",""FromUserName"":""{FROMUSERNAME}"",""ToUserName"":""{TOUSERNAME}"",""LocalID"":""{TIME}"",""ClientMsgId"":""{TIME}""}}" , KEYS); _10_Response(response); }
/// <summary> /// 获取微信图片 /// </summary> /// <param name="MsgID"></param> /// <param name="slave"></param> void _12_WEBWXGETMSGIMG(string MsgID, bool slave = false) { //&type=slave RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); Dictionary <string, string> KEYS = new Dictionary <string, string>(); KEYS["MSGID"] = MsgID; KEYS["SLAVE"] = slave ? "&type=slave" : ""; var response = WEB.SendRequest(@"GET https://wx{NUMBER}.qq.com/cgi-bin/mmwebwx-bin/webwxgetmsgimg?&MsgID={MSGID}&skey={SKEY}{SLAVE} HTTP/1.1 Host: wx.qq.com Connection: keep-alive Accept: image/webp,image/*,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/ Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; webwxuvid=2be019a311a30a82471c657deb21d97e9d1f45d435bfe8cc3c6d44572bc274f1e6b73083e1be6658fafce8b8da910d9f; pgv_si=s1289632768; MM_WX_NOTIFY_STATE=1; MM_WX_SOUND_STATE=1; mm_lang=zh_CN; wxloadtime=1452566666_expired; wxpluginkey=1452560151; wxuin=840648442; wxsid=dIBYM9GLd2uGFXUR; webwx_data_ticket=AQes8oz/tWrY4mE1SyL1tTnM ", null, KEYS); _12_Response(response); }
/// <summary> /// 获取其他文件 /// </summary> /// <param name="MsgID"></param> void _14_WEBWXGETMEDIA(string MsgID, MessageObject json) { //&type=slave RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); Dictionary <string, string> KEYS = new Dictionary <string, string> { ["MEDIAID"] = json.MediaId, ["FILENAME"] = System.Web.HttpUtility.UrlEncode(json.FileName, WEB.Encoding), ["FROMUSER"] = json.FromUserName }; var response = WEB.SendRequest(@"GET https://file{NUMBER}.wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetmedia?sender={FROMUSER}&mediaid={MEDIAID}&filename={FILENAME}&fromuser={WXUIN}&pass_ticket={PASS_TICKET}&webwx_data_ticket={WEBWX_DATA_TICKET} HTTP/1.1 Host: file.wx.qq.com Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; webwxuvid=2be019a311a30a82471c657deb21d97e9d1f45d435bfe8cc3c6d44572bc274f1e6b73083e1be6658fafce8b8da910d9f; pgv_si=s1289632768; mm_lang=zh_CN; wxloadtime=1452566666_expired; wxpluginkey=1452560151; wxuin=840648442; wxsid=dIBYM9GLd2uGFXUR; webwx_data_ticket=AQes8oz/tWrY4mE1SyL1tTnM ", null, KEYS); _14_Response(response); }
void _1_JSLOGIN() { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); var response = WEB.SendRequest(@"GET https://login.weixin.qq.com/jslogin?appid={APPID}&redirect_uri=https%3A%2F%2Fwx.qq.com%2Fcgi-bin%2Fmmwebwx-bin%2Fwebwxnewloginpage&fun=new&lang=zh_CN&_=1452483004640 HTTP/1.1 Host: login.weixin.qq.com Connection: keep-alive Accept: */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; pgv_si=s9303685120 "); _1_Response(response); }
MemberItem[] _6_WEBWXGETCONTACT() { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); var response = WEB.SendRequest(@"GET https://wx{NUMBER}.qq.com/cgi-bin/mmwebwx-bin/webwxgetcontact?lang=zh_CN&pass_ticket={PASS_TICKET}&r={TIME}&seq=0&skey={SKEY} HTTP/1.1 Host: wx.qq.com Connection: keep-alive Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; webwxuvid=2be019a311a30a82471c657deb21d97e9d1f45d435bfe8cc3c6d44572bc274f1e6b73083e1be6658fafce8b8da910d9f; pgv_si=s1289632768; wxpluginkey=1452474574; MM_WX_NOTIFY_STATE=1; MM_WX_SOUND_STATE=1; wxuin=840648442; wxsid=+tGm0ywQU38jT5PG; wxloadtime=1452502754; mm_lang=zh_CN; webwx_data_ticket=AQd2WpESNN3Z2JoHNxnridSy "); return(_6_Response(response)); }
byte[] _2_QRCODE() { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); var response = WEB.SendRequest(@"GET https://login.weixin.qq.com/qrcode/{UUID} HTTP/1.1 Host: login.weixin.qq.com Connection: keep-alive Accept: image/webp,image/*,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; pgv_si=s9303685120 "); return(_2_Response(response)); }
void _4_REDIRECT_URL() { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); var response = WEB.SendRequest(@"GET {REDIRECT_URL} HTTP/1.1 Host: wx.qq.com Connection: keep-alive Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; webwxuvid=2be019a311a30a82471c657deb21d97e9d1f45d435bfe8cc3c6d44572bc274f1e6b73083e1be6658fafce8b8da910d9f; pgv_si=s9303685120; wxloadtime=1452481173_expired; wxpluginkey=1452474574; wxuin=840648442; mm_lang=zh_CN; MM_WX_NOTIFY_STATE=1; MM_WX_SOUND_STATE=1 "); _4_Response(response); }
void _5_WEBWXINIT() { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); var response = WEB.SendRequest(@"POST https://wx{NUMBER}.qq.com/cgi-bin/mmwebwx-bin/webwxinit?r=-784058664&lang=zh_CN&pass_ticket={PASS_TICKET} HTTP/1.1 Host: wx.qq.com Connection: keep-alive Content-Length: 148 Accept: application/json, text/plain, */* Origin: https://wx.qq.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Content-Type: application/json;charset=UTF-8 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; webwxuvid=2be019a311a30a82471c657deb21d97e9d1f45d435bfe8cc3c6d44572bc274f1e6b73083e1be6658fafce8b8da910d9f; pgv_si=s9303685120; wxpluginkey=1452474574; MM_WX_NOTIFY_STATE=1; MM_WX_SOUND_STATE=1; wxuin=840648442; wxsid=5D8s8i5gHhv7JbGO; wxloadtime=1452483021; mm_lang=zh_CN; webwx_data_ticket=AQfq+7neXON/cnHqx9WtuaT/ ", @"{""BaseRequest"":{""Uin"":""{WXUIN}"",""Sid"":""{WXSID}"",""Skey"":""{SKEY}"",""DeviceID"":""{DEVICEID}""}}"); _5_Response(response); }
bool _3_LOGIN() { for (int i = 0; i < LOGIN_TRY_TIMES; i++) { RecordMessage(System.Reflection.MethodBase.GetCurrentMethod().Name, null); var response = WEB.SendRequest(@"GET https://login.weixin.qq.com/cgi-bin/mmwebwx-bin/login?loginicon=true&uuid={UUID}&tip=0&r=-784071163&_={TIME} HTTP/1.1 Host: login.weixin.qq.com Connection: keep-alive Accept: */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8 Cookie: pgv_pvid=5421692288; ptcz=4e0a323b1662b719e627137efa1221bb5c435b44a27cba4b09293c0e2cb57516; pt2gguin=o0007103505; pgv_pvi=1998095360; pgv_si=s9303685120 "); if (_3_Response(response)) { return(true); } System.Threading.Thread.Sleep(SAOMIAO_SLEEPTIME); } return(false); }
void _8_WEBWXSYNC() { //_ShowMessage(System.Reflection.MethodInfo.GetCurrentMethod().Name); var response = WEB.SendRequest(@"POST https://wx{NUMBER}.qq.com/cgi-bin/mmwebwx-bin/webwxsync?sid={WXSID}&skey={SKEY}&lang=zh_CN&pass_ticket={PASS_TICKET} HTTP/1.1 Host: wx.qq.com Connection: keep-alive Content-Length: 301 Accept: application/json, text/plain, */* Origin: https://wx.qq.com User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Content-Type: application/json;charset=UTF-8 Referer: https://wx.qq.com/?&lang=zh_CN Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8 Cookie: webwxuvid=bebe27f97a88e8ce573a38b4c48984e8f578650b8ba48b2bacce4ec572e41a3f2b1d021c6656cfeef62091ed7ac2c000; o_cookie=7103505; pgv_pvid=4255253068; pt_clientip=4c950af78b5036b4; pt_serverip=feef0abf0662c02f; ptui_loginuin=7103505; ptcz=6a354e61d971ccc416a5d9fa461f67c599f02d19c0bbb5cc8dad6d82c7850721; pt2gguin=o0007103505; uin=o0007103505; skey=@SVm04rrY6; qm_username=7103505; qm_sid=65f2ed6111bef5d92e7dbf710aec3449,qb3BUenJOMmtmUndFenl3MVFmaExsQkJOYmpVLWRqeC1qNG0xeGxGdDZVUV8.; pgv_pvi=9815860224; pgv_si=s1555394560; MM_WX_NOTIFY_STATE=1; MM_WX_SOUND_STATE=1; wxuin=840648442; wxsid=BJONNeerx+IW+mmH; wxloadtime=1452518428; mm_lang=zh_CN; webwx_data_ticket=AQfiPZdvOnP2C2jMbzfG7DN/ ", @"{""BaseRequest"":{""Uin"":{WXUIN},""Sid"":""{WXSID}"",""Skey"":""{SKEY}"",""DeviceID"":""{DEVICEID}""},""SyncKey"":{SYNCKEY_LONG},""rr"":{TIME}}" ); _8_Response(response); }