获取主板BIOS的信息

http://tech.ddvip.com   2007年03月20日    社区交流

本文详细介绍获取主板BIOS的信息

  2、AWard Bios密码读取(应该是jingtao的文章,但是ID没有记录)

Unit AwardBiosPas;
//Write by lovejingtao
//http://www.138soft.com
interface
uses windows,SysUtils;
function My_GetBiosPassword:String;
implementation
function CalcPossiblePassword(PasswordValue: WORD): string;
var
I: BYTE;
C: CHAR;
S: string[8];
begin
I := 0;
while PasswordValue <> 0 do
  begin
   Inc(I);
   if $263 > PasswordValue then
    begin
     if $80 > PasswordValue then
      S[I] := CHAR(PasswordValue)
     else if $B0 > PasswordValue then
      S[I] := CHAR(PasswordValue and $77)
     else if $11D > PasswordValue then
      S[I] := CHAR($30 or (PasswordValue and $0F))
     else if $114 > PasswordValue then
      begin
       S[I] := CHAR($64 or (PasswordValue and $0F));
       if '0' > S[I] then
        S[I] := CHAR(BYTE(S[I]) + 8);
      end
     else if $1C2 > PasswordValue then
      S[I] := CHAR($70 or (PasswordValue and $03))
     else if $1E4 > PasswordValue then
      S[I] := CHAR($30 or (PasswordValue and $03))
     else
      begin
       S[I] := CHAR($70 or (PasswordValue and $0F));
       if 'z' < S[I] then
        S[I] := CHAR(BYTE(S[I]) - 8);
      end;
    end
   else
    S[I] := CHAR($30 or (PasswordValue and $3));
   PasswordValue := (PasswordValue - BYTE(S[I])) shr 2;
  end;
S[0] := CHAR(I);
PasswordValue := I shr 1;
while PasswordValue < I do
  begin {this is to do because award starts calculating with the last letter}
   C := S[BYTE(S[0]) - I + 1];
   S[BYTE(S[0]) - I + 1] := S[I];
   S[I] := C;
   Dec(I);
  end;
CalcPossiblePassword := S;
end;
function readcmos(off: byte): byte;
var
value: byte;
begin
asm
   xor ax, ax
   mov al, off
   out 70h, al
   in al, 71h
   mov value, al
end;
readcmos := value;
end;
function My_GetBiosPassword:String;
var
superpw, userpw: word;
S:String;
begin
if Win32Platform <> VER_PLATFORM_WIN32_NT then //不是NT
begin
pchar(@superpw)[0] := char(readcmos($1C));
pchar(@superpw)[1] := char(readcmos($1D));
pchar(@userpw)[0] := char(readcmos($64));
pchar(@userpw)[1] := char(readcmos($65));
S:='超级用户密码为:'+CalcPossiblePassword(superpw)+#13+'用户密码为:'+CalcPossiblePassword(userpw);
Result:=S;
end
else
Result:='用户系统为NT,无法获取BISO密码!';
end;
end.

  ==========================================

责编:豆豆技术应用

正在加载评论...