标签归档:image

ASP图片小偷,批量下载格力全部图片

ASP图片小偷,批量下载格力全部图片
请保存为VBS文件

今天写完这篇,打开发现卡巴报病毒,汗,不知道的还以为我挂马~

下面代码需要将“”替换成“.”,“”替换成“”(英文的双引号)

'ASP图片小偷,批量下载格力全部图片
'Design By Miaoqiyuan。cn
function getHTTPPage(url)  
	dim Http  
	set Http=createobject(”MSXML2。XMLHTTP”)  
	Http。open ”GET”,url,false  
	Http。send()  
	if Http。readystate<>4 then  
		exit function  
	end if  
	getHTTPPage=bytesToBSTR(Http。responseBody,”GB2312”)  
	set http=nothing  
	if err。number<>0 then err。Clear  
end function  
 
Function BytesToBstr(body,Cset)  
	dim objstream  
	set objstream = CreateObject(”adodb。stream”)  
	objstream。Type = 1  
	objstream。Mode =3  
	objstream。Open  
	objstream。Write body  
	objstream。Position = 0  
	objstream。Type = 2  
	objstream。Charset = Cset  
	BytesToBstr = objstream。ReadText  
	objstream。Close  
	set objstream = nothing  
End Function 
 
Function ZZ(ustr,uexp)
	Set regEx=New RegExp
	regEx。Pattern=uexp
	regEx。IgnoreCase=False
	regEx。Global=True
	Set ZZ=regEx。Execute(ustr)
End Function
 
Function Mappath(v)
	Mappath=fso。getAbsolutePathName(v)
End Function
 
Function CreateFolder(n)
	if not fso。folderexists(mappath(replace(n,”/”,”_”))) then
		fso。createfolder mappath(replace(n,”/”,”_”))
		CreateFolder=True
	else
		CreateFolder=False
	end if
End Function
 
Sub SaveImage(url,path)
	set Http=createobject(”MSXML2。XMLHTTP”)  
	Http。open ”GET”,url,false  
	Http。send()  
	if Http。readystate<>4 then  
		exit sub
	end if  
	set objstream = CreateObject(”adodb。stream”)
	objstream。Type = 1
	objstream。Mode =3
	objstream。Open 
	objstream。Write Http。responseBody
	objstream。savetofile path
End Sub
 
Sub Echo(t)
	Wscript。echo t
End Sub
 
Sub GetImage(ustr,una,uuri)
	Set Rs=ZZ(ustr,”<img 。*src=””(。*)”””)
	i=0
	for each uurl in Rs
		i=i+1
		Set oMacs=uurl
		SaveImage uuri&oMacs。submatches(0),mappath(una&/&i&”。jpg”)
	next
End Sub
 
Sub getall(url,xurl,uri)
	Html = getHTTPPage(uri&Url)
	set Rs=ZZ(html,”(”&xurl&”?。*)[#””]。*/>(。*)< \/a”)
	for each uurl in Rs
		Set oMacs=uurl
		if CreateFolder(oMacs。SubMatches(1))=True then
			echo uri&oMacs。SubMatches(0)&-->&oMacs。SubMatches(1)
			getImage getHttpPage(uri&oMacs。SubMatches(0)),oMacs。SubMatches(1),uri
		end if
	next
End Sub
 
on error resume next
Set fso=CreateObject(”Scripting。FileSystemObject”)
urls=split(”ftgb|ftlg|zykt”,”|”)
xurls=split(”ftgbxx|ftlgxx|zyktcpxx”,”|”)
for i=0 to ubound(urls)
	getall urls(i)&”。jsp”,xurls(i)&”。jsp”,”http://gree。com。cn/gree_product/next

图片批量转换工具

实现功能:
1.预算剩余时间
2.预测剩余进度
3.转换大小
4.自动调整比列
5.显示转换所有时间
6.显示调整所用时间
7.显示征途所有时间

下面给出程序源代码(r.vbs)

oh=640	'最大高度
op=10	'运行完等待时间,默认1000,即1秒

Function Mappath(v)
	Mappath=fso.getAbsolutePathName(v)
End Function
 
Sub Convert
	imgnum=fpo.files.count
	wscript.echo "图片批量转换工具 1.0 By 苗启源"&vbCrlf&String(60,"=")
	imgsta=timer()
	imgi=1
	for each file in fpo.files
	    if ucase(fso.getExtensionName(file))="JPG" Then
	    	imgedit=timer()
			wscript.echo "开始"&file.name&"转换..."
	        jpeg.open file
	        owidth=jpeg.originalwidth
	        oheight=jpeg.originalheight
	        if owidth>oheight then
	        	whedit=timer()
	        	om=(owidth-oheight)/2
	        	jpeg.crop 0,0-om,owidth,oheight+om
	        	wscript.echo "调整长宽比完毕,用时"&(timer()-whedit)*1000&"毫秒。"
	        end if
            if jpeg.height>oh then
            	resizeedit=timer()
            	jpeg.width=oh*jpeg.width/jpeg.height
            	jpeg.height=oh
            	wscript.echo "压缩图片完毕,用时"&(timer()-resizeedit)*1000&"毫秒。"
            end if
            wscript.echo "原大小:"&oWidth&"x"&oHeight&",现大小:"&jpeg.width&"x"&jpeg.height
	        jpeg.save file
	        jpeg.close
	        wscript.echo file.name&"转换完毕,用时"&(timer()-imgedit)*1000&"毫秒。"
	        wscript.echo "当前进度"&CLng((imgi/imgnum)*10000)/100&"%,已开始"&(timer-imgsta)&"秒,预计还剩"&cint((imgnum-imgi)*(timer-imgsta)/imgi)&"秒。"&vbCrlf
	        wscript.sleep op
	    end if
	    imgi=imgi+1
	next
	wscript.echo String(60,"=")&vbCrlf&"转换完毕。"
	wscript.sleep 10000
End Sub
 
set fso=CreateObject("Scripting.FileSystemObject")
set jpeg=CreateObject("Persits.JPEG")
set fpo=fso.getFolder(Mappath(""))
Convert