2025-09-08 01:04:54 +01:00
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2025-09-07 13:28:54 +01:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace Aaru.Archives;
|
|
|
|
|
|
|
|
|
|
public sealed partial class Ha
|
|
|
|
|
{
|
2025-09-08 01:04:54 +01:00
|
|
|
#region Nested type: Entry
|
|
|
|
|
|
|
|
|
|
struct Entry
|
|
|
|
|
{
|
|
|
|
|
public Method Method;
|
|
|
|
|
public uint Compressed;
|
|
|
|
|
public uint Uncompressed;
|
|
|
|
|
public DateTime LastWrite;
|
|
|
|
|
public FileAttributes Attributes;
|
|
|
|
|
public long DataOffset;
|
|
|
|
|
public string Filename;
|
2025-09-08 01:54:06 +01:00
|
|
|
public ushort? Mode;
|
|
|
|
|
public ushort? Uid;
|
|
|
|
|
public ushort? Gid;
|
2025-09-08 01:04:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
2025-09-07 13:28:54 +01:00
|
|
|
#region Nested type: FHeader
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
readonly struct FHeader
|
|
|
|
|
{
|
|
|
|
|
// First nibble is archive version, second nibble is compression type
|
|
|
|
|
public readonly byte VerType;
|
|
|
|
|
|
|
|
|
|
// Compressed length
|
2025-09-08 01:04:54 +01:00
|
|
|
public readonly uint clen;
|
2025-09-07 13:28:54 +01:00
|
|
|
|
|
|
|
|
// Original length
|
2025-09-08 01:04:54 +01:00
|
|
|
public readonly uint olen;
|
2025-09-07 13:28:54 +01:00
|
|
|
|
2025-09-08 01:04:54 +01:00
|
|
|
public readonly int time;
|
2025-09-07 13:28:54 +01:00
|
|
|
|
|
|
|
|
// CRC32
|
|
|
|
|
public readonly uint crc;
|
|
|
|
|
|
|
|
|
|
// Follows null-terminated path
|
|
|
|
|
// Follows null-terminated filename
|
|
|
|
|
// Follows 1-byte machine dependent information length
|
|
|
|
|
// Follows machine dependent information
|
|
|
|
|
// Follows compressed data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Nested type: HaHeader
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
readonly struct HaHeader
|
|
|
|
|
{
|
|
|
|
|
public readonly ushort magic;
|
|
|
|
|
public readonly ushort count;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-08 01:04:54 +01:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Nested type: UnixMdi
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
readonly struct UnixMdi
|
|
|
|
|
{
|
|
|
|
|
public readonly byte type;
|
|
|
|
|
public readonly ushort attr;
|
|
|
|
|
public readonly ushort user;
|
|
|
|
|
public readonly ushort group;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-07 13:28:54 +01:00
|
|
|
#endregion
|
|
|
|
|
}
|