找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
楼主: a574045075

[文件操作] [已解决]批处理如何把文本内容替换到文件里?

[复制链接]
 楼主| 发表于 2023-2-21 15:08:54 | 显示全部楼层
回复 15# cnnetstar


    论坛好像上传不了图片,一上传就失败,我用网络图片.
发表于 2023-2-21 15:33:57 | 显示全部楼层
回复 11# terse


    有可能是楼主使用的那个图床的网络问题
发表于 2023-2-21 15:34:16 | 显示全部楼层
回复 15# cnnetstar


如果需要上传文件,可以用阿里云盘或百度网盘。

如果需要上传截图,可以找个图床,例如:
http://bbs.bathome.net/thread-60985-1-1.html
发表于 2023-2-21 16:14:14 | 显示全部楼层
回复 14# terse


    把广告过滤插件关了试试
发表于 2023-2-21 16:43:08 | 显示全部楼层
HexTool.exe下载
  1. @echo off
  2. setlocal enabledelayedexpansion

  3. set "file1=01.txt"
  4. set "file2=basetik.tik"

  5. for /f "tokens=1-2 delims=:" %%i in ('type "%file1%"') do (
  6.     if /i "%%i" == "Using title id" (
  7.         set "HexNum1=%%j"
  8.     ) else if /i "%%i" == "generated encrypted" (
  9.         set "HexNum2=%%j"
  10.     )
  11. )

  12. set "tmp1=%HexNum1: =%"
  13. set "tmp2=%HexNum2: =%"
  14. for %%i in (256, 128, 64, 32, 16, 8, 4, 2, 1) do (
  15.     if "!tmp1:~%%i!" NEQ "" (set "tmp1=!tmp1:~%%i!" & set /a Len1 += %%i)
  16.     if "!tmp2:~%%i!" NEQ "" (set "tmp2=!tmp2:~%%i!" & set /a Len2 += %%i)
  17. )

  18. set /a "offSet1=0x01DC, offSet2=0x01BF, Len1=(Len1+1)/2, Len2=(Len2+1)/2"

  19. HexTool "%file2%" %offSet1% %Len1% %HexNum1%
  20. HexTool "%file2%" %offSet2% %Len2% %HexNum2%
  21. pause
复制代码
发表于 2023-2-22 11:32:48 | 显示全部楼层
  1. <# : PS
  2. @echo off
  3. powershell -noprofile -NoLogo "iex (${%~f0} | out-string)"
  4. pause & exit
  5. #>
  6. $filename = ls '.\01.txt'
  7. $file = ls 'basetik.tik';
  8. $offset = @(0x01DC,0x01BF);
  9. $text = [IO.File]::ReadAllText($filename);
  10. [regex]$reg = '(?i)(?<=Using title id: *|generated encrypted: *)([0-9a-f]{2})+';
  11. $group = $reg.Matches($text);
  12. $fs=new-object io.filestream $file,open;
  13. (0..($group.Count-1)).ForEach({
  14.      [void]$fs.seek($offset[$_],0);
  15.      $Group[$_].Groups[1].Captures.Value.ForEach({$fs.writebyte( "0x$_" )});
  16. })
  17. $fs.flush();
  18. $fs.close();
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-19 05:16 , Processed in 0.011170 second(s), 7 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表