delphi获取主板BIOS的信息

时间:2010-02-11 14:08:46  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:p;  SHA1Context: TSHA1Context;    SHA1Digest: TSHA1Digest;  begin    // Get the BIOS data    SetString(Result, PChar(Ptr($F0000)), $10000);    // Hash the string    SHA1Init(SHA1Context);    SHA1Update(SHA1Context, PChar(Result), Length(Result));
  正文:

1、读取主板序列号
2、AWard BIOS/ target=_blank class=infotextkey>BIOS密码读取
3、读取BIOS信息
4、获取BIOS日期信息

========
1、读取主板序列号

uses SHA1, Base64;

 function GetHashedBiosInfo: string;
 var
   SHA1Context: TSHA1Context;
   SHA1Digest: TSHA1Digest;
 begin
   // Get the BIOS data
   SetString(Result, PChar(Ptr($F0000)), $10000);
   // Hash the string
   SHA1Init(SHA1Context);
   SHA1Update(SHA1Context, PChar(Result), Length(Result));
   SHA1Final(SHA1Context, SHA1Digest);
   SetString(Result, PChar(@SHA1Digest), sizeof(SHA1Digest));
   // Return the hash string encoded in printable characters
   Result := B64Encode(Result);
 end;


 function GetBiosInfoAsText: string;
 var
   p, q: pchar;
 begin
   q := nil;
   p := PChar(Ptr($FE000));
   repeat
     if q <> nil then begin
       if not (p^ in [#10, #13, #32..#126, #169, #184]) then begin
         if (p^ = #0) and (p - q >= 8) then begin
           Result := Result + TrimRight(String(q)) + #13#10;
         end;
         q := nil;
       end;
     end else
       if p^ in [#33..#126, #169, #184] then
         q := p;
     inc(p);
   until p > PChar(Ptr($FFFFF));
   Result := TrimRight(Result);
 end;

 procedure TForm1.FormCreate(Sender: TObject);
 begin
   Memo1.Lines.Text := GetBiosInfoAsText;
 end;

=======www.002pc.com============
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
delphi获取主板BIOS的信息》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/Delphi/12833.html

 1/12    1 2 3 4 5 6 下一页 尾页


关键字:

关于《delphi获取主板BIOS的信息》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td