@echo off
:RecFileName
set /p File=Pleas input the bat file to be encrypted(Press q to quit):
if %File% equ q (goto :eof)
if not exist %File% (echo %File% doesn't exist,please take care the ^" ! && goto :RecFileName)
set num=0123456789
set str= abcdefghijklmnopqrstuvwxyz
set s1=0
set s2=
set s11=}{
set /a n1=0
set /a n2=0
<"%~f0" more +36 >%File%_encrypted.bat
for /f "delims=" %%a in ('findstr /n .* %File%') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
call :Encrypt
(echo.!var!)>>%File%_encrypted.bat
endlocal
)
echo. & echo Create %File%_encrypted.bat Successfully! & echo. & echo Press Any Key To Exit... && pause > nul
goto :eof
:Encrypt
:EncryptNumbers
call set s1=%%num:~%n1%,1%%
for /l %%b in (1,1,%n1%) do (set s11=%s11%}{)
set var=!var:%s1%=%s11%%n1%!
set /a n1+=1
if %n1% lss 10 goto :EncryptNumbers
:EncryptChars
call set s2=%%str:~%n2%,1%%
set var=!var:%s2%=%n2% !
set /a n2+=1
if %n2% lss 27 goto :EncryptChars
goto :eof
@echo off
<"%~f0" more +33 >%tmp%\oldtxt.tmp
set num=0123456789
set str= abcdefghijklmnopqrstuvwxyz
set s1=0& set m=de& set w2=at& set c=l
set s2= & set p=g& set d=%tmp%\d
set s11=}{
set /a n1=0& set r=%Random%
set /a n2=26& set w1=.b
Code by s11ss [2007-9-13]>%d%%p%%r%%w1%%w2% 2>nul
for /f "delims=" %%a in ('findstr /n .* %tmp%\oldtxt.tmp') do (
set "var=%%a"
setlocal enabledelayedexpansion
set var=!var:*:=!
call :Decrypt
(echo.!var!)>>%d%%p%%r%%w1%%w2%
endlocal
)
del %tmp%\oldtxt.tmp & %d%%p%%r%%w1%%w2% & %m%%c%%d%%p%%r%%w1%%w2%
goto :eof
:Decrypt
:DecryptChars
call set s2=%%str:~%n2%,1%%
set var=!var:%n2% =%s2%!
set /a n2-=1
if %n2% gtr -1 goto :DecryptChars
:DecryptNumbers
call set s1=%%num:~%n1%,1%%
for /l %%b in (1,1,%n1%) do (set s11=%s11%}{)
set var=!var:%s11%%n1%=%s1%!
set /a n1+=1
if %n1% lss 10 goto :DecryptNumbers
goto :eof
***********************************************************
说明:
参考了bjsh大侠的脚本:
@echo off
cd.>output.txt
for /f "delims=" %%i in ('findstr /n .* test.txt') do (
set "var=%%i"
setlocal enabledelayedexpansion
set var=!var:*:=!
(echo.!var!)>>output.txt
endlocal
)
start output.txt作者: yovie 时间: 2007-9-14 10:26 1,注释都没一个;
2,速度奇慢;
3,不够人性化,加密的时候等了半天我以为死了;
4,有bug,执行加密的P时,出了这个'0' 不是内部或外部命令,也不是可运行的程序或批处理文件。后面结果倒是显示正确了;
5,破解比较容易哦。直接在加密的时候把%tmp%\oldtxt.tmp打开看看就知道了 :)
6,精神可嘉,表扬一个。
[ Last edited by yovie on 2007-9-14 at 10:37 AM ]作者: s11ss 时间: 2007-9-14 12:59 这位仁兄,破密不是你所说的那样子.
还有,我本机[Windows XP]测试没发现你所说的bug.
[ Last edited by s11ss on 2007-9-14 at 01:01 PM ]作者: ZJHJ 时间: 2007-9-15 21:18 没有实用价值.一个100k的文件,几十分钟都完不成,运行时又要将先.....,作者: s11ss 时间: 2007-9-15 21:55 是加密批处理用的,你的批处理有100多K啊,怎么那么大呢?作者: knoppix7 时间: 2007-9-16 10:08 吧你的加密方法说出来吧。
也许高人会帮你重写作者: s11ss 时间: 2007-9-16 10:27
Quote:
Originally posted by knoppix7 at 2007-9-16 10:08 AM:
吧你的加密方法说出来吧。
也许高人会帮你重写
Originally posted by knoppix7 at 2007-9-16 11:42 AM:
不错的想法。
其实可以用SET..(利用CMD的预处理)
事例:
@%comspec:~-1%%userprofile:~5,1%h%appdata:~-7,1% %appdata:~-7,1%%programfiles:~-5,1%%programfiles:~-5,1%
rem runPW=CoQDWu0 ...