展会信息港展会大全

去掉RAR右键解压菜单的VBS代码
来源:互联网   发布日期:2016-01-26 10:07:17   浏览:1173次  

导读:前两天写了个批处理的,效率不高,百度、谷歌后找到一个更好的办法原理: http: demon tw programming vbs-binary-file-another html复制代码 代码如下:Public ReadBinaryReadBinaryDat( 1 exe)BinaryDat ...

前两天写了个批处理的,效率不高,百度、谷歌后找到一个更好的办法

原理: http://demon.tw/programming/vbs-binary-file-another.html

复制代码 代码如下:

Public ReadBinary

ReadBinaryDat(".1.exe")

BinaryDat = Replace(Replace(ReadBinary, "526172211a07", "522172211a07"), "807a0161", "807a0121")

WriteBinaryDat "new.exe", BinaryDat

Function ReadBinaryDat(FileName)

Const adTypeBinary = 1

Dim stream, xmldom, node

Set xmldom = CreateObject("Microsoft.XMLDOM")

Set node = xmldom.CreateElement("binary")

node.DataType = "bin.hex"

Set stream = CreateObject("ADODB.Stream")

stream.Type = adTypeBinary

stream.Open

stream.LoadFromFile FileName

node.NodeTypedValue = stream.Read

stream.Close

Set stream = Nothing

ReadBinary = node.Text

Set node = Nothing

Set xmldom = Nothing

End Function Sub WriteBinaryDat(FileName, Buf)

Const adTypeBinary = 1

Const adSaveCreateOverWrite = 2

Dim stream, xmldom, node

Set xmldom = CreateObject("Microsoft.XMLDOM")

Set node = xmldom.CreateElement("binary")

node.DataType = "bin.hex"

node.Text = Buf

Set stream = CreateObject("ADODB.Stream")

stream.Type = adTypeBinary

stream.Open

stream.write node.NodeTypedValue

stream.saveToFile FileName, adSaveCreateOverWrite

stream.Close

Set stream = Nothing

Set node = Nothing

Set xmldom = Nothing

End Sub

赞助本站

人工智能实验室

相关热词: RAR 右键 解压 VBS

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港