mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
* LICENSE.LGPL: Added LICENSE files for LGPL and MIT licenses. * DiscImageChef.Devices/Enums.cs: * DiscImageChef.Partitions/MBR.cs: * DiscImageChef.Partitions/RDB.cs: * DiscImageChef.DiscImages/GDI.cs: * DiscImageChef.Partitions/Sun.cs: * DiscImageChef.DiscImages/VHD.cs: * DiscImageChef.Partitions/GPT.cs: * DiscImageChef.Filesystems/FFS.cs: * DiscImageChef.Filesystems/FAT.cs: * DiscImageChef.Partitions/NeXT.cs: * DiscImageChef.Devices/Command.cs: * DiscImageChef.DiscImages/Nero.cs: * DiscImageChef.Decoders/CD/PMA.cs: * DiscImageChef.Decoders/CD/TOC.cs: * DiscImageChef.Filesystems/BFS.cs: * DiscImageChef.Filesystems/ODS.cs: * DiscImageChef.Helpers/PrintHex.cs: * DiscImageChef.Helpers/Swapping.cs: * DiscImageChef.Decoders/DVD/PRI.cs: * DiscImageChef.Decoders/DVD/DMI.cs: * DiscImageChef.Decoders/DVD/DDS.cs: * DiscImageChef.Decoders/DVD/RMD.cs: * DiscImageChef.Decoders/DVD/UDI.cs: * DiscImageChef.Partitions/Atari.cs: * DiscImageChef.Decoders/DVD/BCA.cs: * DiscImageChef.Filesystems/SysV.cs: * DiscImageChef.Filesystems/HPFS.cs: * DiscImageChef.Filesystems/NTFS.cs: * DiscImageChef.Filesystems/APFS.cs: * DiscImageChef.Decoders/DVD/PFI.cs: * DiscImageChef.Decoders/CD/ATIP.cs: * DiscImageChef.Filesystems/Acorn.cs: * DiscImageChef.DiscImages/CDRWin.cs: * DiscImageChef.DiscImages/CDRDAO.cs: * DiscImageChef.Filesystems/BTRFS.cs: * DiscImageChef.Decoders/Xbox/DMI.cs: * DiscImageChef.Helpers/ArrayFill.cs: * DiscImageChef.Settings/Settings.cs: * DiscImageChef.Filesystems/Opera.cs: * DiscImageChef.Filesystems/extFS.cs: * DiscImageChef.Decoders/DVD/CPRM.cs: * DiscImageChef.Decoders/DVD/ADIP.cs: * DiscImageChef.Decoders/CD/Enums.cs: * DiscImageChef.Decoders/DVD/AACS.cs: * DiscImageChef.Decoders/SCSI/EVPD.cs: * DiscImageChef.Filesystems/ProDOS.cs: * DiscImageChef.Metadata/MediaType.cs: * DiscImageChef.Console/DicConsole.cs: * DiscImageChef.Decoders/DVD/Spare.cs: * DiscImageChef.Filesystems/ext2FS.cs: * DiscImageChef.Decoders/DVD/Enums.cs: * DiscImageChef.Filesystems/Symbian.cs: * DiscImageChef.Decoders/SCSI/Types.cs: * DiscImageChef.Filesystems/UNIXBFS.cs: * DiscImageChef.DiscImages/TeleDisk.cs: * DiscImageChef.Decoders/SCSI/Sense.cs: * DiscImageChef.Decoders/CD/FullTOC.cs: * DiscImageChef.Decoders/Blu-ray/DI.cs: * DiscImageChef.Decoders/ATA/Errors.cs: * DiscImageChef.Filesystems/ISO9660.cs: * DiscImageChef.Filesystems/MinixFS.cs: * DiscImageChef.Devices/Linux/Enums.cs: * DiscImageChef.Filesystems/SolarFS.cs: * DiscImageChef.Filesystems/Structs.cs: * DiscImageChef.DiscImages/Apple2MG.cs: * DiscImageChef.Decoders/SCSI/Modes.cs: * DiscImageChef.Metadata/Dimensions.cs: * DiscImageChef.Partitions/AppleMap.cs: * DiscImageChef.Decoders/Floppy/ISO.cs: * DiscImageChef.Decoders/DVD/Layers.cs: * DiscImageChef.Decoders/CD/Session.cs: * DiscImageChef.Decoders/SCSI/Enums.cs: * DiscImageChef.Filesystems/Nintendo.cs: * DiscImageChef.Helpers/DateHandlers.cs: * DiscImageChef.Filesystems/AmigaDOS.cs: * DiscImageChef.DiscImages/ImageInfo.cs: * DiscImageChef.Checksums/MD5Context.cs: * DiscImageChef.Devices/Linux/Extern.cs: * DiscImageChef.Filesystems/AppleHFS.cs: * DiscImageChef.Filesystems/AppleMFS.cs: * DiscImageChef.Helpers/ArrayIsEmpty.cs: * DiscImageChef.Decoders/Blu-ray/BCA.cs: * DiscImageChef.Decoders/Blu-ray/DDS.cs: * DiscImageChef.Filesystems/PCEngine.cs: * DiscImageChef.Decoders/ATA/Identify.cs: * DiscImageChef.Devices/Linux/Command.cs: * DiscImageChef.Devices/FreeBSD/Enums.cs: * DiscImageChef.Decoders/SCSI/Inquiry.cs: * DiscImageChef.Metadata/DeviceReport.cs: * DiscImageChef.Decoders/Floppy/Amiga.cs: * DiscImageChef.Devices/Linux/Structs.cs: * DiscImageChef.Devices/Windows/Enums.cs: * DiscImageChef.Decoders/DVD/CSS&CPRM.cs: * DiscImageChef.Checksums/SHA1Context.cs: * DiscImageChef.DiscImages/DiskCopy42.cs: * DiscImageChef.Partitions/PartPlugin.cs: * DiscImageChef.CommonTypes/Partition.cs: * DiscImageChef.Decoders/Floppy/Enums.cs: * DiscImageChef.CommonTypes/MediaType.cs: * DiscImageChef.Decoders/Floppy/Apple2.cs: * DiscImageChef.Devices/Windows/Extern.cs: * DiscImageChef.Decoders/SCSI/MMC/CPRM.cs: * DiscImageChef.Helpers/StringHandlers.cs: * DiscImageChef.DiscImages/ImagePlugin.cs: * DiscImageChef.Checksums/CRC64Context.cs: * DiscImageChef.Checksums/CRC32Context.cs: * DiscImageChef.DiscImages/ZZZRawImage.cs: * DiscImageChef.Checksums/CRC16Context.cs: * DiscImageChef.Filesystems/LisaFS/Dir.cs: * DiscImageChef.Decoders/DVD/Cartridge.cs: * DiscImageChef.Decoders/Blu-ray/Spare.cs: * DiscImageChef.Filesystems/Filesystem.cs: * DiscImageChef.Decoders/SCSI/MMC/AACS.cs: * DiscImageChef.Devices/FreeBSD/Extern.cs: * DiscImageChef.Devices/Device/Commands.cs: * DiscImageChef.Checksums/SHA384Context.cs: * DiscImageChef.Devices/FreeBSD/Command.cs: * DiscImageChef.Checksums/SHA512Context.cs: * DiscImageChef.Decoders/SCSI/MMC/Enums.cs: * DiscImageChef.Devices/Windows/Command.cs: * DiscImageChef.Devices/FreeBSD/Structs.cs: * DiscImageChef.Devices/Windows/Structs.cs: * DiscImageChef.Filesystems/LisaFS/Info.cs: * DiscImageChef.Checksums/SHA256Context.cs: * DiscImageChef.Filesystems/LisaFS/File.cs: * DiscImageChef.Filesystems/AppleHFSPlus.cs: * DiscImageChef.Filesystems/LisaFS/Super.cs: * DiscImageChef.Filesystems/LisaFS/Xattr.cs: * DiscImageChef.Checksums/Adler32Context.cs: * DiscImageChef.Decoders/Floppy/System34.cs: * DiscImageChef.Checksums/SpamSumContext.cs: * DiscImageChef.Decoders/SCSI/MMC/Hybrid.cs: * DiscImageChef.Devices/Device/Variables.cs: * DiscImageChef.Filesystems/LisaFS/Consts.cs: * DiscImageChef.Filesystems/LisaFS/LisaFS.cs: * DiscImageChef.Decoders/Floppy/Commodore.cs: * DiscImageChef.Checksums/FletcherContext.cs: * DiscImageChef.Filesystems/LisaFS/Extent.cs: * DiscImageChef.Devices/Device/Destructor.cs: * DiscImageChef.Decoders/Floppy/AppleSony.cs: * DiscImageChef.Filesystems/LisaFS/Structs.cs: * DiscImageChef.Decoders/SCSI/VendorString.cs: * DiscImageChef.Decoders/SCSI/MMC/Features.cs: * DiscImageChef.Devices/Device/Constructor.cs: * DiscImageChef.Checksums/RIPEMD160Context.cs: * DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs: * DiscImageChef.Decoders/Blu-ray/Cartridge.cs: * DiscImageChef.Decoders/Floppy/System3740.cs: * DiscImageChef.Filesystems/LisaFS/Encoding.cs: * DiscImageChef.Decoders/SCSI/ModesEncoders.cs: * DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: * DiscImageChef.Helpers/BigEndianBitConverter.cs: * DiscImageChef.Decoders/Floppy/Perpendicular.cs: * DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs: * DiscImageChef.Decoders/SCSI/MMC/WriteProtect.cs: * DiscImageChef.Devices/Device/ScsiCommands/HP.cs: * DiscImageChef.Devices/Device/AtaCommands/Cfa.cs: * DiscImageChef.Devices/Device/ScsiCommands/NEC.cs: * DiscImageChef.Helpers/EndianAwareBinaryReader.cs: * DiscImageChef.Devices/Device/ScsiCommands/MMC.cs: * DiscImageChef.Devices/Device/AtaCommands/MCPT.cs: * DiscImageChef.Devices/Device/ScsiCommands/SSC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SMC.cs: * DiscImageChef.Devices/Device/ScsiCommands/SBC.cs: * DiscImageChef.Metadata/Properties/AssemblyInfo.cs: * DiscImageChef.Devices/Device/AtaCommands/Atapi.cs: * DiscImageChef.Devices/Device/AtaCommands/Ata28.cs: * DiscImageChef.Devices/Device/AtaCommands/Smart.cs: * DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs: * DiscImageChef.Devices/Device/AtaCommands/Ata48.cs: * DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs: * DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs: * DiscImageChef.Devices/Device/ScsiCommands/SyQuest.cs: * DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs: * DiscImageChef.Devices/Device/ScsiCommands/Plasmon.cs: * DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs: * DiscImageChef.Devices/Device/ScsiCommands/Adaptec.cs: * DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs: * DiscImageChef.Devices/Device/ScsiCommands/HL-DT-ST.cs: * DiscImageChef.Devices/Device/ScsiCommands/Certance.cs: * DiscImageChef.Decoders/SCSI/DiscStructureCapabilities.cs: * DiscImageChef.Devices/Device/ScsiCommands/ArchiveCorp.cs: Relicensed as LGPL. Updated standard header. * DiscImageChef/Main.cs: * DiscImageChef/Plugins.cs: * DiscImageChef/Options.cs: * DiscImageChef/Commands/Ls.cs: * DiscImageChef/Core/IBGLog.cs: * DiscImageChef/Core/MHDDLog.cs: * DiscImageChef/AssemblyInfo.cs: * DiscImageChef/Core/Checksum.cs: * DiscImageChef/Commands/Decode.cs: * DiscImageChef/Core/Statistics.cs: * DiscImageChef/Commands/Verify.cs: * DiscImageChef/Commands/Formats.cs: * DiscImageChef/Commands/Entropy.cs: * DiscImageChef/Commands/Compare.cs: * DiscImageChef.Interop/DetectOS.cs: * DiscImageChef/Commands/Analyze.cs: * DiscImageChef/Commands/Commands.cs: * DiscImageChef/Commands/PrintHex.cs: * DiscImageChef/Commands/Checksum.cs: * DiscImageChef/DetectImageFormat.cs: * DiscImageChef/Commands/DumpMedia.cs: * DiscImageChef/Commands/Benchmark.cs: * DiscImageChef/Commands/Configure.cs: * DiscImageChef/Commands/MediaInfo.cs: * DiscImageChef.Interop/PlatformID.cs: * DiscImageChef/Commands/MediaScan.cs: * DiscImageChef/Commands/Statistics.cs: * DiscImageChef/Commands/DeviceInfo.cs: * DiscImageChef.Checksums/ReedSolomon.cs: * DiscImageChef/Commands/DeviceReport.cs: * DiscImageChef/Commands/ExtractFiles.cs: * DiscImageChef.Checksums/CDChecksums.cs: * DiscImageChef/Commands/CreateSidecar.cs: Updated standard header. * DiscImageChef.Checksums/DiscImageChef.Checksums.csproj: Relicensed project as LGPL. Updated standard header. Embed license as resource. * DiscImageChef.Console/DiscImageChef.Console.csproj: * DiscImageChef.Devices/DiscImageChef.Devices.csproj: * DiscImageChef.Helpers/DiscImageChef.Helpers.csproj: * DiscImageChef.Settings/DiscImageChef.Settings.csproj: * DiscImageChef.Decoders/DiscImageChef.Decoders.csproj: * DiscImageChef.Metadata/DiscImageChef.Metadata.csproj: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: * DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj: * DiscImageChef.Filesystems/DiscImageChef.Filesystems.csproj: * DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj: Relicensed as LGPL. Updated standard header. Embed license as resource. * DiscImageChef/DiscImageChef.csproj: * DiscImageChef.Interop/DiscImageChef.Interop.csproj: Updated standard header. Embed license as resource.
438 lines
21 KiB
C#
438 lines
21 KiB
C#
// /***************************************************************************
|
|
// The Disc Image Chef
|
|
// ----------------------------------------------------------------------------
|
|
//
|
|
// Filename : ODS.cs
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
//
|
|
// Component : Files-11 On-Disk Structure plugin.
|
|
//
|
|
// --[ Description ] ----------------------------------------------------------
|
|
//
|
|
// Identifies the Files-11 On-Disk Structure and shows information.
|
|
//
|
|
// --[ License ] --------------------------------------------------------------
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
// published by the Free Software Foundation; either version 2.1 of the
|
|
// License, or (at your option) any later version.
|
|
//
|
|
// This library is distributed in the hope that it will be useful, but
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
// Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
//
|
|
// ----------------------------------------------------------------------------
|
|
// Copyright © 2011-2016 Natalia Portillo
|
|
// ****************************************************************************/
|
|
|
|
using System;
|
|
using System.Text;
|
|
using DiscImageChef;
|
|
using System.Collections.Generic;
|
|
|
|
// Information from VMS File System Internals by Kirby McCoy
|
|
// ISBN: 1-55558-056-4
|
|
// With some hints from http://www.decuslib.com/DECUS/vmslt97b/gnusoftware/gccaxp/7_1/vms/hm2def.h
|
|
// Expects the home block to be always in sector #1 (does not check deltas)
|
|
// Assumes a sector size of 512 bytes (VMS does on HDDs and optical drives, dunno about M.O.)
|
|
// Book only describes ODS-2. Need to test ODS-1 and ODS-5
|
|
// There is an ODS with signature "DECFILES11A", yet to be seen
|
|
// Time is a 64 bit unsigned integer, tenths of microseconds since 1858/11/17 00:00:00.
|
|
// TODO: Implement checksum
|
|
namespace DiscImageChef.Filesystems
|
|
{
|
|
class ODS : Filesystem
|
|
{
|
|
public ODS()
|
|
{
|
|
Name = "Files-11 On-Disk Structure";
|
|
PluginUUID = new Guid("de20633c-8021-4384-aeb0-83b0df14491f");
|
|
}
|
|
|
|
public ODS(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
|
{
|
|
Name = "Files-11 On-Disk Structure";
|
|
PluginUUID = new Guid("de20633c-8021-4384-aeb0-83b0df14491f");
|
|
}
|
|
|
|
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
|
{
|
|
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
|
return false;
|
|
|
|
if(imagePlugin.GetSectorSize() < 512)
|
|
return false;
|
|
|
|
byte[] magic_b = new byte[12];
|
|
string magic;
|
|
byte[] hb_sector = imagePlugin.ReadSector(1 + partitionStart);
|
|
|
|
Array.Copy(hb_sector, 0x1F0, magic_b, 0, 12);
|
|
magic = Encoding.ASCII.GetString(magic_b);
|
|
|
|
return magic == "DECFILE11A " || magic == "DECFILE11B ";
|
|
}
|
|
|
|
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
|
|
{
|
|
information = "";
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
ODSHomeBlock homeblock = new ODSHomeBlock();
|
|
byte[] temp_string = new byte[12];
|
|
homeblock.min_class = new byte[20];
|
|
homeblock.max_class = new byte[20];
|
|
|
|
byte[] hb_sector = imagePlugin.ReadSector(1 + partitionStart);
|
|
|
|
homeblock.homelbn = BitConverter.ToUInt32(hb_sector, 0x000);
|
|
homeblock.alhomelbn = BitConverter.ToUInt32(hb_sector, 0x004);
|
|
homeblock.altidxlbn = BitConverter.ToUInt32(hb_sector, 0x008);
|
|
homeblock.struclev = BitConverter.ToUInt16(hb_sector, 0x00C);
|
|
homeblock.cluster = BitConverter.ToUInt16(hb_sector, 0x00E);
|
|
homeblock.homevbn = BitConverter.ToUInt16(hb_sector, 0x010);
|
|
homeblock.alhomevbn = BitConverter.ToUInt16(hb_sector, 0x012);
|
|
homeblock.altidxvbn = BitConverter.ToUInt16(hb_sector, 0x014);
|
|
homeblock.ibmapvbn = BitConverter.ToUInt16(hb_sector, 0x016);
|
|
homeblock.ibmaplbn = BitConverter.ToUInt32(hb_sector, 0x018);
|
|
homeblock.maxfiles = BitConverter.ToUInt32(hb_sector, 0x01C);
|
|
homeblock.ibmapsize = BitConverter.ToUInt16(hb_sector, 0x020);
|
|
homeblock.resfiles = BitConverter.ToUInt16(hb_sector, 0x022);
|
|
homeblock.devtype = BitConverter.ToUInt16(hb_sector, 0x024);
|
|
homeblock.rvn = BitConverter.ToUInt16(hb_sector, 0x026);
|
|
homeblock.setcount = BitConverter.ToUInt16(hb_sector, 0x028);
|
|
homeblock.volchar = BitConverter.ToUInt16(hb_sector, 0x02A);
|
|
homeblock.volowner = BitConverter.ToUInt32(hb_sector, 0x02C);
|
|
homeblock.sec_mask = BitConverter.ToUInt32(hb_sector, 0x030);
|
|
homeblock.protect = BitConverter.ToUInt16(hb_sector, 0x034);
|
|
homeblock.fileprot = BitConverter.ToUInt16(hb_sector, 0x036);
|
|
homeblock.recprot = BitConverter.ToUInt16(hb_sector, 0x038);
|
|
homeblock.checksum1 = BitConverter.ToUInt16(hb_sector, 0x03A);
|
|
homeblock.credate = BitConverter.ToUInt64(hb_sector, 0x03C);
|
|
homeblock.window = hb_sector[0x044];
|
|
homeblock.lru_lim = hb_sector[0x045];
|
|
homeblock.extend = BitConverter.ToUInt16(hb_sector, 0x046);
|
|
homeblock.retainmin = BitConverter.ToUInt64(hb_sector, 0x048);
|
|
homeblock.retainmax = BitConverter.ToUInt64(hb_sector, 0x050);
|
|
homeblock.revdate = BitConverter.ToUInt64(hb_sector, 0x058);
|
|
Array.Copy(hb_sector, 0x060, homeblock.min_class, 0, 20);
|
|
Array.Copy(hb_sector, 0x074, homeblock.max_class, 0, 20);
|
|
homeblock.filetab_fid1 = BitConverter.ToUInt16(hb_sector, 0x088);
|
|
homeblock.filetab_fid2 = BitConverter.ToUInt16(hb_sector, 0x08A);
|
|
homeblock.filetab_fid3 = BitConverter.ToUInt16(hb_sector, 0x08C);
|
|
homeblock.lowstruclev = BitConverter.ToUInt16(hb_sector, 0x08E);
|
|
homeblock.highstruclev = BitConverter.ToUInt16(hb_sector, 0x090);
|
|
homeblock.copydate = BitConverter.ToUInt64(hb_sector, 0x092);
|
|
homeblock.serialnum = BitConverter.ToUInt32(hb_sector, 0x1C8);
|
|
Array.Copy(hb_sector, 0x1CC, temp_string, 0, 12);
|
|
homeblock.strucname = StringHandlers.CToString(temp_string);
|
|
Array.Copy(hb_sector, 0x1D8, temp_string, 0, 12);
|
|
homeblock.volname = StringHandlers.CToString(temp_string);
|
|
Array.Copy(hb_sector, 0x1E4, temp_string, 0, 12);
|
|
homeblock.ownername = StringHandlers.CToString(temp_string);
|
|
Array.Copy(hb_sector, 0x1F0, temp_string, 0, 12);
|
|
homeblock.format = StringHandlers.CToString(temp_string);
|
|
homeblock.checksum2 = BitConverter.ToUInt16(hb_sector, 0x1FE);
|
|
|
|
if((homeblock.struclev & 0xFF00) != 0x0200 || (homeblock.struclev & 0xFF) != 1 || homeblock.format != "DECFILE11B ")
|
|
sb.AppendLine("The following information may be incorrect for this volume.");
|
|
if(homeblock.resfiles < 5 || homeblock.devtype != 0)
|
|
sb.AppendLine("This volume may be corrupted.");
|
|
|
|
sb.AppendFormat("Volume format is {0}", homeblock.format).AppendLine();
|
|
sb.AppendFormat("Volume is Level {0} revision {1}", (homeblock.struclev & 0xFF00) >> 8, homeblock.struclev & 0xFF).AppendLine();
|
|
sb.AppendFormat("Lowest structure in the volume is Level {0}, revision {1}", (homeblock.lowstruclev & 0xFF00) >> 8, homeblock.lowstruclev & 0xFF).AppendLine();
|
|
sb.AppendFormat("Highest structure in the volume is Level {0}, revision {1}", (homeblock.highstruclev & 0xFF00) >> 8, homeblock.highstruclev & 0xFF).AppendLine();
|
|
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", homeblock.cluster, homeblock.cluster * 512).AppendLine();
|
|
sb.AppendFormat("This home block is on sector {0} (cluster {1})", homeblock.homelbn, homeblock.homevbn).AppendLine();
|
|
sb.AppendFormat("Secondary home block is on sector {0} (cluster {1})", homeblock.alhomelbn, homeblock.alhomevbn).AppendLine();
|
|
sb.AppendFormat("Volume bitmap starts in sector {0} (cluster {1})", homeblock.ibmaplbn, homeblock.ibmapvbn).AppendLine();
|
|
sb.AppendFormat("Volume bitmap runs for {0} sectors ({1} bytes)", homeblock.ibmapsize, homeblock.ibmapsize * 512).AppendLine();
|
|
sb.AppendFormat("Backup INDEXF.SYS;1 is in sector {0} (cluster {1})", homeblock.altidxlbn, homeblock.altidxvbn).AppendLine();
|
|
sb.AppendFormat("{0} maximum files on the volume", homeblock.maxfiles).AppendLine();
|
|
sb.AppendFormat("{0} reserved files", homeblock.resfiles).AppendLine();
|
|
if(homeblock.rvn > 0 && homeblock.setcount > 0 && homeblock.strucname != " ")
|
|
sb.AppendFormat("Volume is {0} of {1} in set \"{2}\".", homeblock.rvn, homeblock.setcount, homeblock.strucname).AppendLine();
|
|
sb.AppendFormat("Volume owner is \"{0}\" (ID 0x{1:X8})", homeblock.ownername, homeblock.volowner).AppendLine();
|
|
sb.AppendFormat("Volume label: \"{0}\"", homeblock.volname).AppendLine();
|
|
sb.AppendFormat("Drive serial number: 0x{0:X8}", homeblock.serialnum).AppendLine();
|
|
sb.AppendFormat("Volume was created on {0}", DateHandlers.VMSToDateTime(homeblock.credate)).AppendLine();
|
|
if(homeblock.revdate > 0)
|
|
sb.AppendFormat("Volume was last modified on {0}", DateHandlers.VMSToDateTime(homeblock.revdate)).AppendLine();
|
|
if(homeblock.copydate > 0)
|
|
sb.AppendFormat("Volume copied on {0}", DateHandlers.VMSToDateTime(homeblock.copydate)).AppendLine();
|
|
sb.AppendFormat("Checksums: 0x{0:X4} and 0x{1:X4}", homeblock.checksum1, homeblock.checksum2).AppendLine();
|
|
sb.AppendLine("Flags:");
|
|
sb.AppendFormat("Window: {0}", homeblock.window).AppendLine();
|
|
sb.AppendFormat("Cached directores: {0}", homeblock.lru_lim).AppendLine();
|
|
sb.AppendFormat("Default allocation: {0} blocks", homeblock.extend).AppendLine();
|
|
if((homeblock.volchar & 0x01) == 0x01)
|
|
sb.AppendLine("Readings should be verified");
|
|
if((homeblock.volchar & 0x02) == 0x02)
|
|
sb.AppendLine("Writings should be verified");
|
|
if((homeblock.volchar & 0x04) == 0x04)
|
|
sb.AppendLine("Files should be erased or overwritten when deleted");
|
|
if((homeblock.volchar & 0x08) == 0x08)
|
|
sb.AppendLine("Highwater mark is to be disabled");
|
|
if((homeblock.volchar & 0x10) == 0x10)
|
|
sb.AppendLine("Classification checks are enabled");
|
|
sb.AppendLine("Volume permissions (r = read, w = write, c = create, d = delete)");
|
|
sb.AppendLine("System, owner, group, world");
|
|
// System
|
|
if((homeblock.protect & 0x1000) == 0x1000)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("r");
|
|
if((homeblock.protect & 0x2000) == 0x2000)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("w");
|
|
if((homeblock.protect & 0x4000) == 0x4000)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("c");
|
|
if((homeblock.protect & 0x8000) == 0x8000)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("d");
|
|
// Owner
|
|
if((homeblock.protect & 0x100) == 0x100)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("r");
|
|
if((homeblock.protect & 0x200) == 0x200)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("w");
|
|
if((homeblock.protect & 0x400) == 0x400)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("c");
|
|
if((homeblock.protect & 0x800) == 0x800)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("d");
|
|
// Group
|
|
if((homeblock.protect & 0x10) == 0x10)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("r");
|
|
if((homeblock.protect & 0x20) == 0x20)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("w");
|
|
if((homeblock.protect & 0x40) == 0x40)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("c");
|
|
if((homeblock.protect & 0x80) == 0x80)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("d");
|
|
// World (other)
|
|
if((homeblock.protect & 0x1) == 0x1)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("r");
|
|
if((homeblock.protect & 0x2) == 0x2)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("w");
|
|
if((homeblock.protect & 0x4) == 0x4)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("c");
|
|
if((homeblock.protect & 0x8) == 0x8)
|
|
sb.Append("-");
|
|
else
|
|
sb.Append("d");
|
|
|
|
sb.AppendLine();
|
|
|
|
sb.AppendLine("Unknown structures:");
|
|
sb.AppendFormat("Security mask: 0x{0:X8}", homeblock.sec_mask).AppendLine();
|
|
sb.AppendFormat("File protection: 0x{0:X4}", homeblock.fileprot).AppendLine();
|
|
sb.AppendFormat("Record protection: 0x{0:X4}", homeblock.recprot).AppendLine();
|
|
|
|
xmlFSType = new Schemas.FileSystemType();
|
|
xmlFSType.Type = "FILES-11";
|
|
xmlFSType.ClusterSize = homeblock.cluster * 512;
|
|
xmlFSType.Clusters = homeblock.cluster;
|
|
xmlFSType.VolumeName = homeblock.volname;
|
|
xmlFSType.VolumeSerial = String.Format("{0:X8}", homeblock.serialnum);
|
|
if(homeblock.credate > 0)
|
|
{
|
|
xmlFSType.CreationDate = DateHandlers.VMSToDateTime(homeblock.credate);
|
|
xmlFSType.CreationDateSpecified = true;
|
|
}
|
|
if(homeblock.revdate > 0)
|
|
{
|
|
xmlFSType.ModificationDate = DateHandlers.VMSToDateTime(homeblock.revdate);
|
|
xmlFSType.ModificationDateSpecified = true;
|
|
}
|
|
|
|
information = sb.ToString();
|
|
}
|
|
|
|
struct ODSHomeBlock
|
|
{
|
|
/// <summary>0x000, LBN of THIS home block</summary>
|
|
public UInt32 homelbn;
|
|
/// <summary>0x004, LBN of the secondary home block</summary>
|
|
public UInt32 alhomelbn;
|
|
/// <summary>0x008, LBN of backup INDEXF.SYS;1</summary>
|
|
public UInt32 altidxlbn;
|
|
/// <summary>0x00C, High byte contains filesystem version (1, 2 or 5), low byte contains revision (1)</summary>
|
|
public UInt16 struclev;
|
|
/// <summary>0x00E, Number of blocks each bit of the volume bitmap represents</summary>
|
|
public UInt16 cluster;
|
|
/// <summary>0x010, VBN of THIS home block</summary>
|
|
public UInt16 homevbn;
|
|
/// <summary>0x012, VBN of the secondary home block</summary>
|
|
public UInt16 alhomevbn;
|
|
/// <summary>0x014, VBN of backup INDEXF.SYS;1</summary>
|
|
public UInt16 altidxvbn;
|
|
/// <summary>0x016, VBN of the bitmap</summary>
|
|
public UInt16 ibmapvbn;
|
|
/// <summary>0x018, LBN of the bitmap</summary>
|
|
public UInt32 ibmaplbn;
|
|
/// <summary>0x01C, Max files on volume</summary>
|
|
public UInt32 maxfiles;
|
|
/// <summary>0x020, Bitmap size in sectors</summary>
|
|
public UInt16 ibmapsize;
|
|
/// <summary>0x022, Reserved files, 5 at minimum</summary>
|
|
public UInt16 resfiles;
|
|
/// <summary>0x024, Device type, ODS-2 defines it as always 0</summary>
|
|
public UInt16 devtype;
|
|
/// <summary>0x026, Relative volume number (number of the volume in a set)</summary>
|
|
public UInt16 rvn;
|
|
/// <summary>0x028, Total number of volumes in the set this volume is</summary>
|
|
public UInt16 setcount;
|
|
/// <summary>0x02A, Flags</summary>
|
|
public UInt16 volchar;
|
|
/// <summary>0x02C, User ID of the volume owner</summary>
|
|
public UInt32 volowner;
|
|
/// <summary>0x030, Security mask (??)</summary>
|
|
public UInt32 sec_mask;
|
|
/// <summary>0x034, Volume permissions (system, owner, group and other)</summary>
|
|
public UInt16 protect;
|
|
/// <summary>0x036, Default file protection, unsupported in ODS-2</summary>
|
|
public UInt16 fileprot;
|
|
/// <summary>0x038, Default file record protection</summary>
|
|
public UInt16 recprot;
|
|
/// <summary>0x03A, Checksum of all preceding entries</summary>
|
|
public UInt16 checksum1;
|
|
/// <summary>0x03C, Creation date</summary>
|
|
public UInt64 credate;
|
|
/// <summary>0x044, Window size (pointers for the window)</summary>
|
|
public byte window;
|
|
/// <summary>0x045, Directories to be stored in cache</summary>
|
|
public byte lru_lim;
|
|
/// <summary>0x046, Default allocation size in blocks</summary>
|
|
public UInt16 extend;
|
|
/// <summary>0x048, Minimum file retention period</summary>
|
|
public UInt64 retainmin;
|
|
/// <summary>0x050, Maximum file retention period</summary>
|
|
public UInt64 retainmax;
|
|
/// <summary>0x058, Last modification date</summary>
|
|
public UInt64 revdate;
|
|
/// <summary>0x060, Minimum security class, 20 bytes</summary>
|
|
public byte[] min_class;
|
|
/// <summary>0x074, Maximum security class, 20 bytes</summary>
|
|
public byte[] max_class;
|
|
/// <summary>0x088, File lookup table FID</summary>
|
|
public UInt16 filetab_fid1;
|
|
/// <summary>0x08A, File lookup table FID</summary>
|
|
public UInt16 filetab_fid2;
|
|
/// <summary>0x08C, File lookup table FID</summary>
|
|
public UInt16 filetab_fid3;
|
|
/// <summary>0x08E, Lowest structure level on the volume</summary>
|
|
public UInt16 lowstruclev;
|
|
/// <summary>0x090, Highest structure level on the volume</summary>
|
|
public UInt16 highstruclev;
|
|
/// <summary>0x092, Volume copy date (??)</summary>
|
|
public UInt64 copydate;
|
|
/// <summary>0x09A, 302 bytes</summary>
|
|
public byte[] reserved1;
|
|
/// <summary>0x1C8, Physical drive serial number</summary>
|
|
public UInt32 serialnum;
|
|
/// <summary>0x1CC, Name of the volume set, 12 bytes</summary>
|
|
public string strucname;
|
|
/// <summary>0x1D8, Volume label, 12 bytes</summary>
|
|
public string volname;
|
|
/// <summary>0x1E4, Name of the volume owner, 12 bytes</summary>
|
|
public string ownername;
|
|
/// <summary>0x1F0, ODS-2 defines it as "DECFILE11B", 12 bytes</summary>
|
|
public string format;
|
|
/// <summary>0x1FC, Reserved</summary>
|
|
public UInt16 reserved2;
|
|
/// <summary>0x1FE, Checksum of preceding 255 words (16 bit units)</summary>
|
|
public UInt16 checksum2;
|
|
}
|
|
|
|
public override Errno Mount()
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno Mount(bool debug)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno Unmount()
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno MapBlock(string path, long fileBlock, ref long deviceBlock)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno GetAttributes(string path, ref FileAttributes attributes)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno ListXAttr(string path, ref List<string> xattrs)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno GetXattr(string path, string xattr, ref byte[] buf)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno Read(string path, long offset, long size, ref byte[] buf)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno ReadDir(string path, ref List<string> contents)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno StatFs(ref FileSystemInfo stat)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno Stat(string path, ref FileEntryInfo stat)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
|
|
public override Errno ReadLink(string path, ref string dest)
|
|
{
|
|
return Errno.NotImplemented;
|
|
}
|
|
}
|
|
} |