⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 freeotfefrmvolproperties.pas

📁 文件驱动加密,功能强大,可产生加密分区,支持AES,MD2,MD4,MD5MD2, MD4, MD5, RIPEMD-128, RIPEMD-160, SHA-1, SHA-224, SHA-256,
💻 PAS
字号:
unit FreeOTFEfrmVolProperties;
// Description: 
// By Sarah Dean
// Email: sdean12@sdean12.org
// WWW:   http://www.FreeOTFE.org/
//
// -----------------------------------------------------------------------------
//


interface                          

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,
  OTFEFreeOTFE_U;

type
  TfrmFreeOTFEVolProperties = class(TForm)
    pbOK: TButton;
    Label15: TLabel;
    Label22: TLabel;
    Label5: TLabel;
    Label7: TLabel;
    Label6: TLabel;
    edDrive: TEdit;
    edDeviceName: TEdit;
    edVolumeFile: TEdit;
    edReadOnly: TEdit;
    edMainCypher: TEdit;
    pbInfoMainCypher: TButton;
    pbInfoIVHash: TButton;
    lblIVHash: TLabel;
    edIVHash: TEdit;
    Label2: TLabel;
    edSectorIVGenMethod: TEdit;
    pbInfoIVCypher: TButton;
    edIVCypher: TEdit;
    lblIVCypher: TLabel;
    procedure FormShow(Sender: TObject);
    procedure pbInfoIVHashClick(Sender: TObject);
    procedure pbInfoMainCypherClick(Sender: TObject);
    procedure pbInfoIVCypherClick(Sender: TObject);
  private
    { Private declarations }
  public
    DriveLetter: char;
    OTFEFreeOTFE: TOTFEFreeOTFE;
  end;

implementation

{$R *.DFM}


uses
  ActiveX,  // Required for IsEqualGUID
  ComObj,  // Required for StringToGUID
  OTFEFreeOTFE_DriverAPI;  // Required for NULL_GUID


procedure TfrmFreeOTFEVolProperties.FormShow(Sender: TObject);
var
  volumeInfo: TOTFEFreeOTFEVolumeInfo;
  hashDetails: TFreeOTFEHash;
  cypherDetails: TFreeOTFECypher;
begin
  edDrive.text := DriveLetter+':';

  edVolumeFile.text := '<Unknown>';
  edReadOnly.text   := '<Unknown>';
  edIVHash.text     := '<Unknown>';
  edIVCypher.text   := '<Unknown>';
  edMainCypher.text := '<Unknown>';
  edDeviceName.text := '<Unknown>';
  edSectorIVGenMethod.Text := '<Unknown>';

  lblIVHash.Enabled    := FALSE;
  edIVHash.Enabled     := FALSE;
  pbInfoIVHash.Enabled := FALSE;
  
  lblIVCypher.Enabled    := FALSE;
  edIVCypher.Enabled     := FALSE;
  pbInfoIVCypher.Enabled := FALSE;


  if OTFEFreeOTFE.GetVolumeInfo(DriveLetter, volumeInfo) then
    begin
    edVolumeFile.text := volumeInfo.Filename;
    if volumeInfo.ReadOnly then
      begin
      edReadOnly.text := 'Readonly';
      end
    else
      begin
      edReadOnly.text := 'Read/write';
      end;


    edSectorIVGenMethod.Text := FreeOTFESectorIVGenMethodTitle[volumeInfo.SectorIVGenMethod];


    if (
        (volumeInfo.IVHashDevice = '') and
        IsEqualGUID(volumeInfo.IVHashGUID, StringToGUID(NULL_GUID))
       ) then
      begin
      edIVHash.Text := 'n/a';
      end
    else
      begin
      lblIVHash.Enabled    := TRUE;
      edIVHash.Enabled     := TRUE;
      pbInfoIVHash.Enabled := TRUE;

      if OTFEFreeOTFE.GetSpecificHashDetails(
                                             volumeInfo.IVHashDevice,
                                             volumeInfo.IVHashGUID,
                                             hashDetails
                                            ) then
        begin
        edIVHash.Text := OTFEFreeOTFE.GetHashDisplayTitle(hashDetails);
        end;

      end;



    if (
        (volumeInfo.IVCypherDevice = '') and
        IsEqualGUID(volumeInfo.IVCypherGUID, StringToGUID(NULL_GUID))
       ) then
      begin
      edIVCypher.Text := 'n/a';
      end
    else
      begin
      lblIVCypher.Enabled    := TRUE;
      edIVCypher.Enabled     := TRUE;
      pbInfoIVCypher.Enabled := TRUE;

      if OTFEFreeOTFE.GetSpecificCypherDetails(
                                             volumeInfo.IVCypherDevice,
                                             volumeInfo.IVCypherGUID,
                                             cypherDetails
                                            ) then
        begin
        edIVCypher.Text := OTFEFreeOTFE.GetCypherDisplayTitle(cypherDetails);
        end;

      end;



    if OTFEFreeOTFE.GetSpecificCypherDetails(
                                             volumeInfo.MainCypherDevice,
                                             volumeInfo.MainCypherGUID,
                                             cypherDetails
                                            ) then
      begin
      edMainCypher.Text := OTFEFreeOTFE.GetCypherDisplayTitle(cypherDetails);
      end;

    edDeviceName.text := volumeInfo.DeviceName;
    end
  else
    begin
    showmessage('Unable to get drive properties for drive '+DriveLetter+':');
    end;

end;


procedure TfrmFreeOTFEVolProperties.pbInfoIVHashClick(Sender: TObject);
var
  volumeInfo: TOTFEFreeOTFEVolumeInfo;
begin
  if OTFEFreeOTFE.GetVolumeInfo(DriveLetter, volumeInfo) then
    begin
    OTFEFreeOTFE.ShowHashDetailsDlg(volumeInfo.IVHashDevice, volumeInfo.IVHashGUID);
    end;

end;

procedure TfrmFreeOTFEVolProperties.pbInfoMainCypherClick(Sender: TObject);
var
  volumeInfo: TOTFEFreeOTFEVolumeInfo;
begin
  if OTFEFreeOTFE.GetVolumeInfo(DriveLetter, volumeInfo) then
    begin
    OTFEFreeOTFE.ShowCypherDetailsDlg(volumeInfo.MainCypherDevice, volumeInfo.MainCypherGUID);
    end;

end;

procedure TfrmFreeOTFEVolProperties.pbInfoIVCypherClick(Sender: TObject);
var
  volumeInfo: TOTFEFreeOTFEVolumeInfo;
begin
  if OTFEFreeOTFE.GetVolumeInfo(DriveLetter, volumeInfo) then
    begin
    OTFEFreeOTFE.ShowCypherDetailsDlg(volumeInfo.IVCypherDevice, volumeInfo.IVCypherGUID);
    end;

end;

END.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -