delphi获取主板BIOS的信息-Delphi教程-第二电脑网

  第二电脑网导读: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密码读取
3、读取信息
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的信息-Delphi教程-第二电脑网】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——