无忧启动论坛

标题: Drive SnapShot 的汉化批处理补充 [打印本页]

作者: chishingchan    时间: 2021-11-23 21:02
标题: Drive SnapShot 的汉化批处理补充
参考 Drive SnapShot 简易汉化工具_终版 的批处理,修改为不输出临时文件的版本:

相关工具下载:
http://bytepointer.com/download.php?name=pelook.zip
http://stahlworks.com/dev/sfk/sfkwinxp.exe
https://github.com/upx/upx/relea ... /upx-3.96-win32.zip

  1. @echo off
  2. cd /d %~dp0
  3. if not exist snapshot.exe echo 请重新安装程序!&pause&exit
  4. if not exist snapshot64.exe echo 请重新安装程序!&pause&exit
  5. :: http://bytepointer.com/download.php?name=pelook.zip
  6. if not exist pelook.exe echo 缺少 pelook.exe 文件!&pause&exit
  7. :: http://stahlworks.com/dev/sfk/sfkwinxp.exe
  8. if not exist sfkwinxp.exe echo 缺少 sfkwinxp.exe 文件!&pause&exit
  9. :: https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win32.zip
  10. if not exist upx.exe echo 缺少 upx.exe 文件!&pause&exit

  11. set FileName=snapshot.exe

  12. :: 获取 PE 头
  13. for /f "tokens=3" %%i in ('pelook.exe -d %FileName%^|findstr "PE"') do set PE=0x%%i

  14. :: 获取 安全目录 偏移 值
  15. for /f "delims=" %%i in ('sfkwinxp.exe calc "%PE%+152"') do set Security_Directory_RVA_Offset=%%i
  16. for /f "delims=" %%i in ('sfkwinxp.exe calc "%PE%+156"') do set Security_Directory_Size_Offset=%%i
  17. for /f "tokens=8,10 delims=- " %%i in ('pelook.exe -s %FileName%') do (set SDRV=%%i & set SDSV=%%j)
  18. :: 高低位转换
  19. set "Security_Directory_RVA_Value=0x%SDRV:~6,2%%SDRV:~4,2%%SDRV:~2,2%%SDRV:~0,2%"
  20. set "Security_Directory_Size_Value=0x%SDSV:~6,2%%SDSV:~4,2%%SDSV:~2,2%%SDSV:~0,2%"

  21. :: 解压缩
  22. upx.exe -d --strip-relocs=0 %FileName%

  23. :: 修复 病毒警告
  24. sfkwinxp.exe replace -binary /E000220D/E000230D/ -dir . -file %FileName% -yes
  25. sfkwinxp.exe replace -binary /742081BD/EB0C81BD/ -dir . -file %FileName% -yes

  26. :: 修复 中文限制
  27. sfkwinxp.exe replace -binary /743A5768/EB3A5768/ -dir . -file %FileName% -yes

  28. :: 汉化
  29. call :HH

  30. :: 压缩
  31. upx.exe -9 --compress-exports=0 --strip-relocs=0 --compress-icons=0 --lzma %FileName%

  32. :: 修复 数字证书
  33. sfkwinxp.exe setbytes %FileName% %Security_Directory_RVA_Offset% %Security_Directory_RVA_Value% -yes
  34. sfkwinxp.exe setbytes %FileName% %Security_Directory_Size_Offset% %Security_Directory_Size_Value% -yes

  35. :: 注册
  36. for /f "tokens=6 delims= " %%i in ('sfk xhexfind -text "/\x53\x4e\x41\x53\x45\x52\x4e\x55\x4d\x00\x8f\x0a/" -dir . -file %FileName%^|findstr "%FileName%"') do set SNASERNUM=%%i
  37. for /f "delims=" %%i in ('sfkwinxp.exe calc "%SNASERNUM%+12"') do set Name=%%i
  38. :: 简体中文版
  39. sfkwinxp.exe setbytes %FileName% %Name% 0xBCF2CCE5D6D0CEC4B0E60000000000000000 -yes
  40. for /f "delims=" %%i in ('sfkwinxp.exe calc "%SNASERNUM%+76"') do set Vers=%%i
  41. :: 111111U - Site License
  42. sfkwinxp.exe setbytes %FileName% %Vers% 0x31313131313155202D2053697465204C6963656E7365 -yes
  43. for /f "delims=" %%i in ('sfkwinxp.exe calc "%SNASERNUM%+108"') do set Serial=%%i
  44. :: 25D4-5455-467B-B161
  45. sfkwinxp.exe setbytes %FileName% %Serial% 0x323544342D353435352D343637422D42313631 -yes

  46. set FileName=snapshot64.exe

  47. :: 获取 PE 头
  48. for /f "tokens=3" %%i in ('pelook.exe -d %FileName%^|findstr "PE"') do set PE=0x%%i

  49. :: 获取 安全目录 偏移 值
  50. for /f "delims=" %%i in ('sfkwinxp.exe calc "%PE%+168"') do set Security_Directory_RVA_Offset=%%i
  51. for /f "delims=" %%i in ('sfkwinxp.exe calc "%PE%+172"') do set Security_Directory_Size_Offset=%%i
  52. for /f "tokens=8,10 delims=- " %%i in ('pelook.exe -s %FileName%') do (set SDRV=%%i & set SDSV=%%j)
  53. :: 高低位转换
  54. set "Security_Directory_RVA_Value=0x%SDRV:~6,2%%SDRV:~4,2%%SDRV:~2,2%%SDRV:~0,2%"
  55. set "Security_Directory_Size_Value=0x%SDSV:~6,2%%SDSV:~4,2%%SDSV:~2,2%%SDSV:~0,2%"

  56. :: 解压缩
  57. upx.exe -d --strip-relocs=0 %FileName%

  58. :: 修复 病毒警告
  59. sfkwinxp.exe replace -binary /E000220D/E000230D/ -dir . -file %FileName% -yes
  60. sfkwinxp.exe replace -binary /742081BD/EB0C81BD/ -dir . -file %FileName% -yes

  61. :: 修复 中文限制
  62. sfkwinxp.exe replace -binary /743A5768/EB3A5768/ -dir . -file %FileName% -yes

  63. :: 汉化
  64. call :HH

  65. :: 压缩
  66. upx.exe -9 --compress-exports=0 --strip-relocs=0 --compress-icons=0 --lzma %FileName%

  67. :: 修复 数字证书
  68. sfkwinxp.exe setbytes %FileName% %Security_Directory_RVA_Offset% %Security_Directory_RVA_Value% -yes
  69. sfkwinxp.exe setbytes %FileName% %Security_Directory_Size_Offset% %Security_Directory_Size_Value% -yes

  70. :: 注册
  71. for /f "tokens=6 delims= " %%i in ('sfk xhexfind -text "/\x53\x4e\x41\x53\x45\x52\x4e\x55\x4d\x00\x8f\x0a/" -dir . -file %FileName%^|findstr "%FileName%"') do set SNASERNUM=%%i
  72. for /f "delims=" %%i in ('sfkwinxp.exe calc "%SNASERNUM%+12"') do set Name=%%i
  73. :: 简体中文版
  74. sfkwinxp.exe setbytes %FileName% %Name% 0xBCF2CCE5D6D0CEC4B0E60000000000000000 -yes
  75. for /f "delims=" %%i in ('sfkwinxp.exe calc "%SNASERNUM%+76"') do set Vers=%%i
  76. :: 111111U - Site License
  77. sfkwinxp.exe setbytes %FileName% %Vers% 0x31313131313155202D2053697465204C6963656E7365 -yes
  78. for /f "delims=" %%i in ('sfkwinxp.exe calc "%SNASERNUM%+108"') do set Serial=%%i
  79. :: 25D4-5455-467B-B161
  80. sfkwinxp.exe setbytes %FileName% %Serial% 0x323544342D353435352D343637422D42313631 -yes
  81. pause
  82. exit

  83. :HH
  84. :: Dynamic partition = 动态分区
  85. sfkwinxp.exe replace -binary /44796E616D696320706172746974696F6E/B6AFCCACB7D6C7F8000000000000000000/ -dir . -file %FileName% -yes
  86. :: Logical drive = 逻辑驱动
  87. sfkwinxp.exe replace -binary /4C6F676963616C206472697665/C2DFBCADC7FDB6AF0000000000/ -dir . -file %FileName% -yes
  88. :: Extended partition = 扩展分区
  89. sfkwinxp.exe replace -binary /457874656E64656420706172746974696F6E/C0A9D5B9B7D6C7F800000000000000000000/ -dir . -file %FileName% -yes
  90. :: Primary partition = 主分区
  91. sfkwinxp.exe replace -binary /5072696D61727920706172746974696F6E/D6F7B7D6C7F80000000000000000000000/ -dir . -file %FileName% -yes
  92. :: Unallocated = 未分配
  93. sfkwinxp.exe replace -binary /556E616C6C6F6361746564/CEB4B7D6C5E40000000000/ -dir . -file %FileName% -yes
  94. :: Boot partition = 启动分区
  95. sfkwinxp.exe replace -binary /426F6F7420706172746974696F6E/C6F4B6AFB7D6C7F8000000000000/ -dir . -file %FileName% -yes
复制代码



作者: chishingchan    时间: 2021-11-23 21:10
本帖最后由 chishingchan 于 2021-11-23 21:38 编辑

注册界面:


仅被汉化的界面


作者: chishingchan    时间: 2021-11-23 21:17
我的 au3 版,抽时间再完善 汉化 的条目,直接摆脱 Athena 界面操作的汉化。

作者: lily9718    时间: 2021-11-24 06:04
谢谢
作者: wondaol    时间: 2021-11-24 11:05
截图好像没有汉化嘛
作者: chishingchan    时间: 2021-11-24 11:13
wondaol 发表于 2021-11-24 11:05
截图好像没有汉化嘛

第二幅图倒数第二行就是汉化,只作参考
作者: casttt    时间: 2021-11-24 14:58
顺带请教一下各位批处理大师,下面的拖入映像文件方式恢复系统,中间会多弹出一个黑框,而不是只提示“按任意键开始恢复系统...”,
因该是没有管理员权限执行,但尝试了用几个常见的提权方式是行不通的,不知有解决方法没有,

----------------------------------------------------------------
@echo off
if "%~1"=="" (echo 你没有拖入任何文件,或不要直接双击启动,按任意键退出&pause >nul&goto :eof)

%~dp0\Snapshot64 --schedule C: "%~1" --autoreboot:any >nul

::reg add "HKLM\SYSTEM\CurrentControlSet\Control\Snapshot" /v "Timeout" /t REG_DWORD /d 5 /f
@ echo.
@ echo.
echo 按任意键开始恢复系统...
@ echo.
pause >nul
shutdown -r -t 0
------------------------------------------------------------------



作者: chishingchan    时间: 2021-11-24 16:20
casttt 发表于 2021-11-24 14:58
顺带请教一下各位批处理大师,下面的拖入映像文件方式恢复系统,中间会多弹出一个黑框,而不是只提示“按任 ...

批处理就是运行方便,建议将拖入方式直接改写为文件名称
作者: casttt    时间: 2021-11-24 20:27
本帖最后由 casttt 于 2021-11-24 23:01 编辑
chishingchan 发表于 2021-11-24 16:20
批处理就是运行方便,建议将拖入方式直接改写为文件名称

是的,给别人用就直接用,再加几行中文说明,不用拖入的方式,不懂电脑也会用
这个拖入用是没问题的,就是要按二次键盘而已,有时自己用多个映象方便一些,不用改什么,只是想有办法完美更好。

向你学习如何 “获取安全目录偏移值” 中,




作者: 旁观者清    时间: 2021-11-24 20:57
chishingchan 发表于 2021-11-24 11:13
第二幅图倒数第二行就是汉化,只作参考

哟呵,要不是提醒还真没仔细看出汉化了。汗
作者: rzp428    时间: 2021-11-24 21:41
本帖最后由 rzp428 于 2021-12-2 12:31 编辑

0
作者: casttt    时间: 2021-11-24 23:02
rzp428 发表于 2021-11-24 21:41
老师辛苦了!

        我测试好像【修复 数字证书】部分有问题,详见我修改后的压缩包。

应该是当中有sfk.exe没改过来
作者: rzp428    时间: 2021-11-25 22:51
本帖最后由 rzp428 于 2021-12-2 12:32 编辑

0
作者: huqiu2    时间: 2023-10-7 11:04
原贴好像挂了,本贴资源不完整,刚好在电脑上找到了之前保存的一个最近的版本的“Snapshot简易汉化_20230507.7z”,汉化字典增补了5条记录,修订了4条记录,然后手动生成了最新版的 Snapshot 1.50.1258 汉化注册版 放到这里了
ww删w.123pan.co删m/s/JkqyVv-rgJD3#5YOU


作者: geogls    时间: 2023-10-18 17:21
huqiu2 发表于 2023-10-7 11:04
原贴好像挂了,本贴资源不完整,刚好在电脑上找到了之前保存的一个最近的版本的“Snapshot简易汉化_2023050 ...

32位程序没能修复不能在含有汉字的路径下运行的问题。
作者: huqiu2    时间: 2023-10-18 17:54
geogls 发表于 2023-10-18 17:21
32位程序没能修复不能在含有汉字的路径下运行的问题。
  1. @echo off
  2. start snapshot.exe
  3. exit
复制代码
以上代码另存为:x86.bat

文件编码为:
ANSI
将保存好的文件直接复制到x86文件下的同级目录,运行即可!

ENJOY!

PS:
其实不关中文路径的事情,而是路径中不能有空格,比如路径中包含类似以下路径“Program Files”
作者: 2011lanz    时间: 2023-10-18 18:16
huqiu2 发表于 2023-10-18 17:54
以上代码另存为:x86.bat

文件编码为:

大佬很厉害,谢谢分享!
作者: huqiu2    时间: 2023-10-18 22:47
报错

22:46:36 Start of Snapshot 1.50.1249 [Sep 13 2023] at 2023-10-18
22:46:36 Running on Windows 11 Professional 64-bit  (22621)
22:46:36 Memory Info: Total: 7959Mb, Free: 2996Mb, Pagefile total: 15895Mb, Pagefile free: 5538Mb
22:46:36 Command line: "D:\123\snapshot64.exe"
22:46:37 Timelimited TrialWare - use possible up to 2023-10-27
22:46:37 ***********************************************************
22:46:37 Snapshot error WINSHOT, line 6729
22:46:37 internal error:invalid dialog <StartupScreen>
22:46:37 last Windows Error: 715-找不到映像文件中指定的资源类型。
22:46:40 ***********************************************************
22:46:40 End of Snapshot 1.50 [Sep 13 2023] at 2023-10-18



作者: geogls    时间: 2023-10-22 09:39
geogls 发表于 2023-10-18 17:21
32位程序没能修复不能在含有汉字的路径下运行的问题。

但64位没有问题。如果像以前一样在程序里直接改过来会更好。
作者: denslin    时间: 2023-10-22 09:50
Thank You very much
作者: yyz2191958    时间: 2023-10-25 21:57
谢谢分享
作者: a90206882981    时间: 2023-10-25 22:58
先保存,等方法
作者: hcwww    时间: 2023-10-26 14:04
这软件备份速度快




欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3