Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- c1: array [1..10] of Integer = (51625781,83806911,16019871,48201001,80382130,
- 12595091,44776220,76989181,41383271,73564400);//Любое значение из table_stzatrat2.dbf (ZAT1)
- c2: array [1..10] of Integer = (33358003, 65539132,97752093,29933222,62146183,//аналогичное ро порядк.номеру поля таблицы значение из table_stzatrat2.dbf (ZAT2)
- 94327312, 26508442,58721402,90902532,23115492);
- // Getting HDD SN
- function GetHardDiskSerial(const DriveLetter: Char): string;
- var
- NotUsed: DWORD;
- VolumeFlags: DWORD;
- VolumeInfo: array[0..MAX_PATH] of Char;
- VolumeSerialNumber: DWORD;
- begin
- GetVolumeInformation(PChar(DriveLetter + ':\'),
- nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
- VolumeFlags, nil, 0);
- Result := Format('%8.8X',[VolumeSerialNumber])
- end;
- // Hex value into integer
- function Hex2Int( const Value : String) : Integer;
- var I : Integer;
- begin
- Result := 0;
- I := 1;
- if Value = '' then Exit; {>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
- if Value[ 1 ] = '$' then Inc( I );
- while I <= Length( Value ) do
- begin
- if (Value[ I ] >= '0')
- and (Value[ I ] <= '9') then
- Result := (Result shl 4) or (Ord(Value[I]) - Ord('0'))
- else if (Value[ I ] >= 'A')
- and (Value[ I ] <= 'F') then
- Result := (Result shl 4) or (Ord(Value[I]) - Ord('A') + 10)
- else if (Value[ I ] >= 'a')
- and (Value[ I ] <= 'f') then
- Result := (Result shl 4) or (Ord(Value[I]) - Ord('a') + 10)
- else break;
- Inc( I );
- end;
- end;
- { Generate Serial procedure }
- // Getting HWID
- function getHWID:string;
- var l_sern:Int64;
- begin
- l_sern:=Hex2Int('$'+GetHardDiskSerial('C'));
- if l_sern < 0 then l_sern := 4294967296 +l_sern;
- l_sern:=l_sern+1234567;
- Result := Inttostr(l_sern);
- end;
- function gen(hwid:string):string;
- var
- tyu1:double;
- p1,p2,p3:string;
- i:Byte;
- begin
- tyu1:=StrToFloat(getHWID);
- tyu1 := Trunc((tyu1/3+8754264)/10*1.94 );
- p2 := FloatToStr(tyu1);
- Randomize;i:=Random(10)+1;
- p1:=Inttostr(c1[i]); // value from array c1
- p3:=Inttostr(c2[i]); // value from array c2
- Result:=p1+' '+p2+' '+p3;
- end;
Advertisement
Add Comment
Please, Sign In to add comment