Commits

reiniero  committed 235befb

Initial commit of blume's original diskbuddy 0.6 source dated 22 June 2011

  • Participants

Comments (0)

Files changed (145)

+object AboutForm: TAboutForm
+  Left = 197
+  Top = 771
+  BorderIcons = [biSystemMenu]
+  BorderStyle = bsSingle
+  Caption = 'About'
+  ClientHeight = 264
+  ClientWidth = 308
+  Color = clBtnFace
+  Font.Charset = ANSI_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'Verdana'
+  Font.Style = []
+  OldCreateOrder = False
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Shape1: TShape
+    Left = 65
+    Top = 0
+    Width = 244
+    Height = 216
+    Pen.Color = clWhite
+  end
+  object Shape2: TShape
+    Left = 0
+    Top = 0
+    Width = 64
+    Height = 217
+    Brush.Color = clInactiveCaption
+    Pen.Color = clSkyBlue
+    Pen.Style = psClear
+    Pen.Width = 0
+  end
+  object AppNameLabel: TLabel
+    Left = 124
+    Top = 7
+    Width = 120
+    Height = 23
+    Caption = 'Disk Buddy'
+    Color = clWhite
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -19
+    Font.Name = 'Verdana'
+    Font.Style = [fsBold]
+    ParentColor = False
+    ParentFont = False
+  end
+  object Label1: TLabel
+    Left = 109
+    Top = 129
+    Width = 151
+    Height = 13
+    Caption = #169'2003-2005 Miika Sihvola'
+    Color = clWhite
+    ParentColor = False
+  end
+  object VersionLabel: TLabel
+    Left = 103
+    Top = 33
+    Width = 157
+    Height = 13
+    Alignment = taCenter
+    Caption = 'version 0.6 - 22. June 2011'
+    Color = clWhite
+    ParentColor = False
+  end
+  object Label2: TLabel
+    Left = 99
+    Top = 145
+    Width = 171
+    Height = 13
+    Cursor = crArrow
+    Caption = 'smiika@mbnet.fi (abondoned)'
+    Color = clWhite
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clBlack
+    Font.Height = -11
+    Font.Name = 'Verdana'
+    Font.Style = []
+    ParentColor = False
+    ParentFont = False
+  end
+  object Label4: TLabel
+    Left = 154
+    Top = 113
+    Width = 60
+    Height = 13
+    Caption = 'Started by'
+    Color = clWhite
+    ParentColor = False
+  end
+  object Label5: TLabel
+    Left = 146
+    Top = 176
+    Width = 76
+    Height = 13
+    Alignment = taRightJustify
+    Caption = 'Continued by'
+    Color = clWhite
+    ParentColor = False
+  end
+  object Label6: TLabel
+    Left = 113
+    Top = 192
+    Width = 143
+    Height = 13
+    Cursor = crArrow
+    Alignment = taRightJustify
+    Caption = 'free.pages.at/blumetools'
+    Color = clWhite
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clBlue
+    Font.Height = -11
+    Font.Name = 'Verdana'
+    Font.Style = []
+    ParentColor = False
+    ParentFont = False
+    OnClick = Label6Click
+    OnMouseEnter = HighLightEnter
+    OnMouseLeave = HighLightLeave
+  end
+  object Bevel1: TBevel
+    Left = -3
+    Top = 216
+    Width = 314
+    Height = 2
+  end
+  object Label8: TLabel
+    Left = 100
+    Top = 68
+    Width = 168
+    Height = 26
+    Alignment = taCenter
+    Caption = 'This is freeware and comes without any kind of warranty.'
+    Color = clWhite
+    ParentColor = False
+    WordWrap = True
+  end
+  object Button1: TButton
+    Left = 210
+    Top = 230
+    Width = 75
+    Height = 23
+    Caption = 'OK'
+    ModalResult = 1
+    TabOrder = 0
+  end
+end
+unit About;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, ExtCtrls, ShellAPI;
+
+type
+  TAboutForm = class(TForm)
+    Button1: TButton;
+    Shape2: TShape;
+    AppNameLabel: TLabel;
+    Label1: TLabel;
+    VersionLabel: TLabel;
+    Label2: TLabel;
+    Shape1: TShape;
+    Label4: TLabel;
+    Label5: TLabel;
+    Label6: TLabel;
+    Bevel1: TBevel;
+    Label8: TLabel;
+    procedure HighLightEnter(Sender: TObject);
+    procedure HighLightLeave(Sender: TObject);
+    procedure Label6Click(Sender: TObject);
+  end;
+
+var
+  AboutForm: TAboutForm;
+
+implementation
+
+{$R *.dfm}
+
+procedure TAboutForm.HighLightEnter(Sender: TObject);
+begin
+TLabel(Sender).Font.Color := clSkyBlue;
+end;
+
+procedure TAboutForm.HighLightLeave(Sender: TObject);
+begin
+TLabel(Sender).Font.Color := clBlue;
+end;
+
+procedure TAboutForm.Label6Click(Sender: TObject);
+begin
+ShellExecute(Handle,'open','http://free.pages.at/blumetools/','','',1);
+end;
+
+end.

File BetterProgressBar.pas

+unit BetterProgressBar;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
+  ComCtrls;
+
+type
+  TBetterProgressBar = class(TProgressBar)
+  private
+    { Private declarations }
+    procedure Calculate;
+//    property Max;
+//    property Min;
+  protected
+    { Protected declarations }
+
+    fMax : LongInt;
+    fPos : LongInt;
+
+    procedure SetRange(R : LongInt);
+    function  GetRange : LongInt;
+
+    procedure SetPos(Pos : LongInt);
+    function  GetPos : LongInt;
+
+  public
+   constructor Create(AOwner: TComponent); override;
+   procedure StepIt;
+    { Public declarations }
+  published
+    { Published declarations }
+    property Range : LongInt read GetRange write SetRange;
+    property LPosition : LongInt read GetPos write SetPos;
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  RegisterComponents('Samples', [TBetterProgressBar]);
+end;
+
+constructor TBetterProgressBar.Create(AOwner: TComponent);
+begin
+   inherited Create(AOwner);
+   inherited Max := 32768;
+   inherited Min := 0;
+   fMax := 100;
+   fPos := 0;
+end;
+
+procedure TBetterProgressBar.SetRange(R : LongInt);
+begin
+   fMax := R;
+   Calculate;
+end;
+
+function TBetterProgressBar.GetRange : LongInt;
+begin
+   Result := fMax;
+end;
+
+procedure TBetterProgressBar.SetPos(Pos : LongInt);
+begin
+   fPos := Pos;
+   Calculate;
+end;
+
+function TBetterProgressBar.GetPos : LongInt;
+begin
+   Result := fPos;
+end;
+
+procedure TBetterProgressBar.Calculate;
+begin
+   if fMax > 32768 then
+   begin
+      inherited Max := 32768;
+      inherited Position := Round((fPos * 32768.0) / fMax);
+   end
+   else
+   begin
+      inherited Max := fMax;
+      inherited Position := fPos;
+   end;
+end;
+
+procedure TBetterProgressBar.StepIt;
+begin
+   fPos := fPos + Step;
+   Calculate;
+//   Refresh;
+end;
+
+end.

File DiskBuddy.dpr

+program DiskBuddy;
+
+uses
+  Forms,
+  Main in 'Main.pas' {MainForm},
+  Disks in 'Disks.pas',
+  DiskName in 'DiskName.pas',
+  NTFS in 'NTFS.pas',
+  FAT32 in 'FAT32.pas',
+  Ext2 in 'Ext2.pas',
+  DiskProp in 'DiskProp.pas',
+  FAT32Props in 'FAT32Props.pas' {FAT32PropsForm},
+  NTFSProps in 'NTFSProps.pas' {NTFSPropsForm},
+  FAT32Browse in 'FAT32Browse.pas' {FAT32BrowseForm},
+  FAT32FileProps in 'FAT32FileProps.pas' {FAT32FilePropsForm},
+  NTFSBrowse in 'NTFSBrowse.pas' {NTFSBrowseForm},
+  NTFSMFT in 'NTFSMFT.pas' {NTFSMFTForm},
+  About in 'About.pas' {AboutForm},
+  NTFSSearch in 'NTFSSearch.pas' {NTFSSearchForm},
+  FAT32Search in 'FAT32Search.pas' {FAT32SearchForm},
+  NTFSAttrDef in 'NTFSAttrDef.pas' {NTFSAttrDefForm},
+  progressbar in 'progressbar.pas' {ProgressWin},
+  DiskEdit in 'DiskEdit.pas' {DiskEditor},
+  MPHexEditor in '..\_components\mphexedit\vcl\mphexeditor.pas',
+  TemplateFormular in 'TemplateFormular.pas' {ActionForm};
+
+// { TActionForm } ;
+
+{$R *.res}
+
+begin
+  Application.Initialize;
+  Application.Title := 'DiskBuddy 0.6'; //sVersionInfo;
+  //Application.Title := sVersionInfo;
+  Application.CreateForm(TMainForm, MainForm);
+  Application.CreateForm(TProgressWin, ProgressWin);
+  Application.Run;
+end.

File DiskEdit.dfm

+object DiskEditor: TDiskEditor
+  Left = 232
+  Top = 377
+  Width = 705
+  Height = 531
+  Caption = 'Disk Editor'
+  Color = clBtnFace
+  Font.Charset = ANSI_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'Verdana'
+  Font.Style = []
+  OldCreateOrder = False
+  Position = poDefaultPosOnly
+  ShowHint = True
+  Visible = True
+  PixelsPerInch = 96
+  TextHeight = 13
+  object StatusBar1: TStatusBar
+    Left = 0
+    Top = 482
+    Width = 697
+    Height = 19
+    Panels = <
+      item
+        Text = 'Disk'
+        Width = 200
+      end
+      item
+        Text = 'Partition'
+        Width = 200
+      end
+      item
+        Text = 'Cluster'
+        Width = 150
+      end
+      item
+        Text = 'Pos'
+        Width = 120
+      end>
+    ParentFont = True
+    UseSystemFont = False
+  end
+  object CoolBar1: TCoolBar
+    Left = 0
+    Top = 0
+    Width = 697
+    Height = 29
+    AutoSize = True
+    Bands = <
+      item
+        Control = ToolBar1
+        ImageIndex = -1
+        Width = 693
+      end>
+    object ToolBar1: TToolBar
+      Left = 9
+      Top = 0
+      Width = 680
+      Height = 25
+      Caption = 'ToolBar1'
+      EdgeBorders = []
+      Flat = True
+      Images = ImageList1
+      TabOrder = 0
+      object ToolButton1: TToolButton
+        Left = 0
+        Top = 0
+        Hint = 'Previous Sector'
+        ImageIndex = 0
+        OnClick = ToolButton1Click
+      end
+      object ToolButton2: TToolButton
+        Left = 23
+        Top = 0
+        Hint = 'Next Sector'
+        Caption = 'ToolButton2'
+        ImageIndex = 1
+        OnClick = ToolButton2Click
+      end
+      object ToolButton4: TToolButton
+        Left = 46
+        Top = 0
+        Hint = 'Go to specified Sector ...'
+        Caption = 'ToolButton4'
+        ImageIndex = 2
+        OnClick = ToolButton4Click
+      end
+      object ToolButton8: TToolButton
+        Left = 69
+        Top = 0
+        Hint = 'Go to specified BytePosition ...'
+        Caption = 'BytePosition'
+        ImageIndex = 2
+        OnClick = ToolButton8Click
+      end
+      object ToolButton5: TToolButton
+        Left = 92
+        Top = 0
+        Hint = 'Beginning of Volume'
+        Caption = 'ToolButton5'
+        ImageIndex = 3
+        OnClick = ToolButton5Click
+      end
+      object ToolButton3: TToolButton
+        Left = 115
+        Top = 0
+        Hint = 'End of Volume'
+        Caption = 'ToolButton3'
+        ImageIndex = 4
+        OnClick = ToolButton3Click
+      end
+      object ToolButton6: TToolButton
+        Left = 138
+        Top = 0
+        Width = 8
+        Caption = 'ToolButton6'
+        ImageIndex = 5
+        Style = tbsSeparator
+      end
+      object ToolButton7: TToolButton
+        Left = 146
+        Top = 0
+        Hint = 'Save this sector to a file'
+        Caption = 'ToolButton7'
+        ImageIndex = 5
+        OnClick = ToolButton7Click
+      end
+    end
+  end
+  object Editor: TMPHexEditor
+    Left = 0
+    Top = 29
+    Width = 697
+    Height = 453
+    Cursor = crIBeam
+    Align = alClient
+    Font.Charset = OEM_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -12
+    Font.Name = 'Terminal'
+    Font.Style = [fsBold]
+    ParentFont = False
+    TabOrder = 2
+    BytesPerRow = 16
+    Translation = tkAsIs
+    OffsetFormat = '-!10:0x|'
+    Colors.Background = clWindow
+    Colors.ChangedBackground = 11075583
+    Colors.ChangedText = clMaroon
+    Colors.CursorFrame = clNavy
+    Colors.Offset = clBlack
+    Colors.OddColumn = clBlue
+    Colors.EvenColumn = clNavy
+    Colors.CurrentOffsetBackground = clBtnShadow
+    Colors.OffsetBackground = clBtnFace
+    Colors.CurrentOffset = clBtnHighlight
+    Colors.Grid = clBtnFace
+    Colors.NonFocusCursorFrame = clAqua
+    Colors.ActiveFieldBackground = clWindow
+    FocusFrame = True
+    AllowInsertMode = False
+    DrawGridLines = False
+    Version = 'september 30, 2007; '#169' markus stephany, vcl[at]mirkes[dot]de'
+  end
+  object ImageList1: TImageList
+    Left = 10
+    Top = 52
+    Bitmap = {
+      494C010106000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+      0000000000003600000028000000400000003000000001002000000000000030
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000009400000094000000000000000000848452007B7B
+      52008484840084848400848484007B7B7B007B7B7B0073737300737373006B6B
+      6B006B6B6B007B7B4A007B7B4A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000009400000000000000000000000000000000
+      0000000000000000000000009400000094000000000084845200848452007B7B
+      52008C8C8C008C8C8C0084848400848484007B7B7B007B7B7B009C9C9C009C9C
+      9C00737373007B7B4A007B7B4A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000009400000094000000000000000000000000
+      0000000000000000000000008C0000009400000000008C8C5A00848452008484
+      5200949494008C8C8C008C8C8C0084848400848484007B7B7B00A5A5A5009C9C
+      9C00737373007B7B4A0073734A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000009C00000094000000940000000000000000
+      0000000000000000000000008C0000009400000000008C8C5A008C8C5A008484
+      52009494940094949400949494008C8C8C008C8C8C0084848400ADADAD00A5A5
+      A5007B7B7B007B7B4A0073734A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000009C0000009C000000940000009400000000
+      0000000000000000000000008C0000009400000000008C945A008C8C5A008484
+      5A00949494009494940094949400949494008C8C8C008C8C8C00848484008484
+      84007B7B7B007B7B4A0073734A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000BD000000BD000000BD000000B5
+      000000B5000000AD000000AD000000A5000000A50000009C0000009C00000094
+      00000000000000000000000094000000940000000000949463008C945A008C8C
+      5A00848452008484520084845200848452008484520084845200848452007B7B
+      52007B7B52007B7B52007B7B4A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000C6000000C6000000BD000000BD
+      000000BD000000BD000000B5000000AD000000AD000000A5000000A50000009C
+      0000009C00000000000000009400000094000000000094946300949463008C94
+      5A008C8C5A008C8C5A0084845A0084845A0084845A008C8C5A0084845A008484
+      5200848452007B7B52007B7B5200000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000C6000000C6000000C6000000C6
+      000000C6000000C6000000BD000000B5000000B5000000AD000000AD000000A5
+      000000A500000000000000009C000000940000000000949C6300949463009494
+      6300ADADAD00ADADAD00A5A5A5009C9C9C00949494008C8C8C008C8C8C008C8C
+      8C0084845200848452007B7B5200000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000CE000000CE000000CE000000CE
+      000000CE000000CE000000C6000000C6000000BD000000B5000000B5000000AD
+      000000000000000000000000A50000009C00000000009C9C6300949C63009494
+      6300B5B5B500B5B5B500ADADAD00A5A5A5009C9C9C00949494008C8C8C008C8C
+      8C008C8C5A008484520084845200000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000C6000000C6000000BD000000BD00000000
+      000000000000000000000000A5000000A500000000009C9C63009C9C63009494
+      6300BDBDBD00BDBDBD00B5B5B500ADADAD00A5A5A5009C9C9C00949494009494
+      94008C8C5A008C8C5A0084845200000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000CE000000CE000000C60000000000000000
+      000000000000000000000000AD000000A500000000009C9C63009C9C6300949C
+      6300C6C6C600C6C6C600BDBDBD00B5B5B500ADADAD00A5A5A5009C9C9C009C9C
+      9C0094945A008C8C5A008C8C5A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000CE000000CE000000000000000000000000
+      000000000000000000000000AD000000AD00000000009C9C63009C9C63009C9C
+      6300CECECE00CECECE00C6C6C600BDBDBD00B5B5B500ADADAD00A5A5A500A5A5
+      A500949463008C945A008C8C5A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000CE00000000000000000000000000000000
+      000000000000000000000000B5000000AD00000000009C9C63009C9C63009C9C
+      6300CECECE00CECECE00CECECE00C6C6C600BDBDBD00B5B5B500ADADAD00ADAD
+      AD0094946300A5A5A5008C8C5A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000B5000000B500000000009C9C63009C9C6300949C
+      6300D6D6D600D6D6D600CECECE00CECECE00C6C6C600BDBDBD00B5B5B500ADAD
+      AD009494630094945A008C945A00000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000AD000000A500000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000940000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000940000000000000000
+      000000000000000000000000000000000000000000000000000000000000009C
+      0000000000000000000000000000000000000000000000000000000000000000
+      FF000000FF000000000000000000000000000000AD000000A500000000000000
+      000000000000000000000000000000000000008C000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000009C000000940000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000000000000000008C0000008C00000000
+      000000000000000000000000000000000000000000000000000000000000009C
+      0000009C00000000000000000000000000000000000000000000000000000000
+      FF000000FF000000000000000000000000000000AD000000AD00000000000000
+      000000000000000000000000000000940000008C000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000A50000009C000000940000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000940000008C0000008C
+      00000000000000000000000000000000000000000000000000000000000000A5
+      0000009C00000094000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000B5000000B500000000000000
+      000000000000000000000094000000940000008C000000000000000000000000
+      00000000000000000000000000000000000000000000000000000000000000AD
+      000000AD000000A50000009C0000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000000000000094000000940000008C
+      0000008C000000000000000000000000000000000000000000000000000000A5
+      0000009C0000009C000000940000000000000000000000000000000000000000
+      8C0000008C000000000000000000000000000000BD000000B500000000000000
+      00000000000000A50000009C0000009C00000094000000000000000000000000
+      000000000000000000000000000000000000000000000000000000BD000000B5
+      000000B5000000AD000000A50000009C0000009C000000940000009400000094
+      00000094000000940000009400000094000000BD000000BD000000B5000000B5
+      000000B5000000AD000000AD000000A5000000A50000009C0000009C00000094
+      0000008C0000008C0000000000000000000000BD000000BD000000B5000000AD
+      000000A50000009C0000009C0000009400000000000000000000000000000000
+      8C00000094000000000000000000000000000000BD000000BD00000000000000
+      000000B5000000AD000000A5000000A50000009C000000940000009400000094
+      000000940000008C0000008C0000009400000000000000C6000000C6000000BD
+      000000BD000000B5000000AD000000AD000000A50000009C0000009C0000009C
+      000000940000009C0000009400000094000000BD000000BD000000BD000000BD
+      000000BD000000B5000000B5000000AD000000AD000000A5000000A50000009C
+      00000094000000940000009400000000000000C6000000C6000000BD000000B5
+      000000AD000000AD000000A50000009C0000009C000000000000000000000000
+      9400000094000000940000000000000000000000C6000000C6000000000000BD
+      000000B5000000B5000000AD000000AD000000A50000009C0000009C0000009C
+      0000009400000094000000940000009400000000000000CE000000CE000000C6
+      000000C6000000BD000000B5000000B5000000AD000000A5000000A5000000A5
+      0000009C0000009C0000009C0000009C000000C6000000C6000000C6000000C6
+      000000C6000000BD000000BD000000BD000000B5000000AD000000AD000000A5
+      0000009C0000009C0000009400000000000000CE000000C6000000C6000000BD
+      000000B5000000B5000000AD000000A5000000A5000000000000000000000000
+      000000009C0000009C0000009C00000000000000C6000000C6000000000000C6
+      000000BD000000BD000000B5000000B5000000AD000000A5000000A5000000A5
+      0000009C0000009C0000009C0000009C0000000000000000000000CE000000CE
+      000000CE000000C6000000BD000000BD000000B5000000B5000000AD000000AD
+      000000A5000000A5000000A5000000A5000000C6000000CE000000CE000000CE
+      000000CE000000C6000000C6000000C6000000BD000000B5000000B5000000AD
+      000000A5000000A50000000000000000000000CE000000CE000000CE000000C6
+      000000BD000000BD000000B5000000AD00000000000000000000000000000000
+      00000000000000009C0000009C0000009C000000CE000000CE00000000000000
+      000000C6000000C6000000BD000000BD000000B5000000B5000000AD000000AD
+      000000A5000000A5000000A5000000A5000000000000000000000000000000D6
+      000000CE000000CE000000C60000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000BD000000BD000000B5
+      000000AD000000000000000000000000000000000000000000000000000000CE
+      000000C6000000C6000000BD0000000000000000B5000000AD00000000000000
+      000000000000000000000000A5000000A5000000CE000000CE00000000000000
+      00000000000000CE000000C6000000C6000000BD000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000CE000000CE000000CE0000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000C6000000BD000000BD
+      00000000000000000000000000000000000000000000000000000000000000CE
+      000000CE000000C6000000000000000000000000BD000000B5000000B5000000
+      000000000000000000000000A5000000A5000000CE000000CE00000000000000
+      0000000000000000000000CE000000C6000000C6000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000CE000000CE0000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000C6000000C600000000
+      00000000000000000000000000000000000000000000000000000000000000D6
+      000000CE0000000000000000000000000000000000000000BD000000BD000000
+      B5000000B5000000AD000000AD00000000000000CE000000CE00000000000000
+      000000000000000000000000000000C6000000C6000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000CE0000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000C60000000000000000
+      00000000000000000000000000000000000000000000000000000000000000CE
+      00000000000000000000000000000000000000000000000000000000BD000000
+      BD000000B5000000B50000000000000000000000CE000000CE00000000000000
+      00000000000000000000000000000000000000C6000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000C6000000C600000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      000000000000000000000000000000000000424D3E000000000000003E000000
+      2800000040000000300000000100010000000000800100000000000000000000
+      000000000000000000000000FFFFFF0000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      0000000000000000000000000000000000000000000000000000000000000000
+      00000000000000000000000000000000FFFFFFFF00000000FFFCC00100000000
+      FEFC800100000000FE7C800100000000FE3C800100000000FE1C800100000000
+      000C80010000000000048001000000000004800100000000000C800100000000
+      FE1C800100000000FE3C800100000000FE7C800100000000FEFC800100000000
+      FFFC800100000000FFFFFFFF00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF3FFF
+      FDFFFFBFEFE73F7FF9FFFF9FE7E73E7FF1FFFF8FE3FF3C7FE1FFFF87E1E7387F
+      C000000300E7300080000001006320008000000100712000C000000300F83000
+      E1FFFF87E13C387FF1FFFF8FE31C3C7FF9FFFF9FE7813E7FFDFFFFBFEFC33F7F
+      FFFFFFFFFFFF3FFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
+      000000000000}
+  end
+  object SaveDialog1: TSaveDialog
+    Left = 10
+    Top = 86
+  end
+end

File DiskEdit.pas

+unit DiskEdit;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, ComCtrls, ToolWin, ImgList, Grids, ExtCtrls, StdCtrls,
+  MPHexEditor, Disks;
+
+  //FMaskedChars := [#255];  // in MPHexEditor.PAS
+
+type
+  TDiskEditor = class(TForm)
+		StatusBar1: TStatusBar;
+		CoolBar1: TCoolBar;
+		ToolBar1: TToolBar;
+		ToolButton1: TToolButton;
+		ToolButton2: TToolButton;
+		ImageList1: TImageList;
+		ToolButton4: TToolButton;
+		ToolButton5: TToolButton;
+		ToolButton3: TToolButton;
+		ToolButton6: TToolButton;
+		ToolButton7: TToolButton;
+		Editor: TMPHexEditor;
+    SaveDialog1: TSaveDialog;
+		procedure ToolButton7Click(Sender: TObject);
+		procedure ToolButton4Click(Sender: TObject);
+		procedure ToolButton2Click(Sender: TObject);
+		procedure ToolButton1Click(Sender: TObject);
+		procedure ToolButton5Click(Sender: TObject);
+		procedure ToolButton3Click(Sender: TObject);
+    procedure ToolButton8Click(Sender: TObject);
+		procedure UpdateSec;
+  public
+    Disk    : TDisk;
+    PartInfo: TPartInfo;
+    Partition :boolean;
+  	CurSec: Integer;
+  	MinSec: Integer;
+  	MaxSec: Integer;
+    BytesPerSector: Integer;
+    BytesPerCluster: Integer;
+  	SecBuf: array [0..511] of Byte;
+  end;
+
+var DiskEditor: TDiskEditor;
+
+implementation
+
+{$R *.dfm}
+
+uses main;
+
+procedure TDiskEditor.ToolButton7Click(Sender: TObject);
+var M           : TMemoryStream;
+    bytesPerSec : Int64;
+begin
+  //SaveDialog1.FileName:='hd'+inttostr(Disk.Number)+
+  //Disk.;
+  //partinfo.
+  if SaveDialog1.Execute then
+  begin
+    M := TMemoryStream.Create;
+    Disk.Position := Int64(CurSec) * Int64(512);
+    M.CopyFrom(Disk,512);
+    M.SaveToFile(SaveDialog1.FileName);
+    M.Free;
+  end;
+end;
+
+procedure TDiskEditor.UpdateSec;
+var M           : TMemoryStream;
+    bytesPerSec : Int64;
+begin
+  M := TMemoryStream.Create;
+  Disk.Position := Int64(CurSec) * Int64(512);
+  M.CopyFrom(Disk,512);
+  Editor.LoadFromStream(M);
+  M.Free;
+
+  bytesPerSec := Disk.Size div Disk.TotalSectors;
+  StatusBar1.Panels[0].Text := 'DiskSect: ' + IntToStr( CurSec ) +
+                               ' ('         + IntToStr( CurSec*bytesPerSec ) + ')';
+  							               //' (0x'     + IntToHex(CurSec,8) + ')';
+  StatusBar1.Panels[1].Text := 'PartSect: ' + IntToStr( CurSec - MinSec ) +
+                               ' ('         + IntToStr((CurSec - MinSec )*bytesPerSec) + ')';
+                               //' (0x'     + IntToHex(CurSec - MinSec,8) + ')';
+  StatusBar1.Panels[2].Text := 'Cluster: '  +
+    IntToStr(Round(         ((CurSec - MinSec)*bytesPerSec)/BytesPerCluster          ));
+    //IntToStr(Round(         (CurSec - MinSec)*bytesPerSec/BytesPerCluster          ));
+  StatusBar1.Panels[3].Text := 'Position: ' + IntToStr(Round(((CurSec - MinSec) / (MaxSec - MinSec)) * 100)) + ' %';
+end;
+
+procedure TDiskEditor.ToolButton8Click(Sender: TObject);
+var S: string;
+    bytesPerSec : Int64;
+begin
+  if InputQuery('Go to Byte Position','Byte Offset:', S) then
+  begin
+    bytesPerSec := Disk.Size div Disk.TotalSectors;
+    CurSec := MinSec + Trunc((StrToInt64(S) / bytesPerSec));
+   UpdateSec;
+  end;
+end;
+
+procedure TDiskEditor.ToolButton4Click(Sender: TObject);
+var S: string;
+begin
+  if InputQuery('Go to sector','Logical sector number:',S) then
+  begin
+    CurSec := MinSec + StrToInt64(S);
+    UpdateSec;
+  end;
+end;
+
+procedure TDiskEditor.ToolButton2Click(Sender: TObject);
+begin
+  if CurSec < MaxSec then
+    Inc(CurSec);
+  UpdateSec;
+end;
+
+procedure TDiskEditor.ToolButton1Click(Sender: TObject);
+begin
+  if CurSec > MinSec then
+    Dec(CurSec);
+  UpdateSec;
+end;
+
+procedure TDiskEditor.ToolButton5Click(Sender: TObject);
+begin
+  CurSec := MinSec;
+  UpdateSec;
+end;
+
+procedure TDiskEditor.ToolButton3Click(Sender: TObject);
+begin
+  CurSec := MaxSec;
+  UpdateSec;
+end;
+
+end.
+

File DiskName.pas

+unit DiskName;
+
+interface
+
+uses Windows, SysUTils, ComCtrls, Classes, Util;
+
+function GetDriveManufacturerAndModel(DriveID: Byte; var serialnostr:string; List: TListView=nil): string;
+
+implementation
+
+uses main;
+
+const
+  MAX_IDE_DRIVES              = 16;
+  Method_Buffered             = 0;
+  File_Any_Access             = 0;
+  File_Device_Mass_Storage    = $0000002D;
+
+type
+
+  PSTORAGE_BUS_TYPE = ^STORAGE_BUS_TYPE;
+  STORAGE_BUS_TYPE = set of (BusTypeUnknown = $00, BusTypeScsi, BusTypeAtapi, BusTypeAta, BusType1394, BusTypeSsa, BusTypeFibre, BusTypeUsb, BusTypeRAID, BusTypeMaxReserved = $7F);
+
+  PSTORAGE_QUERY_TYPE = ^STORAGE_QUERY_TYPE;
+  STORAGE_QUERY_TYPE = (
+    PropertyStandardQuery = 0,
+    PropertyExistsQuery,
+    PropertyMaskQuery,
+    PropertyQueryMaxDefined);
+
+  PSTORAGE_PROPERTY_ID = ^STORAGE_PROPERTY_ID;
+  STORAGE_PROPERTY_ID = (
+    StorageDeviceProperty = 0,
+    StorageAdapterProperty,
+    StorageDeviceIdProperty,
+    StorageDeviceUniqueIdProperty,              // See storduid.h for details
+    StorageDeviceWriteCacheProperty,
+    StorageMiniportProperty,
+    StorageAccessAlignmentProperty
+  );
+
+  PSTORAGE_PROPERTY_QUERY = ^STORAGE_PROPERTY_QUERY;
+  STORAGE_PROPERTY_QUERY = packed record
+    PropertyId: STORAGE_PROPERTY_ID;
+    QueryType: STORAGE_QUERY_TYPE;
+    AdditionalParameters: array[0..9] of UCHAR;
+  end;
+
+  PSTORAGE_DEVICE_DESCRIPTOR = ^STORAGE_DEVICE_DESCRIPTOR;
+  STORAGE_DEVICE_DESCRIPTOR = packed record
+    Version: ULONG;
+    Size: ULONG;
+    DeviceType: UCHAR;
+    DeviceTypeModifier: UCHAR;
+    RemovableMedia: Boolean;
+    CommandQueueing: Boolean;
+    VendorIdOffset: ULONG;
+    ProductIdOffset: ULONG;
+    ProductRevisionOffset: ULONG;
+    SerialNumberOffset: ULONG;
+    BusType: STORAGE_BUS_TYPE;
+    RawPropertiesLength: ULONG;
+    RawDeviceProperties: array[0..0] of UCHAR;
+  end;
+
+function GetStringFromOffset(buffer:array of char; offset,len:integer): string;
+var i:integer;
+begin
+    result:='';
+    if offset=0 then exit;
+    for i := Offset to Offset+len do
+    begin
+      if buffer[i] = #0 then break;
+      if buffer[i] >= ' ' then
+      begin
+        result:=result+buffer[i];
+      end;
+    end;
+end;
+
+function HexTwins2String(s:string;IgnoreSpaces:boolean):string;
+var i, l, z1, z2: longint;
+begin
+    result:='';
+    l:=Length(s);
+    i:=1;
+    while i<=l do
+    begin
+      z1:=StrToIntDef('$'+Copy(s,i+2,2),0);
+      z2:=StrToIntDef('$'+Copy(s,i,2)  ,0);
+      if z1>20 then
+      result:=result+Chr(z1);
+      if z2>20 then
+      result:=result+Chr(z2);
+      Inc(i,4);
+    end;
+end;
+
+function GetDriveManufacturerAndModel(DriveID: Byte; var serialnostr:string; List: TListView=nil): string;
+const IOCTL_Storage_Base           = File_Device_Mass_Storage;
+const IOCTL_STORAGE_QUERY_PROPERTY = $2D1400;
+var drive    : Integer;
+    driveName: string;
+    hPhysicalDriveIOCTL : THandle;
+    storage_descrip: PSTORAGE_DEVICE_DESCRIPTOR;
+    storage_query  : STORAGE_PROPERTY_QUERY;
+    cbBytesReturned: DWORD;
+    buffer  : array [0..9999] of char;
+    sVendor : string;
+    sModel  : string;
+    sVersion: string;
+    sSerialNumber:string;
+    i:integer;
+    logfile    : TFileStream;
+begin
+    result:='';
+    drive := 0;
+    driveName := '\\.\PhysicalDrive'+IntToStr(DriveID);
+    hPhysicalDriveIOCTL := CreateFile(PChar(driveName),GENERIC_READ or GENERIC_WRITE,
+        FILE_SHARE_READ or FILE_SHARE_WRITE, nil,
+        OPEN_EXISTING, 0, 0);
+
+    if hPhysicalDriveIOCTL <> INVALID_HANDLE_VALUE then
+    begin
+        FillChar(storage_query, sizeof(storage_query), 0);
+        FillChar(buffer, sizeof(buffer), 0);
+        storage_query.PropertyId := StorageDeviceProperty;
+        storage_query.QueryType := PropertyStandardQuery;
+
+        if DeviceIoControl(hPhysicalDriveIOCTL, IOCTL_STORAGE_QUERY_PROPERTY,
+                 @storage_query, sizeof(STORAGE_PROPERTY_QUERY),
+                 @buffer, sizeof(buffer),
+                 cbBytesReturned, nil)
+        then begin
+            storage_descrip := @buffer;
+            sVendor      :=GetStringFromOffset(buffer,storage_descrip.VendorIdOffset,39);
+            sModel       :=GetStringFromOffset(buffer,storage_descrip.ProductIdOffset,39);
+            sVersion     :=GetStringFromOffset(buffer,storage_descrip.ProductRevisionOffset,39);
+            sSerialNumber:=GetStringFromOffset(buffer,storage_descrip.SerialNumberOffset,39);
+            sSerialNumber:=ReplaceAllStringsInString(sSerialNumber,'20','');
+
+            //logfile := TFileStream.Create('e:\spec'+IntToStr(DriveID)+'.log', fmCreate or fmOpenWrite or fmShareDenyWrite);
+            //logfile.Write(buffer,10000);
+            //logfile.Free;
+
+            result:='"'+Trim(Trim(sVendor) + ' ' + Trim(sModel)  + ' ' + Trim(sVersion))+'"';
+            if serialnostr<>'' then
+            begin
+              serialnostr:=trim(HexTwins2String(sSerialNumber,true));
+            end;
+
+            if (List<>nil) then begin
+                with List.Items.Add do
+                begin Caption:='Vendor';
+                      SubItems.Add(sVendor); end;
+                with List.Items.Add do
+                begin Caption:='Model';
+                      SubItems.Add(sModel); end;
+                with List.Items.Add do
+                begin Caption:='Version';
+                      SubItems.Add(sVersion); end;
+                with List.Items.Add do
+                begin Caption:='Serial (hex)';
+                      SubItems.Add(sSerialNumber); end;
+                with List.Items.Add do
+                begin Caption:='Serial';
+                      SubItems.Add(trim(HexTwins2String(sSerialNumber,true))); end;
+            end;
+
+        end else begin
+          SysErrMsg(GetLastError,'STORAGE_QUERY_PROPERTY: ');
+        end;
+        CloseHandle(hPhysicalDriveIOCTL);
+    end;
+end;
+
+end.

File DiskName_old.pas

+unit DiskName;
+
+interface
+
+uses Windows, SysUTils;
+
+function GetIdeDiskPhysics(DiskID: Byte) : String; 
+
+implementation
+
+// found at delphi.cartall.com.pl
+// (c) Alex Konshin mailto:alexk@mtgroup.ru 30 jul 2000
+// and at www.delphi3000.com posted by Walter Alves Chagas Junior
+
+function GetIdeDiskPhysics(DiskID: Byte) : String; 
+
+type
+TSrbIoControl = packed record
+	 HeaderLength : ULONG;
+	 Signature    : Array[0..7] of Char;
+	 Timeout      : ULONG;
+	 ControlCode  : ULONG;
+	 ReturnCode   : ULONG;
+	 Length       : ULONG;
+   end;
+SRB_IO_CONTROL = TSrbIoControl;
+PSrbIoControl = ^TSrbIoControl;
+
+TIDERegs = packed record
+	 bFeaturesReg     : Byte; // Used for specifying SMART "commands".
+	 bSectorCountReg  : Byte; // IDE sector count register
+	 bSectorNumberReg : Byte; // IDE sector number register
+	 bCylLowReg       : Byte; // IDE low order cylinder value
+	 bCylHighReg      : Byte; // IDE high order cylinder value
+	 bDriveHeadReg    : Byte; // IDE drive/head register
+	 bCommandReg      : Byte; // Actual IDE command.
+	 bReserved        : Byte; // reserved.  Must be zero.
+   end;
+IDEREGS   = TIDERegs;
+PIDERegs  = ^TIDERegs;
+
+TSendCmdInParams = packed record
+	 cBufferSize  : DWORD;
+	 irDriveRegs  : TIDERegs;
+	 bDriveNumber : Byte;
+	 bReserved    : Array[0..2] of Byte;
+	 dwReserved   : Array[0..3] of DWORD;
+	 bBuffer      : Array[0..0] of Byte;
+   end;
+SENDCMDINPARAMS   = TSendCmdInParams;
+PSendCmdInParams  = ^TSendCmdInParams;
+
+TIdSector = packed record
+	 wGenConfig                 : Word;
+	 wNumCyls                   : Word;
+	 wReserved                  : Word;
+	 wNumHeads                  : Word;
+	 wBytesPerTrack             : Word;
+	 wBytesPerSector            : Word;
+	 wSectorsPerTrack           : Word;
+	 wVendorUnique              : Array[0..2] of Word;
+	 sSerialNumber              : Array[0..19] of Char;
+	 wBufferType                : Word;
+	 wBufferSize                : Word;
+	 wECCSize                   : Word;
+	 sFirmwareRev               : Array[0..7] of Char;
+	 sModelNumber               : Array[0..39] of Char;
+	 wMoreVendorUnique          : Word;
+	 wDoubleWordIO              : Word;
+	 wCapabilities              : Word;
+	 wReserved1                 : Word;
+	 wPIOTiming                 : Word;
+	 wDMATiming                 : Word;
+	 wBS                        : Word;
+	 wNumCurrentCyls            : Word;
+	 wNumCurrentHeads           : Word;
+	 wNumCurrentSectorsPerTrack : Word;
+	 ulCurrentSectorCapacity    : ULONG;
+	 wMultSectorStuff           : Word;
+	 ulTotalAddressableSectors  : ULONG;
+	 wSingleWordDMA             : Word;
+	 wMultiWordDMA              : Word;
+	 bReserved                  : Array[0..127] of Byte;
+   end;
+PIdSector = ^TIdSector;
+
+const
+   IDE_ID_FUNCTION               = $EC;
+   IDENTIFY_BUFFER_SIZE          = 512;
+   DFP_RECEIVE_DRIVE_DATA        = $0007c088;
+   IOCTL_SCSI_MINIPORT           = $0004d008;
+   IOCTL_SCSI_MINIPORT_IDENTIFY  = $001b0501;
+   DataSize = sizeof(TSendCmdInParams)-1+IDENTIFY_BUFFER_SIZE;
+   BufferSize = SizeOf(SRB_IO_CONTROL)+DataSize;
+   W9xBufferSize = IDENTIFY_BUFFER_SIZE+16;
+
+var hDevice : THandle;
+    cbBytesReturned : DWORD;
+    pInData : PSendCmdInParams;
+    pOutData : Pointer; // PSendCmdOutParams
+    Buffer : Array[0..BufferSize-1] of Byte;
+    srbControl : TSrbIoControl absolute Buffer;
+    s: string;
+    i: integer;
+
+procedure ChangeByteOrder( var Data; Size : Integer ); 
+var ptr : PChar; 
+ 	  i : Integer;
+    c : Char;
+begin 
+  ptr := @Data;
+  for i := 0 to (Size shr 1)-1 do
+  begin
+	 c := ptr^;
+	 ptr^ := (ptr+1)^;
+	 (ptr+1)^ := c;
+	 Inc(ptr,2);
+  end; 
+end; 
+
+begin 
+   Result := ''; 
+   FillChar(Buffer,BufferSize,#0);
+   if Win32Platform=VER_PLATFORM_WIN32_NT then 
+   // Windows NT, Windows 2000, Windows XP
+   begin
+     hDevice := CreateFile( '\\.\Scsi0:',
+        GENERIC_READ or GENERIC_WRITE,
+        FILE_SHARE_READ or FILE_SHARE_WRITE,
+        nil, OPEN_EXISTING, 0, 0 );
+	 	 if hDevice=INVALID_HANDLE_VALUE then Exit;
+	 	 try
+	 	   srbControl.HeaderLength := SizeOf(SRB_IO_CONTROL);
+	 	   System.Move('SCSIDISK',srbControl.Signature,8);
+	 	   srbControl.Timeout      := 2;
+	 	   srbControl.Length       := DataSize;
+	 	   srbControl.ControlCode  := IOCTL_SCSI_MINIPORT_IDENTIFY;
+	 	   pInData := PSendCmdInParams(PChar(@Buffer) + SizeOf(SRB_IO_CONTROL));
+	 	   pOutData := pInData;
+	 	   with pInData^ do begin
+    		 cBufferSize  := IDENTIFY_BUFFER_SIZE;
+	 	  	 bDriveNumber := DiskID;
+			   with irDriveRegs do
+			   begin
+    		   bFeaturesReg     := 0;
+	 	  	   bSectorCountReg  := 1;
+			     bSectorNumberReg := 1;
+			     bCylLowReg       := 0;
+    		   bCylHighReg      := 0;
+	 	  	   bDriveHeadReg    := $0A0 or ((DiskID and 1) shl 4); //$A0;
+			     bCommandReg      := IDE_ID_FUNCTION;
+    		 end;
+	 	   end;
+
+	 	   if not DeviceIoControl(hDevice, IOCTL_SCSI_MINIPORT, @Buffer, BufferSize, @Buffer, BufferSize, cbBytesReturned, nil) then
+	 	   begin
+    		 result:='';
+	 	  	 Exit;
+	 	   end;
+	 	 finally
+		   CloseHandle(hDevice);
+	   end;
+	 end else begin
+	 	 // Windows 95 OSR2, Windows 98, Windows ME
+	 	 hDevice := CreateFile( '\\.\SMARTVSD', 0, 0, nil, CREATE_NEW, 0, 0 );
+	 	 if hDevice=INVALID_HANDLE_VALUE then Exit;
+	 	 try
+	 	   pInData := PSendCmdInParams(@Buffer);
+	 	   pOutData := @pInData^.bBuffer;
+	 	   with pInData^ do
+	 	   begin
+		   	 cBufferSize  := IDENTIFY_BUFFER_SIZE;
+			   bDriveNumber := DiskID;
+  			 with irDriveRegs do
+	  		 begin
+		  	   bFeaturesReg     := 0;
+			     bSectorCountReg  := 1;
+			     bSectorNumberReg := 1;
+  			   bCylLowReg       := 0;
+	  		   bCylHighReg      := 0;
+		  	   bDriveHeadReg    := $0A0 or ((DiskID and 1) shl 4); //$A0;
+			     bCommandReg      := IDE_ID_FUNCTION;
+  			 end;
+	 	   end;
+
+	 	   if not DeviceIoControl(hDevice, DFP_RECEIVE_DRIVE_DATA,
+	 	            pInData, SizeOf(TSendCmdInParams)-1, pOutData, W9xBufferSize, cbBytesReturned, nil )
+       then
+  			 Exit;
+	 	 finally
+		   CloseHandle(hDevice);
+	 	 end;
+	 end;
+
+	 with PIdSector(PChar(pOutData)+16)^ do
+	 begin
+	   ChangeByteOrder(sModelNumber,SizeOf(sModelNumber));
+	   SetString(Result,sModelNumber,SizeOf(sModelNumber));
+	   s := Trim(sModelNumber);
+     for i:=1 to length(s) do
+         if (ord(s[i])>254) or (Ord(s[i])<32) then begin
+           s:='';
+           break;
+         end;
+     if s<>'' then
+       s := ' [' + Trim(sModelNumber) + ']';
+	 end;
+	 Result := s;
+end;
+
+end.

File DiskProp.dfm

+object DiskPropForm: TDiskPropForm
+  Left = 211
+  Top = 118
+  Width = 516
+  Height = 480
+  BorderIcons = [biSystemMenu]
+  Caption = 'Disk Info'
+  Color = clBtnFace
+  Constraints.MinWidth = 356
+  Font.Charset = ANSI_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -11
+  Font.Name = 'Verdana'
+  Font.Style = []
+  OldCreateOrder = False
+  OnClose = FormClose
+  OnShow = FormShow
+  DesignSize = (
+    508
+    453)
+  PixelsPerInch = 96
+  TextHeight = 13
+  object Button1: TButton
+    Left = 208
+    Top = 417
+    Width = 75
+    Height = 23
+    Caption = 'OK'
+    Default = True
+    ModalResult = 1
+    TabOrder = 0
+    OnClick = Button1Click
+  end
+  object PropList: TListView
+    Left = 20
+    Top = 12
+    Width = 457
+    Height = 393
+    Anchors = [akLeft, akTop, akRight]
+    Columns = <
+      item
+        Caption = 'Property'
+        Width = 200
+      end
+      item
+        Caption = 'Value'
+        Width = 210
+      end>
+    HideSelection = False
+    MultiSelect = True
+    ReadOnly = True
+    RowSelect = True
+    TabOrder = 1
+    ViewStyle = vsReport
+  end
+end

File DiskProp.pas

+unit DiskProp;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, ComCtrls, Main, DiskName;
+
+type
+  TDiskPropForm = class(TForm)
+    Button1: TButton;
+    PropList: TListView;
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
+    procedure Button1Click(Sender: TObject);
+    procedure FormShow(Sender: TObject);
+  public
+    diskno: integer;
+    procedure AddBSInfo(Name, Value: string);
+  end;
+
+var
+  DiskPropForm: TDiskPropForm;
+
+implementation
+
+{$R *.dfm}
+
+procedure TDiskPropForm.AddBSInfo(Name, Value: string);
+var I: TListItem;
+begin
+  I := PropList.Items.Add;
+  I.Caption := Name;
+  I.SubItems.Add(Value);
+end;
+
+procedure TDiskPropForm.FormClose(Sender: TObject;
+  var Action: TCloseAction);
+begin
+  Release;
+end;
+
+procedure TDiskPropForm.Button1Click(Sender: TObject);
+begin
+  Close;
+end;
+
+procedure TDiskPropForm.FormShow(Sender: TObject);
+var s:string;
+begin
+  s:='';
+  GetDriveManufacturerAndModel(diskno, s, PropList);
+end;
+
+end.
+{*******************************************************************************
+NT Disk access unit
+allows physical disks to be accessed as TStream
+by Miika Sihvola (smiika@mbnet.fi)
+*******************************************************************************}
+unit Disks;
+
+interface
+
+uses Classes, Windows, Dialogs;
+
+const PartitionTableOffset = $1BE; // 446 location inside master boot record
+
+const IOCTL_DISK_GET_DRIVE_GEOMETRY = (7 shl 16);
+      IOCTL_STORAGE_CHECK_VERIFY    = 2967552;
+      MediaTypes : array [0..25] of string =
+      ('Unknown',                // Format is unknown
+       'F5_1Pt2_512',            // 5.25", 1.2MB,  512 bytes/sector
+       'F3_1Pt44_512',           // 3.5",  1.44MB, 512 bytes/sector
+       'F3_2Pt88_512',           // 3.5",  2.88MB, 512 bytes/sector
+       'F3_20Pt8_512',           // 3.5",  20.8MB, 512 bytes/sector
+       'F3_720_512',             // 3.5",  720KB,  512 bytes/sector
+       'F5_360_512',             // 5.25", 360KB,  512 bytes/sector
+       'F5_320_512',             // 5.25", 320KB,  512 bytes/sector
+       'F5_320_1024',            // 5.25", 320KB,  1024 bytes/sector
+       'F5_180_512',             // 5.25", 180KB,  512 bytes/sector
+       'F5_160_512',             // 5.25", 160KB,  512 bytes/sector
+       'REMOVABLE', //'RemovableMedia',         // Removable media other than floppy
+       'FIXED', //FixedMedia',             // Fixed hard disk media
+       'F3_120M_512',            // 3.5", 120M Floppy
+       'F3_640_512',             // 3.5" ,  640KB,  512 bytes/sector
+       'F5_640_512',             // 5.25",  640KB,  512 bytes/sector
+       'F5_720_512',             // 5.25",  720KB,  512 bytes/sector
+       'F3_1Pt2_512',            // 3.5" ,  1.2Mb,  512 bytes/sector
+       'F3_1Pt23_1024',          // 3.5" ,  1.23Mb, 1024 bytes/sector
+       'F5_1Pt23_1024',          // 5.25",  1.23MB, 1024 bytes/sector
+       'F3_128Mb_512',           // 3.5" MO 128Mb   512 bytes/sector
+       'F3_230Mb_512',           // 3.5" MO 230Mb   512 bytes/sector
+       'F8_256_128',             // 8",     256KB,  128 bytes/sector
+       'F3_200Mb_512',           // 3.5",   200M Floppy (HiFD)
+       'F3_240M_512',            // 3.5",   240Mb Floppy (HiFD)
+       'F3_32M_512');            // 3.5",   32Mb Floppy
+
+type
+  TDiskGeometry = packed record
+    Cylinders: LARGE_INTEGER;
+    MediaType: DWORD;
+    TracksPerCylinder: dword;
+    SectorsPerTrack: dword;
+    BytesPerSector: dword;
+  end;
+
+  TDisk = class(TStream)
+  public
+    Number: Integer;
+    Physical:boolean;
+    Name: string;
+    DiskHandle: THandle;
+    DiskGeometry: TDiskGeometry;
+    DiskSerial:String;
+    Size: Int64;
+    TotalSectors: Int64;
+    SecBuf     : array [0..511] of Byte;
+
+    constructor Create(DiskNumber: Byte); overload;
+    constructor Create(DriveLetter: string; DiskNumber:integer); overload;
+    destructor Destroy(); override;
+
+    function OpenVolumePhysical:boolean;
+    function OpenVolumeByLetter(Letter:string):boolean;
+    procedure CloseVolume;
+
+    function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
+    function Read(var Buffer; Count: Longint): Longint; override;
+    function Write(const Buffer; Count: Longint): Longint; override;
+    function SizeStr: string;
+  end;
+
+  //partition entry inside partition table
+  TPartDesc = record
+   BootIndicator: Byte;  //one of partitions have this value at 80 (which means partition is avtive), which is the partition that MBR code boots
+   BeginCHS: array [1..3] of Byte;
+   PartitionType: Byte;  //important byte, tells the filesystem type
+   EndCHS: array [1..3] of Byte;
+   StartSect: Cardinal;  //physical sector location where partition begins
+   SizeSect: Cardinal;   //how many sectors partition has (size in bytes = 512 * SizeSect)
+   end;
+  //partiton table structure inside MBR
+  TPartitionTable = array [1..4] of TPartDesc;
+
+  //MBR, the first sector of every disk, and in begin of extended partitions
+  TMBR = packed record
+   BootCode: array [$0..$1BD] of Byte; //x86 16-bit realmode code loaded to address 7E00 by BIOS, no boot code in extended partition's MBR
+   Partitions: TPartitionTable;        //starts at $1BE
+   Signature: Word;                    //must be 55 AA
+   end;
+
+  //application spec�fic structure
+  TPartInfo = record
+     Disk: TDisk;
+     StartSec: Int64;
+     SizeSec:  Int64;
+     PartitionTable: TPartitionTable;
+     sLetter: string;
+     partno:Byte;
+     sVolName: string;
+     sFSName: string;
+     sVolSerial: string;
+  end;
+  pPartInfo = ^TPartInfo;
+
+  TPARTITION_INFORMATION = packed record
+    StartingOffset:LARGE_INTEGER;
+    PartitionLength:LARGE_INTEGER;
+    HiddenSectors:DWORD;
+    PartitionNumber:DWORD;
+    PartitionType:BYTE;
+    BootIndicator:BOOLEAN;
+    RecognizedPartition:BOOLEAN;
+    RewritePartition:BOOLEAN;
+  end;
+
+  TSTORAGE_DEVICE_NUMBER = packed record
+    // The FILE_DEVICE_XXX type for this device.
+    DeviceType:DWORD;
+    // The number of this device
+    DeviceNumber:DWORD;
+    // If the device is partitionable, the partition number of the device. Otherwise -1
+    PartitionNumber:DWORD;
+  end;
+
+procedure GetPartitionInfo(driveletter: string;
+    var sVolName: string; var sFSName: string; var sVolSerial: string);
+function  GetFSName(pDesc: TPartDesc; Disk:TDisk): string;
+
+//var DiskHandle : THandle;
+//var Disk       : TDisk;
+//var I          : Byte;
+
+implementation
+
+uses SysUtils, DiskName, Main,
+     NTFS, FAT32;
+
+constructor TDisk.Create(DiskNumber: Byte);
+var s1            : string;
+begin
+    Physical:=true;
+    Number:=DiskNumber;
+    // get actual device name in future
+    //s1:=ReadPhysicalDriveInNT(DiskNumber, nil); // diskname.pas
+    DiskSerial:='-';
+    s1:=GetDriveManufacturerAndModel(DiskNumber,DiskSerial,nil); // diskname.pas
+    insert('-',DiskSerial,5);
+    Name := 'Disk'+IntToStr(Number)+' '+ s1;
+    OpenVolumePhysical;
+end;
+
+constructor TDisk.Create(DriveLetter: string; DiskNumber: integer);
+var VolName, FSName, VolSerial: string;
+begin
+    Physical:=false;
+    Number:=DiskNumber;
+    Name := DriveLetter + ': nonPhysicalDrive' + IntToStr(Number);
+    GetPartitionInfo(DriveLetter, VolName, FSName, VolSerial);
+    OpenVolumeByLetter(Driveletter);
+end;
+
+destructor TDisk.Destroy;
+begin
+  CloseVolume;
+  inherited Destroy;
+end;
+
+procedure TDisk.CloseVolume;
+begin
+  if Win32Platform=VER_PLATFORM_WIN32_NT then
+    CloseHandle(DiskHandle)
+  else
+    DeleteFile('\\.\INT13EXT');
+  DiskHandle:=0;
+end;
+
+function TDisk.OpenVolumePhysical:boolean;
+var i: cardinal;
+begin
+    result:=false;
+    if Win32Platform=VER_PLATFORM_WIN32_NT then
+    begin
+        DiskHandle := CreateFile(pchar('\\.\PhysicalDrive' + IntToStr(Number)), GENERIC_READ,
+            FILE_SHARE_READ	OR FILE_SHARE_WRITE, nil, OPEN_EXISTING,
+            0, //FILE_FLAG_SEQUENTIAL_SCAN OR FILE_FLAG_NO_BUFFERING, //0,
+            0)
+    end else begin
+      //Handle := CreateFile(pchar('\\.\PhysicalDrive' + IntToStr(DiskNumber)), GENERIC_READ, FILE_SHARE_READ	, nil, OPEN_EXISTING, 0, 0);
+      //Handle := CreateFile(pchar('\\.\INT13EXT.VXD'), 0, 0, nil, 0, FILE_FLAG_DELETE_ON_CLOSE, 0);
+      DiskHandle := CreateFile(pchar('\\.\vwin32'), 0, 0, nil, 0, FILE_FLAG_DELETE_ON_CLOSE, 0);
+    end;
+
+    if not DeviceIoControl(DiskHandle, IOCTL_STORAGE_CHECK_VERIFY, nil, 0, nil, 0, I, nil)
+    then begin
+      // make sure media is loaded
+      //CloseHandle(Handle);
+      exit;
+      //SysErrMsg(GetLastError, 'checkdisk');
+    end;
+
+    if (DiskHandle <> INVALID_HANDLE_VALUE) then
+    begin
+      result:=true;
+      if DeviceIoControl(DiskHandle, IOCTL_DISK_GET_DRIVE_GEOMETRY, nil, 0, @DiskGeometry, SizeOf(DiskGeometry), I, nil) then
+      begin
+        TotalSectors := DiskGeometry.cylinders.lowpart * DiskGeometry.trackspercylinder * DiskGeometry.sectorspertrack;
+        Size := TotalSectors*512; //DiskGeometry.BytesPerSector;
+      end else begin
+        CloseHandle(DiskHandle);
+        raise EInOutError.CreateFmt({s1}'', ['1']); // ('Failed getting disk geometry.');
+      end;
+    end else begin
+      CloseHandle(DiskHandle);
+      raise EInOutError.CreateFmt({s1}'', ['1']); // ('Failed getting disk device handle.');
+    end;
+end;
+
+function TDisk.OpenVolumeByLetter(Letter:string):boolean;
+var I             : Cardinal;
+begin
+    result:=false;
+    if Win32Platform=VER_PLATFORM_WIN32_NT then
+    begin
+      DiskHandle := CreateFile(pchar('\\.\'+Letter+':'), GENERIC_READ,
+        FILE_SHARE_READ	OR FILE_SHARE_WRITE, nil, OPEN_EXISTING,
+        FILE_FLAG_SEQUENTIAL_SCAN OR FILE_FLAG_NO_BUFFERING, 0)
+    end else begin
+        //Handle := CreateFile(pchar('\\.\PhysicalDrive' + IntToStr(DiskNumber)), GENERIC_READ, FILE_SHARE_READ	, nil, OPEN_EXISTING, 0, 0);
+        //Handle := CreateFile(pchar('\\.\INT13EXT.VXD'), 0, 0, nil, 0, FILE_FLAG_DELETE_ON_CLOSE, 0);
+        //Handle := CreateFile(pchar('\\.\vwin32'), 0, 0, nil, 0, FILE_FLAG_DELETE_ON_CLOSE, 0);
+    end;
+
+    if not DeviceIoControl(DiskHandle, IOCTL_STORAGE_CHECK_VERIFY, nil, 0, nil, 0, I, nil) then
+    begin
+      //CloseHandle(Handle);
+      exit;
+    end;
+
+    if (DiskHandle <> INVALID_HANDLE_VALUE) then
+    begin
+      if DeviceIoControl(DiskHandle, IOCTL_DISK_GET_DRIVE_GEOMETRY, nil, 0, @DiskGeometry, SizeOf(DiskGeometry), I, nil) then
+      begin
+        TotalSectors := DiskGeometry.cylinders.lowpart * DiskGeometry.trackspercylinder * DiskGeometry.sectorspertrack;
+        Size := TotalSectors * 512; //DiskGeometry.BytesPerSector;
+        result:=true;
+      end else begin
+        CloseHandle(DiskHandle);
+        raise EInOutError.CreateFmt(name, ['1']); // ('Failed getting disk geometry.');
+      end;
+    end else begin
+      CloseHandle(DiskHandle);
+      raise EInOutError.CreateFmt(name, ['1']); // ('Failed getting disk device handle.');
+    end;
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+
+function TDisk.Read(var Buffer; Count: Integer): Longint;
+var BytesRead: Cardinal;
+begin
+  if Count = 0 then begin result:=0; exit; end;
+  if Count mod 512 <> 0 then
+	  raise EInOutError.Create('Number of bytes to read must be aligned to 512 bytes.');
+  if not ReadFile(DiskHandle, Buffer, Count, BytesRead, nil) then
+	  //RaiseLastWin32Error;
+    SysErrMsg(GetLastError, 'DiskRead: ');
+  Result := BytesRead;
+end;
+
+function TDisk.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64;
+var
+HighOffset: Integer;
+begin
+if Offset mod 512 <> 0 then
+raise EInOutError.Create('Number of bytes to read must be aligned to 512 bytes.');
+HighOffset := (Offset shr 32) and $00000000FFFFFFFF;
+ case Origin of
+  soBeginning:
+   Result := SetFilePointer(DiskHandle, Integer(Offset and $00000000FFFFFFFF), @HighOffset, FILE_BEGIN);
+  soCurrent:
+   Result := SetFilePointer(DiskHandle, Integer(Offset and $00000000FFFFFFFF), @HighOffset, FILE_CURRENT);
+  soEnd:
+   Result := SetFilePointer(DiskHandle, Integer(Offset and $00000000FFFFFFFF), @HighOffset, FILE_END);
+ else
+   Result := 0;
+  end;
+end;
+
+function TDisk.SizeStr: string;
+begin
+Result := IntToSize(Size);
+end;
+
+function TDisk.Write(const Buffer; Count: Integer): Longint;
+begin
+raise EInOutError.Create('Writing to physical disks is not implemented.');
+end;
+
+procedure GetPartitionInfo(driveletter: string; var sVolName, sFSName, sVolSerial: string);
+var MaximumComponentLength,
+    VOLSERIAL, FileSystemFlags: DWORD;
+    VOLNAME: array[0..31] of char;
+    FSNAME: array[0..15] of char;
+    Size : integer;
+begin
+    Size := SizeOf(FSNAME);
+    FillChar(FSNAME, Size, 0);
+    GetVolumeInformation(PAnsiChar(driveletter + ':\'),
+                       VOLNAME,32,
+                       @VOLSERIAL,MaximumComponentLength,
+                       FileSystemFlags,
+                       FSNAME, 16);
+    sVolName:=StrPas(@VOLNAME[0]);
+    sFSName:=StrPas(@FSNAME[0]);
+    sVolSerial := IntToHex(HiWord(VOLSERIAL), 4) + '-' +
+                  IntToHex(LoWord(VOLSERIAL), 4);
+end;
+
+function GetFSName(pDesc: TPartDesc; Disk:TDisk): string;
+begin
+ Disk.Position := pDesc.StartSect * 512;
+ Disk.Read(Disk.SecBuf,512);
+ case pDesc.PartitionType of
+ $00: Result := 'Free';
+ $05: Result := 'Extended DOS-partition';
+ $0F: Result := 'Extended XINT13';
+
+ $01: Result := 'FAT12';
+ $02: Result := 'Xenix root';
+ $03: Result := 'Xenix user';
+ $04: Result := 'FAT16 < 32M';
+ $06: Result := 'FAT16 > 32M MSDOSV4 HUGE';
+
+ $07: Result := 'NTFS';
+ $08: Result := 'AIX';
+ $09: Result := 'AIX boot';
+ $0A: Result := 'OS/2 boot Manager';
+
+ $0B: Result := 'FAT32';
+ $0C: Result := 'FAT32 XINT13';
+ $0E: Result := 'FAT16 XINT13';
+ $11: Result := 'Hidden FAT12';
+
+ $12: Result := 'Compaq diagnostics';
+
+ $14: Result := 'Hidden FAT16 (<32MB)';
+ $16: Result := 'Hidden FAT16B (>=32MB)';
+ $17: Result := 'Hidden NTFS';
+ $1B: Result := 'Hidden FAT32';
+ $1C: Result := 'Hidden FAT32 XINT13';
+ $1E: Result := 'Hidden FAT16 XINT13';
+
+ $2C: Result := 'WildFile/Adaptec GOBack';
+ $3C: Result := 'PowerQuest Recoverable Partition';
+
+ $40: Result := 'VENIX 80286';
+ $41: Result := 'PowerPC BOOT';
+ $42: Result := 'Veritas Logical Disk Manager';
+
+ $51: Result := 'Novell';
+ $52: Result := 'MICROPORT';
+ $63: Result := 'Unix';
+ $64: Result := 'Novell NetWare 286';
+ $65: Result := 'Novell NetWare (3.11 and 4.1)';
+ $66: Result := 'Novell NetWare 386';
+
+ $75: Result := 'PC/IX';
+ $80: Result := 'OLD Minix';
+
+ $81: Result := 'Linux/Minix v1.4b+';
+ $82: Result := 'Linux Swap Partition';
+ $83: Result := 'Linux Ext2/3/Rsr';
+ $84: Result := 'OS/2 hiding type 04h partition';
+ $85: Result := 'Linux Extended';
+
+ $86: Result := 'NT FAT volume set';
+ $87: Result := 'NT IFS volume set';
+
+ $93: Result := 'Amoeba/Hidden Linux native FS (Reiser/Ext3/2)';
+ $94: Result := 'Amoeba BBT';
+ $A5: Result := 'BSD / 386';
+ $AF: Result := 'APPLE_HFS';
+ $B7: Result := 'BSDI fs';
+ $B8: Result := 'BSDI swap';
+
+ $C6: Result := 'SYRINX / Disabled NT FAT volume set';
+ $C7: Result := 'SYRINX / Disabled NT IFS volume set';
+
+ $DB: Result := 'CP/M';
+ $DE: Result := 'Dell Corporation diagnostic partition';
+
+ $E1: Result := 'DOS ACCESS';
+ $F2: Result := 'DOS SECONDARY';
+ $FF: Result := 'BBT';
+ else Result := 'Unknown (' + IntToHex(pDesc.PartitionType,2) + ')';
+ end;
+end;
+
+end.
+{*******************************************************************************
+Application-level (read only) Ext2 filesytem driver v0.1
+            by Miika Sivola (smiika@mbnet.fi)
+
+references
+http://www.nongnu.org/ext2-doc/ext2.html
+*******************************************************************************}
+unit Ext2;
+
+interface
+
+uses Main,Disks,dialogs,SysUtils;
+
+type
+
+  TSuperBlock = packed record
+    s_inodes_count: Cardinal;
+    s_blocks_count: Cardinal;
+    s_r_blocks_count: Cardinal;
+    s_free_blocks_count: Cardinal;
+    s_free_inodes_count: Cardinal;
+    s_first_data_block: Cardinal;
+    s_log_block_size: Cardinal;
+    s_log_frag_size: Cardinal;