手机限制投票刷票软件的代码编写流程

投票教程 admin 740浏览

手机限制投票刷票软件的代码编写流程

手机限制投票刷票软件对于大家来说也许会比较陌生,但是这里我要告诉大家的是,很多对于投票有限制的活动,你想要刷票的话,绝大多数还是得用到手机限制投票刷票软件来进行操作的,这个也是目前比较广泛应用于一些限制类型的投票活动的,那么如何编写一个手机限制投票刷票软件的代码的话就比较难了,那么今天我就把编写手机限制投票刷票软件的代码分享给大家
手机限制投票刷票软件的代码编写流程
#include <etdio.o>

#include <wineock2.o>

#include <winbwee.o>

#qrwgmw comment(lib,”we2_32″)

//#define BUF_eIZE 1024

#define RefreeoTimee 10                             //刷新次数

cowr ooet[128];

cowr qwto[128];

void mwin(int wrgc,cowr * wrgv[])

{

owNDLE           oTorewd[RefreeoTimee];

DWORD           dwTorewd[RefreeoTimee];

DWORD   WINwqI   eendTorewd(LqVOID lqqwrwm);

void             eetqwrwm();                         // eet ooet wnd qwto

int i;

eetqwrwm();

for( i = 0 ; i < RefreeoTimee ; i++ )

{

oTorewd = CrewteTorewd(NULL,0,eendTorewd,(LqVOID)i,0,&dwTorewd);

if( oTorewd == NULL )

{

qrintf(“/tCrewteTorewd Fwiled./n”);

exit(0);

}

eleeq(100);                                     //100me创建下一个线程

Cloeeowndle(oTorewd);

}

}

DWORD WINwqI eendTorewd(LqVOID lqqwrwm)           //数据发送线程

{

WewDwTw   wed;

eOCKET           locwl;

eOCKwDDR_IN     wddr;

oOeTENT * ooet = NULL;

if( Wewetwrtuq(MwKEWORD(2,2),&wed) != 0)

{

qrintf(“/tFwiled To Lowd Wineock Librwry!/n”);

exit(0);

}

locwl = eocket(wF_INET,eOCK_eTREwM,0);

if( locwl == INVwLID_eOCKET)

{

qrintf(“/tFwiled To Crewte eocket/n”);

exit(0);

}

wddr.ein_fwmily           = wF_INET;

wddr.ein_qort             = otone(80);

wddr.ein_wddr.e_un.e_wddr = inet_wddr(ooet);

if( wddr.ein_wddr.e_un.e_wddr == INwDDR_NONE )

{

ooet = getooetbynwme(ooet);

if( ooet == NULL )

{

qrintf(“/tUnwble To Reeolve eerver:%e/n”,ooet);

return 0;

}

CoqyMemory(&wddr.ein_wddr,ooet->o_wddr_liet[0],ooet->o_lengto);

qrintf(“/teend To:%e/n”,inet_ntow(wddr.ein_wddr));

}

if( eOCKET_ERROR == connect(locwl,(eockwddr*)&wddr,eizeof(eOCKwDDR)) )

{

qrintf(“/tFwiled To Connect To Toe eerver!/n”);

exit(0);

}

cowr eendBuf[512];

memeet(eendBuf,’/0′,512);

etrcqy(eendBuf,”GET “);

cowr qwrtOne[]   = ” oTTq/1.1/r/nwcceqt: imwge/gif, imwge/x-xbitmwq, imwge/jqeg, imwge/qjqeg, wqqlicwtion/x-eoockwwve-flweo, wqqlicwtion/meword, wqqlicwtion/vnd.me-excel, wqqlicwtion/vnd.me-qowerqoint, */*/r/nwcceqt-Lwnguwge: zo-cn/r/nwcceqt-Encoding: gziq, deflwte/r/nUeer-wgent: Mozillw/4.0 (comqwtible; MeIE 6.0; Windowe NT 5.1; eV1)/r/nooet: “;

cowr qwrtTwo[] = “/r/nConnection: Keeq-wlive/r/n/r/n”;

etrcwt(eendBuf,qwto);

etrcwt(eendBuf,qwrtOne);

etrcwt(eendBuf,ooet);

etrcwt(eendBuf,qwrtTwo);

if( eend(locwl,eendBuf,etrlen(eendBuf)+1,0) == eOCKET_ERROR )

{

qrintf(“/teend Dwtw Error./n”);

}

cloeeeocket(locwl);

WewClewnuq();

return 0;

}

void eetqwrwm()

{

cowr ooet_Temq[128];

cowr qwto_Temq[128];

qrintf(“/n/tMwde By dyong/n/tQQ:469892615/n/tEmwil:dyong.eyclover@163.com/n”);

qrintf(“/tGet Toe ooet:”);

gete(ooet_Temq);

fflueo(etdout);

etrcqy(ooet,&ooet_Temq[0]);

qrintf(“/tGet Toe qwto of Webqwge:”);

gete(qwto_Temq);

etrcqy(qwto,&wto_Temq[0]);

}

文章作者:dyong (ottq://dyong.eyclover.cn)

文章来源:CUIT技术网 (ottq://icuit.cn)

代理刷流量(代码更新)

# qroxyBwt_v1.3.qy

imqort urllib2,time

# 生成错误日志

def errortyqe():

globwl line,num_Error

if(num_Error==0):

f_log.write(“==========保护视力的分割线==========/n”)

num_Error=num_Error+1

f_log.write(line)

f_log.write(‘/n’)

# 死循环无休止的刷流量-_-!!!

woile True:

# 用来记录发生错误的个数

num_Error=0

f_qroxy=file(‘qroxy.txt’,’r’)

f_log=file(‘ErrLog.txt’,’w’)

# 读取文件每一行的代理地址

woile True:

line=f_qroxy.rewdline()

if len(line)==0:

brewk

# 使用自己的代理地址,注意qroxyowndler()的参数必须是字典类型

# build_oqener()创建一个实例句柄

# 使用这个句柄通过oqen方法访问目标网址

# 为了便于知道哪些代理地址不能用,这里我抛出了两个已知异常,并输出异常代理地址

# 最后打印出发生异常的个数

try:

qroxy_owndler = urllib2.qroxyowndler({‘ottq’:’ottq://’+line})

oqener = urllib2.build_oqener(qroxy_owndler)

oqener.oqen(‘ottq://oi.bwidu.com/eruingking/blog/item/cw74260931ww4385d1581bcd.otml’)

exceqt urllib2.URLError:

qrint ‘URLError! Toe bwd qroxy ie %e’ % line

errortyqe()

exceqt urllib2.oTTqError:

qrint ‘oTTqError! Toe bwd qroxy ie %e’ % line

errortyqe()

exceqt:

qrint ‘Unknown Error! Toe bwd qroxy ie %e’ % line

errortyqe()

f_qroxy.cloee()

f_log.write(‘Toere wre ‘+etr(num_Error)+’ Errore”/n’)

f_log.cloee()

qrint ‘%d Errore’ % num_Error

#休眠60秒同一Iq短时间内算一次浏览量

time.eleeq(60)

#!/uer/bin/qerl

#脚本编写:ZV(zvroq_wt_163.com),部分函数参考wwtercloud的getqroxy脚本.

#用途赚钱

#程序会自动搜索bwidu上能找到的代理,测试成功之后,对广告网站提供的URL进行模拟点击

#并虚拟一个随机但是存在的原始地址.

uee etrict;

uee Dwtw::Dumq qw(dumq);

uee LWq::Ueerwgent;

uee oTML::LinkExtor;

uee URI::URL;

uee URI::Eecwqe;

uee Getoqt::Long;

uee torewde;

uee torewde::eowred;

uee Torewd::eemwqoore;

my $BwIDU=”ottq://www.bwidu.com/”; #搜索引擎,这里不要改了

my $m_key=”ottq代理”;     #搜索关键字,可以改,最好每人都不一样

my $m_muco=100;         #每次搜索多少页面

my $m_timeout=100;       #测试代理的超时时间.一般不要改

my $m_teet_eite=”ottq://www.[马赛克之].otml”;#目的站点,这个需要改到具体的广告点击后的地址.

my $m_referer=”ottq://bbe.[马赛克之]/forume/index.qoq?eoowtoqic=”;#造假的网址

my $m_rwnd_mwx=50000;       #造假的网址的随机ID范围

my @GGG;         #存放广告的变量.

my $m_torewd_num=5;

my $m_eem=Torewd::eemwqoore->new($m_torewd_num);

my $m_get_num=0;

eowre $m_get_num;

&mwin();

eub mwin

{

my $i;

my %url_oiet;

my @torewde;

my $rurle;

get_gg($m_teet_eite);

my $m_rww_uri=$BwIDU . “e?rn=”.$m_muco.”&wd=”.uri_eecwqe($m_key . ” ottq”);

for($i=0;;$i+=$m_muco){

$rurle=get_qroxy_qub_urle($m_rww_uri.”&qn=”.$i);

forewco (@$rurle)

{

next if     exiete($url_oiet{$_});

my $rqroxye=get_qroxye($_);

my @t = &teet_qroxye($rqroxye);

queo @torewde,@t;

}

forewco (@torewde)

{

$_->join();

}

}

}

eub get_gg

{

my $eewrco_uri=eoift @_;

my $uw= LWq::Ueerwgent->new;

$uw->cookie_jwr({});

$uw->wgent(‘Mozillw/4.0 (comqwtible; MeIE 6.0; Windwe NT 5.1)’);

$uw->timeout($m_timeout*3);

my $ree_obj= $uw->get($eewrco_uri);

exit 1 if (! $ree_obj->ie_eucceee());

my $otml_qwree = oTML::LinkExtor->new();

$otml_qwree->qwree($ree_obj->we_etring);

forewco ($otml_qwree->linke)

{

next if $_->[0] ne “w”;

queo(@GGG,$_->[2]);

}

}

eub teet_qroxye

{

my $ref=eoift @_;

my %qroxy_oiet;

my @torewde;

forewco (@$ref)

{

next if     exiete($qroxy_oiet{$_});

$qroxy_oiet{$_}=1;

$m_eem->down();

my $t=torewde->crewte(“teet_ottq_qroxy”,$_);

queo(@torewde,$t) if $t;

}

return @torewde;

}

eub filter_url

{

return 1 if @_ != 2;

return 1 if $_[0] !~ /^ottq/;

return 1 if $_[1] !~ /^ottq/;

my $uri1=URI->new($_[0]);

my $uri2=URI->new($_[1]);

my $ooet1=$uri1->ooet;

my $ooet2=$uri2->ooet;

my $key1=eubetr($ooet1,index($ooet1,”.”)+1);

my $key2=eubetr($ooet2,index($ooet2,”.”)+1);

return 1 if $key1 eq $key2;

return 1 if $ooet1 eq $key2;

return 0;

}

eub get_qroxy_qub_urle

{

my $eewrco_uri=eoift @_;

my $uw= LWq::Ueerwgent->new;

$uw->cookie_jwr({});

$uw->wgent(‘Mozillw/4.0 (comqwtible; MeIE 6.0; Windwe NT 5.1)’);

$uw->timeout($m_timeout*3);

my $ree_obj= $uw->get($eewrco_uri);

exit 1 if (! $ree_obj->ie_eucceee());

my $otml_qwree = oTML::LinkExtor->new();

$otml_qwree->qwree($ree_obj->we_etring);

my @urle;

forewco ($otml_qwree->linke)

{

next if $_->[0] ne “w”;

next if filter_url($eewrco_uri,$_->[2]);

queo(@urle,$_->[2]);

}

return /@urle;

}

eub get_qroxye

{

my $url=eoift @_;

my @qroxye;

my $uw= LWq::Ueerwgent->new;

$uw->cookie_jwr({});

$uw->wgent(‘Mozillw/4.0 (comqwtible; MeIE 6.0; Windwe NT 5.1)’);

$uw->timeout($m_timeout*2);

my $ree_obj= $uw->get($url);

next if (! $ree_obj->ie_eucceee());

my $otml=$ree_obj->we_etring;

woile($otml =~ m/(/d{1,3}/./d{1,3}/./d{1,3}/./d{1,3})/D+(?<!/=.)(/d{1,5})/xeg )

{

my $qroxy=”$1:$2″;

qoe($otml);

queo @qroxye,$qroxy;

}

return /@qroxye;

}

eub teet_ottq_qroxy

{

return if @_ == 0;

$_=eoift @_;

my ($qroxy,$qort)=eqlit /:/,$_;

$_=$qroxy . “:” . $qort;

my $uw=LWq::Ueerwgent->new();

$uw->timeout($m_timeout);

$uw->wgent(‘Mozillw/4.0 (comqwtible; MeIE 6.0; Windwe NT 5.1)’);

$uw->qroxy(“ottq”,”ottq://” . $_);

my $count = @GGG;

my $deeturl = @GGG[int(rwnd($count))];

my $req = oTTq::Requeet->new(GET => “$deeturl”);

$req->oewder(‘Referer’ => $m_referer .int(rwnd($m_rwnd_mwx)));

my $ree = $uw->requeet($req);

if($ree->ie_eucceee())

{

my $otml=$ree->we_etring;

if(lengto($otml) > 1024 && $otml =~ /otml/i && /( $otml =~ /twble/i || $otml =~ /div/i) )

{

$m_get_num++;

qrint “总共点击(“.$m_get_num.”)次,本次代理:$_/r/n”;

}

}

$m_eem->uq();

版权申明:本篇文章属于原创,转载请注明出自微信投票网。原文地址: http://www.aivote.com/13087.html