202305写的,今天发现CSDN没得,就把它拿过来了,挺好玩的一个程序,好玩的点在于开了多个进程算密码,大家试下就知道了,只能解密数字密码+后缀rar的压缩包哦,最高支持9位
使用方法:
代码复制到记事本,另存为,编码ansi,文件类型所有类型,文件名XXX.bat,bat固定,XXX随意
@echo off
setlocal enabledelayedexpansion
echo WINRAR数字密码解密器,会生成多个窗口跑密码,勿关
if "%1" equ "" (
set /p numDigit=请输入密码最大位数:
set /p rarRoot=请输入WINRAR主目录,如C:\Program Files\WinRAR:
set /p rarFile=请输入数字密码压缩文件包路径,如C:\test.rar:
rem 数字位数
rem set numDigit=10
rem 线程数
set /a threadNum=0+numDigit
for /l %%x in (1,1,!threadNum!) do (
copy /b /y %0 %temp%\thd%%x.bat
start "rarNumPwdThread%%x" /min %temp%\thd%%x.bat %%x !threadNum!
)
) else (
set idx=%1
set maxThd=%2
call:threadMain
)
:threadMain
cd /d "!rarRoot!"
set begin=0
set end=1
for /l %%x in (1,1,!idx!) do (
set /a end=!end!*10
)
if not "!idx!"=="1" (
set /a begin=!end!/10
)
set /a totalnum=!end!-!begin!+1
for /l %%a in (!begin!,1,!end!) do (
rar x -mt50 -o+ -r- -p%%a -inul -ilog%temp%\rarlog!idx!.txt "!rarFile!"
set checkCharFlag=1
for /f "usebackq tokens=3 delims=:" %%b in (`find /c "错误" %temp%\rarlog!idx!.txt`) do (
set checkChar=%%b
set checkChar=!checkChar: =!
if not "!checkChar!"=="0" (
rem echo password %%a is wrong^^!
set checkCharFlag=0
)
)
if "!checkCharFlag!" equ "1" (
cls
echo rar password is %%a^^!
for /l %%c in (1,1,!maxThd!) do (
if not "!idx!"=="%%c" (
taskkill /f /fi "windowtitle eq rarNumPwdThread%%c*" /fi "status eq running">nul
)
)
pause
exit
)
del /q %temp%\rarlog!idx!.txt
set /a num1=%%a-!begin!+1
set /a num1=!num1!*100
set /a num2=!end!-!begin!+1
set /a progressnum=num1/num2
cls
echo !begin!~!end!范围数字测试已完成!progressnum!%%
)
exit
(全文完)