CODE: [Copy to clipboard]
@echo off&setlocal EnableDelayedExpansion
title 16进制文件解密! QQ:309254515-趣味东
set file=qwd.txt
:new
echo: ----若行长大于8188字节请自行手动分行----&echo.
set/p file=解密16进制文件路径:
echo.
dir/a-d/-c !file!|findstr "文件"
echo.&echo. 字节-起点-行号 数值
for %%i in (0123456789ABCDEF,xh,480,b," ",sp) do if "!.!"=="" (
set.=%%~i)else (set %%i=!.!&set.=)
for /l %%i in (1 1 64) do set t=!t!
(echo debug^<%%0^&exit)>j.bat
for /f "delims=" %%i in ('type !file!^&echo//') do (
set n=0
set $=%%i&set $=!$:-= !
call:str
)
(for %%i in ("" ntmp.txt rcx !bh! w q) do echo.%%~i)>>j.bat
echo.
del tmp.* 2>nul
start/min/wait j.bat
:del j.bat
for %%i in (jpg bmp gif mp3) do (
set yn=y&set/p yn=%%i y/n:
if !yn! equ n set bt=&goto new
if !yn! equ y ren tmp.* tmp.%%i&start tmp.%%i
)
del tmp.*
pause>nul
exit
:str
if "!$:~%n%,1!" neq " " (
set/a b+=1,k=b%%2,h=b%%32,bx=b/2
set/p=!t!请稍等:!bt!-!b!-!bh! !$:~%n%,1!<nul
if "!$:~%n%,1!" equ "/" (
set bh=&set/a"bx=(bx+16)/16*16"
call:h&echo.e!bh! !ts!>>j.bat&set ts=
set bh=!bh:~,-1!f&goto:eof
)
set ts=!ts!!$:~%n%,1!!sp:~,%k%!
if !h!==0 (
set bh=
call:h
echo.e!bh! !ts!>>j.bat
set ts=&set h=
)
)
set/a n+=1,bt+=1
if "!$:~%n%,1!" equ "" (goto:eof) else (goto str)
:h
set/a by=bx%%16,bx/=16
set bh=!xh:~%by%,1!!bh!
if !bx! neq 0 goto h
goto:eof
打包里的gif.txt原文件整个是一行的,现在是经手动断行修改后的三行文件。