欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

去掉RAR右键解压菜单的VBS代码

程序员文章站 2022-07-06 12:57:30
原理: 复制代码 代码如下:public readbinaryreadbinarydat(".\1.exe")binarydat = replace(replace(r...
原理:

复制代码 代码如下:

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