Start documenting Advanced Installer

This commit is contained in:
Matt Nadareski
2025-09-25 22:23:50 -04:00
parent d7ade2efc4
commit 76fcc49d6d
3 changed files with 151 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
namespace SabreTools.Models.AdvancedInstaller
{
/// <summary>
/// Single entry in the file table
/// </summary>
public class FileEntry
{
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// Observed values:
/// - 05 00 00 00 (DLL)
/// - 01 00 00 00 (MSI, CAB)
/// - 00 00 00 00 (INI)
/// </remarks>
public uint Unknown0 { get; set; }
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// Observed values:
/// - 0C 00 00 00 (DLL)
/// - 00 00 00 00 (MSI)
/// - 01 00 00 00 (CAB)
/// - 03 00 00 00 (INI)
/// </remarks>
public uint Unknown1 { get; set; }
/// <summary>
/// Unknown, always 0?
/// </summary>
/// <remarks>
/// Observed values:
/// - 00 00 00 00 (DLL, MSI, CAB, INI)
/// </remarks>
public uint Unknown2 { get; set; }
/// <summary>
/// Size of the file
/// </summary>
public uint FileSize { get; set; }
/// <summary>
/// Offset of the file relative to the start
/// of the SFX stub
/// </summary>
public uint FileOffset { get; set; }
/// <summary>
/// Size of the file name in characters
/// </summary>
public uint NameSize { get; set; }
/// <summary>
/// Unicode-encoded file name
/// </summary>
public string? Name { get; set; }
}
}

View File

@@ -0,0 +1,69 @@
namespace SabreTools.Models.AdvancedInstaller
{
/// <summary>
/// Structure similar to the end of central directory
/// header in PKZIP files
/// </summary>
public class Footer
{
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// Observed values:
/// - 00 00 00 00
/// </remarks>
public uint Unknown0 { get; set; }
/// <summary>
/// Pointer to <see cref="Unknown0"/>?
/// </summary>
public uint FooterOffset { get; set; }
/// <summary>
/// Number of entries that preceed the footer
/// </summary>
public uint EntryCount { get; set; }
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// Observed values:
/// - 64 00 00 00
/// </remarks>
public uint Unknown1 { get; set; }
/// <summary>
/// Pointer to <see cref="Unknown0"/>?
/// </summary>
public uint FooterOffset2 { get; set; }
/// <summary>
/// Offset of the start of the file table
/// </summary>
public uint TablePointer { get; set; }
/// <summary>
/// Offset to the start of the file data
/// </summary>
public uint FileDataStart { get; set; }
/// <summary>
/// Null-terminated hex string that looks
/// like a key or other identifier.
/// </summary>
public string? KeyString { get; set; }
/// <summary>
/// Unknown, always zero?
/// </summary>
public ushort Unknown2 { get; set; }
/// <summary>
/// "ADVINSTSFX", null terminated
/// </summary>
/// <remarks>May have another trailing null after?</remarks>
public string? Signature { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
namespace SabreTools.Models.AdvancedInstaller
{
/// <summary>
/// Represents the structure at the end of a Caphyon
/// Advanced Installer SFX file. These SFX files store
/// all files uncompressed sequentially in the overlay
/// of an executable.
/// </summary>
public class SFX
{
/// <summary>
/// Set of file entries
/// </summary>
public FileEntry[]? Entries { get; set; }
/// <summary>
/// Footer representing the central directory
/// </summary>
public Footer? Footer { get; set; }
}
}