[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
本帖最后由 czjt1234 于 2023-2-21 10:15 编辑

vbs
  1. file1 = "01.txt"
  2. file2 = "basetik.tik"
  3. Set oFSO = CreateObject("Scripting.FileSystemObject")
  4. Set oTextStream = oFSO.OpenTextFile(file1)
  5. s = oTextStream.ReadAll()
  6. oTextStream.Close()
  7. Set oRegExp = CreateObject("VBScript.RegExp")
  8. oRegExp.IgnoreCase = True
  9. oRegExp.Pattern = "Using title id\: (.+)?\r\n"
  10. For Each i In oRegExp.Execute(s)
  11.     t = i.SubMatches.Item(0)
  12. Next
  13. With CreateObject("Msxml2.DOMDocument").CreateElement("hex")
  14.     .DataType = "bin.hex"
  15.     .Text = t
  16.     arrByte = .NodeTypedValue
  17. End With
  18. With CreateObject("ADODB.Stream")
  19.     .Type = 1    'adTypeBinary
  20.     .Mode = 3    'adModeReadWrite
  21.     .Open()
  22.     .LoadFromFile file2
  23.     .Position = &H01DC
  24.     .Write arrByte
  25.     .SaveToFile file2, 2
  26.     .Close()
  27. End With
  28. oRegExp.Pattern = "generated encrypted\: (.+)?\r\n"
  29. For Each i In oRegExp.Execute(s & vbCrLf)
  30.     t = i.SubMatches.Item(0)
  31. Next
  32. With CreateObject("Msxml2.DOMDocument").CreateElement("hex")
  33.     .DataType = "bin.hex"
  34.     .Text = t
  35.     arrByte = .NodeTypedValue
  36. End With
  37. With CreateObject("ADODB.Stream")
  38.     .Type = 1    'adTypeBinary
  39.     .Mode = 3    'adModeReadWrite
  40.     .Open()
  41.     .LoadFromFile file2
  42.     .Position = &H01BF
  43.     .Write arrByte
  44.     .SaveToFile file2, 2
  45.     .Close()
  46. End With
  47. MsgBox "ok"
复制代码
1

评分人数


QQ 20147578

TOP

回复 9# a574045075


   测试的结果能发一下吗
如果不成功的,也希望看到错在哪里的

QQ 20147578

TOP

返回列表