(Transfer)BAT Encryption and Decryption Article
-----------------------------------------------------------
This is a piece of bat encryptor code
author:pengfei@www.cn-dos.net
%%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a %%a
cls
@echo off
color 27
:start
cls
echo *******************************************************************************
echo * *
echo * BAT 加 密 最 终 版 *
echo * *
echo *******************************************************************************
echo.
echo.
echo BAT encryption final version is an updated version of "BAT encryption tool". Compared with the previous version of the encryption tool, it has many advantages:
echo.
echo ★ Can successfully encrypt any batch processing file at one time, which is more convenient.
echo.
echo ★ You can input any batch processing that needs to be encrypted, and the encryption flexibility is greater.
echo.
echo ★ Can automatically judge wrong input, more humanized.
echo.
echo Description: Enter the batch processing file that needs to be encrypted below, directly enter the batch processing file name to encrypt the BAT in the current directory, or you can specify any BAT with a path. The encrypt.bat file generated in the current directory is the encrypted batch processing.
echo.
echo Author: Mulinsen QQ:573381312 BYE
echo.
echo.
echo.
set /p file=Please enter the batch processing that needs to be encrypted and press Enter (q=quit):
if "%file%"=="q" goto quit
echo %file%|findstr /i "\.bat$">nul && goto go
echo %file%|findstr /i "\.cmd$">nul && goto go
cls
echo ==============
echo Please enter correctly!
echo ==============
echo.
echo.
echo Press any key to re-enter......
pause>nul
goto start
:go
if not exist "%file%" goto newly
if exist encrypt.bat copy encrypt.bat encryptbak.bat
echo %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a >"%tmp%\encrypt.tmp"
echo cls>>"%tmp%\encrypt.tmp"
type "%file%">>"%tmp%\encrypt.tmp"
setlocal enabledelayedexpansion
for %%i in ("%tmp%\encrypt.tmp") do (
echo %%~zi >nul 2>nul
set size=%%~zi
set num=!size:~-1!
set /a mod=!num!%%2
if !mod! equ 0 (goto even) else (goto odd)
)
:even
copy "%tmp%\encrypt.tmp" encrypt.bat
del "%tmp%\encrypt.tmp"
cls
echo ==========================
echo Congratulations, batch processing encryption is successful^^!
echo ==========================
echo.
echo.
echo Press any key to exit......
pause>nul
goto quit
:odd
echo. >>"%tmp%\encrypt.tmp"
copy "%tmp%\encrypt.tmp" encrypt.bat
del "%tmp%\encrypt.tmp"
cls
echo ==========================
echo Congratulations, batch processing encryption is successful^^!
echo ==========================
echo.
echo.
echo Press any key to exit......
pause>nul
goto quit
:newly
cls
echo ================================
echo Batch processing file not found, please re-enter!
echo ================================
echo.
echo.
echo Press any key to start......
pause>nul
goto start
:quit
exit
---------------------------------------------------------------------------------------------
The following is the bat decryptor code
---------------------------------------------------------------------------------------------
@echo off
mode con: cols=80 lines=25
:index
color 27
cls
echo ╭───────────────╮
echo │ │
echo ╭─────────┤ BAT 解 密 工 具 ├─────────╮
echo │ │ │ │
echo │ ╰───────────────╯ │
echo │ │
echo │ │
echo │ This tool is used to decrypt encrypted batch processing with confused text encoding type! │
echo │ │
echo │ Fill in the batch processing that needs to be decrypted below and press Enter. │
echo │ │
echo │ It is recommended to directly drag and drop the batch processing file to be decrypted into this window to release. │
echo │ │
echo │ After successful decryption, a file in the format "new_original file name.file suffix name" will be generated in the directory of this program │
echo │ format file. │
echo │ │
echo │ Note: If there is a file "new_original file name.file suffix name" in this directory, │
echo │ will be replaced. │
echo │ │
echo │ │
echo ╰───────────────────────────────────╯
echo.
set route=%cd%
set ravel=
set /p ravel= Please enter the batch processing to be decrypted:
set "ravel=%ravel:"=%"
if /i "%ravel:~-4%"==".bat" if exist "%ravel%" goto go
if /i "%ravel:~-4%"==".cmd" if exist "%ravel%" goto go
cls
echo ╭──────────╮
echo ╭─────────┤ 文 件 错 误 ├────────╮
echo │ ╰──────────╯ │
echo │ │
echo │ The specified file does not exist or the file is not a batch processing type! │
echo │ │
echo │ Press any key to re-enter... │
echo │ │
echo ╰─────────────────────────────╯
echo.
echo.
echo Press any key to re-enter...
pause >nul
goto index
:go
for /f "tokens=*" %%c in ("%ravel%") do (
cd /d "%%~dpc"
if exist "%route%\new_%%~nxc" attrib -s -h -r -a "%route%\new_%%~nxc"
echo author:pengfei@www.cn-dos.net>"%route%\new_%%~nxc"
for /f "tokens=*" %%i in (%%~nxc) do (
echo %%i>>"%route%\new_%%~nxc"
)
)
cls
echo ╭──────────╮
echo ╭─────────┤ 解 密 成 功 ├────────╮
echo │ ╰──────────╯ │
echo │ │
echo │ Congratulations, batch processing decryption is successful! │
echo │ │
echo ╰─────────────────────────────╯
echo.
echo.
echo Press any key to exit...
pause >nul
exit
Recent Ratings for This Post
( 2 in total)
Click for details
| Rater | Score | Time |
| xixixi |
+1 |
2007-06-08 23:48 |
| txratu |
+2 |
2008-03-19 19:24 |