Add layouts for some XZP models

This commit is contained in:
Matt Nadareski
2024-04-23 15:49:41 -04:00
parent 5856967794
commit 8f3be17850
2 changed files with 27 additions and 11 deletions

View File

@@ -1,10 +1,18 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class Footer
{
public uint FileLength { get; set; }
public uint FileLength;
public string? Signature { get; set; }
/// <summary>
/// "tFzX"
/// </summary>
/// <remarks>4 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Signature;
}
}

View File

@@ -1,24 +1,32 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.XZP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/XZPFile.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class Header
{
public string? Signature { get; set; }
/// <summary>
/// "piZx"
/// </summary>
/// <remarks>4 bytes</remarks>
[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;
}
}