DimitarSerg

ARM OT

Apr 26th, 2012
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.21 KB | None | 0 0
  1. const
  2.  c1: array [1..10] of Integer = (51625781,83806911,16019871,48201001,80382130,
  3.                  12595091,44776220,76989181,41383271,73564400);//Любое значение из table_stzatrat2.dbf (ZAT1)
  4.  c2: array [1..10] of Integer = (33358003, 65539132,97752093,29933222,62146183,//аналогичное ро порядк.номеру поля таблицы значение из table_stzatrat2.dbf (ZAT2)
  5. 94327312, 26508442,58721402,90902532,23115492);
  6.  
  7. // Getting HDD SN
  8. function GetHardDiskSerial(const DriveLetter: Char): string;
  9. var
  10.   NotUsed:     DWORD;
  11.   VolumeFlags: DWORD;
  12.   VolumeInfo:  array[0..MAX_PATH] of Char;
  13.   VolumeSerialNumber: DWORD;
  14. begin
  15.   GetVolumeInformation(PChar(DriveLetter + ':\'),
  16.     nil, SizeOf(VolumeInfo), @VolumeSerialNumber, NotUsed,
  17.     VolumeFlags, nil, 0);
  18.     Result := Format('%8.8X',[VolumeSerialNumber])
  19. end;
  20.  
  21. // Hex value into integer
  22. function Hex2Int( const Value : String) : Integer;
  23. var I : Integer;
  24. begin
  25.   Result := 0;
  26.   I := 1;
  27.   if Value = '' then Exit; {>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
  28.   if Value[ 1 ] = '$' then Inc( I );
  29.   while I <= Length( Value ) do
  30.   begin
  31.     if  (Value[ I ] >= '0')
  32.     and (Value[ I ] <= '9') then
  33.          Result := (Result shl 4) or (Ord(Value[I]) - Ord('0'))
  34.     else if  (Value[ I ] >= 'A')
  35.     and  (Value[ I ] <= 'F') then
  36.          Result := (Result shl 4) or (Ord(Value[I]) - Ord('A') + 10)
  37.     else if  (Value[ I ] >= 'a')
  38.     and  (Value[ I ] <= 'f') then
  39.          Result := (Result shl 4) or (Ord(Value[I]) - Ord('a') + 10)
  40.     else break;
  41.     Inc( I );
  42.   end;
  43. end;
  44.  
  45. { Generate Serial procedure }
  46.  
  47. // Getting HWID
  48. function getHWID:string;
  49. var l_sern:Int64;
  50. begin
  51.     l_sern:=Hex2Int('$'+GetHardDiskSerial('C'));
  52.     if l_sern < 0 then l_sern := 4294967296 +l_sern;
  53.     l_sern:=l_sern+1234567;
  54.     Result := Inttostr(l_sern);
  55. end;
  56.  
  57. function gen(hwid:string):string;
  58. var
  59. tyu1:double;
  60. p1,p2,p3:string;
  61. i:Byte;
  62. begin
  63.     tyu1:=StrToFloat(getHWID);
  64.     tyu1 := Trunc((tyu1/3+8754264)/10*1.94 );
  65.     p2 := FloatToStr(tyu1);
  66.     Randomize;i:=Random(10)+1;
  67.     p1:=Inttostr(c1[i]); // value from array c1
  68.     p3:=Inttostr(c2[i]); // value from array c2
  69.     Result:=p1+'  '+p2+'  '+p3;
  70. end;
Advertisement
Add Comment
Please, Sign In to add comment