diff --git a/XZP/Footer.cs b/XZP/Footer.cs
index 5282a76..8cecadc 100644
--- a/XZP/Footer.cs
+++ b/XZP/Footer.cs
@@ -1,10 +1,18 @@
+using System.Runtime.InteropServices;
+
namespace SabreTools.Models.XZP
{
///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class Footer
{
- public uint FileLength { get; set; }
+ public uint FileLength;
- public string? Signature { get; set; }
+ ///
+ /// "tFzX"
+ ///
+ /// 4 bytes
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
+ public string? Signature;
}
}
diff --git a/XZP/Header.cs b/XZP/Header.cs
index 89caa70..620fbcf 100644
--- a/XZP/Header.cs
+++ b/XZP/Header.cs
@@ -1,24 +1,32 @@
+using System.Runtime.InteropServices;
+
namespace SabreTools.Models.XZP
{
///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class Header
{
- public string? Signature { get; set; }
+ ///
+ /// "piZx"
+ ///
+ /// 4 bytes
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
+ public string? Signature;
- public uint Version { get; set; }
+ public uint Version;
- public uint PreloadDirectoryEntryCount { get; set; }
+ public uint PreloadDirectoryEntryCount;
- public uint DirectoryEntryCount { get; set; }
+ public uint DirectoryEntryCount;
- public uint PreloadBytes { get; set; }
+ public uint PreloadBytes;
- public uint HeaderLength { get; set; }
+ public uint HeaderLength;
- public uint DirectoryItemCount { get; set; }
+ public uint DirectoryItemCount;
- public uint DirectoryItemOffset { get; set; }
+ public uint DirectoryItemOffset;
- public uint DirectoryItemLength { get; set; }
+ public uint DirectoryItemLength;
}
}