:
Copy codeThe Code is as follows: Save the following code as a. BAT or. CMD batch file and double-click it to run it.
: For Base64 encryption and decryption, refer to the s11ss code.
: Reprinted, please indicate from SunTB
@ Echo off
Set "base64 = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 +/="
: Begin
Cls
Setlocal disabledelayedexpansion
Echo. & echo: Enter the link to be converted (if it is a real download link, it must start with http: // or 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 = %
Set es =! Str :~ 10!
)
Set type = thunder & set dltype = thunder
Goto: Base64_Decode
: Flashget
Setlocal enabledelayedexpansion
For/f "delims = ^ &" % a in ("% str %") do (
Set str = %
Set es =! Str :~ 11!
)
Set type = Express & set dltype = flashget
Goto: Base64_Decode
: Qqdl
Setlocal enabledelayedexpansion
For/f "delims = ^ &" % a in ("% str %") do (
Set str = %
Set es =! Str :~ 7!
)
Set type = tornado & set dltype = qqdl
Goto: Base64_Decode
: Encode
If/I not "% str :~ 0, 7% "=" http: // "(if/I not" % str :~ 0, 6% "=" ftp: // "(the echo. & echo link format is incorrect. Press any key to Exit & pause> nul & goto: eof ))
Set s =
If % m % EQU 1 (set type = thunder & set dltype = thunder & set s = AA % str % ZZ)
If % m % EQU 2 (set type = Express & set dltype = flashget & set s = [FLASHGET] % str % [FLASHGET])
If % m % EQU 3 (set type = tornado & set dltype = qqdl & set s = % str %)
: Base64 Encryption
: 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 = %"
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 %! "&" 63
If % c2 % equ 0 set ec3 = 64
If % c3 % equ 0 set ec4 = 64
For/l % a in (, 4) do call set "es = % es % base64 :~! Ec % !, 1% %"
Goto: hex2base64
: Print_Encode
Echo. & echo. The corresponding % type % download private chain conversion is as follows: & echo. % dltype %: // % es %
Set es =
Setlocal disabledelayedexpansion
If % m % EQU 3 (pause> nul & goto: eof) else (set/a m = % m % + 1 & goto: encode)
: Base64 decryption
: Base64_Decode
Setlocal enabledelayedexpansion
: GetEs
Set I = 0
: Base64-hex
Set "o =! Es :~ % I %, 1! "
If not "% o %" equ "" (call: b64-h1by1) else (goto: hex-hex2)
Set/a I + = 1
Go: base64-hex
: Hex-hex2
If not defined hex goto: hex2-str
For/l % a in (1, 1, 4) do (
Set/a "n = 2 * (% A-1 )"
Call set x = % hex :~! N !, 2% %
Set "ec % a = 0x! X! "
If "! X! "Equ" 40 "(set ec % a = 0 & set f % a = 0)
)
Set hex = % hex :~ 8%
Set/a c1 = % ec1 % "<" 2 "|" % ec2 % ">" 4
Set/a c2 = % ec2 % "<" 4 "|" % ec3 % ">" 2
Set/a c3 = % ec3 % "<" 6 "|" % ec4 %
For/l % a in (1, 1, 3) do (
Set/a c % a =! C %! "&" 255
Call: dec-hex! C %!
)
If "% f3 %" equ "0" set "c2 ="
If "% f4 %" equ "0" set "c3 ="
For/l % a in (, 3) do call set "hex2 = % hex2 % r! C %! %"
Go: hex-hex2
: Hex2-str
Set vbs = % tmp % \ tt. vbs
If exist % vbs % goto: runVBS
: CreateVBS
Set t = ^> % vbs % echo
% T % h = wscript. arguments (0)
% T % s = ""
% T % for I = 1 to len (h) step 2
% T % a = cint ("& h" ^ & mid (h, I, 2 ))
% T % if a ^> 160 then
% T % a = cint ("& h" ^ & mid (h, I, 4 ))
% T % I = I + 2
% T % end if
% T % s = s ^ & chr ()
% T % next
% T % wscript. stdout. write (s)
: RunVBS
For/f "delims =" % a in ('cscript // nologo % vbs % hex2 % ') do set "s = %"
: Print_Decode
Echo. & echo the % type % chain is as follows:
If "% type %" = "Thunder" echo. % s :~ 2.-2%
If "% type %" = "Express" echo. % s :~ 10,-10%.
If "% type %" = "tornado" echo. % s %
Pause> nul & goto: eof
: B64-h1by1
For/l % a in (0, 1, 64) do (
If "! Base64 :~ % A, 1! "Equ" % o % "(
Call: dec-hex %
Set hex =! Hex !! R %!
Goto: eof
)
)
Goto: eof
: Dec-hex
Set "r % 1 ="
Set "h = 0123456789 ABCDEF"
Set/a q = % 1
: 1c
Set/a r = % q % 16
Set/a q = % q %/16
Call set r = % h :~ % R %, 1% %
Set r % 1 = % r %! R % 1!
If not % q % equ 0 goto: 1c
If % 1 leq 0xf set r % 1 = 0! R % 1!
Prevents batch processing from being packaged and downloaded due to problems with the editor