diff --git a/Aaru.Filesystems/Squash/Info.cs b/Aaru.Filesystems/Squash/Info.cs index 1b58d9ff4..68b58c512 100644 --- a/Aaru.Filesystems/Squash/Info.cs +++ b/Aaru.Filesystems/Squash/Info.cs @@ -78,7 +78,7 @@ public sealed partial class Squash break; case SQUASH_CIGAM: - sqSb = Marshal.ByteArrayToStructureBigEndian(sector); + sqSb = Marshal.ByteArrayToStructureBigEndianGenerated(sector); littleEndian = false; break; diff --git a/Aaru.Filesystems/Squash/Structs.cs b/Aaru.Filesystems/Squash/Structs.cs index 5c779e6d7..592ba2af5 100644 --- a/Aaru.Filesystems/Squash/Structs.cs +++ b/Aaru.Filesystems/Squash/Structs.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using System.Runtime.InteropServices; +using Aaru.CommonTypes.Attributes; namespace Aaru.Filesystems; @@ -37,27 +38,28 @@ public sealed partial class Squash #region Nested type: SuperBlock [StructLayout(LayoutKind.Sequential, Pack = 1)] - readonly struct SuperBlock + [SwapEndian] + partial struct SuperBlock { - public readonly uint magic; - public readonly uint inodes; - public readonly uint mkfs_time; - public readonly uint block_size; - public readonly uint fragments; - public readonly ushort compression; - public readonly ushort block_log; - public readonly ushort flags; - public readonly ushort no_ids; - public readonly ushort s_major; - public readonly ushort s_minor; - public readonly ulong root_inode; - public readonly ulong bytes_used; - public readonly ulong id_table_start; - public readonly ulong xattr_id_table_start; - public readonly ulong inode_table_start; - public readonly ulong directory_table_start; - public readonly ulong fragment_table_start; - public readonly ulong lookup_table_start; + public uint magic; + public uint inodes; + public uint mkfs_time; + public uint block_size; + public uint fragments; + public ushort compression; + public ushort block_log; + public ushort flags; + public ushort no_ids; + public ushort s_major; + public ushort s_minor; + public ulong root_inode; + public ulong bytes_used; + public ulong id_table_start; + public ulong xattr_id_table_start; + public ulong inode_table_start; + public ulong directory_table_start; + public ulong fragment_table_start; + public ulong lookup_table_start; } #endregion