标题: 如何在autoexec.bat写密码登陆程序?
[打印本页]
作者: susan2003
时间: 2003-10-17 00:00
标题: 如何在autoexec.bat写密码登陆程序?
如何在autoexec.bat,在dos模式下,需输入密码,不能跳过,当密码确认时才可以进入dos,否则反复提示要输入正式密码?帮帮忙。
作者: susan2003
时间: 2003-10-17 00:00
怎么写呢?
作者: Roy
时间: 2003-10-17 00:00
Quote: |
以下是引用susan2003在2003-10-17 22:18:04的发言:
怎么写呢? |
|
在autoexec.bat中"登入"...........安全性不足呢.......在bios中設置密碼比較實際
作者: susan2003
时间: 2003-10-18 00:00
是的,但是麻烦写该程序,BIOS知道的,谢谢。
作者: Roy
时间: 2003-10-18 00:00
:: --------------------------------------------------------------
:: Author: Leonardo Pignataro (secret_doom@hotmail.com)
:: --------------------------------------------------------------
:: Usage: Request an alpha-numeric password request (letters
:: and numbers only). Displays asterisks instead of
:: typed characters. The input method used will convert
:: all leters to lowercase, so the password will be case
:: insensitive. If user inputs the right password, the
:: label :granted will be invoked. Otherwise, the label
:: :denied will be invoked. Setup real password below.
:: --------------------------------------------------------------
:: * Disabled CTRL+C (CTRL+BREAK still works)
:: --------------------------------------------------------------
@echo off
:: --------------------------------------------------------------
:: SCRIPT SETUP
:: --------------------------------------------------------------
:: Set password (the right one, which grats access) below.
:: Use letters in LOWERCASE ONLY, otherwise access will never be
:: granted.
:: --------------------------------------------------------------
REM 你的密碼和密碼長度(以*表示)
REM 注意:密碼必須為小階字母或數字
SET REAL_PASS=mypass
SET REAL_LENGTH=******
:: --------------------------------------------------------------
:: The REAL_LENGTH variable must have the same length as
:: REAL_PASS, but must be made of asterisks only.
:: --------------------------------------------------------------
REM 制作檢查程序
:: Thanks to Laurence Soucy for the following assembler code
echo e100 B4 00 CD 16 88 E0 B4 4C CD 21> %temp%.\scan.com
for %%? in (rcx A w q) do echo %%?>> %temp%.\scan.com
type %temp%.\scan.com |DEBUG %temp%.\scan.com > nul
REM 起始設定
:pre
for %%? in (pass length) do set user_%%?=
REM 檢查密碼
:loop
set input=
cls
echo Type password: %user_length%
if "%user_pass%"=="%real_pass%" goto granted
if "%user_length%"=="%real_length%" goto denied
call %temp%.\scan.com
if errorlevel=2 if not errorlevel=3 set input=1
if errorlevel=3 if not errorlevel=4 set input=2
if errorlevel=4 if not errorlevel=5 set input=3
if errorlevel=5 if not errorlevel=6 set input=4
if errorlevel=6 if not errorlevel=7 set input=5
if errorlevel=7 if not errorlevel=8 set input=6
if errorlevel=8 if not errorlevel=9 set input=7
if errorlevel=9 if not errorlevel=10 set input=8
if errorlevel=10 if not errorlevel=11 set input=9
if errorlevel=11 if not errorlevel=12 set input=0
if errorlevel=30 if not errorlevel=31 set input=a
if errorlevel=48 if not errorlevel=49 set input=b
if errorlevel=46 if not errorlevel=47 set input=c
if errorlevel=32 if not errorlevel=33 set input=d
if errorlevel=18 if not errorlevel=19 set input=e
if errorlevel=33 if not errorlevel=34 set input=f
if errorlevel=34 if not errorlevel=35 set input=g
if errorlevel=35 if not errorlevel=36 set input=h
if errorlevel=23 if not errorlevel=24 set input=i
if errorlevel=36 if not errorlevel=37 set input=j
if errorlevel=37 if not errorlevel=38 set input=k
if errorlevel=38 if not errorlevel=39 set input=l
if errorlevel=50 if not errorlevel=51 set input=m
if errorlevel=49 if not errorlevel=50 set input=n
if errorlevel=24 if not errorlevel=25 set input=o
if errorlevel=25 if not errorlevel=26 set input=p
if errorlevel=16 if not errorlevel=17 set input=q
if errorlevel=19 if not errorlevel=20 set input=r
if errorlevel=31 if not errorlevel=32 set input=s
if errorlevel=20 if not errorlevel=21 set input=t
if errorlevel=22 if not errorlevel=23 set input=u
if errorlevel=47 if not errorlevel=48 set input=v
if errorlevel=17 if not errorlevel=18 set input=w
if errorlevel=45 if not errorlevel=46 set input=x
if errorlevel=21 if not errorlevel=22 set input=y
if errorlevel=44 if not errorlevel=45 set input=z
if errorlevel=71 if not errorlevel=72 set input=7
if errorlevel=72 if not errorlevel=73 set input=8
if errorlevel=73 if not errorlevel=74 set input=9
if errorlevel=75 if not errorlevel=76 set input=4
if errorlevel=76 if not errorlevel=77 set input=5
if errorlevel=77 if not errorlevel=78 set input=6
if errorlevel=79 if not errorlevel=80 set input=1
if errorlevel=80 if not errorlevel=81 set input=2
if errorlevel=81 if not errorlevel=82 set input=3
if errorlevel=82 if not errorlevel=83 set input=0
if "%input%"=="" goto loop
set user_length=*%user_length%
set user_pass=%user_pass%%input%
goto loop
REM 密碼正確
:granted
echo Access granted.
goto pass_end
REM 密碼錯誤
:denied
echo Access denied.
GOTO PRE
REM "登入"完成
:pass_end
for %%? in (pass length) do set user_%%?=
for %%? in (pass length) do set real_%%?=
del %temp%.\scan.com
REM 下面的指令是"登入"後運行的
作者: susan2003
时间: 2003-10-18 00:00
非常感谢,你是我的偶像!!!!
作者: 柳五
时间: 2003-10-18 00:00
跳过执行autoexec.bat这个密码还有用吗?