// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Version : 1.0 // Author(s) : Natalia Portillo // // Component : Component // // Revision : $Revision$ // Last change by : $Author$ // Date : $Date$ // // --[ Description ] ---------------------------------------------------------- // // Description // // --[ License ] -------------------------------------------------------------- // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ---------------------------------------------------------------------------- // Copyright (C) 2011-2015 Claunia.com // ****************************************************************************/ // //$Id$ using System; namespace DiscImageChef.Filesystems.LisaFS { partial class LisaFS : Filesystem { struct MDDF { /// 0x00, Filesystem version public UInt16 fsversion; /// 0x02, Volume ID public UInt64 volid; /// 0x0A, Volume sequence number public UInt16 volnum; /// 0x0C, Pascal string, 32+1 bytes, volume name public string volname; /// 0x2D, unknown, possible padding public byte unknown1; /// 0x2E, Pascal string, 32+1 bytes, password public string password; /// 0x4F, unknown, possible padding public byte unknown2; /// 0x50, Lisa serial number that init'ed this disk public UInt32 machine_id; /// 0x54, ID of the master copy ? no idea really public UInt32 master_copy_id; /// 0x58, Date of volume creation public DateTime dtvc; /// 0x5C, Date... public DateTime dtcc; /// 0x60, Date of volume backup public DateTime dtvb; /// 0x64, Date of volume scavenging public DateTime dtvs; /// 0x68, unknown public UInt32 unknown3; /// 0x6C, block the MDDF is residing on public UInt32 mddf_block; /// 0x70, volsize-1 public UInt32 volsize_minus_one; /// 0x74, volsize-1-mddf_block public UInt32 volsize_minus_mddf_minus_one; /// 0x78, Volume size in blocks public UInt32 vol_size; /// 0x7C, Blocks size of underlying drive (data+tags) public UInt16 blocksize; /// 0x7E, Data only block size public UInt16 datasize; /// 0x80, unknown public UInt16 unknown4; /// 0x82, unknown public UInt32 unknown5; /// 0x86, unknown public UInt32 unknown6; /// 0x8A, Size in sectors of filesystem clusters public UInt16 clustersize; /// 0x8C, Filesystem size in blocks public UInt32 fs_size; /// 0x90, unknown public UInt32 unknown7; /// 0x94, Pointer to S-Records public UInt32 srec_ptr; /// 0x98, unknown public UInt16 unknown9; /// 0x9A, S-Records length public UInt16 srec_len; /// 0x9C, unknown public UInt32 unknown10; /// 0xA0, unknown public UInt32 unknown11; /// 0xA4, unknown public UInt32 unknown12; /// 0xA8, unknown public UInt32 unknown13; /// 0xAC, unknown public UInt32 unknown14; /// 0xB0, Files in volume public UInt16 filecount; /// 0xB2, unknown public UInt32 unknown15; /// 0xB6, unknown public UInt32 unknown16; /// 0xBA, Free blocks public UInt32 freecount; /// 0xBE, unknown public UInt16 unknown17; /// 0xC0, unknown public UInt32 unknown18; /// 0xC4, no idea public UInt64 overmount_stamp; /// 0xCC, serialization, lisa serial number authorized to use blocked software on this volume public UInt32 serialization; /// 0xD0, unknown public UInt32 unknown19; /// 0xD4, unknown, possible timestamp public UInt32 unknown_timestamp; /// 0xD8, unknown public UInt32 unknown20; /// 0xDC, unknown public UInt32 unknown21; /// 0xE0, unknown public UInt32 unknown22; /// 0xE4, unknown public UInt32 unknown23; /// 0xE8, unknown public UInt32 unknown24; /// 0xEC, unknown public UInt32 unknown25; /// 0xF0, unknown public UInt32 unknown26; /// 0xF4, unknown public UInt32 unknown27; /// 0xF8, unknown public UInt32 unknown28; /// 0xFC, unknown public UInt32 unknown29; /// 0x100, unknown public UInt32 unknown30; /// 0x104, unknown public UInt32 unknown31; /// 0x108, unknown public UInt32 unknown32; /// 0x10C, unknown public UInt32 unknown33; /// 0x110, unknown public UInt32 unknown34; /// 0x114, unknown public UInt32 unknown35; /// 0x118, ID of volume where this volume was backed up public UInt64 backup_volid; /// 0x120, Size of LisaInfo label public UInt16 label_size; /// 0x122, not clear public UInt16 fs_overhead; /// 0x124, Return code of Scavenger public UInt16 result_scavenge; /// 0x126, No idea public UInt16 boot_code; /// 0x128, No idea public UInt16 boot_environ; /// 0x12A, unknown public UInt32 unknown36; /// 0x12E, unknown public UInt32 unknown37; /// 0x132, unknown public UInt32 unknown38; /// 0x136, Total volumes in sequence public UInt16 vol_sequence; /// 0x138, Volume is dirty? public byte vol_left_mounted; /// Is password present? (On-disk position unknown) public byte passwd_present; /// Opened files (memory-only?) (On-disk position unknown) public UInt32 opencount; /// No idea (On-disk position unknown) public UInt32 copy_thread; // Flags are boolean, but Pascal seems to use them as full unsigned 8 bit values /// No idea (On-disk position unknown) public byte privileged; /// Read-only volume (On-disk position unknown) public byte write_protected; /// Master disk (On-disk position unknown) public byte master; /// Copy disk (On-disk position unknown) public byte copy; /// No idea (On-disk position unknown) public byte copy_flag; /// No idea (On-disk position unknown) public byte scavenge_flag; } struct Tag { /// 0x00 version public UInt16 version; /// 0x02 unknown public UInt16 unknown; /// 0x04 File ID. Negative numbers are extents for the file with same absolute value number public Int16 fileID; /// Only in 20 bytes tag at 0x06, mask 0x8000 if valid tag public UInt16 usedBytes; /// Only in 20 bytes tag at 0x08, 3 bytes public UInt32 absoluteBlock; /// Only in 20 bytes tag at 0x0B, checksum byte public byte checksum; /// 0x06 in 12 bytes tag, 0x0C in 20 bytes tag, relative block public UInt16 relBlock; /// /// Next block for this file. /// In 12 bytes tag at 0x08, 2 bytes, 0x8000 bit seems always set, 0x07FF means this is last block. /// In 20 bytes tag at 0x0E, 3 bytes, 0xFFFFFF means this is last block. /// public UInt32 nextBlock; /// /// Previous block for this file. /// In 12 bytes tag at 0x0A, 2 bytes, 0x07FF means this is first block. /// In 20 bytes tag at 0x11, 3 bytes, 0xFFFFFF means this is first block. /// public UInt32 prevBlock; /// On-memory value for easy first block search. public bool isFirst; /// On-memory value for easy last block search. public bool isLast; } struct CatalogEntry { /// 0x00, seems to be 0x24 when the entry is valid public byte marker; /// 0x01, seems to be always zero public ushort zero; /// 0x03, filename, 32-bytes, null-padded public byte[] filename; /// 0x23, null-termination public byte terminator; /// /// At 0x24 /// 0x03 here for entries 64 bytes long /// 0x08 here for entries 78 bytes long /// 0x7C here for entries 50 bytes long /// This is incomplete, may fail, mostly works... /// public byte fileType; /// 0x25, lot of values found here, unknown public byte unknown; /// 0x26, file ID, must be positive and bigger than 4 public Int16 fileID; /// 0x28, creation date public UInt32 dtc; /// 0x2C, last modification date public UInt32 dtm; /// 0x30, file length in bytes public Int32 length; /// 0x34, file length in bytes, including wasted block space public Int32 wasted; /// 0x38, unknown public byte[] tail; } struct Extent { public Int32 start; public Int16 length; } struct ExtentFile { /// 0x00, filename length public byte filenameLen; /// 0x01, filename public byte[] filename; /// 0x20, unknown public ushort unknown1; /// 0x22, 8 bytes public UInt64 file_uid; /// 0x2A, unknown public byte unknown2; /// 0x2B, entry type? gets modified public byte etype; /// 0x2C, file type public FileType ftype; /// 0x2D, unknown public byte unknown3; /// 0x2E, creation time public UInt32 dtc; /// 0x32, last access time public UInt32 dta; /// 0x36, modification time public UInt32 dtm; /// 0x3A, backup time public UInt32 dtb; /// 0x3E, scavenge time public UInt32 dts; /// 0x42, machine serial number public UInt32 serial; /// 0x46, unknown public byte unknown4; /// 0x47, locked file public byte locked; /// 0x48, protected file public byte protect; /// 0x49, master file public byte master; /// 0x4A, scavenged file public byte scavenged; /// 0x4B, file closed by os public byte closed; /// 0x4C, file left open public byte open; /// 0x4D, 11 bytes, unknown public byte[] unknown5; /// 0x58, Release number public UInt16 release; /// 0x5A, Build number public UInt16 build; /// 0x5C, Compatibility level public UInt16 compatibility; /// 0x5E, Revision level public UInt16 revision; /// 0x60, unknown public ushort unknown6; /// 0x62, 0x08 set if password is valid public byte password_valid; /// 0x63, 8 bytes, scrambled password public byte[] password; /// 0x6B, 3 bytes, unknown public byte[] unknown7; /// 0x6E, filesystem overhead public ushort overhead; /// 0x70, 16 bytes, unknown public byte[] unknown8; /// 0x80, 0x200 in v1, file length in blocks public Int32 length; /// 0x84, 0x204 in v1, unknown public Int32 unknown9; /// 0x88, 0x208 in v1, extents, can contain up to 41 extents (85 in v1), dunno LisaOS maximum (never seen more than 3) public Extent[] extents; /// 0x17E, unknown, empty, padding? public short unknown10; /// 0x180, 128 bytes public byte[] LisaInfo; } struct SRecord { /// 0x00, block where ExtentsFile for this entry resides public UInt32 extent_ptr; /// 0x04, unknown public UInt32 unknown; /// 0x08, filesize in bytes public UInt32 filesize; /// 0x0C, some kind of flags, meaning unknown public UInt16 flags; } struct CatalogEntryV2 { /// 0x00, filename, 32-bytes, null-padded public byte filenameLen; /// 0x01, filename, 31-bytes public byte[] filename; /// 0x21, unknown public byte unknown1; /// 0x22, unknown public byte fileType; /// 0x23, unknown public byte unknown2; /// 0x24, unknown public Int16 fileID; /// 0x26, 16 bytes, unknown public byte[] unknown3; } } }