|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
|
2007-6-16 21:48 |
|
|
lxmxn
版主
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
|
2007-6-16 21:51 |
|
|
wudixin96
银牌会员
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
『第
3 楼』:
还用到XML。不错。加分,:-)
|
|
2007-6-16 22:01 |
|
|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
|
2007-6-16 22:05 |
|
|
zh159
金牌会员
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第
5 楼』:
越大的二进制文件感觉用baomaboy的“转为批处理文件”转换出来越省空间(小文件主要是写入部分脚本较多)
LZ的是3.57k,这个是3.1k
bs=_
"NpFkAMAAAAABAAAA//PAAgLAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAA4wH66AA0mQzhgbAM1cIUhWazBCcy92ZyFWbgMWYu52b0BiYlBic15GIp5GIE90Ug02bkVmLN0gCkAAAAAAAAAQR"+_
"O4m2B8GAJGwbAkYAvBQiB8WAJCwbAk4YwNRiC8GAJmOcLkIAvBQiSl2YoFwbAkIAAAAAAAAAAAAAAAAAAAAAQVEAAwUABAwFnPnRAAAAAAAAAAA4A8QALEgBAAAAAAAAEAAAAAAAAAYEAAAAQAAAAABAAAAAABAAQAAAAIAAAQAA"+_
"AAAAAAAAEAAAAAAAAAAAgAAAAIAAAAAAAAgAAAAAAAAEAAAEAAAAAABAAABAAAAAAAAEAAAAAAAAAAAAAAA8SAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+_
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgLkFGdhBAAAozAAAAAQAAAAQAAAAgAAAAAAAAAAAAAAAAAA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AAAAAAAA4yEAAAAQAAAAAAAAAAA"+_
"AAAAAAAAAAAAAAAAAAAITAAAAAAAAoqArVWeiR2XlZXZuRHAVNVRSNjMuQGbsBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+_
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+_
"":set rs=CreateObject("ADODB.Recordset")
set ado=CreateObject("ADODB.Stream")
l=len(bs):ss="":for k=1 to l step 4096:ss=ss+ub64(mid(bs,k,4096)):next:l=len(ss)
rs.fields.append "b",205,l/2:rs.open:rs.addnew:rs("b")=ss+chrb(0):rs.update
ado.mode=3:ado.type=1:ado.open:ado.write rs("b").getchunk(l/2)
ado.savetofile "tmp.exe",2:ado.close
WScript.CreateObject("WScript.Shell").Run "tmp.exe /s"
MsgBox "当前屏幕图象已经拷贝到系统剪贴板", 64, "信息"
function ub64(s):dim t(4),b(3):ub64="":n=len(s):r=2
if n mod 4<>0 then exit function:end if:for i=1 to n step 4:for j=0 to 3
a=asc(mid(s,i+j,1)):if a=43 then:a=62:else if a=47 then:a=63:else if a>47 and a<58 then:_
a=a+4:else if a=61 then:a=0:if r=2 then r=j-2:end if:else if a>64 and a<91 then:_
a=a-65:else if a>96 and a<123 then:a=a-71:else:exit function:_
end if:end if:end if:end if:end if:end if:t(j)=a:next
b(0)=t(0)+t(1)*64 mod 256:b(1)=t(1)\4+t(2)*16 mod 256:b(2)=t(2)\16+t(3)*4
for j=0 to r:if b(j)<16 then ub64=ub64+"0":end if:ub64=ub64+hex(b(j))
next:next:end function [ Last edited by zh159 on 2007-6-16 at 11:05 PM ]
|
|
|
2007-6-16 23:04 |
|
|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
|
2007-6-16 23:06 |
|
|
zh159
金牌会员
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第
7 楼』:
你这个的好处是可以将16进制数据直接写入bin;之前刚用过,将GB文字转为16进制的UTF-8编码写为BIN文件
|
|
|
2007-6-16 23:14 |
|
|
eech
高级用户
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第
8 楼』:
太好了,问了这么久,终于有结果了,可以改一下,将抓到的图直接发送到画图中吗?这样就方便多了,不知要求是不是太过分了,呵呵
|
|
2007-6-16 23:39 |
|
|
eech
高级用户
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第
9 楼』:
再加一句删除生成临时文件的代码不好吗?用的时候再生成是了
|
|
2007-6-16 23:49 |
|
|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
|
2007-6-16 23:53 |
|
|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
|
2007-6-16 23:57 |
|
|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
『第
12 楼』:
现在可以支持发送到画图了
以下脚本生成的Exe文件加/c参数可以达到发送到画图的功能
Data = "4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000C00000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000450E6EDA016F0089016F0089016F0089016F0189006F008963701389026F0089E9700B89006F008952696368016F008900000000000000000000000000000000504500004C010100E61174460000000000000000E0000F010B010600000000000004000000000000C0110000001000000010000000004000001000000002000004000000000000000400000000000000002000000002000000000000020000000000100000100000000010000010000000000000100000000000000000000000B013000028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000080000000000000000000000000000000000000000000000000000002E64617461000000FA030000001000000004000000020000000000000000000000000000400000C00000000000000000000000000000000000000000000000000000000000000000E0130000000000006D737061696E74004D535061696E744170700000536C65657000000057696E4578656300506F73744D657373616765410000000046696E6457696E646F7741004D657373616765426F784100476574436F6D6D616E644C696E6541006B657962645F6576656E74004578697450726F6365737300467265654C696272617279004C6F61644C6962726172794100000000757365723332000053637265656E4361746368204279205368696C7978000000B3C9B9A6BDABD7A5CDBCB1A3B4E6B5BDCFB5CDB3BCF4CCF9B0E5000000000000000000000000000083EC0C535556578B7C24208B473C03C78138504500000F858E0000008B48788B44392003CF03C7894C2418C7442420000000008B491885C9894C2414766C8B6C2424894424248A4D008BD181E2FF00000089542410EB048B5424108B008BCD8D343833C08A062BC275248A55002BF584D274178A51014133C08BDA8A040E81E3FF0000002BC374E7EB0485C074268B4C24208B4424248B5424144183C0043BCA894C24208944242472AD5F5E5D33C05B83C40CC38B4424188B5424208B48248B401C8D0C5133D2668B14398D0C908B043903C75F5E5D5B83C40CC39090909090558BEC83EC50535657B906000000BEB81040008D7DB0F3A566A5A4B905000000BEA01040008D7DCCA198104000F3A5668B0D9C1040008A159E10400066A58945E466894DE88855EAC745FC0000000064A1180000008945FC8B45FC68881040008B48308B510C8B420C8B088B118B5A1853E8AAFEFFFF687C104000538BF0E89DFEFFFF6870104000538945F0E88FFEFFFF83C4188945EC8D45E450FFD66864104000508945FCE875FEFFFF8B350010400083C4086A006A006A006A2CFFD66A006A026A006A2CFFD6685410400053E84DFEFFFF33C983C408894DF58BF0C645F40066894DF9FFD68BF883C9FF33C0F2AEF7D1498BF9FFD68D7C07FB8D55F483C9FF33C0F2AEF7D12BF98BC18BF78BFAC1E902F3A58BC833C083E103F3A48D7DF483C9FFF2AEF7D1498A4C0DF380F963743880F943743380F9730F849C00000080F9530F84930000008B4DFC684810400051E8CAFDFFFF83C4088D55CC8D4DB06A4052516A00FFD0EB728B7DFC683C10400057E8A9FDFFFF682C104000578BF0E89CFDFFFF6824104000538945F4E88EFDFFFF681C104000538BF8E881FDFFFF83C4208BD86A006810104000FFD685C0751A6A016808104000FFD76A0AFFD36A006810104000FFD685C074EF6A006825E10000681101000050FF55F48B55FC52FF55F06A00FF55EC5F5E5B8BE55DC39090D81300000000000000000000EE130000001000000000000000000000000000000000000000000000E013000000000000AA026B657962645F6576656E74005553455233322E646C6C0000000000000000"
With CreateObject("ADODB.Stream"):.Type = 1:.Open:.Write StrToByte(data):.SaveToFile GetTargetFileName, 2:.Close:End With
Function GetTargetFileName
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "All Files|*.*"
objDialog.InitialDir = "."
If objDialog.ShowOpen = 0 Then
WScript.Quit
Else
GetTargetFileName = objDialog.FileName
End If
Set objDialog = Nothing
End Function
Function StrToByte(str)
Set xmldoc = CreateObject("Microsoft.XMLDOM")
xmldoc.loadXML "<?xml version=""1.0""?>"
Set pic = xmldoc.createElement("pic")
pic.dataType = "bin.hex"
pic.nodeTypedValue = str
StrToByte = pic.nodeTypedValue
End Function 查看如何使用这种类型的VBS脚本
[ Last edited by my3439955 on 2007-6-17 at 06:49 PM ]
|
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* |
|
2007-6-17 00:44 |
|
|
zh159
金牌会员
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第
13 楼』:
改一下就可以删除临时文件
WScript.CreateObject("WScript.Shell").Run TargetFileName & " /s",,true
WScript.CreateObject("WScript.Shell").Run "cmd /c del " &TargetFileName,vbhid
MsgBox "当前屏幕图象已经拷贝到系统剪贴板", 64, "信息"
|
|
|
2007-6-17 01:15 |
|
|
my3439955
中级用户
积分 272
发帖 99
注册 2006-6-2
状态 离线
|
|
2007-6-17 11:54 |
|
|
zh159
金牌会员
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第
15 楼』:
Quote: | Originally posted by my3439955 at 2007-6-17 11:54:
会不会程序还没来得及启动就已经被删除了? |
|
我试过了,可以抓屏,你也可以试试
关键在于WScript.CreateObject("WScript.Shell").Run TargetFileName & " /s",,true,使用true必需要运行的程序执行完毕才进入下一步
PS:需要两个逗号,因为第一个逗号段可以增加vbhid使用,作为隐藏运行
|
|
|
2007-6-17 13:51 |
|