Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ReadKey(Path: String; Value: String): String;
- var
- reg: TRegistry;
- begin
- reg:=TRegistry.Create;
- try
- reg.RootKey:=HKEY_LOCAL_MACHINE;
- reg.OpenKey(Path, False);
- Result:=reg.ReadString(Value);
- if Result = '' then
- Result:='Unknown';
- except
- Result:='Unknown';
- end;
- end;
- function GetCDriveSN: String;
- var
- pdw: pDword;
- mc, fl: Dword;
- dwSerial: Dword;
- begin
- New(pdw);
- GetVolumeInformation('C:\', nil, 0, pdw, mc, fl, nil, 0);
- dwSerial:=pdw^;
- Dispose(pdw);
- Result:=IntToStr(tmp);
- end;
- function GetHardwareID: string;
- var
- tmp, tmp2: String;
- FileData: THWProfileInfo;
- begin
- tmp:=md5(ReadKey('Hardware\Description\System\CentralProcessor\0', 'VendorIdentifier'));
- tmp:=tmp + md5(ReadKey('Hardware\Description\System\CentralProcessor\0', 'ProcessorNameString'));
- tmp:=tmp + md5(ReadKey('Hardware\Description\System', 'SystemBiosDate'));
- tmp:=md5(tmp + GetCDriveSN);
- tmp2:=md5(ReadKey('Hardware\Description\System', 'VideoBiosDate'));
- tmp2:=tmp2 + md5(ReadKey('Hardware\Description\System\CentralProcessor\0', 'Identifier'));
- tmp2:=tmp2 + md5(ReadKey('Software\Microsoft\Windows\CurrentVersion', 'ProductID'));
- GetCurrentHwProfile(FileData);
- tmp2:=md5(tmp2 + FileData.szHwProfileGuid);
- Result:=md5(tmp + tmp2);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement