Π. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎΠ³ΠΎ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΡ Π΄Π»Ρ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ Π΄Π°Π½Π½ΡΡ
MessageDlg ('Π ΡΡΠΎΠΌ ΠΎΠΊΠ½Π΅ Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΡΠΎΠ·Π΄Π°ΡΡ USB-ΠΊΠ»ΡΡ. ΠΠ½ ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΡΡΡ ΠΠ°ΠΌ Π΄Π»Ρ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ ΠΈ ΡΠ°ΡΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ ΡΠ°ΠΉΠ»ΠΎΠ² ΠΈ ΡΠ°ΠΉΠ»ΠΎΠ²ΡΡ ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅ΡΠΎΠ². ΠΠ°ΠΏΠΎΠ»Π½ΠΈΡΠ΅ Π²ΡΠ΅ ΠΏΠΎΠ»Ρ. ΠΠΠΠΠΠΠΠ: Π·Π°ΠΏΠΎΠΌΠ½ΠΈΡΠ΅ Π²Π²Π΅Π΄Π΅Π½Π½ΡΠ΅ ΠΠΠΠΠ ΠΈ ΠΠΠ ΠΠΠ¬ — ΠΎΠ½ΠΈ ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΡΡΡΡ Π΄Π»Ρ Π²Ρ ΠΎΠ΄Π° Π² ΡΠΈΡΡΠ΅ΠΌΡ. ', mtInformation, 0); MessageDlg ('RC6 ' +inttostr (U_key.Key_RC) + ' ' + inttostr (U_key.Key_RC) + ' ' + inttostr (U_key.Key_RC) + ' ' + inttostr… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
Π. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎΠ³ΠΎ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΡ Π΄Π»Ρ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ Π΄Π°Π½Π½ΡΡ (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
unit Unit3;
interface.
uses.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.
Dialogs, StdCtrls, ComCtrls, FileCtrl, CryptoAPI, CRC64, ExtCtrls;
type.
USB_key = record.
Key_RC: Array [1.8] of cardinal; //256bit ΠΊΠ»ΡΡ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ RC6.
Key_IDEA: Array [1.4] of cardinal;//128bit ΠΊΠ»ΡΡ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ IDEA.
Key_CONST: Array [1.4] of cardinal;//128bit Π²Π΅ΠΊΡΠΎΡ ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ.
CRC642: int64; //64bit ΠΊΠΎΠ½Ρ ΡΡΠΌΠΌΠ° ΠΠ’ΠΠ Π«Π’Π«Π₯ ΠΏΠΎΠ»Π΅ΠΉ Π²ΡΡΠ΅.
Key_counter: cardinal; //32bit ΡΡΠ΅ΡΡΠΈΠΊ — ΠΌΠ΅Π½ΡΠ΅ΡΡΡ ΠΊΠ°ΠΆΠ΄ΡΠΉ ΡΠ΅Π°Π½Ρ ΡΠ°Π±ΠΎΡΡ Ρ ΠΊΠ»ΡΡΠΎΠΌ.
data_key: cardinal;//32bit Π΄Π°ΡΠ° ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΊΠ»ΡΡΠ° ΠΠΠΠΠΠ.
Control_hash: string[128]; //512bit.
Familiy: string[60];
Name: string[30];
CRC641: int64;//64.
end;
TForm3 = class (TForm).
Label1: TLabel;
GroupBox1: TGroupBox;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Label4: TLabel;
Edit2: TEdit;
Label5: TLabel;
Edit3: TEdit;
Label6: TLabel;
Edit4: TEdit;
Label7: TLabel;
Edit5: TEdit;
ProgressBar1: TProgressBar;
Button1: TButton;
GroupBox3: TGroupBox;
Label10: TLabel;
DriveComboBox1: TDriveComboBox;
Label11: TLabel;
Image1: TImage;
Procedure WMGetSysCommand (var Message: TMessage); message WM_SYSCOMMAND;
procedure Button1Click (Sender: TObject);
procedure Edit4Change (Sender: TObject);
procedure DriveComboBox1Change (Sender: TObject);
procedure FormCreate (Sender: TObject);
procedure Image1Click (Sender: TObject);
private.
{ Private declarations }.
public.
{ Public declarations }.
end;
var.
Form3: TForm3;
G_numdisk: cardinal;
function CRC64_sum (str: string): int64;
procedure new_yserkey;
function hexTOdec (str: string):cardinal;
implementation.
uses Unit1, Unit2;
{$R *.dfm}.
{======================================}.
function hexTOdec (str: string):cardinal;
CONST HEX: ARRAY['a'.'f'] OF INTEGER = (10,11,12,13,14,15);
VAR.
Int, i: cardinal;
BEGIN.
str:='ffffffff';
Int := 0;
FOR i := 1 TO Length (str) DO.
IF str[i] < 'A' THEN Int := Int * 16 + ORD (str[i]) — 48.
ELSE Int := Int * 16 + HEX[str[i]];
HexToDec:= int;
end;
{======================================}.
function c_GetTempPath: String; //ΠΏΡΡΡ ΠΊ TEMP ΠΏΠ°ΠΏΠΊΠ΅.
var.
Buffer: array[0.1023] of Char;
begin.
SetString (Result, Buffer, GetTempPath (Sizeof (Buffer)-1,Buffer));
end;
{======================================}.
function CRC64_sum (str: string): int64;
var.
InFile: TFileStream;
f1: textfile;
crc: int64;
TempPath: string;
begin.
TempPath:=c_GetTempPath;
assign (f1, TempPath+'+ 'crc.qwl');
rewrite (f1);
write (f1, str);
closefile (f1);
InFile := TFileStream. Create (TempPath+'+ 'crc.qwl', fmShareDenyNone);
crc:=(CRC64Stream (INFILE, SIZEOF (INFILE), 1024));
DeleteFile (TempPath+'+ 'crc.qwl');
CRC64_sum:=crc;
end;
{================}.
procedure new_yserkey;
const.
max = 4 294 967 295;
var.
ret: LongWord;
buffer, d, Control_hash, Lite_key, S_key, str: String;
i: integer;
num_user, pl: cardinal; //Π½ΠΎΠΌΠ΅Ρ ΡΠ·Π΅ΡΠ°.
U_key: USB_key;
Fkey: file of USB_key;
data_: TDateTime;
y, m, day: word; //Π΄Π»Ρ ΠΏΠ΅ΡΠ΅Π²ΠΎΠ΄Π° Π΄Π°ΡΡ Π² ΡΠΈΡΠ»ΠΎ.
begin.
randomize ();
U_key.Key_counter:= Random (max); //ΠΎΠ΄Π½ΠΎΡΠ°Π·ΠΎΠ²ΡΠΉ ΡΡΠ΅ΡΡΠΈΠΊ.
//ΡΠ°Π·ΠΌΠ½ΠΎΠΆΠ°Π΅ΠΌ ΠΈ Π·Π°Π³ΠΎΠ½ΡΠ΅ΠΌ Π² Π±ΡΡΠ΅Ρ: ΠΏΠ°ΡΠΎΠ»Ρ_ΡΠΎΠ»Ρ_id USB.
d:='';
buffer:='';
d:= '76' + Form3. edit4.text + '4387swqsalt_ewui3765_saltvlkskl09' + Form3. edit3.text + '438 7654salt_745 963 765_saltvlkrto743' + inttostr (G_numdisk);
for i:=1 to 765 do.
buffer:= buffer + d;
ret := HashStr (HASH_SHA512, buffer, Control_hash); //.
d:='';
buffer:='';
d:= Form3. edit3.text + '4333salt_OUedie437_saltvlkskl09' + Form3. edit4.text + 'AQQQdkwpsalt_07CNJWEKUEk_saltvdw7DH3' + inttostr (G_numdisk);
for i:=1 to 801 do.
buffer:= buffer + d;
ret := HashStr (HASH_SHA512, buffer, Lite_key); //.
{MessageDlg (Control_hash, mtWarning, [mbOK], 0);
MessageDlg (Lite_key, mtWarning, [mbOK], 0);}.
Randomize ();
U_key.Key_RC[1]: = Random (max);
U_key.Key_RC[2]: = Random (max);
U_key.Key_RC[3]: = Random (max);
U_key.Key_RC[4]: = Random (max);
U_key.Key_RC[5]: = Random (max);
U_key.Key_RC[6]: = Random (max);
U_key.Key_RC[7]: = Random (max);
U_key.Key_RC[8]: = Random (max);
U_key.Key_IDEA[1]: =Random (max);
U_key.Key_IDEA[2]: =Random (max);
U_key.Key_IDEA[3]: =Random (max);
U_key.Key_IDEA[4]: =Random (max);
U_key.Key_CONST[1]: =Random (max);
U_key.Key_CONST[2]: =Random (max);
U_key.Key_CONST[3]: =Random (max);
U_key.Key_CONST[4]: =Random (max);
// MessageDlg ('RC6 ' +inttostr (U_key.Key_RC[1]) + ' ' + inttostr (U_key.Key_RC[2]) + ' ' + inttostr (U_key.Key_RC[3]) + ' ' + inttostr (U_key.Key_RC[4]) + ' ' + inttostr (U_key.Key_RC[5]) + ' ' + inttostr (U_key.Key_RC[6]) + ' ' + inttostr (U_key.Key_RC[7]) + ' ' + inttostr (U_key.Key_RC[8]), mtWarning, [mbOK], 0);
// MessageDlg ('IDEA ' +inttostr (U_key.Key_IDEA[1]) + ' ' + inttostr (U_key.Key_IDEA[2]) + ' ' + inttostr (U_key.Key_IDEA[3]) + ' ' + inttostr (U_key.Key_IDEA[4]), mtWarning, [mbOK], 0);
// MessageDlg ('CONST ' +inttostr (U_key.Key_CONST[1]) + ' ' + inttostr (U_key.Key_CONST[2]) + ' ' +inttostr (U_key.Key_CONST[3]) + ' ' +inttostr (U_key.Key_CONST[4]), mtWarning, [mbOK], 0);
//ΡΡΠΈΡΠ°Π΅ΠΌ CRC64 ΠΎΡ ΠΎΡΠΊΡΡΡΡΡ ΠΊΠ»ΡΡΠ΅ΠΉ ΠΈ Π²Π΅ΠΊΡΠΎΡΠ° ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ:
buffer:='';
for i:=1 to 8 do.
buffer:= buffer + inttostr (U_key.Key_RC[i]);
for i:=1 to 4 do.
buffer:= buffer + inttostr (U_key.Key_IDEA[i]);
for i:=1 to 4 do.
buffer:= buffer + inttostr (U_key.Key_CONST[i]);
U_key.CRC642:= CRC64_sum (buffer);
// MessageDlg (inttostr (U_key.Key_RC[1]) + ' ' + inttostr (U_key.Key_RC[2]) + ' ' + inttostr (U_key.Key_RC[3]) + ' ' + inttostr (U_key.Key_RC[4]) + ' ' + inttostr (U_key.Key_RC[5]) + ' ' + inttostr (U_key.Key_RC[6]) + ' ' + inttostr (U_key.Key_RC[7]) + ' ' + inttostr (U_key.Key_RC[8]), mtWarning, [mbOK], 0);
// MessageDlg (inttostr (U_key.Key_IDEA[1]) + ' ' + inttostr (U_key.Key_IDEA[2]) + ' ' + inttostr (U_key.Key_IDEA[3]) + ' ' + inttostr (U_key.Key_IDEA[4]), mtWarning, [mbOK], 0);
// MessageDlg (inttostr (U_key.Key_CONST[1]) + ' ' + inttostr (U_key.Key_CONST[2]) + ' ' +inttostr (U_key.Key_CONST[3]) + ' ' +inttostr (U_key.Key_CONST[4]), mtWarning, [mbOK], 0);
// MessageDlg (inttostr (U_key.CRC642), mtWarning, [mbOK], 0);
d:='';
buffer:='';
d:= inttostr (U_key.Key_counter) + '56437gc77dg73643276' + Form3. edit3.text + '44322salt_4327h4897d3946f' + Form3. edit4.text + 'Afrejoiewpsalt_04o2hudbuk_salt4222222' + inttostr (G_numdisk);
for i:=1 to 707 do.
buffer:= buffer + d;
ret := HashStr (HASH_SHA512, buffer, S_key); // S_key — ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π΄Π»Ρ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ ΠΏΠ΅ΡΠ²ΠΎΠ³ΠΎ Π±Π»ΠΎΠΊΠ° ΠΊΠ»ΡΡΠ° — ΠΊΠ»ΡΡΠ΅ΠΉ ΠΈ Π²Π΅ΠΊΡΠΎΡΠ° ΠΈΠ½ΠΈΡ.
buffer:=copy (S_key, 1,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[1]: =U_key.Key_RC[1] xor pl;
buffer:=copy (S_key, 8,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[2]: =U_key.Key_RC[2] xor pl;
buffer:=copy (S_key, 16,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[3]: =U_key.Key_RC[3] xor pl;
buffer:=copy (S_key, 24,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[4]: =U_key.Key_RC[4] xor pl;
buffer:=copy (S_key, 32,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[5]: =U_key.Key_RC[5] xor pl;
buffer:=copy (S_key, 40,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[6]: =U_key.Key_RC[6] xor pl;
buffer:=copy (S_key, 48,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[7]: =U_key.Key_RC[7] xor pl;
buffer:=copy (S_key, 56,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_RC[8]: =U_key.Key_RC[8] xor pl;
//MessageDlg (inttostr (U_key.Key_RC[1]) + ' ' + inttostr (U_key.Key_RC[2]) + ' ' + inttostr (U_key.Key_RC[3]) + ' ' + inttostr (U_key.Key_RC[4]) + ' ' + inttostr (U_key.Key_RC[5]) + ' ' + inttostr (U_key.Key_RC[6]) + ' ' + inttostr (U_key.Key_RC[7]) + ' ' + inttostr (U_key.Key_RC[8]), mtWarning, [mbOK], 0);
buffer:=copy (S_key, 64,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_IDEA[1]: =U_key.Key_IDEA[1] xor pl;
buffer:=copy (S_key, 72,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_IDEA[2]: =U_key.Key_IDEA[2] xor pl;
buffer:=copy (S_key, 80,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_IDEA[3]: =U_key.Key_IDEA[3] xor pl;
buffer:=copy (S_key, 88,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_IDEA[4]: =U_key.Key_IDEA[4] xor pl;
// MessageDlg (inttostr (U_key.Key_IDEA[1]) + ' ' + inttostr (U_key.Key_IDEA[2]) + ' ' + inttostr (U_key.Key_IDEA[3]) + ' ' + inttostr (U_key.Key_IDEA[4]), mtWarning, [mbOK], 0);
buffer:=copy (S_key, 96,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_CONST[1]: =U_key.Key_CONST[1] xor pl;
buffer:=copy (S_key, 104,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_CONST[2]: =U_key.Key_CONST[2] xor pl;
buffer:=copy (S_key, 112,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_CONST[3]: =U_key.Key_CONST[3] xor pl;
buffer:=copy (S_key, 120, 8);
pl:= StrToInt ('$'+buffer);
U_key.Key_CONST[4]: =U_key.Key_CONST[4] xor pl;
// ΠΏΠ΅ΡΠ²ΡΠΉ Π±Π»ΠΎΠΊ ΠΊΠ»ΡΡΠ° ΡΡΠΏΠ΅ΡΠ½ΠΎ Π·Π°ΡΠΈΡΡΠΎΠ²Π°Π½! ΠΡ ΠΌΠΎΠ»ΠΎΠ΄ΡΡ!
//ΠΏΠΎΠ»ΡΡΠ°Π΅ΠΌ Π΄Π°ΡΡ.
data_:=Date;
DecodeDate (data_, y, m, day);
if day<10 then str:= str + '0' + inttostr (day);
if m<10 then str:= str + '0' + inttostr (m);
str:= str + inttostr (y);
U_key.data_key:= strtoint (str);
// ΡΠΈΡΡΡΠ΅ΠΌ Π²ΡΠΎΡΡΡ ΡΠ°ΡΡΡ ΠΊΠ»ΡΡΠ°.
// MessageDlg (inttostr (U_key.CRC642), mtWarning, [mbOK], 0);
buffer:=copy (lite_key, 1,8);
pl:= StrToInt ('$'+buffer);
U_key.CRC642:= U_key.CRC642 xor pl;
buffer:=copy (lite_key, 8,8);
pl:= StrToInt ('$'+buffer);
U_key.Key_counter:=U_key.Key_counter xor pl;
buffer:=copy (lite_key, 16,8);
pl:= StrToInt ('$'+buffer);
U_key.data_key :=U_key.data_key xor pl;
//ΡΡΠΈΡΠ°Π΅ΠΌ CRC64 ΠΎΡ 1 ΠΈ 2 ΡΠ°ΡΡΠΈ ΠΊΠ»ΡΡΠ° ΡΠΆΠ΅ Π·Π°ΡΠΈΡΡΠΎΠ²Π°Π½Π½ΡΡ :
buffer:='';
for i:=1 to 8 do.
buffer:= buffer + inttostr (U_key.Key_RC[i]);
for i:=1 to 4 do.
buffer:= buffer + inttostr (U_key.Key_IDEA[i]);
for i:=1 to 4 do.
buffer:= buffer + inttostr (U_key.Key_CONST[i]);
buffer:= buffer + inttostr (U_key.CRC642);
buffer:= buffer + inttostr (U_key.Key_counter);
buffer:= buffer + inttostr (U_key.data_key);
U_key.CRC641:= CRC64_sum (buffer);
//ΡΠΎΠ·Π΄Π°Π΅ΠΌ USB-ΠΊΠ»ΡΡ.
U_key.Control_hash:= Control_hash;
U_key.Familiy:= Form3. Edit1.Text;
U_key.Name:= Form3. Edit2.Text;
//ΠΏΡΠΎΠ²Π΅ΡΠΊΠ°:
{ MessageDlg ('RC6 ' +inttostr (U_key.Key_RC[1]) + ' ' + inttostr (U_key.Key_RC[2]) + ' ' + inttostr (U_key.Key_RC[3]) + ' ' + inttostr (U_key.Key_RC[4]) + ' ' + inttostr (U_key.Key_RC[5]) + ' ' + inttostr (U_key.Key_RC[6]) + ' ' + inttostr (U_key.Key_RC[7]) + ' ' + inttostr (U_key.Key_RC[8]), mtWarning, [mbOK], 0);
MessageDlg ('IDEA ' +inttostr (U_key.Key_IDEA[1]) + ' ' + inttostr (U_key.Key_IDEA[2]) + ' ' + inttostr (U_key.Key_IDEA[3]) + ' ' + inttostr (U_key.Key_IDEA[4]), mtWarning, [mbOK], 0);
MessageDlg ('CONST ' +inttostr (U_key.Key_CONST[1]) + ' ' + inttostr (U_key.Key_CONST[2]) + ' ' +inttostr (U_key.Key_CONST[3]) + ' ' +inttostr (U_key.Key_CONST[4]), mtWarning, [mbOK], 0);
MessageDlg ('CRC2 ' + inttostr (U_key.CRC642), mtWarning, [mbOK], 0);
MessageDlg ('Π‘ΡΠ΅ΡΡΠΈΠΊ ' + inttostr (U_key.Key_counter), mtInformation, [mbOK], 0);
MessageDlg ('ΠΠ°ΡΠ° ' + inttostr (U_key.data_key), mtInformation, [mbOK], 0);
MessageDlg ('Control_hash ' + Control_hash, mtInformation, [mbOK], 0);
MessageDlg ('FAM ' + U_key.Familiy, mtInformation, [mbOK], 0);
MessageDlg ('Name ' + U_key.Name, mtInformation, [mbOK], 0);
MessageDlg ('CRC1 ' + inttostr (U_key.CRC641), mtInformation, [mbOK], 0);
}.
assign (fkey, Form3. drivecombobox1.Drive + ':qwallke.qwkey');
rewrite (fkey);
write (fkey, U_key);
closefile (fkey);
FileSetAttr (Form3.drivecombobox1.Drive + ':qwallke.qwkey', faHidden);
//Π΄Π΅Π»Π°Π΅ΠΌ Π΅Π³ΠΎ Π½Π΅Π²ΠΈΠ΄ΠΈΠΌΡΠΌ.
MessageDlg ('USB-ΠΊΠ»ΡΡ ΡΡΠΏΠ΅ΡΠ½ΠΎ ΡΠΎΠ·Π΄Π°Π½!', mtInformation, [mbOK], 0);
Form2.Timer1.Enabled:=true;
Form2.Show;
Form3.Hide;
end;
{===============}.
procedure TForm3. Button1Click (Sender: TObject);
var.
j: byte;
begin.
j:=0;
if (Length (Edit1.Text)<7) then MessageDlg ('ΠΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° «Π€Π°ΠΌΠΈΠ»ΠΈΡ» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΌΠ΅Π½ΡΡΠ΅ 7 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!', mtWarning, [mbOK], 0).
else if (Length (Edit2.Text)<2) then MessageDlg ('ΠΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° «ΠΠΌΡ» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΌΠ΅Π½ΡΡΠ΅ 2 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!', mtWarning, [mbOK], 0).
else if (Length (Edit5.Text)<8) then MessageDlg ('ΠΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° «ΠΠ°ΡΠΎΠ»Ρ Π΄ΠΎΡΡΡΠΏΠ°» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΌΠ΅Π½ΡΡΠ΅ 8 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!', mtWarning, [mbOK], 0).
else if (Length (Edit4.Text)<8) then MessageDlg ('ΠΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° «ΠΠΎΠ΄ΡΠ²Π΅ΡΠ΄ΠΈΡΠ΅ ΠΏΠ°ΡΠΎΠ»Ρ» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΌΠ΅Π½ΡΡΠ΅ 8 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!', mtWarning, [mbOK], 0).
else if (Length (Edit3.Text)<5) then MessageDlg ('ΠΠΎΠ»Π΅ Π²Π²ΠΎΠ΄Π° «ΠΠΎΠ³ΠΈΠ½» Π½Π΅ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΌΠ΅Π½ΡΡΠ΅ 5 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!', mtWarning, [mbOK], 0).
else if (Edit5.Text Edit4. Text) then MessageDlg ('ΠΠΎΠ΄ΡΠ²Π΅ΡΠΆΠ΄Π΅Π½ΠΈΠ΅ ΠΏΠ°ΡΠΎΠ»Ρ Π½Π΅Π²Π΅ΡΠ½ΠΎ! ΠΠΎΠ²ΡΠΎΡΠΈΡΠ΅ ΠΏΠΎΠΏΡΡΠΊΡ', mtWarning, [mbOK], 0).
else new_yserkey;
end;
{==================================}.
//ΠΏΠ΅ΡΠ΅Ρ Π²Π°ΡΡΠ²Π°Π΅ΠΌ Π·Π°ΠΊΡΡΡΠΈΠ΅ ΡΠΎΡΠΌΡ ΠΈ Π·Π°ΠΊΡΡΠ²Π°Π΅ΠΌ ΠΏΡΠΎΠ³Ρ.
Procedure TForm3. WMGetSysCommand (var Message: TMessage) ;
var.
s: integer;
Begin.
if code=0 then begin.
IF (Message.wParam = SC_MINIMIZE).
Then Form1. Visible:=False;
IF (Message.wParam = SC_CLOSE).
Then begin.
Application.Terminate; end.
Else Inherited;
End;
if (Message.wParam = SC_CLOSE) and (code=1).
Then Form3. Hide;
end;
{======================================}.
procedure TForm3. Edit4Change (Sender: TObject);
var.
str, h: string;
i, k: integer;
begin.
str:=edit4.Text;
k:=0;
for i:=1 to length (str) do begin.
if (copy (str, i, 1)>'A') and (copy (str, i, 1)<'Z') then inc (k);
if (copy (str, i, 1)>'0') and (copy (str, i, 1)<'9') then inc (k);
end;
if length (str)>7 then begin.
//PostMessage (ProgressBar1.Handle, $ 0409, 0, clRed);
//newuser:=true;
progressbar1.Position:=length (str) + k;
//GroupBox3.Enabled:=true;
end;
end;
procedure TForm3. DriveComboBox1Change (Sender: TObject);
var.
SerialNum: dword;
VolumeName, FSName: array [0.255] of char;
MaximumFNameLength,.
FileSystemFlags: dword;
FileEx: boolean;
begin.
GetVolumeInformation (PChar (drivecombobox1.Drive + ':),.
VolumeName, SizeOf (VolumeName),.
@SerialNum,.
MaximumFNameLength,.
FileSystemFlags,.
FSName, SizeOf (FSName));
label11.Caption:= 'ΠΠΌΡ Π΄ΠΈΡΠΊΠ°: ' + VolumeName;
G_numdisk:=SerialNum;//ΡΠ·Π½Π°Π΅ΠΌ id USB.
FileEx:=FileExists (PChar (drivecombobox1.Drive + ': + 'qwallke.qwkey'));
if FileEx=true then begin.
label11.Caption:='ΠΡΠΎΡ USB ΡΠΆΠ΅ ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΊΠ»ΡΡΠΎΠΌ!';
if edit4. text'' then label11. Visible:=true;
label11.Font.Color:=clRed;
Button1.Enabled:=false end.
else begin.
label11.Font.Color:=clBlack;
Button1.Enabled:=true;
end;
end;
{=============================}.
procedure TForm3. FormCreate (Sender: TObject);
var.
i: integer;
DriveType: uInt;
begin.
//newuser:=false;
{ΠΎΡΡΠ°Π²Π»ΡΠ΅ΠΌ ΡΠΎΠ»ΡΠΊΠΎ ΡΠΌΠ΅Π½Π½ΡΠ΅ Π½ΠΎΡΠΈΡΠ΅Π»ΠΈ}.
i := 0;
while i <= Form3. DriveComboBox1.Items.Count — 1 do.
begin.
DriveType := GetDriveType (PChar (Form3.DriveComboBox1.Items[i][1] + ':));
if (DriveType Drive_Removable) then.
Form3.DriveComboBox1.Items.Delete (i).
else.
inc (i);
end;
Form3.button1.Enabled:=false;
end;
procedure TForm3. Image1Click (Sender: TObject);
begin.
MessageDlg ('Π ΡΡΠΎΠΌ ΠΎΠΊΠ½Π΅ Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΡΠΎΠ·Π΄Π°ΡΡ USB-ΠΊΠ»ΡΡ. ΠΠ½ ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΡΡΡ ΠΠ°ΠΌ Π΄Π»Ρ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ ΠΈ ΡΠ°ΡΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ ΡΠ°ΠΉΠ»ΠΎΠ² ΠΈ ΡΠ°ΠΉΠ»ΠΎΠ²ΡΡ ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅ΡΠΎΠ². ΠΠ°ΠΏΠΎΠ»Π½ΠΈΡΠ΅ Π²ΡΠ΅ ΠΏΠΎΠ»Ρ. ΠΠΠΠΠΠΠΠ: Π·Π°ΠΏΠΎΠΌΠ½ΠΈΡΠ΅ Π²Π²Π΅Π΄Π΅Π½Π½ΡΠ΅ ΠΠΠΠΠ ΠΈ ΠΠΠ ΠΠΠ¬ — ΠΎΠ½ΠΈ ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΡΡΡΡ Π΄Π»Ρ Π²Ρ ΠΎΠ΄Π° Π² ΡΠΈΡΡΠ΅ΠΌΡ. ', mtInformation, [mbOK], 0);
end;
end.