Two days ago wrote a batch processing, efficiency is not high, Baidu, Google found a better way
Principle: http://demon.tw/programming/vbs-binary-file-another.html
Copy Code code as follows:
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 = no
end Function Sub writebinarydat (FileName, Buf)
&N Bsp 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 = no
set node = Nothing
set xmldom = Nothing
End Sub