42 Commits

Author SHA1 Message Date
Matt Nadareski
33d63fddae Bump version 2024-04-23 21:01:52 -04:00
Matt Nadareski
209be57bf4 Add layouts for some BD+ models 2024-04-23 20:59:47 -04:00
Matt Nadareski
a1581e9d9b Add layouts for some BFPK models 2024-04-23 20:58:51 -04:00
Matt Nadareski
521664d5a8 Add layouts for some BSP models 2024-04-23 20:57:24 -04:00
Matt Nadareski
73a8d91a83 Add layouts for some CFB models 2024-04-23 20:55:10 -04:00
Matt Nadareski
438e87f833 Add layouts for some CHD models 2024-04-23 20:50:09 -04:00
Matt Nadareski
2cdedbb456 Add layouts for some DVD models 2024-04-23 20:47:33 -04:00
Matt Nadareski
b57a545598 Add layouts for some GCF models 2024-04-23 20:38:11 -04:00
Matt Nadareski
8dc6eb2eee Add layouts for some IS-CAB models 2024-04-23 20:26:18 -04:00
Matt Nadareski
b58436d71a Add layouts for some MoPaQ models 2024-04-23 20:18:26 -04:00
Matt Nadareski
925c20021f Add layouts for some MSDOS models 2024-04-23 20:13:07 -04:00
Matt Nadareski
9bebf95599 Add layouts for some N3DS models 2024-04-23 20:09:39 -04:00
Matt Nadareski
089e13ca03 Add layouts for some NCF models 2024-04-23 19:34:56 -04:00
Matt Nadareski
de07b3b0dd Make some types non-nullable 2024-04-23 19:13:47 -04:00
Matt Nadareski
22cb5360e6 Add notes about prefixed strings 2024-04-23 17:20:05 -04:00
Matt Nadareski
a422ec7e6d Add layouts for some Nitro models 2024-04-23 17:15:15 -04:00
Matt Nadareski
f60afd6368 Add layouts for some PE models 2024-04-23 16:42:29 -04:00
Matt Nadareski
b8f67a8ab0 Add layouts for some VBSP models 2024-04-23 16:06:09 -04:00
Matt Nadareski
d844a8b582 Add layouts for some VPK models 2024-04-23 16:03:20 -04:00
Matt Nadareski
8583baa862 Add layouts for some WAD models 2024-04-23 15:56:43 -04:00
Matt Nadareski
8f3be17850 Add layouts for some XZP models 2024-04-23 15:49:41 -04:00
Matt Nadareski
5856967794 Fill and fix some ISAv3 information 2024-04-23 15:43:33 -04:00
Matt Nadareski
8f78c73c6f Fix publish scripts 2024-04-23 14:12:10 -04:00
Matt Nadareski
af4ff3d383 Bump version 2024-04-23 14:10:58 -04:00
Matt Nadareski
3e638a5c57 Make Linux publish script executable 2024-04-23 14:10:27 -04:00
Matt Nadareski
638d0226c1 Add publish scripts 2024-04-23 14:10:03 -04:00
Matt Nadareski
07c6d5b43a Obsolete is not an error... for now 2024-04-23 13:38:37 -04:00
Matt Nadareski
108e63a099 Add some null-terminated type flags 2024-04-23 13:36:24 -04:00
Matt Nadareski
c636d3252b Migrate many models to StructLayout 2024-04-23 13:30:43 -04:00
Matt Nadareski
b19dbf2254 Update APPNOTE link, add more Header IDs 2024-04-17 16:43:02 -04:00
Matt Nadareski
111b84170c Add relevant information to PKZIP archive 2024-04-17 16:09:30 -04:00
Matt Nadareski
2d7df0d4fb Add PKZIP archive model 2024-04-17 15:59:56 -04:00
Matt Nadareski
aba02663e5 Start adding PKZIP models 2024-04-17 15:47:41 -04:00
Matt Nadareski
594fec923a Bump version 2024-04-03 22:44:18 -04:00
Deterous
b5cf4e870d Add fields for v1.0 catalog.js files (#6) 2024-04-03 19:43:17 -07:00
Matt Nadareski
e6976796c2 Initial attempt at Delphi models 2024-04-02 10:58:20 -04:00
Deterous
295d8c7612 XboxOne/XboxSX catalog.js Model (#5)
* XboxOne catalog.js model

* Split Catalog object, bump version

* Minor fixes

* Custom JsonConverter for launchPackage

* Make launchPackage an abstract object

* Don't ignore packages

* Fix field types for Catalog/Package
2024-04-02 07:54:57 -07:00
Matt Nadareski
4dd184583c Revert XML tag for OfflineList duplicate ID 2024-03-19 15:30:45 -04:00
Matt Nadareski
081c9c9245 Bump version 2024-03-12 16:21:06 -04:00
Matt Nadareski
b974380ccf Fix SoftwareList.Disk field name 2024-03-12 15:28:58 -04:00
Matt Nadareski
41ed2cbc9a Fix XML element name for duplicateId 2024-03-12 00:07:47 -04:00
Matt Nadareski
2cfcb49e35 Fix missing OfflineList field 2024-03-11 23:35:22 -04:00
214 changed files with 3966 additions and 1183 deletions

View File

@@ -1,13 +1,17 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <summary>
/// This record type is undocumented but found in real media key blocks
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public sealed class CopyrightRecord : Record
{
/// <summary>
/// Null-terminated ASCII string representing the copyright
/// </summary>
public string? Copyright { get; set; }
[MarshalAs(UnmanagedType.LPStr)]
public string? Copyright;
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DriveRevocationListEntry
{
/// <summary>
@@ -9,13 +12,14 @@ namespace SabreTools.Models.AACS
/// field indicates that only one ID is being revoked, a value of one
/// in the Range field indicates two IDs are being revoked, and so on.
/// </summary>
public ushort Range { get; set; }
public ushort Range;
/// <summary>
/// A 6-byte Drive ID value identifying the Licensed Drive being revoked
/// (or the first in a range of Licensed Drives being revoked, in the
/// case of a non-zero Range value).
/// </summary>
public byte[]? DriveID { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? DriveID;
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class HostRevocationListEntry
{
/// <summary>
@@ -9,13 +12,14 @@ namespace SabreTools.Models.AACS
/// field indicates that only one ID is being revoked, a value of one
/// in the Range field indicates two IDs are being revoked, and so on.
/// </summary>
public ushort Range { get; set; }
public ushort Range;
/// <summary>
/// A 6-byte Host ID value identifying the host being revoked (or the
/// first in a range of hosts being revoked, in the case of a non-zero
/// Range value).
/// </summary>
public byte[]? HostID { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? HostID;
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class SubsetDifference
{
/// <summary>
@@ -9,12 +12,12 @@ namespace SabreTools.Models.AACS
/// the mask. For example, the value 0x01 denotes a mask of
/// 0xFFFFFFFE; value 0x0A denotes a mask of 0xFFFFFC00.
/// </summary>
public byte Mask { get; set; }
public byte Mask;
/// <summary>
/// The last 4 bytes are the uv number, most significant
/// byte first.
/// </summary>
public uint Number { get; set; }
public uint Number;
}
}

View File

@@ -6,11 +6,13 @@ namespace SabreTools.Models.BDPlus
/// <summary>
/// "BDSVM_CC"
/// </summary>
/// <remarks>8 bytes</remarks>
public string? Signature { get; set; }
/// <summary>
/// 5 bytes of unknown data
/// Unknown data
/// </summary>
/// <remarks>5 bytes</remarks>
public byte[]? Unknown1 { get; set; }
/// <summary>
@@ -29,8 +31,9 @@ namespace SabreTools.Models.BDPlus
public byte Day { get; set; }
/// <summary>
/// 4 bytes of unknown data
/// Unknown data
/// </summary>
/// <remarks>4 bytes</remarks>
public byte[]? Unknown2 { get; set; }
/// <summary>

View File

@@ -14,6 +14,6 @@
/// <summary>
/// Files
/// </summary>
public FileEntry?[]? Files { get; set; }
public FileEntry[]? Files { get; set; }
}
}

View File

@@ -1,24 +1,28 @@
namespace SabreTools.Models.BFPK
using System.Runtime.InteropServices;
namespace SabreTools.Models.BFPK
{
/// <summary>
/// Header
/// </summary>
/// <see cref="https://forum.xentax.com/viewtopic.php?t=5102"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class Header
{
/// <summary>
/// "BFPK"
/// </summary>
public string? Magic { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Magic;
/// <summary>
/// Version
/// </summary>
public int Version { get; set; }
public int Version;
/// <summary>
/// Files
/// </summary>
public int Files { get; set; }
public int Files;
}
}

View File

@@ -1,3 +1,5 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BMP
{
/// <summary>
@@ -5,31 +7,32 @@ namespace SabreTools.Models.BMP
/// and layout of a file that contains a DIB.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapfileheader"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BITMAPFILEHEADER
{
/// <summary>
/// The file type; must be BM.
/// </summary>
public ushort Type { get; set; }
public ushort Type;
/// <summary>
/// The size, in bytes, of the bitmap file.
/// </summary>
public uint Size { get; set; }
public uint Size;
/// <summary>
/// Reserved; must be zero.
/// </summary>
public ushort Reserved1 { get; set; }
public ushort Reserved1;
/// <summary>
/// Reserved; must be zero.
/// </summary>
public ushort Reserved2 { get; set; }
public ushort Reserved2;
/// <summary>
/// The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
/// </summary>
public uint OffBits { get; set; }
public uint OffBits;
}
}

View File

@@ -1,9 +1,12 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BMP
{
/// <summary>
/// The BITMAPINFOHEADER structure contains information about the dimensions and
/// color format of a device-independent bitmap (DIB).
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public sealed class BITMAPINFOHEADER
{
/// <summary>
@@ -11,12 +14,12 @@ namespace SabreTools.Models.BMP
/// not include the size of the color table or the size of the color masks,
/// if they are appended to the end of structure.
/// </summary>
public uint Size { get; set; }
public uint Size;
/// <summary>
/// Specifies the width of the bitmap, in pixels.
/// </summary>
public int Width { get; set; }
public int Width;
/// <summary>
/// Specifies the height of the bitmap, in pixels.
@@ -30,19 +33,19 @@ namespace SabreTools.Models.BMP
/// or negative biHeight.
/// - For compressed formats, biHeight must be positive, regardless of image orientation.
/// </summary>
public int Height { get; set; }
public int Height;
/// <summary>
/// Specifies the number of planes for the target device. This value must be set to 1.
/// </summary>
public ushort Planes { get; set; }
public ushort Planes;
/// <summary>
/// Specifies the number of bits per pixel (bpp). For uncompressed formats, this value
/// is the average number of bits per pixel. For compressed formats, this value is the
/// implied bit depth of the uncompressed image, after the image has been decoded.
/// </summary>
public ushort BitCount { get; set; }
public ushort BitCount;
/// <summary>
/// For compressed video and YUV formats, this member is a FOURCC code, specified as a
@@ -59,36 +62,36 @@ namespace SabreTools.Models.BMP
/// If biCompression equals BI_BITFIELDS, the format is either RGB 555 or RGB 565. Use
/// the subtype GUID in the AM_MEDIA_TYPE structure to determine the specific RGB type.
/// </summary>
public uint Compression { get; set; }
public uint Compression;
/// <summary>
/// Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed
/// RGB bitmaps.
/// </summary>
public uint SizeImage { get; set; }
public uint SizeImage;
/// <summary>
/// Specifies the horizontal resolution, in pixels per meter, of the target device for
/// the bitmap.
/// </summary>
public int XPelsPerMeter { get; set; }
public int XPelsPerMeter;
/// <summary>
/// Specifies the vertical resolution, in pixels per meter, of the target device for
/// the bitmap.
/// </summary>
public int YPelsPerMeter { get; set; }
public int YPelsPerMeter;
/// <summary>
/// Specifies the number of color indices in the color table that are actually used by
/// the bitmap.
/// </summary>
public uint ClrUsed { get; set; }
public uint ClrUsed;
/// <summary>
/// Specifies the number of color indices that are considered important for displaying
/// the bitmap. If this value is zero, all colors are important.
/// </summary>
public uint ClrImportant { get; set; }
public uint ClrImportant;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Header
{
/// <summary>
/// Version
/// </summary>
public uint Version { get; set; }
public uint Version;
}
}

View File

@@ -1,16 +1,19 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Lump
{
/// <summary>
/// Offset
/// </summary>
public uint Offset { get; set; }
public uint Offset;
/// <summary>
/// Length
/// </summary>
public uint Length { get; set; }
public uint Length;
}
}

View File

@@ -11,6 +11,7 @@ namespace SabreTools.Models.BSP
/// <summary>
/// Offsets
/// </summary>
/// <remarks>TextureCount entries</remarks>
public uint[]? Offsets { get; set; }
}
}

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Models.CFB
///
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
/// </remarks>
public SectorNumber?[]? FATSectorNumbers { get; set; }
public SectorNumber[]? FATSectorNumbers { get; set; }
/// <summary>
/// The mini FAT is used to allocate space in the mini stream.
@@ -38,7 +38,7 @@ namespace SabreTools.Models.CFB
///
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
/// </remarks>
public SectorNumber?[]? MiniFATSectorNumbers { get; set; }
public SectorNumber[]? MiniFATSectorNumbers { get; set; }
/// <summary>
/// The DIFAT array is used to represent storage of the FAT sectors.
@@ -55,7 +55,7 @@ namespace SabreTools.Models.CFB
/// If Header Major Version is 4, there MUST be 1,023 fields specified
/// to fill a 4,096-byte sector minus the "Next DIFAT Sector Location" field.
/// </remarks>
public SectorNumber?[]? DIFATSectorNumbers { get; set; }
public SectorNumber[]? DIFATSectorNumbers { get; set; }
/// <summary>
/// The directory entry array is an array of directory entries that
@@ -87,6 +87,6 @@ namespace SabreTools.Models.CFB
/// all zeroes. The Modified Time field in the root storage directory
/// entry MAY be all zeroes.
/// <remarks>
public DirectoryEntry?[]? DirectoryEntries { get; set; }
public DirectoryEntry[]? DirectoryEntries { get; set; }
}
}

View File

@@ -1,8 +1,10 @@
using System;
using System.Runtime.InteropServices;
namespace SabreTools.Models.CFB
{
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class DirectoryEntry
{
/// <summary>
@@ -16,13 +18,15 @@ namespace SabreTools.Models.CFB
/// The following characters are illegal and MUST NOT be part of the
/// name: '/', '\', ':', '!'.
/// </summary>
public string? Name { get; set; }
/// <remarks>64 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string? Name;
/// <summary>
/// This field MUST be 0x00, 0x01, 0x02, or 0x05, depending on the
/// actual type of object. All other values are not valid.
/// </summary>
public ushort NameLength { get; set; }
public ushort NameLength;
/// <summary>
/// This field MUST match the length of the Directory Entry Name Unicode
@@ -30,31 +34,36 @@ namespace SabreTools.Models.CFB
/// terminating null character in the count. This length MUST NOT exceed 64,
/// the maximum size of the Directory Entry Name field.
/// </summary>
public ObjectType ObjectType { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ObjectType ObjectType;
/// <summary>
/// This field MUST be 0x00 (red) or 0x01 (black). All other values are not valid.
/// </summary>
public ColorFlag ColorFlag { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ColorFlag ColorFlag;
/// <summary>
/// This field contains the stream ID of the left sibling. If there
/// is no left sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF).
/// </summary>
public StreamID LeftSiblingID { get; set; }
[MarshalAs(UnmanagedType.U4)]
public StreamID LeftSiblingID;
/// <summary>
/// This field contains the stream ID of the right sibling. If there
/// is no right sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF).
/// </summary>
public StreamID RightSiblingID { get; set; }
[MarshalAs(UnmanagedType.U4)]
public StreamID RightSiblingID;
/// <summary>
/// This field contains the stream ID of a child object. If there is no
/// child object, including all entries for stream objects, the field
/// MUST be set to NOSTREAM (0xFFFFFFFF).
/// </summary>
public StreamID ChildID { get; set; }
[MarshalAs(UnmanagedType.U4)]
public StreamID ChildID;
/// <summary>
/// This field contains an object class GUID, if this entry is for a
@@ -67,7 +76,7 @@ namespace SabreTools.Models.CFB
/// this value is not all zeroes, the object class GUID can be used as a
/// parameter to start applications.
/// </summary>
public Guid CLSID { get; set; }
public Guid CLSID;
/// <summary>
/// This field contains the user-defined flags if this entry is for a storage
@@ -78,7 +87,7 @@ namespace SabreTools.Models.CFB
/// objects without explicitly setting state bits, it MUST write all zeroes
/// by default.
/// </summary>
public uint StateBits { get; set; }
public uint StateBits;
/// <summary>
/// This field contains the creation time for a storage object, or all zeroes
@@ -88,7 +97,7 @@ namespace SabreTools.Models.CFB
/// object, this field MUST be all zeroes, and the creation time is retrieved
/// or set on the compound file itself.
/// </summary>
public ulong CreationTime { get; set; }
public ulong CreationTime;
/// <summary>
/// This field contains the modification time for a storage object, or all
@@ -98,7 +107,7 @@ namespace SabreTools.Models.CFB
/// storage object, this field MAY<2> be set to all zeroes, and the modified
/// time is retrieved or set on the compound file itself.
/// </summary>
public ulong ModifiedTime { get; set; }
public ulong ModifiedTime;
/// <summary>
/// This field contains the first sector location if this is a stream object.
@@ -106,7 +115,7 @@ namespace SabreTools.Models.CFB
/// mini stream, if the mini stream exists. For a storage object, this field MUST
/// be set to all zeroes.
/// </summary>
public uint StartingSectorLocation { get; set; }
public uint StartingSectorLocation;
/// <summary>
/// This 64-bit integer field contains the size of the user-defined data if this
@@ -128,6 +137,6 @@ namespace SabreTools.Models.CFB
/// unless there is a specific reason to do otherwise (for example, a parser whose
/// purpose is to verify the correctness of a compound file).
/// </remarks>
public ulong StreamSize { get; set; }
public ulong StreamSize;
}
}

View File

@@ -1,38 +1,40 @@
using System;
using System.Runtime.InteropServices;
namespace SabreTools.Models.CFB
{
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FileHeader
{
/// <summary>
/// Iddentification signature for the compound file structure, and MUST be
/// set to the value 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1.
/// </summary>
public ulong Signature { get; set; }
public ulong Signature;
/// <summary>
/// Reserved and unused class ID that MUST be set to all zeroes (CLSID_NULL)
/// </summary>
public Guid CLSID { get; set; }
public Guid CLSID;
/// <summary>
/// Version number for nonbreaking changes. This field SHOULD be set to
/// 0x003E if the major version field is either 0x0003 or 0x0004.
/// </summary>
public ushort MinorVersion { get; set; }
public ushort MinorVersion;
/// <summary>
/// Version number for breaking changes. This field MUST be set to either
/// 0x0003 (version 3) or 0x0004 (version 4).
/// </summary>
public ushort MajorVersion { get; set; }
public ushort MajorVersion;
/// <summary>
/// This field MUST be set to 0xFFFE. This field is a byte order mark for
/// all integer fields, specifying little-endian byte order.
/// </summary>
public ushort ByteOrder { get; set; }
public ushort ByteOrder;
/// <summary>
/// This field MUST be set to 0x0009, or 0x000c, depending on the Major
@@ -45,19 +47,21 @@ namespace SabreTools.Models.CFB
/// If Major Version is 4, the Sector Shift MUST be 0x000C, specifying a
/// sector size of 4096 bytes.
/// </summary>
public ushort SectorShift { get; set; }
public ushort SectorShift;
/// <summary>
/// This field MUST be set to 0x0006. This field specifies the sector size
/// of the Mini Stream as a power of 2. The sector size of the Mini Stream
/// MUST be 64 bytes.
/// </summary>
public ushort MiniSectorShift { get; set; }
public ushort MiniSectorShift;
/// <summary>
/// This field MUST be set to all zeroes.
/// </summary>
public byte[]? Reserved { get; set; }
/// <remarks>6 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? Reserved;
/// <summary>
/// This integer field contains the count of the number of directory sectors
@@ -66,18 +70,18 @@ namespace SabreTools.Models.CFB
/// If Major Version is 3, the Number of Directory Sectors MUST be zero. This
/// field is not supported for version 3 compound files.
/// </summary>
public uint NumberOfDirectorySectors { get; set; }
public uint NumberOfDirectorySectors;
/// <summary>
/// This integer field contains the count of the number of FAT sectors in the
/// compound file.
/// </summary>
public uint NumberOfFATSectors { get; set; }
public uint NumberOfFATSectors;
/// <summary>
/// This integer field contains the starting sector number for the directory stream.
/// </summary>
public uint FirstDirectorySectorLocation { get; set; }
public uint FirstDirectorySectorLocation;
/// <summary>
/// This integer field MAY contain a sequence number that is incremented every time
@@ -85,7 +89,7 @@ namespace SabreTools.Models.CFB
/// This is the field that MUST be set to all zeroes if file transactions are not
/// implemented.
/// </summary>
public uint TransactionSignatureNumber { get; set; }
public uint TransactionSignatureNumber;
/// <summary>
/// This integer field MUST be set to 0x00001000. This field specifies the maximum
@@ -94,34 +98,36 @@ namespace SabreTools.Models.CFB
/// greater than or equal to this cutoff size must be allocated as normal sectors from
/// the FAT.
/// </summary>
public uint MiniStreamCutoffSize { get; set; }
public uint MiniStreamCutoffSize;
/// <summary>
/// This integer field contains the starting sector number for the mini FAT.
/// </summary>
public uint FirstMiniFATSectorLocation { get; set; }
public uint FirstMiniFATSectorLocation;
/// <summary>
/// This integer field contains the count of the number of mini FAT sectors in the
/// compound file.
/// </summary>
public uint NumberOfMiniFATSectors { get; set; }
public uint NumberOfMiniFATSectors;
/// <summary>
/// This integer field contains the starting sector number for the DIFAT.
/// </summary>
public uint FirstDIFATSectorLocation { get; set; }
public uint FirstDIFATSectorLocation;
/// <summary>
/// This integer field contains the count of the number of DIFAT sectors in the
/// compound file.
/// </summary>
public uint NumberOfDIFATSectors { get; set; }
public uint NumberOfDIFATSectors;
/// <summary>
/// This array of 32-bit integer fields contains the first 109 FAT sector
/// locations of the compound file
/// </summary>
public SectorNumber?[]? DIFAT { get; set; }
/// <remarks>109 entries</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 109)]
public SectorNumber[]? DIFAT;
}
}

View File

@@ -75,7 +75,7 @@ namespace SabreTools.Models.CFB
/// Properties
/// </summary>
/// <remarks>Each Variant might be followed by an index and offset value</remarks>
public Variant?[]? Properties { get; set; }
public Variant[]? Properties { get; set; }
#endregion
}

View File

@@ -1,28 +1,31 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class CompressedMapEntryV5
[StructLayout(LayoutKind.Sequential)]
public sealed class CompressedMapEntryV5
{
/// <summary>
/// Compression type
/// </summary>
public byte Compression { get; set; }
public byte Compression;
/// <summary>
/// Compressed length
/// </summary>
/// <remarks>Actually UInt24</remarks>
public uint CompLength { get; set; }
public uint CompLength;
/// <summary>
/// Offset
/// </summary>
/// <remarks>Actually UInt48</remarks>
public ulong Offset { get; set; }
public ulong Offset;
/// <summary>
/// CRC-16 of the data
/// </summary>
public ushort CRC { get; set; }
public ushort CRC;
}
}

View File

@@ -1,42 +1,45 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class CompressedMapHeaderV5
[StructLayout(LayoutKind.Sequential)]
public sealed class CompressedMapHeaderV5
{
/// <summary>
/// Length of compressed map
/// </summary>
public uint Length { get; set; }
public uint Length;
/// <summary>
/// Offset of first block
/// </summary>
/// <remarks>Actually UInt48</remarks>
public ulong DataStart { get; set; }
public ulong DataStart;
/// <summary>
/// CRC-16 of the map
/// </summary>
public ushort CRC { get; set; }
public ushort CRC;
/// <summary>
/// Bits used to encode complength
/// </summary>
public byte LengthBits { get; set; }
public byte LengthBits;
/// <summary>
/// Bits used to encode self-refs
/// </summary>
public byte HunkBits { get; set; }
public byte HunkBits;
/// <summary>
/// Bits used to encode parent unit refs
/// </summary>
public byte ParentUnitBits { get; set; }
public byte ParentUnitBits;
/// <summary>
/// Future use
/// </summary>
public byte Reserved { get; set; }
public byte Reserved;
}
}

View File

@@ -1,16 +1,19 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class MapV1
[StructLayout(LayoutKind.Sequential)]
public sealed class MapV1
{
/// <summary>
/// Starting offset within the file
/// </summary>
public ulong StartingOffset { get; set; }
public ulong StartingOffset;
/// <summary>
/// Length of data; If == hunksize, data is uncompressed
/// </summary>
public ulong Length { get; set; }
public ulong Length;
}
}

View File

@@ -1,31 +1,34 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class MapV3
[StructLayout(LayoutKind.Sequential)]
public sealed class MapV3
{
/// <summary>
/// Starting offset within the file
/// </summary>
public ulong StartingOffset { get; set; }
public ulong StartingOffset;
/// <summary>
/// 32-bit CRC of the uncompressed data
/// </summary>
public uint CRC32 { get; set; }
public uint CRC32;
/// <summary>
/// Lower 16 bits of length
/// </summary>
public ushort LengthLo { get; set; }
public ushort LengthLo;
/// <summary>
/// Upper 8 bits of length
/// </summary>
public byte LengthHi { get; set; }
public byte LengthHi;
/// <summary>
/// Flags, indicating compression info
/// </summary>
public byte Flags { get; set; }
public byte Flags;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential)]
public class UncompressedMapV5
{
/// <summary>
/// Starting offset / hunk size
/// </summary>
public uint StartingOffset { get; set; }
public uint StartingOffset;
}
}

View File

@@ -1,17 +1,22 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.Compression.LZ
{
/// <summary>
/// Format of first 14 byte of LZ compressed file
/// </summary>
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class FileHeaader
{
public string? Magic { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string? Magic;
public byte CompressionType { get; set; }
public byte CompressionType;
public char LastChar { get; set; }
[MarshalAs(UnmanagedType.U1)]
public char LastChar;
public uint RealLength { get; set; }
public uint RealLength;
}
}

View File

@@ -1,6 +1,6 @@
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo.html"/>
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo_vmg.html"/>
public sealed class AudioSubPictureAttributesTable
{
/// <summary>
@@ -11,7 +11,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
public ushort Reserved { get; set; }
/// <summary>
/// End address (last byte of last VTS_ATRT)
@@ -21,11 +21,12 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Offset to VTS_ATRT n
/// </summary>
/// <remarks>NumberOfTitleSets entries</remarks>
public uint[]? Offsets { get; set; }
/// <summary>
/// Entries
/// </summary>
public AudioSubPictureAttributesTableEntry?[]? Entries { get; set; }
public AudioSubPictureAttributesTableEntry[]? Entries { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo.html"/>
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo_vmg.html"/>
public sealed class AudioSubPictureAttributesTableEntry
{
/// <summary>

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
public ushort Reserved { get; set; }
/// <summary>
/// End address (last byte of last entry)
@@ -21,6 +21,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// 12-byte entries
/// </summary>
public CellAddressTableEntry?[]? Entries { get; set; }
/// <remarks>NumberOfVOBIDs entries</remarks>
public CellAddressTableEntry[]? Entries { get; set; }
}
}

View File

@@ -1,31 +1,34 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CellAddressTableEntry
{
/// <summary>
/// VOBidn
/// </summary>
public ushort VOBIdentity { get; set; }
public ushort VOBIdentity;
/// <summary>
/// CELLidn
/// </summary>
public byte CellIdentity { get; set; }
public byte CellIdentity;
/// <summary>
/// Reserved
/// </summary>
public byte Reserved { get; set; }
public byte Reserved;
/// <summary>
/// Starting sector within VOB
/// </summary>
public uint StartingSectorWithinVOB { get; set; }
public uint StartingSectorWithinVOB;
/// <summary>
/// Ending sector within VOB
/// </summary>
public uint EndingSectorWithinVOB { get; set; }
public uint EndingSectorWithinVOB;
}
}

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
public ushort Reserved { get; set; }
/// <summary>
/// End address (last byte of last PGC in last LU)
@@ -22,11 +22,13 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Language Units
/// </summary>
public LanguageUnitTableEntry?[]? Entries { get; set; }
/// <remarks>NumberOfVOBIDs entries</remarks>
public LanguageUnitTableEntry[]? Entries { get; set; }
/// <summary>
/// Program Chains
/// </summary>
public ProgramChainTable?[]? ProgramChains { get; set; }
/// <remarks>NumberOfVOBIDs entries</remarks>
public ProgramChainTable[]? ProgramChains { get; set; }
}
}

View File

@@ -1,26 +1,29 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo_vmg.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class LanguageUnitTableEntry
{
/// <summary>
/// ISO639 language code
/// ISO639 language code
/// </summary>
public ushort ISO639LanguageCode { get; set; }
public ushort ISO639LanguageCode;
/// <summary>
/// Reserved for language code extension
/// </summary>
public byte Reserved { get; set; }
public byte Reserved;
/// <summary>
/// Menu existence flag [80 = title]
/// </summary>
public byte MenuExistenceFlag { get; set; }
public byte MenuExistenceFlag;
/// <summary>
/// Offset to VMGM_LU, relative to VMGM_PGCI_UT
/// </summary>
public uint LanguageUnitOffset { get; set; }
public uint LanguageUnitOffset;
}
}

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Entries
/// </summary>
public ParentalManagementMasksTableEntry?[]? Entries { get; set; }
public ParentalManagementMasksTableEntry[]? Entries { get; set; }
/// <summary>
/// The PTL_MAIT contains the 16-bit masks for the VMG and

View File

@@ -1,21 +1,24 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo_vmg.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ParentalManagementMasksTableEntry
{
/// <summary>
/// Country code
/// </summary>
public ushort CountryCode { get; set; }
public ushort CountryCode;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
public ushort Reserved;
/// <summary>
/// Offset to PTL_MAIT
/// </summary>
public uint Offset { get; set; }
public uint Offset;
}
}

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
public ushort Reserved { get; set; }
/// <summary>
/// End address (last byte of last PGC in this LU)
@@ -22,6 +22,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Program Chains
/// </summary>
public ProgramChainTableEntry?[]? Entries { get; set; }
/// <remarks>NumberOfProgramChains entries</remarks>
public ProgramChainTableEntry[]? Entries { get; set; }
}
}

View File

@@ -1,26 +1,30 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo_vmg.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ProgramChainTableEntry
{
/// <summary>
/// PGC category
/// </summary>
public ProgramChainCategory Category { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ProgramChainCategory Category;
/// <summary>
/// Unknown
/// </summary>
public byte Unknown { get; set; }
public byte Unknown;
/// <summary>
/// Parental management mask
/// </summary>
public ushort ParentalManagementMask { get; set; }
public ushort ParentalManagementMask;
/// <summary>
/// Offset to VMGM_PGC, relative to VMGM_LU
/// </summary>
public uint Offset { get; set; }
public uint Offset;
}
}

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
public ushort Reserved { get; set; }
/// <summary>
/// End address (last byte of last entry)
@@ -21,6 +21,7 @@ namespace SabreTools.Models.DVD
/// <summary>
/// 12-byte entries
/// </summary>
public TitlesTableEntry?[]? Entries { get; set; }
/// <remarks>NumberOfTitles entries</remarks>
public TitlesTableEntry[]? Entries { get; set; }
}
}

View File

@@ -1,42 +1,46 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo_vmg.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class TitlesTableEntry
{
/// <summary>
/// Title type
/// </summary>
public TitleType TitleType { get; set; }
[MarshalAs(UnmanagedType.U1)]
public TitleType TitleType;
/// <summary>
/// Number of angles
/// </summary>
public byte NumberOfAngles { get; set; }
public byte NumberOfAngles;
/// <summary>
/// Number of chapters (PTTs)
/// </summary>
public ushort NumberOfChapters { get; set; }
public ushort NumberOfChapters;
/// <summary>
/// Parental management mask
/// </summary>
public ushort ParentalManagementMask { get; set; }
public ushort ParentalManagementMask;
/// <summary>
/// Video Title Set number (VTSN)
/// </summary>
public byte VideoTitleSetNumber { get; set; }
public byte VideoTitleSetNumber;
/// <summary>
/// Title number within VTS (VTS_TTN)
/// </summary>
public byte TitleNumberWithinVTS { get; set; }
public byte TitleNumberWithinVTS;
/// <summary>
/// Start sector for VTS, referenced to whole disk
/// (video_ts.ifo starts at sector 00000000)
/// </summary>
public uint VTSStartSector { get; set; }
public uint VTSStartSector;
}
}

View File

@@ -1,22 +1,26 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo.html"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class VideoManagerIFO
{
/// <summary>
/// "DVDVIDEO-VMG"
/// </summary>
public string? Signature { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
public string? Signature;
/// <summary>
/// Last sector of VMG set (last sector of BUP)
/// </summary>
public uint LastVMGSetSector { get; set; }
public uint LastVMGSetSector;
/// <summary>
/// Last sector of IFO
/// </summary>
public uint LastIFOSector { get; set; }
public uint LastIFOSector;
/// <summary>
/// Version number
@@ -24,127 +28,132 @@ namespace SabreTools.Models.DVD
/// - Byte 1, Bits 7-4 - Major version number
/// - Byte 1, Bits 3-0 - Minor version number
/// </summary>
public ushort VersionNumber { get; set; }
public ushort VersionNumber;
/// <summary>
/// VMG category
/// </summary>
/// <remarks>byte1=prohibited region mask</remarks>
public uint VMGCategory { get; set; }
public uint VMGCategory;
/// <summary>
/// Number of volumes
/// </summary>
public ushort NumberOfVolumes { get; set; }
public ushort NumberOfVolumes;
/// <summary>
/// Volume number
/// </summary>
public ushort VolumeNumber { get; set; }
public ushort VolumeNumber;
/// <summary>
/// Side ID
/// </summary>
public byte SideID { get; set; }
public byte SideID;
/// <summary>
/// Number of title sets
/// </summary>
public ushort NumberOfTitleSets { get; set; }
public ushort NumberOfTitleSets;
/// <summary>
/// Provider ID
/// </summary>
public byte[]? ProviderID { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[]? ProviderID;
/// <summary>
/// VMG POS
/// </summary>
public ulong VMGPOS { get; set; }
public ulong VMGPOS;
/// <summary>
/// End byte address of VMGI_MAT
/// </summary>
public uint InformationManagementTableEndByteAddress { get; set; }
public uint InformationManagementTableEndByteAddress;
/// <summary>
/// Start address of FP_PGC (First Play program chain)
/// </summary>
public uint FirstPlayProgramChainStartAddress { get; set; }
public uint FirstPlayProgramChainStartAddress;
/// <summary>
/// Start sector of Menu VOB
/// </summary>
public uint MenuVOBStartSector { get; set; }
public uint MenuVOBStartSector;
/// <summary>
/// Sector pointer to TT_SRPT (table of titles)
/// </summary>
public uint TableOfTitlesSectorPointer { get; set; }
public uint TableOfTitlesSectorPointer;
/// <summary>
/// Sector pointer to VMGM_PGCI_UT (Menu Program Chain table)
/// </summary>
public uint MenuProgramChainTableSectorPointer { get; set; }
public uint MenuProgramChainTableSectorPointer;
/// <summary>
/// Sector pointer to VMG_PTL_MAIT (Parental Management masks)
/// </summary>
public uint ParentalManagementMasksSectorPointer { get; set; }
public uint ParentalManagementMasksSectorPointer;
/// <summary>
/// Sector pointer to VMG_VTS_ATRT (copies of VTS audio/sub-picture attributes)
/// </summary>
public uint AudioSubPictureAttributesSectorPointer { get; set; }
public uint AudioSubPictureAttributesSectorPointer;
/// <summary>
/// Sector pointer to VMG_TXTDT_MG (text data)
/// </summary>
public uint TextDataSectorPointer { get; set; }
public uint TextDataSectorPointer;
/// <summary>
/// Sector pointer to VMGM_C_ADT (menu cell address table)
/// </summary>
public uint MenuCellAddressTableSectorPointer { get; set; }
public uint MenuCellAddressTableSectorPointer;
/// <summary>
/// Sector pointer to VMGM_VOBU_ADMAP (menu VOBU address map)
/// </summary>
public uint MenuVOBUAddressMapSectorPointer { get; set; }
public uint MenuVOBUAddressMapSectorPointer;
/// <summary>
/// Video attributes of VMGM_VOBS
/// </summary>
public byte[]? VideoAttributes { get; set; }
public ushort VideoAttributes;
/// <summary>
/// Number of audio streams in VMGM_VOBS
/// </summary>
public ushort NumberOfAudioStreams { get; set; }
public ushort NumberOfAudioStreams;
/// <summary>
/// Audio attributes of VMGM_VOBS
/// </summary>
public byte[][]? AudioAttributes { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public ulong[]? AudioAttributes;
/// <summary>
/// Unknown
/// </summary>
public byte[]? Unknown { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? Unknown;
/// <summary>
/// Number of subpicture streams in VMGM_VOBS (0 or 1)
/// </summary>
public ushort NumberOfSubpictureStreams { get; set; }
public ushort NumberOfSubpictureStreams;
/// <summary>
/// Subpicture attributes of VMGM_VOBS
/// </summary>
public byte[]? SubpictureAttributes { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? SubpictureAttributes;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 164)]
public byte[]? Reserved;
}
}

View File

@@ -1,22 +1,26 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.DVD
{
/// <see href="https://dvd.sourceforge.net/dvdinfo/ifo.html"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class VideoTitleSetIFO
{
/// <summary>
/// "DVDVIDEO-VTS"
/// </summary>
public string? Signature { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
public string? Signature;
/// <summary>
/// Last sector of title set (last sector of BUP)
/// </summary>
public uint LastTitleSetSector { get; set; }
public uint LastTitleSetSector;
/// <summary>
/// Last sector of IFO
/// </summary>
public uint LastIFOSector { get; set; }
public uint LastIFOSector;
/// <summary>
/// Version number
@@ -24,137 +28,142 @@ namespace SabreTools.Models.DVD
/// - Byte 1, Bits 7-4 - Major version number
/// - Byte 1, Bits 3-0 - Minor version number
/// </summary>
public ushort VersionNumber { get; set; }
public ushort VersionNumber;
/// <summary>
/// VTS category
/// </summary>
/// <remarks>0=unspecified, 1=Karaoke</remarks>
public uint VMGCategory { get; set; }
public uint VMGCategory;
/// <summary>
/// Number of volumes
/// </summary>
public ushort NumberOfVolumes { get; set; }
public ushort NumberOfVolumes;
/// <summary>
/// Volume number
/// </summary>
public ushort VolumeNumber { get; set; }
public ushort VolumeNumber;
/// <summary>
/// Side ID
/// </summary>
public byte SideID { get; set; }
public byte SideID;
/// <summary>
/// Number of title sets
/// </summary>
public ushort NumberOfTitleSets { get; set; }
public ushort NumberOfTitleSets;
/// <summary>
/// Provider ID
/// </summary>
public byte[]? ProviderID { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[]? ProviderID;
/// <summary>
/// VMG POS
/// </summary>
public ulong VMGPOS { get; set; }
public ulong VMGPOS;
/// <summary>
/// End byte address of VTS_MAT
/// </summary>
public uint InformationManagementTableEndByteAddress { get; set; }
public uint InformationManagementTableEndByteAddress;
/// <summary>
/// Start address of FP_PGC (First Play program chain)
/// </summary>
public uint FirstPlayProgramChainStartAddress { get; set; }
public uint FirstPlayProgramChainStartAddress;
/// <summary>
/// Start sector of Menu VOB
/// </summary>
public uint MenuVOBStartSector { get; set; }
public uint MenuVOBStartSector;
/// <summary>
/// Start sector of Title VOB
/// </summary>
public uint TitleVOBStartSector { get; set; }
public uint TitleVOBStartSector;
/// <summary>
/// Sector pointer to VTS_PTT_SRPT (table of Titles and Chapters)
/// </summary>
public uint TableOfTitlesAndChaptersSectorPointer { get; set; }
public uint TableOfTitlesAndChaptersSectorPointer;
/// <summary>
/// Sector pointer to VTS_PGCI (Title Program Chain table)
/// </summary>
public uint TitleProgramChainTableSectorPointer { get; set; }
public uint TitleProgramChainTableSectorPointer;
/// <summary>
/// Sector pointer to VTSM_PGCI_UT (Menu Program Chain table)
/// </summary>
public uint MenuProgramChainTableSectorPointer { get; set; }
public uint MenuProgramChainTableSectorPointer;
/// <summary>
/// Sector pointer to VTS_TMAPTI (time map)
/// </summary>
public uint TimeMapSectorPointer { get; set; }
public uint TimeMapSectorPointer;
/// <summary>
/// Sector pointer to VTSM_C_ADT (menu cell address table)
/// </summary>
public uint MenuCellAddressTableSectorPointer { get; set; }
public uint MenuCellAddressTableSectorPointer;
/// <summary>
/// Sector pointer to VTSM_VOBU_ADMAP (menu VOBU address map)
/// </summary>
public uint MenuVOBUAddressMapSectorPointer { get; set; }
public uint MenuVOBUAddressMapSectorPointer;
/// <summary>
/// Sector pointer to VTS_C_ADT (title set cell address table)
/// </summary>
public uint TitleSetCellAddressTableSectorPointer { get; set; }
public uint TitleSetCellAddressTableSectorPointer;
/// <summary>
/// Sector pointer to VTS_VOBU_ADMAP (title set VOBU address map)
/// </summary>
public uint TitleSetVOBUAddressMapSectorPointer { get; set; }
public uint TitleSetVOBUAddressMapSectorPointer;
/// <summary>
/// Video attributes of VTSM_VOBS
/// </summary>
public byte[]? VideoAttributes { get; set; }
public ushort VideoAttributes;
/// <summary>
/// Number of audio streams in VTSM_VOBS
/// </summary>
public ushort NumberOfAudioStreams { get; set; }
public ushort NumberOfAudioStreams;
/// <summary>
/// Audio attributes of VTSM_VOBS
/// </summary>
public byte[][]? AudioAttributes { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public ulong[]? AudioAttributes;
/// <summary>
/// Unknown
/// </summary>
public byte[]? Unknown { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? Unknown;
/// <summary>
/// Number of subpicture streams in VTSM_VOBS (0 or 1)
/// </summary>
public ushort NumberOfSubpictureStreams { get; set; }
public ushort NumberOfSubpictureStreams;
/// <summary>
/// Subpicture attributes of VTSM_VOBS
/// </summary>
public byte[]? SubpictureAttributes { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? SubpictureAttributes;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 164)]
public byte[]? Reserved;
}
}

14
Delphi/Constants.cs Normal file
View File

@@ -0,0 +1,14 @@
/// <remarks>
/// Information sourced from https://stackoverflow.com/questions/18720045/what-are-the-list-of-all-possible-values-for-dvclal
/// </remarks>
namespace SabreTools.Models.Delphi
{
public static class Constants
{
public static readonly byte[] DVCLALStandard = [0x23, 0x78, 0x5D, 0x23, 0xB6, 0xA5, 0xF3, 0x19, 0x43, 0xF3, 0x40, 0x02, 0x26, 0xD1, 0x11, 0xC7];
public static readonly byte[] DVCLALProfessional = [0xA2, 0x8C, 0xDF, 0x98, 0x7B, 0x3C, 0x3A, 0x79, 0x26, 0x71, 0x3F, 0x09, 0x0F, 0x2A, 0x25, 0x17];
public static readonly byte[] DVCLALEnterprise = [0x26, 0x3D, 0x4F, 0x38, 0xC2, 0x82, 0x37, 0xB8, 0xF3, 0x24, 0x42, 0x03, 0x17, 0x9B, 0x3A, 0x83];
}
}

View File

@@ -0,0 +1,14 @@
/// <remarks>
/// Information sourced from https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.PackageInfoTable
/// </remarks>
namespace SabreTools.Models.Delphi
{
public class PackageInfoTable
{
public int UnitCount { get; set; }
public PackageUnitEntry[]? UnitInfo { get; set; }
public PackageTypeInfo? TypeInfo { get; set; }
}
}

19
Delphi/PackageTypeInfo.cs Normal file
View File

@@ -0,0 +1,19 @@
/// <remarks>
/// Information sourced from https://docwiki.embarcadero.com/Libraries/Sydney/en/System.TPackageTypeInfo
/// </remarks>
namespace SabreTools.Models.Delphi
{
public class PackageTypeInfo
{
public int TypeCount { get; set; }
/// <remarks>
/// System-dependent pointer type, assumed to be encoded for x86
/// </remarks>
public uint[]? TypeTable { get; set; }
public int UnitCount { get; set; }
public string[]? UnitNames { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using System.Runtime.InteropServices;
/// <remarks>
/// Information sourced from https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.PackageUnitEntry
/// </remarks>
namespace SabreTools.Models.Delphi
{
[StructLayout(LayoutKind.Sequential)]
public class PackageUnitEntry
{
/// <remarks>
/// System-dependent pointer type, assumed to be encoded for x86
/// </remarks>
public uint Init;
/// <remarks>
/// System-dependent pointer type, assumed to be encoded for x86
/// </remarks>
public uint FInit;
}
}

View File

@@ -1,41 +1,44 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BlockEntry
{
/// <summary>
/// Flags for the block entry. 0x200F0000 == Not used.
/// </summary>
public uint EntryFlags { get; set; }
public uint EntryFlags;
/// <summary>
/// The offset for the data contained in this block entry in the file.
/// </summary>
public uint FileDataOffset { get; set; }
public uint FileDataOffset;
/// <summary>
/// The length of the data in this block entry.
/// </summary>
public uint FileDataSize { get; set; }
public uint FileDataSize;
/// <summary>
/// The offset to the first data block of this block entry's data.
/// </summary>
public uint FirstDataBlockIndex { get; set; }
public uint FirstDataBlockIndex;
/// <summary>
/// The next block entry in the series. (N/A if == BlockCount.)
/// </summary>
public uint NextBlockEntryIndex { get; set; }
public uint NextBlockEntryIndex;
/// <summary>
/// The previous block entry in the series. (N/A if == BlockCount.)
/// </summary>
public uint PreviousBlockEntryIndex { get; set; }
public uint PreviousBlockEntryIndex;
/// <summary>
/// The offset of the block entry in the directory.
/// </summary>
public uint DirectoryIndex { get; set; }
public uint DirectoryIndex;
}
}

View File

@@ -1,46 +1,49 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BlockEntryHeader
{
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount { get; set; }
public uint BlockCount;
/// <summary>
/// Number of data blocks that point to data.
/// </summary>
public uint BlocksUsed { get; set; }
public uint BlocksUsed;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy1 { get; set; }
public uint Dummy1;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2 { get; set; }
public uint Dummy2;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3 { get; set; }
public uint Dummy3;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy4 { get; set; }
public uint Dummy4;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -1,19 +1,22 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <remarks>
/// Part of version 5 but not version 6.
/// </remarks>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BlockEntryMap
{
/// <summary>
/// The previous block entry. (N/A if == BlockCount.)
/// </summary>
public uint PreviousBlockEntryIndex { get; set; }
public uint PreviousBlockEntryIndex;
/// <summary>
/// The next block entry. (N/A if == BlockCount.)
/// </summary>
public uint NextBlockEntryIndex { get; set; }
public uint NextBlockEntryIndex;
}
}

View File

@@ -1,34 +1,37 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <remarks>
/// Part of version 5 but not version 6.
/// </remarks>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BlockEntryMapHeader
{
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount { get; set; }
public uint BlockCount;
/// <summary>
/// Index of the first block entry.
/// </summary>
public uint FirstBlockEntryIndex { get; set; }
public uint FirstBlockEntryIndex;
/// <summary>
/// Index of the last block entry.
/// </summary>
public uint LastBlockEntryIndex { get; set; }
public uint LastBlockEntryIndex;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ChecksumEntry
{
/// <summary>
/// Checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -1,16 +1,19 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ChecksumHeader
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Size of LPGCFCHECKSUMHEADER & LPGCFCHECKSUMMAPHEADER & in bytes.
/// </summary>
public uint ChecksumSize { get; set; }
public uint ChecksumSize;
}
}

View File

@@ -1,16 +1,19 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ChecksumMapEntry
{
/// <summary>
/// Number of checksums.
/// </summary>
public uint ChecksumCount { get; set; }
public uint ChecksumCount;
/// <summary>
/// Index of first checksum.
/// </summary>
public uint FirstChecksumIndex { get; set; }
public uint FirstChecksumIndex;
}
}

View File

@@ -1,26 +1,29 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ChecksumMapHeader
{
/// <summary>
/// Always 0x14893721
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy1 { get; set; }
public uint Dummy1;
/// <summary>
/// Number of items.
/// </summary>
public uint ItemCount { get; set; }
public uint ItemCount;
/// <summary>
/// Number of checksums.
/// </summary>
public uint ChecksumCount { get; set; }
public uint ChecksumCount;
}
}

View File

@@ -1,36 +1,39 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DataBlockHeader
{
/// <summary>
/// GCF file version. This field is not part of all file versions.
/// </summary>
public uint LastVersionPlayed { get; set; }
public uint LastVersionPlayed;
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount { get; set; }
public uint BlockCount;
/// <summary>
/// Size of each data block in bytes.
/// </summary>
public uint BlockSize { get; set; }
public uint BlockSize;
/// <summary>
/// Offset to first data block.
/// </summary>
public uint FirstBlockOffset { get; set; }
public uint FirstBlockOffset;
/// <summary>
/// Number of data blocks that contain data.
/// </summary>
public uint BlocksUsed { get; set; }
public uint BlocksUsed;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryCopyEntry
{
/// <summary>
/// Index of the directory item.
/// </summary>
public uint DirectoryIndex { get; set; }
public uint DirectoryIndex;
}
}

View File

@@ -1,46 +1,45 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryEntry
{
/// <summary>
/// Offset to the directory item name from the end of the directory items.
/// </summary>
public uint NameOffset { get; set; }
/// <summary>
/// Directory item name from the end of the directory items.
/// </summary>
public string? Name { get; set; }
public uint NameOffset;
/// <summary>
/// Size of the item. (If file, file size. If folder, num items.)
/// </summary>
public uint ItemSize { get; set; }
public uint ItemSize;
/// <summary>
/// Checksome index. (0xFFFFFFFF == None).
/// </summary>
public uint ChecksumIndex { get; set; }
public uint ChecksumIndex;
/// <summary>
/// Flags for the directory item. (0x00000000 == Folder).
/// </summary>
public HL_GCF_FLAG DirectoryFlags { get; set; }
[MarshalAs(UnmanagedType.U4)]
public HL_GCF_FLAG DirectoryFlags;
/// <summary>
/// Index of the parent directory item. (0xFFFFFFFF == None).
/// </summary>
public uint ParentIndex { get; set; }
public uint ParentIndex;
/// <summary>
/// Index of the next directory item. (0x00000000 == None).
/// </summary>
public uint NextIndex { get; set; }
public uint NextIndex;
/// <summary>
/// Index of the first directory item. (0x00000000 == None).
/// </summary>
public uint FirstIndex { get; set; }
public uint FirstIndex;
}
}

View File

@@ -1,76 +1,79 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryHeader
{
/// <summary>
/// Always 0x00000004
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Cache ID.
/// </summary>
public uint CacheID { get; set; }
public uint CacheID;
/// <summary>
/// GCF file version.
/// </summary>
public uint LastVersionPlayed { get; set; }
public uint LastVersionPlayed;
/// <summary>
/// Number of items in the directory.
/// </summary>
public uint ItemCount { get; set; }
public uint ItemCount;
/// <summary>
/// Number of files in the directory.
/// </summary>
public uint FileCount { get; set; }
public uint FileCount;
/// <summary>
/// Always 0x00008000. Data per checksum?
/// </summary>
public uint Dummy1 { get; set; }
public uint Dummy1;
/// <summary>
/// Size of lpGCFDirectoryEntries & lpGCFDirectoryNames & lpGCFDirectoryInfo1Entries & lpGCFDirectoryInfo2Entries & lpGCFDirectoryCopyEntries & lpGCFDirectoryLocalEntries in bytes.
/// </summary>
public uint DirectorySize { get; set; }
public uint DirectorySize;
/// <summary>
/// Size of the directory names in bytes.
/// </summary>
public uint NameSize { get; set; }
public uint NameSize;
/// <summary>
/// Number of Info1 entires.
/// </summary>
public uint Info1Count { get; set; }
public uint Info1Count;
/// <summary>
/// Number of files to copy.
/// </summary>
public uint CopyCount { get; set; }
public uint CopyCount;
/// <summary>
/// Number of files to keep local.
/// </summary>
public uint LocalCount { get; set; }
public uint LocalCount;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2 { get; set; }
public uint Dummy2;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3 { get; set; }
public uint Dummy3;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryInfo1Entry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryInfo2Entry
{
/// <summary>
/// Reserved
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryLocalEntry
{
/// <summary>
/// Index of the directory item.
/// </summary>
public uint DirectoryIndex { get; set; }
public uint DirectoryIndex;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryMapEntry
{
/// <summary>
/// Index of the first data block. (N/A if == BlockCount.)
/// </summary>
public uint FirstBlockIndex { get; set; }
public uint FirstBlockIndex;
}
}

View File

@@ -1,19 +1,22 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <remarks>
/// Added in version 4 or version 5.
/// </remarks>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DirectoryMapHeader
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Always 0x00000000
/// </summary>
public uint Dummy1 { get; set; }
public uint Dummy1;
}
}

View File

@@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FragmentationMap
{
/// <summary>
/// The index of the next data block.
/// </summary>
public uint NextDataBlockIndex { get; set; }
public uint NextDataBlockIndex;
}
}

View File

@@ -1,26 +1,29 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FragmentationMapHeader
{
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount { get; set; }
public uint BlockCount;
/// <summary>
/// The index of the first unused fragmentation map entry.
/// </summary>
public uint FirstUnusedEntry { get; set; }
public uint FirstUnusedEntry;
/// <summary>
/// The block entry terminator; 0 = 0x0000ffff or 1 = 0xffffffff.
/// </summary>
public uint Terminator { get; set; }
public uint Terminator;
/// <summary>
/// Header checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -1,61 +1,64 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.GCF
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/GCFFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Header
{
/// <summary>
/// Always 0x00000001
/// </summary>
public uint Dummy0 { get; set; }
public uint Dummy0;
/// <summary>
/// Always 0x00000001
/// </summary>
public uint MajorVersion { get; set; }
public uint MajorVersion;
/// <summary>
/// GCF version number.
/// </summary>
public uint MinorVersion { get; set; }
public uint MinorVersion;
/// <summary>
/// Cache ID
/// </summary>
public uint CacheID { get; set; }
public uint CacheID;
/// <summary>
/// Last version played
/// </summary>
public uint LastVersionPlayed { get; set; }
public uint LastVersionPlayed;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy1 { get; set; }
public uint Dummy1;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy2 { get; set; }
public uint Dummy2;
/// <summary>
/// Total size of GCF file in bytes.
/// </summary>
public uint FileSize { get; set; }
public uint FileSize;
/// <summary>
/// Size of each data block in bytes.
/// </summary>
public uint BlockSize { get; set; }
public uint BlockSize;
/// <summary>
/// Number of data blocks.
/// </summary>
public uint BlockCount { get; set; }
public uint BlockCount;
/// <summary>
/// Reserved
/// </summary>
public uint Dummy3 { get; set; }
public uint Dummy3;
}
}

View File

@@ -0,0 +1,7 @@
namespace SabreTools.Models.InstallShieldArchiveV3
{
public static class Constants
{
public const uint HeaderSignature = 0x8C655D13;
}
}

View File

@@ -1,10 +1,25 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
[StructLayout(LayoutKind.Sequential)]
public class Directory
{
public string? Name { get; set; }
/// <summary>
/// Number of files in the directory
/// </summary>
public ushort FileCount;
public ushort FileCount { get; set; }
/// <summary>
/// Size of the chunk
/// </summary>
public ushort ChunkSize;
/// <summary>
/// Byte-length-prefixed ASCII string
/// </summary>
[MarshalAs(UnmanagedType.BStr)]
public string? Name;
}
}

View File

@@ -1,32 +1,37 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
[StructLayout(LayoutKind.Sequential)]
public class File
{
public byte VolumeEnd { get; set; }
public byte VolumeEnd;
public ushort Index { get; set; }
public ushort Index;
public uint UncompressedSize { get; set; }
public uint UncompressedSize;
public uint CompressedSize { get; set; }
public uint CompressedSize;
public uint Offset { get; set; }
public uint Offset;
public uint DateTime { get; set; }
public uint DateTime;
public uint Reserved0 { get; set; }
public uint Reserved0;
public ushort ChunkSize { get; set; }
public ushort ChunkSize;
public Attributes Attrib { get; set; }
[MarshalAs(UnmanagedType.U1)]
public Attributes Attrib;
public byte IsSplit { get; set; }
public byte IsSplit;
public byte Reserved1 { get; set; }
public byte Reserved1;
public byte VolumeStart { get; set; }
public byte VolumeStart;
public string? Name { get; set; }
[MarshalAs(UnmanagedType.AnsiBStr)]
public string? Name;
}
}

View File

@@ -1,50 +1,53 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
[StructLayout(LayoutKind.Sequential)]
public class Header
{
public uint Signature1 { get; set; }
public uint Signature1;
public uint Signature2 { get; set; }
public uint Signature2;
public ushort Reserved0 { get; set; }
public ushort Reserved0;
public ushort IsMultivolume { get; set; }
public ushort IsMultivolume;
public ushort FileCount { get; set; }
public ushort FileCount;
public uint DateTime { get; set; }
public uint DateTime;
public uint CompressedSize { get; set; }
public uint CompressedSize;
public uint UncompressedSize { get; set; }
public uint UncompressedSize;
public uint Reserved1 { get; set; }
public uint Reserved1;
/// <remarks>
/// Set in first vol only, zero in subsequent vols
/// </remarks>
public byte VolumeTotal { get; set; }
public byte VolumeTotal;
/// <remarks>
/// [1...n]
/// </remarks>
public byte VolumeNumber { get; set; }
public byte VolumeNumber;
public byte Reserved2 { get; set; }
public byte Reserved2;
public uint SplitBeginAddress { get; set; }
public uint SplitBeginAddress;
public uint SplitEndAddress { get; set; }
public uint SplitEndAddress;
public uint TocAddress { get; set; }
public uint TocAddress;
public uint Reserved3 { get; set; }
public uint Reserved3;
public ushort DirCount { get; set; }
public ushort DirCount;
public uint Reserved4 { get; set; }
public uint Reserved4;
public uint Reserved5 { get; set; }
public uint Reserved5;
}
}

View File

@@ -1,31 +1,35 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.InstallShieldCabinet
{
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class CommonHeader
{
/// <summary>
/// "ISc("
/// </summary>
public string? Signature { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Signature;
/// <summary>
/// Encoded version
/// </summary>
public uint Version { get; set; }
public uint Version;
/// <summary>
/// Volume information
/// </summary>
public uint VolumeInfo { get; set; }
public uint VolumeInfo;
/// <summary>
/// Offset to cabinet descriptor
/// </summary>
public uint DescriptorOffset { get; set; }
public uint DescriptorOffset;
/// <summary>
/// Cabinet descriptor size
/// </summary>
public uint DescriptorSize { get; set; }
public uint DescriptorSize;
}
}

View File

@@ -33,7 +33,7 @@ namespace SabreTools.Models.InstallShieldCabinet
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved0 { get; set; }
public ushort Reserved0 { get; set; }
/// <summary>
/// Reserved offset
@@ -78,6 +78,7 @@ namespace SabreTools.Models.InstallShieldCabinet
/// <summary>
/// Reserved
/// </summary>
/// <remarks>32 bytes</remarks>
public byte[]? Reserved1 { get; set; }
/// <summary>
@@ -93,11 +94,13 @@ namespace SabreTools.Models.InstallShieldCabinet
/// <summary>
/// Reserved
/// </summary>
/// <remarks>28 bytes</remarks>
public byte[]? Reserved2 { get; set; }
/// <summary>
/// Reserved
/// </summary>
/// <remarks>2 bytes (<= v5), 1 byte (> v5)</remarks>
public byte[]? Reserved3 { get; set; }
/// <summary>

View File

@@ -1,121 +1,126 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.InstallShieldCabinet
{
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Descriptor
{
/// <summary>
/// Offset to the descriptor strings
/// </summary>
public uint StringsOffset { get; set; }
public uint StringsOffset;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved0 { get; set; }
public uint Reserved0;
/// <summary>
/// Offset to the component list
/// </summary>
public uint ComponentListOffset { get; set; }
public uint ComponentListOffset;
/// <summary>
/// Offset to the file table
/// </summary>
public uint FileTableOffset { get; set; }
public uint FileTableOffset;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved1 { get; set; }
public uint Reserved1;
/// <summary>
/// Size of the file table
/// </summary>
public uint FileTableSize { get; set; }
public uint FileTableSize;
/// <summary>
/// Redundant size of the file table
/// </summary>
public uint FileTableSize2 { get; set; }
public uint FileTableSize2;
/// <summary>
/// Number of directories
/// </summary>
public ushort DirectoryCount { get; set; }
public ushort DirectoryCount;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved2 { get; set; }
public uint Reserved2;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved3 { get; set; }
public ushort Reserved3;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved4 { get; set; }
public uint Reserved4;
/// <summary>
/// Number of files
/// </summary>
public uint FileCount { get; set; }
public uint FileCount;
/// <summary>
/// Redundant offset to the file table
/// </summary>
public uint FileTableOffset2 { get; set; }
public uint FileTableOffset2;
/// <summary>
/// Number of component table infos
/// </summary>
public ushort ComponentTableInfoCount { get; set; }
public ushort ComponentTableInfoCount;
/// <summary>
/// Offset to the component table
/// </summary>
public uint ComponentTableOffset { get; set; }
public uint ComponentTableOffset;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved5 { get; set; }
public uint Reserved5;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved6 { get; set; }
public uint Reserved6;
/// <summary>
/// Offsets to the file groups
/// </summary>
public uint[]? FileGroupOffsets { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 71)]
public uint[]? FileGroupOffsets;
/// <summary>
/// Offsets to the components
/// </summary>
public uint[]? ComponentOffsets { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 71)]
public uint[]? ComponentOffsets;
/// <summary>
/// Offset to the setup types
/// </summary>
public uint SetupTypesOffset { get; set; }
public uint SetupTypesOffset;
/// <summary>
/// Offset to the setup table
/// </summary>
public uint SetupTableOffset { get; set; }
public uint SetupTableOffset;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved7 { get; set; }
public uint Reserved7;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved8 { get; set; }
public uint Reserved8;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Fixup Page Table provides a simple mapping of a logical page number
@@ -15,6 +17,7 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FixupPageTableEntry
{
/// <summary>
@@ -28,6 +31,6 @@
/// This field specifies the offset following the last fixup record in the
/// fixup record table. This is the last entry in the fixup page table. (n + 1)
/// </remarks>
public uint Offset { get; set; }
public uint Offset;
}
}

View File

@@ -24,7 +24,7 @@
/// This defines the length of the string in bytes. The length of each
/// ascii name string is limited to 127 characters.
/// </remarks>
public byte Length { get; set; }
public byte Length { get; set; } // TODO: Remove in lieu of AnsiBStr
/// <summary>
/// ASCII String.

View File

@@ -32,7 +32,7 @@
/// linear EXE module and will be used in the future for parameter type
/// checking.
/// </remarks>
public byte Length { get; set; }
public byte Length { get; set; } // TODO: Remove in lieu of AnsiBStr
/// <summary>
/// ASCII String.

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The `information block` in the LE header contains the linker version number,
@@ -10,6 +12,7 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class InformationBlock
{
/// <summary>
@@ -21,7 +24,8 @@
/// The signature word is used by the loader to identify the EXE
/// file as a valid 32-bit Linear Executable Module Format.
/// </remarks>
public string? Signature { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
public string? Signature;
/// <summary>
/// Byte Ordering.
@@ -29,7 +33,8 @@
/// <remarks>
/// This byte specifies the byte ordering for the linear EXE format.
/// </remarks>
public ByteOrder ByteOrder { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ByteOrder ByteOrder;
/// <summary>
/// Word Ordering.
@@ -37,7 +42,8 @@
/// <remarks>
/// This byte specifies the Word ordering for the linear EXE format.
/// </remarks>
public WordOrder WordOrder { get; set; }
[MarshalAs(UnmanagedType.U1)]
public WordOrder WordOrder;
/// <summary>
/// Linear EXE Format Level.
@@ -49,7 +55,7 @@
/// future EXE file versions so that an appropriate error message may be
/// displayed if an attempt is made to load them.
/// </remarks>
public uint ExecutableFormatLevel { get; set; }
public uint ExecutableFormatLevel;
/// <summary>
/// Module CPU Type.
@@ -57,7 +63,8 @@
/// <remarks>
/// This field specifies the type of CPU required by this module to run.
/// </remarks>
public CPUType CPUType { get; set; }
[MarshalAs(UnmanagedType.U2)]
public CPUType CPUType;
/// <summary>
/// Module OS Type.
@@ -65,7 +72,8 @@
/// <remarks>
/// This field specifies the type of Operating system required to run this module.
/// </remarks>
public OperatingSystem ModuleOS { get; set; }
[MarshalAs(UnmanagedType.U2)]
public OperatingSystem ModuleOS;
/// <summary>
/// Module version
@@ -74,12 +82,13 @@
/// This is useful for differentiating between revisions of dynamic linked modules.
/// This value is specified at link time by the user.
/// </remarks>
public uint ModuleVersion { get; set; }
public uint ModuleVersion;
/// <summary>
/// Module type flags
/// </summary>
public ModuleFlags ModuleTypeFlags { get; set; }
[MarshalAs(UnmanagedType.U4)]
public ModuleFlags ModuleTypeFlags;
/// <summary>
/// Number of pages in module.
@@ -94,7 +103,7 @@
/// EXE module. This is used to determine the size of the page information tables
/// in the linear EXE module.
/// </remarks>
public uint ModuleNumberPages { get; set; }
public uint ModuleNumberPages;
/// <summary>
/// The Object number to which the Entry Address is relative.
@@ -109,7 +118,7 @@
/// is set, then the object to which this field refers must be a 32-bit object (i.e.,
/// the Big/Default bit must be set in the object flags; see below).
/// </remarks>
public uint InitialObjectCS { get; set; }
public uint InitialObjectCS;
/// <summary>
/// Entry Address of module.
@@ -118,7 +127,7 @@
/// The Entry Address is the starting address for program modules and the library
/// initialization and Library termination address for library modules.
/// </remarks>
public uint InitialEIP { get; set; }
public uint InitialEIP;
/// <summary>
/// The Object number to which the ESP is relative.
@@ -128,7 +137,7 @@
/// nonzero value for a program module to be correctly loaded. This field is ignored
/// for a library module.
/// </remarks>
public uint InitialObjectSS { get; set; }
public uint InitialObjectSS;
/// <summary>
/// Starting stack address of module.
@@ -138,7 +147,7 @@
/// value in this field indicates that the stack pointer is to be initialized to the
/// highest address/offset in the object. This field is ignored for a library module.
/// </remarks>
public uint InitialESP { get; set; }
public uint InitialESP;
/// <summary>
/// The size of one page for this system.
@@ -148,7 +157,7 @@
/// For the initial version of this linear EXE format the page size is 4Kbytes.
/// (The 4K page size is specified by a value of 4096 in this field.)
/// </remarks>
public uint MemoryPageSize { get; set; }
public uint MemoryPageSize;
/// <summary>
/// The shift left bits for page offsets.
@@ -162,7 +171,7 @@
/// 512 byte (disk sector) basis. The default value for this field is 12 (decimal),
/// which give a 4096 byte alignment. All other offsets are byte aligned.
/// </remarks>
public uint BytesOnLastPage { get; set; }
public uint BytesOnLastPage;
/// <summary>
/// Total size of the fixup information in bytes.
@@ -174,7 +183,7 @@
/// - Import Module name Table
/// - Import Procedure Name Table
/// </remarks>
public uint FixupSectionSize { get; set; }
public uint FixupSectionSize;
/// <summary>
/// Checksum for fixup information.
@@ -185,7 +194,7 @@
/// not always loaded into main memory with the 'loader section'. If the checksum
/// feature is not implemented, then the linker will set these fields to zero.
/// </remarks>
public uint FixupSectionChecksum { get; set; }
public uint FixupSectionChecksum;
/// <summary>
/// Size of memory resident tables.
@@ -195,7 +204,7 @@
/// for the module, while the module is in use. This total size includes all
/// tables from the Object Table down to and including the Per-Page Checksum Table.
/// </remarks>
public uint LoaderSectionSize { get; set; }
public uint LoaderSectionSize;
/// <summary>
/// Checksum for loader section.
@@ -205,7 +214,7 @@
/// If the checksum feature is not implemented, then the linker will set these fields
/// to zero.
/// </remarks>
public uint LoaderSectionChecksum { get; set; }
public uint LoaderSectionChecksum;
/// <summary>
/// Object Table offset.
@@ -213,7 +222,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ObjectTableOffset { get; set; }
public uint ObjectTableOffset;
/// <summary>
/// Object Table Count.
@@ -221,7 +230,7 @@
/// <remarks>
/// This defines the number of entries in Object Table.
/// </remarks>
public uint ObjectTableCount { get; set; }
public uint ObjectTableCount;
/// <summary>
/// Object Page Table offset
@@ -229,7 +238,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ObjectPageMapOffset { get; set; }
public uint ObjectPageMapOffset;
/// <summary>
/// Object Iterated Pages offset.
@@ -237,7 +246,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ObjectIterateDataMapOffset { get; set; }
public uint ObjectIterateDataMapOffset;
/// <summary>
/// Resource Table offset
@@ -245,12 +254,12 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ResourceTableOffset { get; set; }
public uint ResourceTableOffset;
/// <summary>
/// Number of entries in Resource Table.
/// </summary>
public uint ResourceTableCount { get; set; }
public uint ResourceTableCount;
/// <summary>
/// Resident Name Table offset.
@@ -258,7 +267,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ResidentNamesTableOffset { get; set; }
public uint ResidentNamesTableOffset;
/// <summary>
/// Entry Table offset.
@@ -266,7 +275,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint EntryTableOffset { get; set; }
public uint EntryTableOffset;
/// <summary>
/// Module Format Directives Table offset.
@@ -274,7 +283,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ModuleDirectivesTableOffset { get; set; }
public uint ModuleDirectivesTableOffset;
/// <summary>
/// Number of Module Format Directives in the Table.
@@ -283,7 +292,7 @@
/// This field specifies the number of entries in the
/// Module Format Directives Table.
/// </remarks>
public uint ModuleDirectivesCount { get; set; }
public uint ModuleDirectivesCount;
/// <summary>
/// Fixup Page Table offset.
@@ -291,7 +300,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint FixupPageTableOffset { get; set; }
public uint FixupPageTableOffset;
/// <summary>
/// Fixup Record Table offset.
@@ -299,7 +308,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint FixupRecordTableOffset { get; set; }
public uint FixupRecordTableOffset;
/// <summary>
/// Import Module Name Table offset.
@@ -307,12 +316,12 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ImportedModulesNameTableOffset { get; set; }
public uint ImportedModulesNameTableOffset;
/// <summary>
/// The number of entries in the Import Module Name Table.
/// </summary>
public uint ImportedModulesCount { get; set; }
public uint ImportedModulesCount;
/// <summary>
/// Import Procedure Name Table offset.
@@ -320,7 +329,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint ImportProcedureNameTableOffset { get; set; }
public uint ImportProcedureNameTableOffset;
/// <summary>
/// Per-page Checksum Table offset.
@@ -328,7 +337,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint PerPageChecksumTableOffset { get; set; }
public uint PerPageChecksumTableOffset;
/// <summary>
/// Data Pages Offset.
@@ -336,7 +345,7 @@
/// <remarks>
/// This offset is relative to the beginning of the EXE file.
/// </remarks>
public uint DataPagesOffset { get; set; }
public uint DataPagesOffset;
/// <summary>
/// Number of Preload pages for this module.
@@ -345,7 +354,7 @@
/// Note that OS/2 2.0 does not respect the preload of pages as specified
/// in the executable file for performance reasons.
/// </remarks>
public uint PreloadPageCount { get; set; }
public uint PreloadPageCount;
/// <summary>
/// Non-Resident Name Table offset.
@@ -353,12 +362,12 @@
/// <remarks>
/// This offset is relative to the beginning of the EXE file.
/// </remarks>
public uint NonResidentNamesTableOffset { get; set; }
public uint NonResidentNamesTableOffset;
/// <summary>
/// Number of bytes in the Non-resident name table.
/// </summary>
public uint NonResidentNamesTableLength { get; set; }
public uint NonResidentNamesTableLength;
/// <summary>
/// Non-Resident Name Table Checksum.
@@ -366,7 +375,7 @@
/// <remarks>
/// This is a cryptographic checksum of the Non-Resident Name Table.
/// </remarks>
public uint NonResidentNamesTableChecksum { get; set; }
public uint NonResidentNamesTableChecksum;
/// <summary>
/// The Auto Data Segment Object number.
@@ -376,7 +385,7 @@
/// This field is supported for 16-bit compatibility only and is not used by
/// 32-bit modules.
/// </remarks>
public uint AutomaticDataObject { get; set; }
public uint AutomaticDataObject;
/// <summary>
/// Debug Information offset.
@@ -384,7 +393,7 @@
/// <remarks>
/// This offset is relative to the beginning of the linear EXE header.
/// </remarks>
public uint DebugInformationOffset { get; set; }
public uint DebugInformationOffset;
/// <summary>
/// Debug Information length.
@@ -392,7 +401,7 @@
/// <remarks>
/// The length of the debug information in bytes.
/// </remarks>
public uint DebugInformationLength { get; set; }
public uint DebugInformationLength;
/// <summary>
/// Instance pages in preload section.
@@ -400,7 +409,7 @@
/// <remarks>
/// The number of instance data pages found in the preload section.
/// </remarks>
public uint PreloadInstancePagesNumber { get; set; }
public uint PreloadInstancePagesNumber;
/// <summary>
/// Instance pages in demand section.
@@ -408,7 +417,7 @@
/// <remarks>
/// The number of instance data pages found in the demand section.
/// </remarks>
public uint DemandInstancePagesNumber { get; set; }
public uint DemandInstancePagesNumber;
/// <summary>
/// Heap size added to the Auto DS Object.
@@ -418,6 +427,6 @@
/// by the loader. This field is supported for 16-bit compatibility only and
/// is not used by 32-bit modules.
/// </remarks>
public uint ExtraHeapAllocation { get; set; }
public uint ExtraHeapAllocation;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Module Format Directives Table is an optional table that allows additional
@@ -13,6 +15,7 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ModuleFormatDirectivesTableEntry
{
/// <summary>
@@ -22,7 +25,8 @@
/// The directive number specifies the type of directive defined. This can be
/// used to determine the format of the information in the directive data.
/// </remarks>
public DirectiveNumber DirectiveNumber { get; set; }
[MarshalAs(UnmanagedType.U2)]
public DirectiveNumber DirectiveNumber;
/// <summary>
/// Directive data length.
@@ -30,7 +34,7 @@
/// <remarks>
/// This specifies the length in byte of the directive data for this directive number.
/// </remarks>
public ushort DirectiveDataLength { get; set; }
public ushort DirectiveDataLength;
/// <summary>
/// Directive data offset.
@@ -40,6 +44,6 @@
/// to beginning of linear EXE header for a resident table, and relative to the
/// beginning of the EXE file for non-resident tables.
/// </remarks>
public uint DirectiveDataOffset { get; set; }
public uint DirectiveDataOffset;
}
}

View File

@@ -39,7 +39,7 @@
/// signifies that additional information is contained in the linear EXE module and
/// will be used in the future for parameter type checking.
/// </remarks>
public byte Length { get; set; }
public byte Length { get; set; } // TODO: Remove in lieu of AnsiBStr
/// <summary>
/// ASCII String.

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Object page table provides information about a logical page in an object.
@@ -13,6 +15,7 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ObjectPageMapEntry
{
/// <summary>
@@ -35,7 +38,7 @@
/// The logical page number (Object Page Table index), is used to index the Fixup
/// Page Table to find any fixups associated with the logical page.
/// </remarks>
public uint PageDataOffset { get; set; }
public uint PageDataOffset;
/// <summary>
/// Number of bytes of data for this page.
@@ -47,11 +50,12 @@
/// bytes are to be filled with zeros. If the FLAGS field indicates an Iterated Data
/// Page, the iterated data records will completely fill out the remainder.
/// </remarks>
public ushort DataSize { get; set; }
public ushort DataSize;
/// <summary>
/// Attributes specifying characteristics of this logical page.
/// </summary>
public ObjectPageFlags Flags { get; set; }
[MarshalAs(UnmanagedType.U2)]
public ObjectPageFlags Flags;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The object table contains information that describes each segment in
@@ -12,6 +14,7 @@
/// </remarks>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ObjectTableEntry
{
/// <summary>
@@ -24,7 +27,7 @@
/// file for the object. This memory size must also be large enough to
/// contain all of the iterated data and uninitialized data in the EXE file.
/// </remarks>
public uint VirtualSegmentSize { get; set; }
public uint VirtualSegmentSize;
/// <summary>
/// Relocation Base Address.
@@ -34,12 +37,13 @@
/// internal relocation fixups for the module have been removed, this is the
/// address the object will be allocated at by the loader.
/// </remarks>
public uint RelocationBaseAddress { get; set; }
public uint RelocationBaseAddress;
/// <summary>
/// Flag bits for the object.
/// </summary>
public ObjectFlags ObjectFlags { get; set; }
[MarshalAs(UnmanagedType.U2)]
public ObjectFlags ObjectFlags;
/// <summary>
/// Object Page Table Index.
@@ -53,7 +57,7 @@
/// other words the object table entries are sorted based on the object page table
/// index value.
/// </remarks>
public uint PageTableIndex { get; set; }
public uint PageTableIndex;
/// <summary>
/// # of object page table entries for this object.
@@ -69,11 +73,11 @@
/// was neither a zero filled or invalid page, then the additional pages are treated
/// as zero filled pages.
/// </remarks>
public uint PageTableEntries { get; set; }
public uint PageTableEntries;
/// <summary>
/// Reserved for future use. Must be set to zero.
/// </summary>
public uint Reserved { get; set; }
public uint Reserved;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Per-Page Checksum table provides space for a cryptographic checksum for
@@ -11,11 +13,12 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class PerPageChecksumTableEntry
{
/// <summary>
/// Cryptographic checksum.
/// </summary>
public uint Checksum { get; set; }
public uint Checksum;
}
}

View File

@@ -39,7 +39,7 @@
/// signifies that additional information is contained in the linear EXE module and
/// will be used in the future for parameter type checking.
/// </remarks>
public byte Length { get; set; }
public byte Length { get; set; } // TODO: Remove in lieu of AnsiBStr
/// <summary>
/// ASCII String.

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The resource table is an array of resource table entries. Each resource table
@@ -13,31 +15,33 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTableEntry
{
/// <summary>
/// Resource type ID.
/// </summary>
public ResourceTableEntryType TypeID { get; set; }
[MarshalAs(UnmanagedType.U4)]
public ResourceTableEntryType TypeID;
/// <summary>
/// An ID used as a name for the resource when referred to.
/// </summary>
public ushort NameID { get; set; }
public ushort NameID;
/// <summary>
/// The number of bytes the resource consists of.
/// </summary>
public uint ResourceSize { get; set; }
public uint ResourceSize;
/// <summary>
/// The number of the object which contains the resource.
/// </summary>
public ushort ObjectNumber { get; set; }
public ushort ObjectNumber;
/// <summary>
/// The offset within the specified object where the resource begins.
/// </summary>
public uint Offset { get; set; }
public uint Offset;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.LinearExecutable
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Verify Record Directive Table is an optional table. It maintains a record
@@ -9,6 +11,7 @@
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class VerifyRecordDirectiveTableEntry
{
/// <summary>
@@ -19,7 +22,7 @@
/// directive table. This is equal to the number of modules referenced by
/// this module.
/// </remarks>
public ushort EntryCount { get; set; }
public ushort EntryCount;
/// <summary>
/// Ordinal index into the Import Module Name Table.
@@ -28,7 +31,7 @@
/// This value is an ordered index in to the Import Module Name Table for
/// the referenced module.
/// </remarks>
public ushort OrdinalIndex { get; set; }
public ushort OrdinalIndex;
/// <summary>
/// Module Version.
@@ -41,7 +44,7 @@
/// number in a module to be incremented anytime the entry point offsets
/// change.
/// </remarks>
public ushort Version { get; set; }
public ushort Version;
/// <summary>
/// Module # of Object Entries.
@@ -50,7 +53,7 @@
/// This field is used to identify the number of object verify entries
/// that follow for the referenced module.
/// </remarks>
public ushort ObjectEntriesCount { get; set; }
public ushort ObjectEntriesCount;
/// <summary>
/// Object # in Module.
@@ -59,7 +62,7 @@
/// This field specifies the object number in the referenced module that
/// is being verified.
/// </remarks>
public ushort ObjectNumberInModule { get; set; }
public ushort ObjectNumberInModule;
/// <summary>
/// Object load base address.
@@ -68,7 +71,7 @@
/// This is the address that the object was loaded at when the fixups were
/// performed.
/// </remarks>
public ushort ObjectLoadBaseAddress { get; set; }
public ushort ObjectLoadBaseAddress;
/// <summary>
/// Object virtual address size.
@@ -77,6 +80,6 @@
/// This field specifies the total amount of virtual memory required for
/// this object.
/// </remarks>
public ushort ObjectVirtualAddressSize { get; set; }
public ushort ObjectVirtualAddressSize;
}
}

View File

@@ -1,3 +1,5 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MSDOS
{
/// <summary>
@@ -6,6 +8,7 @@ namespace SabreTools.Models.MSDOS
/// </summary>
/// <see href="https://wiki.osdev.org/MZ"/>
/// <see href="http://www.pinvoke.net/default.aspx/Structures.IMAGE_DOS_HEADER"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class ExecutableHeader
{
#region Standard Fields
@@ -13,23 +16,25 @@ namespace SabreTools.Models.MSDOS
/// <summary>
/// 0x5A4D (ASCII for 'M' and 'Z')
/// </summary>
public string? Magic { get; set; }
/// <remarks>15 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
public string? Magic;
/// <summary>
/// Number of bytes in the last page.
/// </summary>
public ushort LastPageBytes { get; set; }
public ushort LastPageBytes;
/// <summary>
/// Number of whole/partial pages.
/// </summary>
/// <remarks>A page (or block) is 512 bytes long.</remarks>
public ushort Pages { get; set; }
public ushort Pages;
/// <summary>
/// Number of entries in the relocation table.
/// </summary>
public ushort RelocationItems { get; set; }
public ushort RelocationItems;
/// <summary>
/// The number of paragraphs taken up by the header. It can be any value, as the loader
@@ -38,57 +43,57 @@ namespace SabreTools.Models.MSDOS
/// own header metadata, or put the relocation table there, or use it for any other purpose. [08]
/// </summary>
/// <remarks>A paragraph is 16 bytes in size</remarks>
public ushort HeaderParagraphSize { get; set; }
public ushort HeaderParagraphSize;
/// <summary>
/// The number of paragraphs required by the program, excluding the PSP and program image.
/// If no free block is big enough, the loading stops.
/// </summary>
/// <remarks>A paragraph is 16 bytes in size</remarks>
public ushort MinimumExtraParagraphs { get; set; }
public ushort MinimumExtraParagraphs;
/// <summary>
/// The number of paragraphs requested by the program.
/// If no free block is big enough, the biggest one possible is allocated.
/// </summary>
/// <remarks>A paragraph is 16 bytes in size</remarks>
public ushort MaximumExtraParagraphs { get; set; }
public ushort MaximumExtraParagraphs;
/// <summary>
/// Relocatable segment address for SS.
/// </summary>
public ushort InitialSSValue { get; set; }
public ushort InitialSSValue;
/// <summary>
/// Initial value for SP.
/// </summary>
public ushort InitialSPValue { get; set; }
public ushort InitialSPValue;
/// <summary>
/// When added to the sum of all other words in the file, the result should be zero.
/// </summary>
public ushort Checksum { get; set; }
public ushort Checksum;
/// <summary>
/// Initial value for IP. [14]
/// </summary>
public ushort InitialIPValue { get; set; }
public ushort InitialIPValue;
/// <summary>
/// Relocatable segment address for CS.
/// </summary>
public ushort InitialCSValue { get; set; }
public ushort InitialCSValue;
/// <summary>
/// The (absolute) offset to the relocation table.
/// </summary>
public ushort RelocationTableAddr { get; set; }
public ushort RelocationTableAddr;
/// <summary>
/// Value used for overlay management.
/// If zero, this is the main executable.
/// </summary>
public ushort OverlayNumber { get; set; }
public ushort OverlayNumber;
#endregion
@@ -97,27 +102,31 @@ namespace SabreTools.Models.MSDOS
/// <summary>
/// Reserved words
/// </summary>
public ushort[]? Reserved1 { get; set; } = new ushort[4];
/// <remarks>4 entries/remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public ushort[]? Reserved1;
/// <summary>
/// Defined by name but no other information is given; typically zeroes
/// </summary>
public ushort OEMIdentifier { get; set; }
public ushort OEMIdentifier;
/// <summary>
/// Defined by name but no other information is given; typically zeroes
/// </summary>
public ushort OEMInformation { get; set; }
public ushort OEMInformation;
/// <summary>
/// Reserved words
/// </summary>
public ushort[]? Reserved2 { get; set; } = new ushort[10];
/// <remarks>10 entries/remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public ushort[]? Reserved2;
/// <summary>
/// Starting address of the PE header
/// </summary>
public uint NewExeHeaderAddr { get; set; }
public uint NewExeHeaderAddr;
#endregion
}

View File

@@ -1,19 +1,22 @@
namespace SabreTools.Models.MSDOS
using System.Runtime.InteropServices;
namespace SabreTools.Models.MSDOS
{
/// <summary>
/// Each pointer in the relocation table looks as such
/// </summary>
/// <see href="https://wiki.osdev.org/MZ"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class RelocationEntry
{
/// <summary>
/// Offset of the relocation within provided segment.
/// </summary>
public ushort Offset { get; set; }
public ushort Offset;
/// <summary>
/// Segment of the relocation, relative to the load segment address.
/// </summary>
public ushort Segment { get; set; }
public ushort Segment;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.MoPaQ
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// The BET table is present if the BetTablePos64 member of MPQ header is set
@@ -14,7 +16,8 @@
/// <summary>
/// 'BET\x1A'
/// </summary>
public string? Signature { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Signature;
/// <summary>
/// Version. Seems to be always 1

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.MoPaQ
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// Block table contains informations about file sizes and way of their storage within
@@ -6,26 +8,28 @@
/// of block table entry is (like hash table entry). The block table is also encrypted.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BlockEntry
{
/// <summary>
/// Offset of the beginning of the file data, relative to the beginning of the archive.
/// </summary>
public uint FilePosition { get; set; }
public uint FilePosition;
/// <summary>
/// Compressed file size
/// </summary>
public uint CompressedSize { get; set; }
public uint CompressedSize;
/// <summary>
/// Size of uncompressed file
/// </summary>
public uint UncompressedSize { get; set; }
public uint UncompressedSize;
/// <summary>
/// Flags for the file.
/// </summary>
public FileFlags Flags { get; set; }
[MarshalAs(UnmanagedType.U4)]
public FileFlags Flags;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.MoPaQ
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// Hash table is used for searching files by name. The file name is converted to
@@ -8,29 +10,31 @@
/// table is 16 bytes.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class HashEntry
{
/// <summary>
/// The hash of the full file name (part A)
/// </summary>
public uint NameHashPartA { get; set; }
public uint NameHashPartA;
/// <summary>
/// The hash of the full file name (part B)
/// </summary>
public uint NameHashPartB { get; set; }
public uint NameHashPartB;
/// <summary>
/// The language of the file. This is a Windows LANGID data type, and uses the same values.
/// 0 indicates the default language (American English), or that the file is language-neutral.
/// </summary>
public Locale Locale { get; set; }
[MarshalAs(UnmanagedType.I2)]
public Locale Locale;
/// <summary>
/// The platform the file is used for. 0 indicates the default platform.
/// No other values have been observed.
/// </summary>
public ushort Platform { get; set; }
public ushort Platform;
/// <summary>
/// If the hash table entry is valid, this is the index into the block table of the file.
@@ -40,6 +44,6 @@
/// - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file).
/// Does not terminate searches for a given file.
/// </summary>
public uint BlockIndex { get; set; }
public uint BlockIndex;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.MoPaQ
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// The HET table is present if the HetTablePos64 member of MPQ header is
@@ -15,7 +17,8 @@
/// <summary>
/// 'HET\x1A'
/// </summary>
public string? Signature { get; set; }
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Signature;
/// <summary>
/// Version. Seems to be always 1

View File

@@ -1,35 +1,42 @@
namespace SabreTools.Models.MoPaQ
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// This structure contains size of the patch, flags and also MD5 of the patch.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class PatchInfo
{
/// <summary>
/// Length of patch info header, in bytes
/// </summary>
public uint Length { get; set; }
public uint Length;
/// <summary>
/// Flags. 0x80000000 = MD5 (?)
/// </summary>
public uint Flags { get; set; }
public uint Flags;
/// <summary>
/// Uncompressed size of the patch file
/// </summary>
public uint DataSize { get; set; }
public uint DataSize;
/// <summary>
/// MD5 of the entire patch file after decompression
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? MD5 { get; set; }
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? MD5;
/// <summary>
/// The sector offset table (variable length)
/// </summary>
public uint[]? SectorOffsetTable { get; set; }
/// <remarks>0 entries</remarks>
/// TODO: Determine the number of entries
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)]
public uint[]? SectorOffsetTable;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.MoPaQ
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// MPQ User Data are optional, and is commonly used in custom maps for
@@ -6,28 +8,31 @@
/// from where the MPQ header should be searched.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class UserData
{
/// <summary>
/// The user data signature
/// </summary>
/// <see cref="SignatureValue"/>
public string? Signature { get; set; }
/// <remarks>4 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Signature;
/// <summary>
/// Maximum size of the user data
/// </summary>
public uint UserDataSize { get; set; }
public uint UserDataSize;
/// <summary>
/// Offset of the MPQ header, relative to the beginning of this header
/// </summary>
public uint HeaderOffset { get; set; }
public uint HeaderOffset;
/// <summary>
/// Appears to be size of user data header (Starcraft II maps)
/// </summary>
public uint UserDataHeaderSize { get; set; }
public uint UserDataHeaderSize;
// TODO: Does this area contain extra data that should be read in?
}

View File

@@ -1,9 +1,12 @@
namespace SabreTools.Models.N3DS
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <summary>
/// The kernel capability descriptors are passed to svcCreateProcess.
/// </summary>
/// <see href="https://www.3dbrew.org/wiki/NCCH/Extended_Header#ARM11_Kernel_Capabilities"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ARM11KernelCapabilities
{
/// <summary>
@@ -34,11 +37,15 @@
/// 13 Process has access to CPU core 2 (New3DS only)
/// </summary>
/// TODO: Make enum for flag values
public uint[]? Descriptors { get; set; }
/// <remarks>28 entries</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public uint[]? Descriptors;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? Reserved;
}
}

View File

@@ -1,66 +1,81 @@
namespace SabreTools.Models.N3DS
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCCH/Extended_Header#ARM11_Local_System_Capabilities"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ARM11LocalSystemCapabilities
{
/// <summary>
/// Program ID
/// </summary>
public ulong ProgramID { get; set; }
public ulong ProgramID;
/// <summary>
/// Core version (The Title ID low of the required FIRM)
/// </summary>
public uint CoreVersion { get; set; }
public uint CoreVersion;
/// <summary>
/// Flag1 (implemented starting from 8.0.0-18).
/// </summary>
public ARM11LSCFlag1 Flag1 { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ARM11LSCFlag1 Flag1;
/// <summary>
/// Flag2 (implemented starting from 8.0.0-18).
/// </summary>
public ARM11LSCFlag2 Flag2 { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ARM11LSCFlag2 Flag2;
/// <summary>
/// Flag0
/// </summary>
public ARM11LSCFlag0 Flag0 { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ARM11LSCFlag0 Flag0;
/// <summary>
/// Priority
/// </summary>
public byte Priority { get; set; }
public byte Priority;
/// <summary>
/// Resource limit descriptors. The first byte here controls the maximum allowed CpuTime.
/// </summary>
public ushort[]? ResourceLimitDescriptors { get; set; }
/// <remarks>16 entries</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public ushort[]? ResourceLimitDescriptors;
/// <summary>
/// Storage info
/// </summary>
public StorageInfo? StorageInfo { get; set; }
public StorageInfo? StorageInfo;
/// <summary>
/// Service access control
/// </summary>
public ulong[]? ServiceAccessControl { get; set; }
/// <remarks>32 entries</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public ulong[]? ServiceAccessControl;
/// <summary>
/// Extended service access control, support for this was implemented with 9.3.0-X.
/// </summary>
public ulong[]? ExtendedServiceAccessControl { get; set; }
/// <remarks>2 entries</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public ulong[]? ExtendedServiceAccessControl;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved { get; set; }
/// <remarks>0x0F bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0F)]
public byte[]? Reserved;
/// <summary>
/// Resource limit category. (0 = APPLICATION, 1 = SYS_APPLET, 2 = LIB_APPLET, 3 = OTHER (sysmodules running under the BASE memregion))
/// </summary>
public ResourceLimitCategory ResourceLimitCategory { get; set; }
[MarshalAs(UnmanagedType.U1)]
public ResourceLimitCategory ResourceLimitCategory;
}
}

View File

@@ -1,17 +1,22 @@
namespace SabreTools.Models.N3DS
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCCH/Extended_Header#ARM9_Access_Control"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ARM9AccessControl
{
/// <summary>
/// Descriptors
/// </summary>
public byte[]? Descriptors { get; set; }
/// <remarks>15 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
public byte[]? Descriptors;
/// <summary>
/// ARM9 Descriptor Version. Originally this value had to be ≥ 2.
/// Starting with 9.3.0-X this value has to be either value 2 or value 3.
/// </summary>
public byte DescriptorVersion { get; set; }
public byte DescriptorVersion;
}
}

View File

@@ -1,21 +1,24 @@
namespace SabreTools.Models.N3DS
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCCH/Extended_Header#Access_Control_Info"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class AccessControlInfo
{
/// <summary>
/// ARM11 local system capabilities
/// </summary>
public ARM11LocalSystemCapabilities? ARM11LocalSystemCapabilities { get; set; }
public ARM11LocalSystemCapabilities? ARM11LocalSystemCapabilities;
/// <summary>
/// ARM11 kernel capabilities
/// </summary>
public ARM11KernelCapabilities? ARM11KernelCapabilities { get; set; }
public ARM11KernelCapabilities? ARM11KernelCapabilities;
/// <summary>
/// ARM9 access control
/// </summary>
public ARM9AccessControl? ARM9AccessControl { get; set; }
public ARM9AccessControl? ARM9AccessControl;
}
}

View File

@@ -1,51 +1,56 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/CIA#CIA_Header"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CIAHeader
{
/// <summary>
/// Archive header size, usually 0x2020 bytes
/// </summary>
public uint HeaderSize { get; set; }
public uint HeaderSize;
/// <summary>
/// Type
/// </summary>
public ushort Type { get; set; }
public ushort Type;
/// <summary>
/// Version
/// </summary>
public ushort Version { get; set; }
public ushort Version;
/// <summary>
/// Certificate chain size
/// </summary>
public uint CertificateChainSize { get; set; }
public uint CertificateChainSize;
/// <summary>
/// Ticket size
/// </summary>
public uint TicketSize { get; set; }
public uint TicketSize;
/// <summary>
/// TMD file size
/// </summary>
public uint TMDFileSize { get; set; }
public uint TMDFileSize;
/// <summary>
/// Meta size (0 if no Meta data is present)
/// </summary>
public uint MetaSize { get; set; }
public uint MetaSize;
/// <summary>
/// Content size
/// </summary>
public ulong ContentSize { get; set; }
public ulong ContentSize;
/// <summary>
/// Content Index
/// </summary>
public byte[]? ContentIndex { get; set; }
/// <remarks>0x2000 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x2000)]
public byte[]? ContentIndex;
}
}

View File

@@ -1,61 +1,74 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCSD#Card_Info_Header"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CardInfoHeader
{
/// <summary>
/// CARD2: Writable Address In Media Units (For 'On-Chip' Savedata). CARD1: Always 0xFFFFFFFF.
/// </summary>
public uint WritableAddressMediaUnits { get; set; }
public uint WritableAddressMediaUnits;
/// <summary>
/// Card Info Bitmask
/// </summary>
public uint CardInfoBitmask { get; set; }
public uint CardInfoBitmask;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved1 { get; set; }
/// <remarks>0xF8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xF8)]
public byte[]? Reserved1;
/// <summary>
/// Filled size of cartridge
/// </summary>
public uint FilledSize { get; set; }
public uint FilledSize;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved2 { get; set; }
/// <remarks>0x0C bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)]
public byte[]? Reserved2;
/// <summary>
/// Title version
/// </summary>
public ushort TitleVersion { get; set; }
public ushort TitleVersion;
/// <summary>
/// Card revision
/// </summary>
public ushort CardRevision { get; set; }
public ushort CardRevision;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved3 { get; set; }
/// <remarks>0x0C bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)]
public byte[]? Reserved3;
/// <summary>
/// Title ID of CVer in included update partition
/// </summary>
public byte[]? CVerTitleID { get; set; }
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? CVerTitleID;
/// <summary>
/// Version number of CVer in included update partition
/// </summary>
public ushort CVerVersionNumber { get; set; }
public ushort CVerVersionNumber;
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved4 { get; set; }
/// <remarks>0xCD6 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xCD6)]
public byte[]? Reserved4;
}
}

View File

@@ -1,21 +1,24 @@
namespace SabreTools.Models.N3DS
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCCH/Extended_Header#Code_Set_Info"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CodeSetInfo
{
/// <summary>
/// Address
/// </summary>
public uint Address { get; set; }
public uint Address;
/// <summary>
/// Physical region size (in page-multiples)
/// </summary>
public uint PhysicalRegionSizeInPages { get; set; }
public uint PhysicalRegionSizeInPages;
/// <summary>
/// Size (in bytes)
/// </summary>
public uint SizeInBytes { get; set; }
public uint SizeInBytes;
}
}

View File

@@ -1,3 +1,5 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <summary>
@@ -5,12 +7,13 @@ namespace SabreTools.Models.N3DS
/// (Determined by "Content Count" in the TMD Header).
/// </summary>
/// <see href="https://www.3dbrew.org/wiki/Title_metadata#Content_chunk_records"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ContentChunkRecord
{
/// <summary>
/// Content id
/// </summary>
public uint ContentId { get; set; }
public uint ContentId;
/// <summary>
/// Content index
@@ -18,21 +21,23 @@ namespace SabreTools.Models.N3DS
/// <remarks>
/// This does not apply to DLC.
/// </remarks>
public ContentIndex ContentIndex { get; set; }
public ContentIndex ContentIndex;
/// <summary>
/// Content type
/// </summary>
public TMDContentType ContentType { get; set; }
public TMDContentType ContentType;
/// <summary>
/// Content size
/// </summary>
public ulong ContentSize { get; set; }
public ulong ContentSize;
/// <summary>
/// SHA-256 hash
/// </summary>
public byte[]? SHA256Hash { get; set; }
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? SHA256Hash;
}
}

View File

@@ -1,24 +1,29 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <summary>
/// There are 64 of these records, usually only the first is used.
/// </summary>
/// <see href="https://www.3dbrew.org/wiki/Title_metadata#Content_Info_Records"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ContentInfoRecord
{
/// <summary>
/// Content index offset
/// </summary>
public ushort ContentIndexOffset { get; set; }
public ushort ContentIndexOffset;
/// <summary>
/// Content command count [k]
/// </summary>
public ushort ContentCommandCount { get; set; }
public ushort ContentCommandCount;
/// <summary>
/// SHA-256 hash of the next k content records that have not been hashed yet
/// </summary>
public byte[]? UnhashedContentRecordsSHA256Hash { get; set; }
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? UnhashedContentRecordsSHA256Hash;
}
}

View File

@@ -1,31 +1,40 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCSD#Development_Card_Info_Header_Extension"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DevelopmentCardInfoHeader
{
/// <summary>
/// InitialData
/// </summary>
public InitialData? InitialData { get; set; }
public InitialData? InitialData;
/// <summary>
/// CardDeviceReserved1
/// </summary>
public byte[]? CardDeviceReserved1 { get; set; }
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? CardDeviceReserved1;
/// <summary>
/// TitleKey
/// </summary>
public byte[]? TitleKey { get; set; }
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? TitleKey;
/// <summary>
/// CardDeviceReserved2
/// </summary>
public byte[]? CardDeviceReserved2 { get; set; }
/// <remarks>0x1BF0 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1BF0)]
public byte[]? CardDeviceReserved2;
/// <summary>
/// TestData
/// </summary>
public TestData? TestData { get; set; }
public TestData? TestData;
}
}

View File

@@ -1,4 +1,6 @@
namespace SabreTools.Models.N3DS
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <summary>
/// There are a maximum of 10 file headers in the ExeFS format. (This maximum
@@ -8,26 +10,24 @@
/// the currently define size of 0x200 bytes.)
/// </summary>
/// <see href="https://www.3dbrew.org/wiki/ExeFS#File_headers"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class ExeFSFileHeader
{
/// <summary>
/// File name
/// </summary>
public string? FileName { get; set; }
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string? FileName;
/// <summary>
/// File offset
/// </summary>
public uint FileOffset { get; set; }
public uint FileOffset;
/// <summary>
/// File size
/// </summary>
public uint FileSize { get; set; }
/// <summary>
/// SHA256 hash calculated over the entire file contents
/// </summary>
public byte[]? FileHash { get; set; }
public uint FileSize;
}
}

View File

@@ -21,6 +21,7 @@
/// <summary>
/// Reserved
/// </summary>
/// <remarks>0x20 bytes</remarks>
public byte[]? Reserved { get; set; }
/// <summary>

View File

@@ -1,36 +1,49 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.N3DS
{
/// <see href="https://www.3dbrew.org/wiki/NCSD#InitialData"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class InitialData
{
/// <summary>
/// Card seed keyY (first u64 is Media ID (same as first NCCH partitionId))
/// </summary>
public byte[]? CardSeedKeyY { get; set; }
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? CardSeedKeyY;
/// <summary>
/// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED)
/// </summary>
public byte[]? EncryptedCardSeed { get; set; }
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? EncryptedCardSeed;
/// <summary>
/// Card seed AES-MAC
/// </summary>
public byte[]? CardSeedAESMAC { get; set; }
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? CardSeedAESMAC;
/// <summary>
/// Card seed nonce
/// </summary>
public byte[]? CardSeedNonce { get; set; }
/// <remarks>0x0C bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)]
public byte[]? CardSeedNonce;
/// <summary>
/// Reserved3
/// </summary>
public byte[]? Reserved { get; set; }
/// <remarks>0xC4 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC4)]
public byte[]? Reserved;
/// <summary>
/// Copy of first NCCH header (excluding RSA signature)
/// </summary>
public NCCHHeader? BackupHeader { get; set; }
public NCCHHeader? BackupHeader;
}
}

Some files were not shown because too many files have changed in this diff Show More