[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
使用debug
  1. @echo off
  2. Setlocal EnableDelayedExpansion
  3. Set fs=1.txt
  4. Set dt=2.txt
  5. Set tf=db-tmp.txt
  6. Set lenb=1
  7. Set "o=>>%tf%"
  8. call :sizehex %fs%
  9. call :consoledb %fs%
  10. ::scan file1
  11. %o% echo s 100 %size% 20
  12. %o% echo q
  13. start /w debug ^<%tf% ^>db-out.txt
  14. ::edit file1
  15. call :consoledb %fs%
  16. for /f "eol=- tokens=2 delims=:" %%a in (db-out.txt) do (
  17. if defined old (
  18. set /a len=0x%%a-old-1
  19. set /a old=0x%%a
  20. if !len! GTR !lenb! Set /a lenb=len
  21. ) else (
  22. set /a old=0x%%a
  23. )
  24. %o% echo e %%a
  25. %o% echo 0A
  26. )
  27. %o% echo w
  28. %o% echo q
  29. start /w debug ^<%tf%
  30. ::output
  31. call :fined >%dt%
  32. call :sizehex %dt%
  33. call :consoledb %dt%
  34. ::scan file2
  35. %o% echo s 100 %size% 0D
  36. %o% echo q
  37. start /w debug ^<%tf% ^>db-out.txt
  38. ::edit file2
  39. call :consoledb %dt%
  40. for /f "eol=- tokens=2 delims=:" %%a in (db-out.txt) do (
  41. set /a count+=1,line=count%%6
  42. if !line! NEQ 0 (
  43. %o% echo e %%a
  44. %o% echo 20 20
  45. )
  46. )
  47. %o% echo w
  48. %o% echo q
  49. start /w debug ^<%tf%
  50. pause
  51. del db-???.txt
  52. goto :eof
  53. :fined
  54. set reg=%reg%[0-9]
  55. if %lenb% EQU 0 goto :eof
  56. set /a lenb-=1
  57. more %fs%|findstr /b /e %reg%|sort
  58. call :fined
  59. goto :eof
  60. :consoledb
  61. >%tf% cd.
  62. %o% echo n%1
  63. %o% echo l
  64. goto :eof
  65. :sizehex
  66. set /a size=%~z1/16*10
  67. goto :eof
复制代码

TOP

原帖由 netbenton 于 2009-5-2 07:31 发表
要是用debug的话,就就应用汇编批令完成了,搞那么多次debug调用,效率太低了一点

那个我不懂嘿嘿

TOP

返回列表