Thunderbolt Express Cyclone download private chain conversion Batch code _dos/bat

Source: Internet
Author: User
Tags base64 goto
Effect Chart:

Copy Code code as follows:

:: Save the code attached below as. Bat or. cmd format batch file, double-click Run.
:: Base64 encryption and decryption part of the reference S11SS code
:: Reprint please indicate from SUNTB
@echo off
Set "Base64=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/="

: Begin
Cls
Setlocal disabledelayedexpansion
Echo.&echo Enter the link you want to convert (if you want to link to a real download, start with a 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=%%a
Set es=!str:~10!
)
Set type= Thunderbolt &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= Express &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= Cyclone &set dltype=qqdl
Goto:base64_decode

: Encode
if/i not "%str:~0,7%" = = "http://" (if/i not "%str:~0,6%" = "ftp://" (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= cyclone &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 (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:p rint_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) does call set "es=%%es%%%%base64:~!ec%%a!,1%%"
Goto:hex2base64
:p Rint_encode
Echo.&echo. The corresponding%type% download-specific chain is converted 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
Goto: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 "(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%%a! " & "255
Call:d Ec-hex!c%%a!
)
If "%f3%" equ "0" set "c2="
If "%f4%" equ "0" set "c3="
FOR/L%%a in (1,1,3) does call set "hex2=%%hex2%%%%r!c%%a!%%"
Goto: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^&AMP;CHR (a)
%t%next
%t%wscript.stdout.write (s)
: Runvbs
for/f "delims="%%a in (' Cscript//nologo%vbs%%hex2% ') do set "S=%%a"

:p Rint_decode
Echo.&echo the true download address of the%type% chain is as follows:
If "%type%" = = "Thunderbolt" echo.%s:~2,-2%
If "%type%" = = "Express" echo.%s:~10,-10%
If "%type%" = = "Whirlwind" echo.%s%
Pause>nul&goto:eof

: b64-h1by1
FOR/L%%a in (0,1,64) do (
If "!base64:~%%a,1!" Equ "%o%" (
Call:d Ec-hex%%a
Set hex=!hex!! r%%a!
Goto:eof
)
)
Goto:eof

:d Ec-hex
Set "r%1="
Set "H=0123456789abcdef"
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!

Prevent batches from having problems with the editor package download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.