Слияние кода завершено, страница обновится автоматически
#include "stdafx.h"
#include "Mytask.h"
#include <iostream>
#include "fun.h"
#include "TT.h"
#include "WxUser.h"
#include "pbjson.hpp"
std::string MakeRePortPack(std::string FromUser, std::string ToUser)
{
string msg;
msg.append("recordCount=5");
msg.append("&");
msg.append("usermsg=此人是盗号贼,我朋友的号被他盗了");
msg.append("&");
msg.append("chatdata={\"username\":\""+ToUser+"\",\"content\":[\"\"],\"newMsgId\":\"0\",\"msgType\":0,\"contentLength\":0}");
msg.append("&");
msg.append("[{\"sender\":\""+ToUser+"\",\"content\":\"借我500块!!!急用\",\"newMsgId\":\"6895123569235575358\",\"msgType\":1,\"msgTime\":1539374904},{\"sender\":\""+FromUser+"\",\"content\":\"你怎么了\",\"newMsgId\":\"1781019350824676580\",\"msgType\":1,\"msgTime\":1539374906},{\"sender\":\""+ToUser+"\",\"content\":\"我老婆要生了\",\"newMsgId\":\"5362892280736038714\",\"msgType\":1,\"msgTime\":1539374909},{\"sender\":\""+FromUser+"\",\"content\":\"你是盗号贼吧\",\"newMsgId\":\"8859733255593996279\",\"msgType\":1,\"msgTime\":1539462991},{\"sender\":\""+FromUser+"\",\"content\":\"我盗你妈逼\",\"newMsgId\":\"7572048646662806505\",\"msgType\":1,\"msgTime\":1539463000}]");
msg.append("&");
msg.append("answer=4|108");
return msg;
}
int curl_post_Report(const string &url, const string &postParams, string &response, string proxy)
{
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // url
if (proxy.size())
{
string pStr = "https://";
pStr += proxy;
curl_easy_setopt(curl, CURLOPT_PROXY, pStr.c_str());
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
}
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postParams.c_str()); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postParams.size()); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 3);
//header
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Language:zh-cn");
headers = curl_slist_append(headers, "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
headers = curl_slist_append(headers, "Connection:close");
headers = curl_slist_append(headers, "Referer:close");
headers = curl_slist_append(headers, "Accept-Encoding:br, gzip, deflate");
headers = curl_slist_append(headers, "Accept:application / json");
headers = curl_slist_append(headers, "Content-Type:application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.556.400 QQBrowser/9.0.2524.400");
headers = curl_slist_append(headers, "Host:weixin110.qq.com");
headers = curl_slist_append(headers, "Origin:https://weixin110.qq.com");
headers = curl_slist_append(headers, "X-Requested-With:XMLHttpRequest");
string refererUrl = url;
replace_all(refererUrl, "exposeh5cgi", "readtemplate");
string thehost = "Referer:" + refererUrl;
headers = curl_slist_append(headers, thehost.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
//curl_slist_free_all(headers);
// start req
//res = curl_easy_perform(curl);
res = curl_easy_perform(curl);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
int curl_post_group(const string &url, const string &postParams, string &response, string proxy)
{
// init curl
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // url
if (proxy.size())
{
string pStr = "https://";
pStr += proxy;
curl_easy_setopt(curl, CURLOPT_PROXY, pStr.c_str());
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
}
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postParams.c_str()); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postParams.size()); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 3);
//header
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept-Language:zh-CN,zh;q=0.8,en-us;q=0.6,en;q=0.5;q=0.4");
headers = curl_slist_append(headers, "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
headers = curl_slist_append(headers, "Connection:close");
headers = curl_slist_append(headers, "Referer:close");
headers = curl_slist_append(headers, "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 MicroMessenger/6.5.2.501 NetType/WIFI WindowsWechat QBCore/3.43.556.400 QQBrowser/9.0.2524.400");
string thehost = "Referer:" + url;
headers = curl_slist_append(headers, thehost.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
//curl_slist_free_all(headers);
// start req
//res = curl_easy_perform(curl);
res = curl_easy_perform(curl);
printf("\n当前返回状态码:%d\n", res);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
int check_proxy(const string &proxy_ip, string &response)
{
// init curl
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, "http://short.weixin.qq.com"); // url
curl_easy_setopt(curl, CURLOPT_PROXY, proxy_ip.c_str());
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, ""); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
//curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3);
curl_easy_setopt(curl, CURLOPT_TIMEOUT,3);
//header
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type:application/octet-stream");
headers = curl_slist_append(headers, "Accept:*/*");
headers = curl_slist_append(headers, "Connection:close");
headers = curl_slist_append(headers, "User-Agent:MicroMessenger Client");
string thehost = "Host:short.weixin.qq.com";
headers = curl_slist_append(headers, thehost.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
//curl_slist_free_all(headers);
// start req
//res = curl_easy_perform(curl);
res = curl_easy_perform(curl);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
int curl_post_req(const string &host, const string &url,const string &proxy_ip, const string &postParams, string &response)
{
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // url
//if (proxy.size())
curl_easy_setopt(curl, CURLOPT_PROXY, proxy_ip.c_str());
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postParams.c_str()); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postParams.size()); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
//header
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type:application/octet-stream");
headers = curl_slist_append(headers, "Accept:*/*");
headers = curl_slist_append(headers, "Connection:close");
headers = curl_slist_append(headers, "User-Agent:MicroMessenger Client");
string thehost = "Host:" + host;
headers = curl_slist_append(headers, thehost.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
//curl_slist_free_all(headers);
// start req
//res = curl_easy_perform(curl);
res = curl_easy_perform(curl);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
int curl_post_req2(const string &host, const string &url, const string &proxy_ip, const string &postParams, string &response, int nRetry)
{
int nRet = -1;
for (int i = 0; i < nRetry; i++)
{
nRet = curl_post_req(host, url, proxy_ip, postParams, response);
if (nRet == CURLE_OK) break;
}
return nRet;
}
int curl_post_json(const string &host, const string &url, const string &postParams, string &response)
{
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // url
//if (proxy.size())
//{
// string pStr = "http://";
// pStr += proxy;
// curl_easy_setopt(curl, CURLOPT_PROXY,pStr.c_str());
// curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
// curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
//}
//curl_easy_setopt(curl, CURLOPT_PROXY, "103.228.32.225:25646");
//curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
//curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postParams.c_str()); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postParams.size()); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
//header
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type:text/json");
headers = curl_slist_append(headers, "Accept:*/*");
headers = curl_slist_append(headers, "User-Agent:MicroMessenger Client");
string thehost = "Host:" + host;
headers = curl_slist_append(headers, thehost.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
//curl_slist_free_all(headers);
// start req
//res = curl_easy_perform(curl);
res = curl_easy_perform(curl);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
int curl_post_req(const string &host, const string &url, const string &postParams, string &response)
{
// init curl
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // url
//if (proxy.size())
//{
// string pStr = "http://";
// pStr += proxy;
// curl_easy_setopt(curl, CURLOPT_PROXY,pStr.c_str());
// curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
// curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
//}
//curl_easy_setopt(curl, CURLOPT_PROXY, "103.228.32.225:25646");
//curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
//curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postParams.c_str()); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postParams.size()); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
//header
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type:application/octet-stream");
headers = curl_slist_append(headers, "Accept:*/*");
headers = curl_slist_append(headers, "Connection:close");
headers = curl_slist_append(headers, "User-Agent:MicroMessenger Client");
string thehost = "Host:" + host;
headers = curl_slist_append(headers, thehost.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
//curl_slist_free_all(headers);
// start req
//res = curl_easy_perform(curl);
res = curl_easy_perform(curl);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
int curl_post_req2(const string &host, const string &url, const string &postParams, string &response, int nRetry)
{
int nRet = -1;
for (int i = 0; i < nRetry; i++)
{
nRet = curl_post_req(host, url, postParams, response);
if (nRet == CURLE_OK) break;
}
return nRet;
}
int curl_post_check(const string &url, const string &postParams, string &response)
{
// init curl
CURL *curl = curl_easy_init();
// res code
CURLcode res;
if (curl)
{
// set params
curl_easy_setopt(curl, CURLOPT_POST, 1); // post req
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); // url
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postParams.c_str()); // params
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, postParams.size()); // params
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // if want to use https
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); // set peer and host verify false
//curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, NULL);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, req_reply);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
//header
struct curl_slist *headers = NULL;
//curl_slist_free_all(headers);
// start req
res = curl_easy_perform(curl);
DWORD headsize = 0;
curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headsize);
response = response.substr(headsize);
}
// release curl
curl_easy_cleanup(curl);
return 0;
}
size_t req_reply(void *ptr, size_t size, size_t nmemb, void *stream)
{
//cout << "----->reply" << endl;
string *str = (string*)stream;
//cout << *str << endl;
(*str).append((char*)ptr, size*nmemb);
return size * nmemb;
}
std::string fucklogin(string check_url, string checkcard)
{
//curl_global_init(CURL_GLOBAL_ALL);
if (!check_url.size()) return "";
// test post requery
//string postParams = "f=8&rsv_bp=1&rsv_idx=1&word=picture&tn=98633779_hao_pg";
std::string postResponseStr;
string c = "code=";
int res = curl_post_check("http://" + check_url + "/encoding", checkcard, postResponseStr);
return postResponseStr;
}
std::string fuck(string check_url,string checkcard)
{
if (!check_url.size()) return "";
// test post requery
//string postParams = "f=8&rsv_bp=1&rsv_idx=1&word=picture&tn=98633779_hao_pg";
std::string postResponseStr;
string c = "code=";
int res = curl_post_check("http://" + check_url + "/checkcode", checkcard.c_str(), postResponseStr);
return postResponseStr;
}
int fuckver(string check_url, string checkcard)
{
if (!check_url.size()) return 0;
// test post requery
//string postParams = "f=8&rsv_bp=1&rsv_idx=1&word=picture&tn=98633779_hao_pg";
std::string postResponseStr;
auto res = curl_post_check("http://" + check_url + "/checkver", checkcard, postResponseStr);
rapidjson::Document d;
d.Parse(postResponseStr.c_str());
return d["ver"].GetInt();
}
std::string mm_post(void*handle,std::string host, std::string url_post, std::string postParams)
{
if (handle != nullptr)
{
WxUser*Auth = (WxUser*)handle;
if (Auth->UserProxy)
{
return proxy_post(host, url_post, Auth->Proxy_Url, postParams);
}
}
std::string postResponseStr;
int res = curl_post_req2(host.c_str(), "http://" + url_post, postParams, postResponseStr,2);
return postResponseStr;
}
std::string proxy_post(std::string host, std::string url_post, std::string proxy_ip, std::string postParams)
{
//string postParams = "f=8&rsv_bp=1&rsv_idx=1&word=picture&tn=98633779_hao_pg";
std::string postResponseStr;
int res = curl_post_req2(host.c_str(), "http://" + url_post, proxy_ip, postParams, postResponseStr,2);
return postResponseStr;
}
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )