代码如下: ::将下面所附代码保存为.BAT或.CMD格式的批处理文件,双击运行。 ::Base64加密解密部分参考s11ss代码 ::转载请注明来自SunTB @echo off set "base64=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
:begin cls setlocal disabledelayedexpansion echo.&echo 输入要转换的链接(若为真实下载链接,需以http://或ftp://开头): set /p str= if /i "%str:~0,10%"=="thunder://" goto :thunder if /i "%str:~0,11%"=="flashget://" goto :flashget if /i "%str:~0,7%"=="qqdl://" goto :qqdl set m=1 goto :encode
:thunder setlocal enabledelayedexpansion for /f "delims=^&" %%a in ("%str%") do ( set str=%%a set es=!str:~10! ) set type=迅雷&set dltype=thunder goto :Base64_Decode
:flashget setlocal enabledelayedexpansion for /f "delims=^&" %%a in ("%str%") do ( set str=%%a set es=!str:~11! ) set type=快车&set dltype=flashget goto :Base64_Decode
:qqdl setlocal enabledelayedexpansion for /f "delims=^&" %%a in ("%str%") do ( set str=%%a set es=!str:~7! ) set type=旋风&set dltype=qqdl goto :Base64_Decode
:encode if /i not "%str:~0,7%"=="http://" (if /i not "%str:~0,6%"=="ftp://" (echo.&echo 链接格式有误,按任意键退出&pause>nul&goto :eof)) set s= if %m% EQU 1 (set type=迅雷&set dltype=thunder&set s=AA%str%ZZ) if %m% EQU 2 (set type=快车&set dltype=flashget&set s=[FLASHGET]%str%[FLASHGET]) if %m% EQU 3 (set type=旋风&set dltype=qqdl&set s=%str%)
::Base64加密 :Base64_Encode setlocal set vbs=%tmp%/t.vbs if exist %vbs% goto :str2hex set t=^>^>%vbs% echo %t%s=wscript.arguments(0) %t%h="" %t%for i=1 to len(s) %t% h=h^&cstr(hex(asc(mid(s,i,1)))) %t%next %t%wscript.stdout.write(h) :str2hex set hex= for /f %%a in ('cscript//nologo %vbs% "%s%"') do set "hex=%%a" setlocal enabledelayedexpansion :hex2base64 if not defined hex goto :print_Encode for /l %%a in (1,1,3) do ( set/a "n=2*(%%a-1)" call set x=%%hex:~!n!,2%% set "c%%a=0x!x!" if "!x!" equ "" set c%%a=0 ) set hex=%hex:~6% set/a ec1=%c1%">>"2 set/a ec2=%c1%"<<"4"|"%c2%">>"4 set/a ec3=%c2%"<<"2"|"%c3%">>"6 set/a ec4=%c3% for /l %%a in (1,1,4) do set/a ec%%a=!ec%%a!"&"63 if %c2% equ 0 set ec3=64 if %c3% equ 0 set ec4=64 for /l %%a in (1,1,4) do call set "es=%%es%%%%base64:~!ec%%a!,1%%" goto :hex2base64 :print_Encode echo.&echo.对应的 %type%下载专用链 转换如下:&echo.%dltype%://%es% set es= setlocal disabledelayedexpansion if %m% EQU 3 (pause>nul&goto :eof) else (set /a m=%m%+1&goto :encode)
::Base64解密 :Base64_Decode setlocal enabledelayedexpansion :GetEs set i=0 :base64-hex set "o=!es:~%i%,1!"