2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2016-09-02 05:23:59 +01:00
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : QNX4.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Component : QNX4 filesystem plugin.
|
2016-09-02 05:23:59 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
2016-09-02 06:03:58 +01:00
|
|
|
|
// Identifies the QNX4 filesystem and shows information.
|
2016-09-02 05:23:59 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ 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/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Copyright © 2011-2018 Natalia Portillo
|
2016-09-02 05:23:59 +01:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
2016-09-02 06:03:58 +01:00
|
|
|
|
using System.Runtime.InteropServices;
|
2017-06-06 21:23:20 +01:00
|
|
|
|
using System.Text;
|
2017-07-19 16:31:08 +01:00
|
|
|
|
using DiscImageChef.CommonTypes;
|
2017-12-21 14:30:38 +00:00
|
|
|
|
using DiscImageChef.DiscImages;
|
|
|
|
|
|
using Schemas;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Filesystems
|
|
|
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
|
public class QNX4 : IFilesystem
|
2016-09-02 05:23:59 +01:00
|
|
|
|
{
|
2017-12-19 20:33:03 +00:00
|
|
|
|
readonly byte[] QNX4_RootDir_Fname =
|
|
|
|
|
|
{0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
Encoding currentEncoding;
|
|
|
|
|
|
FileSystemType xmlFsType;
|
|
|
|
|
|
public virtual FileSystemType XmlFsType => xmlFsType;
|
|
|
|
|
|
public virtual Encoding Encoding => currentEncoding;
|
|
|
|
|
|
public virtual string Name => "QNX4 Plugin";
|
|
|
|
|
|
public virtual Guid Id => new Guid("E73A63FA-B5B0-48BF-BF82-DA5F0A8170D2");
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
public virtual bool Identify(IMediaImage imagePlugin, Partition partition)
|
2016-09-02 05:23:59 +01:00
|
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(partition.Start + 1 >= imagePlugin.Info.Sectors) return false;
|
2017-11-08 17:05:00 +00:00
|
|
|
|
|
2017-07-19 16:37:11 +01:00
|
|
|
|
byte[] sector = imagePlugin.ReadSector(partition.Start + 1);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if(sector.Length < 512) return false;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
IntPtr sbPtr = Marshal.AllocHGlobal(512);
|
|
|
|
|
|
Marshal.Copy(sector, 0, sbPtr, 512);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
QNX4_Superblock qnxSb = (QNX4_Superblock)Marshal.PtrToStructure(sbPtr, typeof(QNX4_Superblock));
|
2016-09-02 05:23:59 +01:00
|
|
|
|
Marshal.FreeHGlobal(sbPtr);
|
|
|
|
|
|
|
|
|
|
|
|
// Check root directory name
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if(!QNX4_RootDir_Fname.SequenceEqual(qnxSb.rootDir.di_fname)) return false;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
// Check sizes are multiple of blocks
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if(qnxSb.rootDir.di_size % 512 != 0 || qnxSb.inode.di_size % 512 != 0 || qnxSb.boot.di_size % 512 != 0 ||
|
|
|
|
|
|
qnxSb.altBoot.di_size % 512 != 0) return false;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
// Check extents are not past device
|
2017-07-19 16:37:11 +01:00
|
|
|
|
if(qnxSb.rootDir.di_first_xtnt.block + partition.Start >= partition.End ||
|
|
|
|
|
|
qnxSb.inode.di_first_xtnt.block + partition.Start >= partition.End ||
|
|
|
|
|
|
qnxSb.boot.di_first_xtnt.block + partition.Start >= partition.End ||
|
2017-12-19 20:33:03 +00:00
|
|
|
|
qnxSb.altBoot.di_first_xtnt.block + partition.Start >= partition.End) return false;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
// Check inodes are in use
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if((qnxSb.rootDir.di_status & 0x01) != 0x01 || (qnxSb.inode.di_status & 0x01) != 0x01 ||
|
|
|
|
|
|
(qnxSb.boot.di_status & 0x01) != 0x01) return false;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
// All hail filesystems without identification marks
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
public virtual void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
|
|
|
|
|
|
Encoding encoding)
|
2016-09-02 05:23:59 +01:00
|
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
|
currentEncoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
2016-09-02 05:23:59 +01:00
|
|
|
|
information = "";
|
2017-07-19 16:37:11 +01:00
|
|
|
|
byte[] sector = imagePlugin.ReadSector(partition.Start + 1);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if(sector.Length < 512) return;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
|
|
|
|
|
IntPtr sbPtr = Marshal.AllocHGlobal(512);
|
|
|
|
|
|
Marshal.Copy(sector, 0, sbPtr, 512);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
QNX4_Superblock qnxSb = (QNX4_Superblock)Marshal.PtrToStructure(sbPtr, typeof(QNX4_Superblock));
|
2016-09-02 05:23:59 +01:00
|
|
|
|
Marshal.FreeHGlobal(sbPtr);
|
|
|
|
|
|
|
|
|
|
|
|
// Too much useless information
|
|
|
|
|
|
/*
|
2017-06-06 21:23:20 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_fname = {0}", CurrentEncoding.GetString(qnxSb.rootDir.di_fname));
|
2016-09-02 05:23:59 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_size = {0}", qnxSb.rootDir.di_size);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_first_xtnt.block = {0}", qnxSb.rootDir.di_first_xtnt.block);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_first_xtnt.length = {0}", qnxSb.rootDir.di_first_xtnt.length);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_xblk = {0}", qnxSb.rootDir.di_xblk);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_ftime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_ftime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_mtime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_mtime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_atime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_atime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_ctime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_ctime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_num_xtnts = {0}", qnxSb.rootDir.di_num_xtnts);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_mode = {0}", Convert.ToString(qnxSb.rootDir.di_mode, 8));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_uid = {0}", qnxSb.rootDir.di_uid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_gid = {0}", qnxSb.rootDir.di_gid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_nlink = {0}", qnxSb.rootDir.di_nlink);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_zero = {0}", qnxSb.rootDir.di_zero);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_type = {0}", qnxSb.rootDir.di_type);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.rootDir.di_status = {0}", qnxSb.rootDir.di_status);
|
|
|
|
|
|
|
2017-06-06 21:23:20 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_fname = {0}", CurrentEncoding.GetString(qnxSb.inode.di_fname));
|
2016-09-02 05:23:59 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_size = {0}", qnxSb.inode.di_size);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_first_xtnt.block = {0}", qnxSb.inode.di_first_xtnt.block);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_first_xtnt.length = {0}", qnxSb.inode.di_first_xtnt.length);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_xblk = {0}", qnxSb.inode.di_xblk);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_ftime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.inode.di_ftime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_mtime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.inode.di_mtime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_atime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.inode.di_atime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_ctime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.inode.di_ctime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_num_xtnts = {0}", qnxSb.inode.di_num_xtnts);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_mode = {0}", Convert.ToString(qnxSb.inode.di_mode, 8));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_uid = {0}", qnxSb.inode.di_uid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_gid = {0}", qnxSb.inode.di_gid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_nlink = {0}", qnxSb.inode.di_nlink);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_zero = {0}", qnxSb.inode.di_zero);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_type = {0}", qnxSb.inode.di_type);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.inode.di_status = {0}", qnxSb.inode.di_status);
|
|
|
|
|
|
|
2017-06-06 21:23:20 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_fname = {0}", CurrentEncoding.GetString(qnxSb.boot.di_fname));
|
2016-09-02 05:23:59 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_size = {0}", qnxSb.boot.di_size);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_first_xtnt.block = {0}", qnxSb.boot.di_first_xtnt.block);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_first_xtnt.length = {0}", qnxSb.boot.di_first_xtnt.length);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_xblk = {0}", qnxSb.boot.di_xblk);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_ftime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.boot.di_ftime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_mtime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.boot.di_mtime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_atime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.boot.di_atime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_ctime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.boot.di_ctime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_num_xtnts = {0}", qnxSb.boot.di_num_xtnts);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_mode = {0}", Convert.ToString(qnxSb.boot.di_mode, 8));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_uid = {0}", qnxSb.boot.di_uid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_gid = {0}", qnxSb.boot.di_gid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_nlink = {0}", qnxSb.boot.di_nlink);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_zero = {0}", qnxSb.boot.di_zero);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_type = {0}", qnxSb.boot.di_type);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.boot.di_status = {0}", qnxSb.boot.di_status);
|
|
|
|
|
|
|
2017-06-06 21:23:20 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_fname = {0}", CurrentEncoding.GetString(qnxSb.altBoot.di_fname));
|
2016-09-02 05:23:59 +01:00
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_size = {0}", qnxSb.altBoot.di_size);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_first_xtnt.block = {0}", qnxSb.altBoot.di_first_xtnt.block);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_first_xtnt.length = {0}", qnxSb.altBoot.di_first_xtnt.length);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_xblk = {0}", qnxSb.altBoot.di_xblk);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_ftime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.altBoot.di_ftime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_mtime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.altBoot.di_mtime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_atime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.altBoot.di_atime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_ctime = {0}", DateHandlers.UNIXUnsignedToDateTime(qnxSb.altBoot.di_ctime));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_num_xtnts = {0}", qnxSb.altBoot.di_num_xtnts);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_mode = {0}", Convert.ToString(qnxSb.altBoot.di_mode, 8));
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_uid = {0}", qnxSb.altBoot.di_uid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_gid = {0}", qnxSb.altBoot.di_gid);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_nlink = {0}", qnxSb.altBoot.di_nlink);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_zero = {0}", qnxSb.altBoot.di_zero);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_type = {0}", qnxSb.altBoot.di_type);
|
|
|
|
|
|
DicConsole.DebugWriteLine("QNX4 plugin", "qnxSb.altBoot.di_status = {0}", qnxSb.altBoot.di_status);
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2017-12-21 17:58:51 +00:00
|
|
|
|
information =
|
2017-12-23 03:59:48 +00:00
|
|
|
|
$"QNX4 filesystem\nCreated on {DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime)}\n";
|
2016-09-02 05:23:59 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
xmlFsType = new FileSystemType
|
2017-07-25 03:27:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
Type = "QNX4 filesystem",
|
|
|
|
|
|
Clusters = (long)partition.Length,
|
|
|
|
|
|
ClusterSize = 512,
|
2017-12-23 03:59:48 +00:00
|
|
|
|
CreationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime),
|
2017-07-25 03:27:47 +01:00
|
|
|
|
CreationDateSpecified = true,
|
2017-12-23 03:59:48 +00:00
|
|
|
|
ModificationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_mtime),
|
2017-07-25 03:27:47 +01:00
|
|
|
|
ModificationDateSpecified = true
|
|
|
|
|
|
};
|
2017-12-26 06:05:12 +00:00
|
|
|
|
xmlFsType.Bootable |= qnxSb.boot.di_size != 0 || qnxSb.altBoot.di_size != 0;
|
2016-09-02 05:23:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-24 02:37:41 +00:00
|
|
|
|
struct QNX4_Extent
|
|
|
|
|
|
{
|
|
|
|
|
|
public uint block;
|
|
|
|
|
|
public uint length;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
struct QNX4_Inode
|
|
|
|
|
|
{
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] di_fname;
|
|
|
|
|
|
public uint di_size;
|
|
|
|
|
|
public QNX4_Extent di_first_xtnt;
|
|
|
|
|
|
public uint di_xblk;
|
|
|
|
|
|
public uint di_ftime;
|
|
|
|
|
|
public uint di_mtime;
|
|
|
|
|
|
public uint di_atime;
|
|
|
|
|
|
public uint di_ctime;
|
|
|
|
|
|
public ushort di_num_xtnts;
|
|
|
|
|
|
public ushort di_mode;
|
|
|
|
|
|
public ushort di_uid;
|
|
|
|
|
|
public ushort di_gid;
|
|
|
|
|
|
public ushort di_nlink;
|
|
|
|
|
|
public uint di_zero;
|
|
|
|
|
|
public byte di_type;
|
|
|
|
|
|
public byte di_status;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
struct QNX4_LinkInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)] public byte[] dl_fname;
|
|
|
|
|
|
public uint dl_inode_blk;
|
|
|
|
|
|
public byte dl_inode_ndx;
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public byte[] dl_spare;
|
|
|
|
|
|
public byte dl_status;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
struct QNX4_ExtentBlock
|
|
|
|
|
|
{
|
|
|
|
|
|
public uint next_xblk;
|
|
|
|
|
|
public uint prev_xblk;
|
|
|
|
|
|
public byte num_xtnts;
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] spare;
|
|
|
|
|
|
public uint num_blocks;
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 60)] public QNX4_Extent[] xtnts;
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] signature;
|
|
|
|
|
|
public QNX4_Extent first_xtnt;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
struct QNX4_Superblock
|
|
|
|
|
|
{
|
|
|
|
|
|
public QNX4_Inode rootDir;
|
|
|
|
|
|
public QNX4_Inode inode;
|
|
|
|
|
|
public QNX4_Inode boot;
|
|
|
|
|
|
public QNX4_Inode altBoot;
|
|
|
|
|
|
}
|
2016-09-02 05:23:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|