diff --git a/SabreTools.Models/AdvancedInstaller/FileEntry.cs b/SabreTools.Models/AdvancedInstaller/FileEntry.cs new file mode 100644 index 0000000..fa2b85e --- /dev/null +++ b/SabreTools.Models/AdvancedInstaller/FileEntry.cs @@ -0,0 +1,61 @@ +namespace SabreTools.Models.AdvancedInstaller +{ + /// + /// Single entry in the file table + /// + public class FileEntry + { + /// + /// Unknown + /// + /// + /// Observed values: + /// - 05 00 00 00 (DLL) + /// - 01 00 00 00 (MSI, CAB) + /// - 00 00 00 00 (INI) + /// + public uint Unknown0 { get; set; } + + /// + /// Unknown + /// + /// + /// Observed values: + /// - 0C 00 00 00 (DLL) + /// - 00 00 00 00 (MSI) + /// - 01 00 00 00 (CAB) + /// - 03 00 00 00 (INI) + /// + public uint Unknown1 { get; set; } + + /// + /// Unknown, always 0? + /// + /// + /// Observed values: + /// - 00 00 00 00 (DLL, MSI, CAB, INI) + /// + public uint Unknown2 { get; set; } + + /// + /// Size of the file + /// + public uint FileSize { get; set; } + + /// + /// Offset of the file relative to the start + /// of the SFX stub + /// + public uint FileOffset { get; set; } + + /// + /// Size of the file name in characters + /// + public uint NameSize { get; set; } + + /// + /// Unicode-encoded file name + /// + public string? Name { get; set; } + } +} diff --git a/SabreTools.Models/AdvancedInstaller/Footer.cs b/SabreTools.Models/AdvancedInstaller/Footer.cs new file mode 100644 index 0000000..00380ca --- /dev/null +++ b/SabreTools.Models/AdvancedInstaller/Footer.cs @@ -0,0 +1,69 @@ +namespace SabreTools.Models.AdvancedInstaller +{ + /// + /// Structure similar to the end of central directory + /// header in PKZIP files + /// + public class Footer + { + /// + /// Unknown + /// + /// + /// Observed values: + /// - 00 00 00 00 + /// + public uint Unknown0 { get; set; } + + /// + /// Pointer to ? + /// + public uint FooterOffset { get; set; } + + /// + /// Number of entries that preceed the footer + /// + public uint EntryCount { get; set; } + + /// + /// Unknown + /// + /// + /// Observed values: + /// - 64 00 00 00 + /// + public uint Unknown1 { get; set; } + + /// + /// Pointer to ? + /// + public uint FooterOffset2 { get; set; } + + /// + /// Offset of the start of the file table + /// + public uint TablePointer { get; set; } + + /// + /// Offset to the start of the file data + /// + public uint FileDataStart { get; set; } + + /// + /// Null-terminated hex string that looks + /// like a key or other identifier. + /// + public string? KeyString { get; set; } + + /// + /// Unknown, always zero? + /// + public ushort Unknown2 { get; set; } + + /// + /// "ADVINSTSFX", null terminated + /// + /// May have another trailing null after? + public string? Signature { get; set; } + } +} diff --git a/SabreTools.Models/AdvancedInstaller/SFX.cs b/SabreTools.Models/AdvancedInstaller/SFX.cs new file mode 100644 index 0000000..4b6989b --- /dev/null +++ b/SabreTools.Models/AdvancedInstaller/SFX.cs @@ -0,0 +1,21 @@ +namespace SabreTools.Models.AdvancedInstaller +{ + /// + /// 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. + /// + public class SFX + { + /// + /// Set of file entries + /// + public FileEntry[]? Entries { get; set; } + + /// + /// Footer representing the central directory + /// + public Footer? Footer { get; set; } + } +}