本帖最后由 czjt1234 于 2023-2-21 10:15 编辑
vbs- file1 = "01.txt"
- file2 = "basetik.tik"
-
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- Set oTextStream = oFSO.OpenTextFile(file1)
- s = oTextStream.ReadAll()
- oTextStream.Close()
-
- Set oRegExp = CreateObject("VBScript.RegExp")
- oRegExp.IgnoreCase = True
- oRegExp.Pattern = "Using title id\: (.+)?\r\n"
- For Each i In oRegExp.Execute(s)
- t = i.SubMatches.Item(0)
- Next
-
- With CreateObject("Msxml2.DOMDocument").CreateElement("hex")
- .DataType = "bin.hex"
- .Text = t
- arrByte = .NodeTypedValue
- End With
-
- With CreateObject("ADODB.Stream")
- .Type = 1 'adTypeBinary
- .Mode = 3 'adModeReadWrite
- .Open()
- .LoadFromFile file2
- .Position = &H01DC
- .Write arrByte
- .SaveToFile file2, 2
- .Close()
- End With
-
- oRegExp.Pattern = "generated encrypted\: (.+)?\r\n"
- For Each i In oRegExp.Execute(s & vbCrLf)
- t = i.SubMatches.Item(0)
- Next
-
- With CreateObject("Msxml2.DOMDocument").CreateElement("hex")
- .DataType = "bin.hex"
- .Text = t
- arrByte = .NodeTypedValue
- End With
-
- With CreateObject("ADODB.Stream")
- .Type = 1 'adTypeBinary
- .Mode = 3 'adModeReadWrite
- .Open()
- .LoadFromFile file2
- .Position = &H01BF
- .Write arrByte
- .SaveToFile file2, 2
- .Close()
- End With
-
- MsgBox "ok"
复制代码
|