Allow byte arrays to be non-null in most models

This commit is contained in:
Matt Nadareski
2025-10-30 20:44:16 -04:00
parent c1f5ebcae1
commit eae75c5943
172 changed files with 593 additions and 579 deletions

View File

@@ -159,8 +159,7 @@ namespace InfoPrint.Features
using Stream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
// Read the first 8 bytes
byte[]? magic = stream.ReadBytes(8);
stream.SeekIfPossible(0, SeekOrigin.Begin);
byte[] magic = stream.PeekBytes(8);
// Get the file type
string extension = Path.GetExtension(file).TrimStart('.');

View File

@@ -898,9 +898,8 @@ namespace SabreTools.Data.Extensions
messageResourceEntry.Flags = entry.Data.ReadUInt16LittleEndian(ref offset);
Encoding textEncoding = messageResourceEntry.Flags == 0x0001 ? Encoding.Unicode : Encoding.ASCII;
byte[]? textArray = entry.Data.ReadBytes(ref offset, messageResourceEntry.Length - 4);
if (textArray != null)
messageResourceEntry.Text = textEncoding.GetString(textArray);
byte[] textArray = entry.Data.ReadBytes(ref offset, messageResourceEntry.Length - 4);
messageResourceEntry.Text = textEncoding.GetString(textArray);
messageResourceEntries[j] = messageResourceEntry;
}
@@ -1007,7 +1006,7 @@ namespace SabreTools.Data.Extensions
// Create the output table
var stringTable = new Dictionary<int, string?>();
// Loop through and add
// Loop through and add
while (offset < entry.Data.Length)
{
string? stringValue = entry.Data.ReadPrefixedUnicodeString(ref offset);

View File

@@ -20,6 +20,6 @@ namespace SabreTools.Data.Models.AACS
/// case of a non-zero Range value).
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? DriveID;
public byte[] DriveID = new byte[6];
}
}
}

View File

@@ -18,6 +18,7 @@ namespace SabreTools.Data.Models.AACS
/// determines that the signature does not verify or is omitted, it
/// must refuse to use the Media Key.
/// </summary>
public byte[]? SignatureData { get; set; }
/// <remarks><see cref="RecordLength"/>-4 bytes</remarks>
public byte[] SignatureData { get; set; }
}
}
}

View File

@@ -8,6 +8,6 @@ namespace SabreTools.Data.Models.AACS
/// <summary>
/// Unparsed data comprising the record after the header
/// </summary>
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
}
}
}

View File

@@ -20,6 +20,6 @@ namespace SabreTools.Data.Models.AACS
/// Range value).
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? HostID;
public byte[] HostID = new byte[6];
}
}
}

View File

@@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.AACS
/// where 0xXXXXXXXXXXXXXXXX is an arbitrary 8-byte value, and Km is
/// the correct final Media Key value.
/// </summary>
public byte[]? CiphertextValue { get; set; }
public byte[] CiphertextValue { get; set; } = new byte[0x10];
}
}
}

View File

@@ -15,7 +15,7 @@ namespace SabreTools.Data.Models.BDPlus
/// Unknown data
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[]? Unknown1 = new byte[5];
public byte[] Unknown1 = new byte[5];
/// <summary>
/// Version year
@@ -43,8 +43,8 @@ namespace SabreTools.Data.Models.BDPlus
public uint Length;
/// <summary>
/// Length bytes of data
/// <see cref="Length"> bytes of data
/// </summary>
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
}
}
}

View File

@@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.BSP
{
/// <summary>
/// The face lump contains the surfaces of the scene.
///
///
/// The first number of this data structure is an index into
/// the planes lump giving a plane which is parallel to this
/// face (meaning they share the same normal). The second
@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
/// an offset in byes giving the beginning of the binary lightmap
/// data of this face in the lighting lump.
/// </summary>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BspFace
{
@@ -55,7 +55,7 @@ namespace SabreTools.Data.Models.BSP
/// Specify lighting styles
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? LightingStyles = new byte[4];
public byte[] LightingStyles = new byte[4];
/// <summary>
/// Offsets into the raw lightmap data; if less than zero,
@@ -63,4 +63,4 @@ namespace SabreTools.Data.Models.BSP
/// </summary>
public int LightmapOffset;
}
}
}

View File

@@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.BSP
{
/// <summary>
/// The leaves lump contains the leaves of the BSP tree.
///
///
/// The first entry of this struct is the type of the content
/// of this leaf. It can be one of the predefined values, found
/// in the compiler source codes, and is litte relevant for the
@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
/// specify the volume of ambient sounds in Quake, but are unused in
/// GoldSrc.
/// </summary>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BspLeaf
{
@@ -62,6 +62,6 @@ namespace SabreTools.Data.Models.BSP
/// Ambient sound levels
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? AmbientLevels = new byte[4];
public byte[] AmbientLevels = new byte[4];
}
}
}

View File

@@ -8,12 +8,12 @@ namespace SabreTools.Data.Models.BSP
/// In this case, the lump data starts with the following header
/// (from public/tier1/lzmaDecoder.h), which is used in place of
/// the standard 13-byte LZMA header.
///
///
/// lzmaSize denotes the size (in bytes) of compressed data, it
/// is equal to the size of a lump minus 17 bytes (lzma header).
/// actualSize denotes the size of decompressed data. properties[5]
/// field are used solely for LZMA decoding.
///
///
/// There are two special cases for compression: LUMP_PAKFILE is never
/// compressed as a lump (the contents of the zip are compressed instead)
/// and each of the game lumps in LUMP_GAME_LUMP are compressed individually.
@@ -35,6 +35,6 @@ namespace SabreTools.Data.Models.BSP
public uint LzmaSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[]? Properties = new byte[5];
public byte[] Properties = new byte[5];
}
}
}

View File

@@ -13,31 +13,31 @@ namespace SabreTools.Data.Models.BSP
/// These files are integrated into the game engine's file system
/// and will be loaded preferentially before externally located
/// files are used.
///
///
/// The format of the Pakfile lump is identical to that used by the
/// Zip compression utility when no compression is specified (i.e.,
/// the individual files are stored in uncompressed format). In some
/// branches, such as , LZMA compression can be used as well. If the
/// Pakfile lump is extracted and written to a file, it can therefore
/// be opened with WinZip and similar programs.
///
///
/// The header public/zip_uncompressed.h defines the structures
/// present in the Pakfile lump. The last element in the lump is a
/// ZIP_EndOfCentralDirRecord structure. This points to an array of
/// ZIP_FileHeader structures immediately preceeding it, one for each
/// file present in the Pak. Each of these headers then point to
/// ZIP_LocalFileHeader structures that are followed by that file's
/// data.
///
/// data.
///
/// The Pakfile lump is usually the last element of the bsp file.
/// </summary>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
public sealed class PakfileLump
{
/// <summary>
/// Pakfile data
/// </summary>
/// TODO: Split and/or decompress data?
public byte[]? Data;
public byte[] Data;
}
}
}

View File

@@ -30,13 +30,13 @@ namespace SabreTools.Data.Models.BSP
public int SolidCount;
/// <summary>
/// Collision data of length <see cref="SolidCount"/>
/// Collision data of length <see cref="SolidCount"/>
/// </summary>
public PhysSolid[]? Solids;
/// <summary>
/// Key data of size <see cref="KeydataSize"/>
/// Key data of size <see cref="KeydataSize"/>
/// </summary>
public byte[]? TextData;
public byte[] TextData;
}
}
}

View File

@@ -18,8 +18,8 @@ namespace SabreTools.Data.Models.BSP
public int Size;
/// <summary>
/// Collision data of length <see cref="Size"/>
/// Collision data of length <see cref="Size"/>
/// </summary>
public byte[]? CollisionData;
public byte[] CollisionData;
}
}
}

View File

@@ -10,7 +10,7 @@ namespace SabreTools.Data.Models.BSP
/// the faces of brushes created in Hammer. Faces are always flat,
/// convex polygons, though they can contain edges that are co-linear.
/// </summary>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class VbspFace
{
@@ -58,7 +58,7 @@ namespace SabreTools.Data.Models.BSP
/// Switchable lighting info
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? Styles = new byte[4];
public byte[] Styles = new byte[4];
/// <summary>
/// Offset into lightmap lump
@@ -102,4 +102,4 @@ namespace SabreTools.Data.Models.BSP
/// </summary>
public uint SmoothingGroups;
}
}
}

View File

@@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.BSP
/// </summary>
/// <remarks>Default to 0, 0, 0, 0</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? FourCC = new byte[4];
public byte[] FourCC = new byte[4];
}
}

View File

@@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.BZip2
/// from the footer.
/// </summary>
/// <remarks>This may not be byte-aligned</remarks>
public byte[]? Magic { get; set; }
public byte[] Magic { get; set; } = new byte[6];
/// <summary>
/// The CRC-32 checksum of the uncompressed data contained

View File

@@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.BZip2
/// from the footer.
/// </summary>
/// <remarks>This may not be byte-aligned</remarks>
public byte[]? Magic { get; set; }
public byte[] Magic { get; set; } = new byte[6];
/// <summary>
/// Contains a custom checksum computed using each of

View File

@@ -40,10 +40,10 @@ namespace SabreTools.Data.Models.CFB
/// This field MUST be set to 0x0009, or 0x000c, depending on the Major
/// Version field. This field specifies the sector size of the compound file
/// as a power of 2.
///
///
/// If Major Version is 3, the Sector Shift MUST be 0x0009, specifying a
/// sector size of 512 bytes.
///
///
/// If Major Version is 4, the Sector Shift MUST be 0x000C, specifying a
/// sector size of 4096 bytes.
/// </summary>
@@ -61,12 +61,12 @@ namespace SabreTools.Data.Models.CFB
/// </summary>
/// <remarks>6 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? Reserved;
public byte[] Reserved = new byte[6];
/// <summary>
/// This integer field contains the count of the number of directory sectors
/// in the compound file.
///
///
/// If Major Version is 3, the Number of Directory Sectors MUST be zero. This
/// field is not supported for version 3 compound files.
/// </summary>
@@ -130,4 +130,4 @@ namespace SabreTools.Data.Models.CFB
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 109)]
public SectorNumber[]? DIFAT;
}
}
}

View File

@@ -36,7 +36,7 @@ namespace SabreTools.Data.Models.CFB
/// <summary>
/// 4 bytes of reserved data
/// </summary>
public byte[]? Reserved { get; set; }
public byte[] Reserved { get; set; } = new byte[4];
#endregion
@@ -50,7 +50,7 @@ namespace SabreTools.Data.Models.CFB
/// <summary>
/// 16 bytes of unknown data
/// </summary>
public byte[]? Unknown { get; set; }
public byte[] Unknown { get; set; } = new byte[16];
#endregion
@@ -79,4 +79,4 @@ namespace SabreTools.Data.Models.CFB
#endregion
}
}
}

View File

@@ -2,7 +2,7 @@
namespace SabreTools.Data.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public class HeaderV2 : Header
{
@@ -47,13 +47,13 @@ namespace SabreTools.Data.Models.CHD
/// MD5 checksum of raw data
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? MD5 = new byte[16];
public byte[] MD5 = new byte[16];
/// <summary>
/// MD5 checksum of parent file
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? ParentMD5 = new byte[16];
public byte[] ParentMD5 = new byte[16];
/// <summary>
/// Number of bytes per sector

View File

@@ -2,7 +2,7 @@
namespace SabreTools.Data.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public class HeaderV3 : Header
{
@@ -37,13 +37,13 @@ namespace SabreTools.Data.Models.CHD
/// MD5 checksum of raw data
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? MD5 = new byte[16];
public byte[] MD5 = new byte[16];
/// <summary>
/// MD5 checksum of parent file
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? ParentMD5 = new byte[16];
public byte[] ParentMD5 = new byte[16];
/// <summary>
/// Number of bytes per hunk
@@ -54,12 +54,12 @@ namespace SabreTools.Data.Models.CHD
/// SHA1 checksum of raw data
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? SHA1 = new byte[20];
public byte[] SHA1 = new byte[20];
/// <summary>
/// SHA1 checksum of parent file
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ParentSHA1 = new byte[20];
public byte[] ParentSHA1 = new byte[20];
}
}

View File

@@ -2,7 +2,7 @@
namespace SabreTools.Data.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public class HeaderV4 : Header
{
@@ -42,18 +42,18 @@ namespace SabreTools.Data.Models.CHD
/// Combined raw+meta SHA1
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? SHA1 = new byte[20];
public byte[] SHA1 = new byte[20];
/// <summary>
/// Combined raw+meta SHA1 of parent
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ParentSHA1 = new byte[20];
public byte[] ParentSHA1 = new byte[20];
/// <summary>
/// Raw data SHA1
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? RawSHA1 = new byte[20];
public byte[] RawSHA1 = new byte[20];
}
}

View File

@@ -2,7 +2,7 @@
namespace SabreTools.Data.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public class HeaderV5 : Header
{
@@ -40,16 +40,16 @@ namespace SabreTools.Data.Models.CHD
/// <summary>
/// Raw data SHA1
/// </summary>
public byte[]? RawSHA1 { get; set; }
public byte[] RawSHA1 { get; set; } = new byte[20];
/// <summary>
/// Combined raw+meta SHA1
/// </summary>
public byte[]? SHA1 { get; set; }
public byte[] SHA1 { get; set; } = new byte[20];
/// <summary>
/// Combined raw+meta SHA1 of parent
/// </summary>
public byte[]? ParentSHA1 { get; set; }
public byte[] ParentSHA1 { get; set; } = new byte[20];
}
}

View File

@@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
namespace SabreTools.Data.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.cpp"/>
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.cpp"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class MetadataHash
{
@@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.CHD
/// Hash data
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? SHA1;
public byte[] SHA1 = new byte[20];
}
}

View File

@@ -7,12 +7,12 @@
/// Instead, the location of the section table is determined by calculating the
/// location of the first byte after the headers. Make sure to use the size of
/// the optional header as specified in the file header.
///
///
/// The number of entries in the section table is given by the NumberOfSections
/// field in the file header. Entries in the section table are numbered starting
/// from one (1). The code and data memory section entries are in the order chosen
/// by the linker.
///
///
/// In an image file, the VAs for sections must be assigned by the linker so that
/// they are in ascending order and adjacent, and they must be a multiple of the
/// SectionAlignment value in the optional header.
@@ -27,10 +27,10 @@
/// decimal number that is an offset into the string table. Executable images
/// do not use a string table and do not support section names longer than 8
/// characters. Long names in object files are truncated if they are emitted
/// to an executable file.
/// to an executable file.
/// </summary>
/// <remarks>8 bytes</remarks>
public byte[]? Name { get; set; }
public byte[] Name { get; set; } = new byte[8];
/// <summary>
/// The total size of the section when loaded into memory. If this value is
@@ -77,7 +77,7 @@
/// <summary>
/// The file pointer to the beginning of line-number entries for the section. This
/// is set to zero if there are no COFF line numbers. This value should be zero for
/// an image because COFF debugging information is deprecated.
/// an image because COFF debugging information is deprecated.
/// </summary>
public uint PointerToLinenumbers { get; set; }

View File

@@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
{
/// <summary>
/// Auxiliary Format 6: CLR Token Definition (Object Only)
///
///
/// This auxiliary symbol generally follows the IMAGE_SYM_CLASS_CLR_TOKEN. It is
/// used to associate a token with the COFF symbol table's namespace.
/// </summary>
@@ -28,6 +28,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// Reserved, must be zero.
/// </summary>
/// <remarks>12 bytes</remarks>
public byte[]? Reserved2 { get; set; }
public byte[] Reserved2 { get; set; } = new byte[12];
}
}
}

View File

@@ -2,13 +2,13 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
{
/// <summary>
/// Auxiliary Format 2: .bf and .ef Symbols
///
///
/// For each function definition in the symbol table, three items describe
/// the beginning, ending, and number of lines. Each of these symbols has
/// storage class FUNCTION (101):
///
///
/// A symbol record named .bf (begin function). The Value field is unused.
///
///
/// A symbol record named .lf (lines in function). The Value field gives the
/// number of lines in the function.
///
@@ -36,7 +36,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// Unused
/// </summary>
/// <remarks>6 bytes</remarks>
public byte[]? Unused2 { get; set; }
public byte[] Unused2 { get; set; } = new byte[6];
/// <summary>
/// The symbol-table index of the next .bf symbol record. If the function is the
@@ -50,4 +50,4 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// </summary>
public ushort Unused3 { get; set; }
}
}
}

View File

@@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
{
/// <summary>
/// Auxiliary Format 4: Files
///
///
/// This format follows a symbol-table record with storage class FILE (103).
/// The symbol name itself should be .file, and the auxiliary record that
/// follows it gives the name of a source-code file.
@@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// with nulls if it is less than the maximum length.
/// </summary>
/// <remarks>18 bytes</remarks>
public byte[]? FileName { get; set; }
public byte[] FileName { get; set; } = new byte[18];
}
}
}

View File

@@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
{
/// <summary>
/// Auxiliary Format 5: Section Definitions
///
///
/// This format follows a symbol-table record that defines a section. Such a
/// record has a symbol name that is the name of a section (such as .text or
/// .drectve) and has storage class STATIC (3). The auxiliary record provides
@@ -49,6 +49,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// Unused
/// </summary>
/// <remarks>3 bytes</remarks>
public byte[]? Unused { get; set; }
public byte[] Unused { get; set; } = new byte[3];
}
}
}

View File

@@ -12,7 +12,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// An array of 8 bytes. This array is padded with nulls on the right if
/// the name is less than 8 bytes long.
/// </summary>
public byte[]? ShortName { get; set; } = new byte[8];
public byte[] ShortName { get; set; } = new byte[8];
/// <summary>
/// A field that is set to all zeros if the name is longer than 8 bytes.
@@ -55,4 +55,4 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// </summary>
public byte NumberOfAuxSymbols { get; set; }
}
}
}

View File

@@ -2,13 +2,13 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
{
/// <summary>
/// Auxiliary Format 3: Weak Externals
///
///
/// "Weak externals" are a mechanism for object files that allows flexibility at
/// link time. A module can contain an unresolved external symbol (sym1), but it
/// can also include an auxiliary record that indicates that if sym1 is not
/// present at link time, another external symbol (sym2) is used to resolve
/// references instead.
///
///
/// If a definition of sym1 is linked, then an external reference to the symbol
/// is resolved normally. If a definition of sym1 is not linked, then all references
/// to the weak external for sym1 refer to sym2 instead. The external symbol, sym2,
@@ -23,7 +23,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
public class WeakExternal : BaseEntry
{
/// <summary>
/// The symbol-table index of sym2, the symbol to be linked if sym1 is not found.
/// The symbol-table index of sym2, the symbol to be linked if sym1 is not found.
/// </summary>
public uint TagIndex { get; set; }
@@ -40,6 +40,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries
/// Unused
/// </summary>
/// <remarks>10 bytes</remarks>
public byte[]? Unused { get; set; }
public byte[] Unused { get; set; } = new byte[10];
}
}
}

View File

@@ -18,6 +18,6 @@ namespace SabreTools.Data.Models.DVD
/// Copy of VTS attributes (offset 100 and on from the VTS IFO
/// file, usually 0x300 bytes long)
/// </summary>
public byte[]? AttributesCopy { get; set; }
public byte[] AttributesCopy { get; set; }
}
}
}

View File

@@ -60,7 +60,7 @@ namespace SabreTools.Data.Models.DVD
/// Provider ID
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[]? ProviderID;
public byte[] ProviderID = new byte[32];
/// <summary>
/// VMG POS
@@ -137,7 +137,7 @@ namespace SabreTools.Data.Models.DVD
/// Unknown
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? Unknown;
public byte[] Unknown = new byte[16];
/// <summary>
/// Number of subpicture streams in VMGM_VOBS (0 or 1)
@@ -148,12 +148,12 @@ namespace SabreTools.Data.Models.DVD
/// Subpicture attributes of VMGM_VOBS
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? SubpictureAttributes;
public byte[] SubpictureAttributes = new byte[6];
/// <summary>
/// Reserved
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 164)]
public byte[]? Reserved;
public byte[] Reserved = new byte[164];
}
}
}

View File

@@ -60,7 +60,7 @@ namespace SabreTools.Data.Models.DVD
/// Provider ID
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[]? ProviderID;
public byte[] ProviderID = new byte[32];
/// <summary>
/// VMG POS
@@ -147,7 +147,7 @@ namespace SabreTools.Data.Models.DVD
/// Unknown
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? Unknown;
public byte[] Unknown = new byte[16];
/// <summary>
/// Number of subpicture streams in VTSM_VOBS (0 or 1)
@@ -158,12 +158,12 @@ namespace SabreTools.Data.Models.DVD
/// Subpicture attributes of VTSM_VOBS
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? SubpictureAttributes;
public byte[] SubpictureAttributes = new byte[6];
/// <summary>
/// Reserved
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 164)]
public byte[]? Reserved;
public byte[] Reserved = new byte[164];
}
}
}

View File

@@ -1,6 +1,6 @@
namespace SabreTools.Data.Models.GZIP
{
/// <see href="https://www.ietf.org/rfc/rfc1952.txt"/>
/// <see href="https://www.ietf.org/rfc/rfc1952.txt"/>
public sealed class ExtraFieldData
{
/// <summary>
@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.GZIP
/// </summary>
public ushort Length { get; set; }
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
}
}
}

View File

@@ -1,13 +1,13 @@
namespace SabreTools.Data.Models.IRD
{
/// <see href="https://psdevwiki.com/ps3/Bluray_disc#IRD_file"/>
/// <see href="https://github.com/SabreTools/MPF/files/13062347/IRD.File.Format.pdf"/>
/// <see href="https://psdevwiki.com/ps3/Bluray_disc#IRD_file"/>
/// <see href="https://github.com/SabreTools/MPF/files/13062347/IRD.File.Format.pdf"/>
public class File
{
/// <summary>
/// "3IRD"
/// </summary>
public byte[]? Magic { get; set; }
public byte[] Magic { get; set; } = new byte[4];
/// <summary>
/// Version
@@ -58,7 +58,7 @@ namespace SabreTools.Data.Models.IRD
/// <summary>
/// Gzip-compressed header data
/// </summary>
public byte[]? Header { get; set; }
public byte[] Header { get; set; }
/// <summary>
/// Length of the gzip-compressed footer data
@@ -68,7 +68,7 @@ namespace SabreTools.Data.Models.IRD
/// <summary>
/// Gzip-compressed footer data
/// </summary>
public byte[]? Footer { get; set; }
public byte[] Footer { get; set; }
/// <summary>
/// Number of complete regions in the image
@@ -112,19 +112,19 @@ namespace SabreTools.Data.Models.IRD
/// D1 key
/// </summary>
/// <remarks>16 bytes</remarks>
public byte[]? Data1Key { get; set; }
public byte[] Data1Key { get; set; } = new byte[16];
/// <summary>
/// D2 key
/// </summary>
/// <remarks>16 bytes</remarks>
public byte[]? Data2Key { get; set; }
public byte[] Data2Key { get; set; } = new byte[16];
/// <summary>
/// Uncompressed PIC data
/// </summary>
/// <remarks>115 bytes, before D1/D2 keys on version 9</remarks>
public byte[]? PIC { get; set; }
public byte[] PIC { get; set; } = new byte[115];
/// <summary>
/// Unique Identifier

View File

@@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: a1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] SystemIdentifier { get; set; }
public byte[] SystemIdentifier { get; set; } = new byte[32];
/// <summary>
/// 32-byte name of the volume
@@ -26,12 +26,12 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: d1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] VolumeIdentifier { get; set; }
public byte[] VolumeIdentifier { get; set; } = new byte[32];
/// <summary>
/// 8 unused bytes at offset 72, should be all 0x00
/// </summary>
public byte[] Unused8Bytes { get; set; }
public byte[] Unused8Bytes { get; set; } = new byte[8];
/// <summary>
/// Number of logical blocks in this volume
@@ -102,7 +102,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: d1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] VolumeSetIdentifier { get; set; }
public byte[] VolumeSetIdentifier { get; set; } = new byte[128];
/// <summary>
/// 128-byte name of the publisher
@@ -112,7 +112,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: a1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] PublisherIdentifier { get; set; }
public byte[] PublisherIdentifier { get; set; } = new byte[128];
/// <summary>
/// 128-byte name of the data preparer
@@ -122,7 +122,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: a1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] DataPreparerIdentifier { get; set; }
public byte[] DataPreparerIdentifier { get; set; } = new byte[128];
/// <summary>
/// 128-byte name of the application
@@ -132,7 +132,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: a1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] ApplicationIdentifier { get; set; }
public byte[] ApplicationIdentifier { get; set; } = new byte[128];
/// <summary>
/// 37-byte filename of the Copyright file
@@ -142,7 +142,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: d1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] CopyrightFileIdentifier { get; set; }
public byte[] CopyrightFileIdentifier { get; set; } = new byte[37];
/// <summary>
/// 37-byte filename of the Abstract file
@@ -152,7 +152,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: d1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] AbstractFileIdentifier { get; set; }
public byte[] AbstractFileIdentifier { get; set; } = new byte[37];
/// <summary>
/// 37-byte filename of the Bibliographic file
@@ -162,7 +162,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Supplementary: d1-characters only, padded to the right with spaces
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
/// </summary>
public byte[] BibliographicFileIdentifier { get; set; }
public byte[] BibliographicFileIdentifier { get; set; } = new byte[37];
/// <summary>
/// PVD-style DateTime format for the Creation date/time of the Volume
@@ -199,11 +199,11 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// 512 bytes for Application Use, contents not defined by ISO9660
/// </summary>
public byte[] ApplicationUse { get; set; }
public byte[] ApplicationUse { get; set; } = new byte[512];
/// <summary>
/// 653 reserved bytes, should be all 0x00
/// </summary>
public byte[] Reserved653Bytes { get; set; }
public byte[] Reserved653Bytes { get; set; } = new byte[653];
}
}

View File

@@ -11,17 +11,17 @@ namespace SabreTools.Data.Models.ISO9660
/// 32-byte name of the intended system that can use this record
/// a-characters only
/// </summary>
public byte[] BootSystemIdentifier { get; set; }
public byte[] BootSystemIdentifier { get; set; } = new byte[32];
/// <summary>
/// 32-byte name of this boot system
/// a-characters only
/// </summary>
public byte[] BootIdentifier { get; set; }
public byte[] BootIdentifier { get; set; } = new byte[32];
/// <summary>
/// 1997 bytes for Boot System Use, contents not defined by ISO9660
/// </summary>
public byte[] BootSystemUse { get; set; }
public byte[] BootSystemUse { get; set; } = new byte[1997];
}
}

View File

@@ -11,37 +11,37 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// 4-byte ASCII digits
/// </summary>
public byte[] Year { get; set; }
public byte[] Year { get; set; } = new byte[4];
/// <summary>
/// 2-byte ASCII digits
/// </summary>
public byte[] Month { get; set; }
public byte[] Month { get; set; } = new byte[2];
/// <summary>
/// 2-byte ASCII digits
/// </summary>
public byte[] Day { get; set; }
public byte[] Day { get; set; } = new byte[2];
/// <summary>
/// 2-byte ASCII digits
/// </summary>
public byte[] Hour { get; set; }
public byte[] Hour { get; set; } = new byte[2];
/// <summary>
/// 2-byte ASCII digits
/// </summary>
public byte[] Minute { get; set; }
public byte[] Minute { get; set; } = new byte[2];
/// <summary>
/// 2-byte ASCII digits
/// </summary>
public byte[] Second { get; set; }
public byte[] Second { get; set; } = new byte[2];
/// <summary>
/// 2-byte ASCII digits
/// </summary>
public byte[] Centisecond { get; set; }
public byte[] Centisecond { get; set; } = new byte[2];
/// <summary>
/// Time zone offset (from GMT = UTC 0), represented by a single byte

View File

@@ -83,6 +83,6 @@ namespace SabreTools.Data.Models.ISO9660
/// Note: This is where SUSP contents are located, including Rock Ridge extension
/// Optional field
/// </summary>
public byte[]? SystemUse { get; set; }
public byte[] SystemUse { get; set; }
}
}

View File

@@ -69,12 +69,12 @@ namespace SabreTools.Data.Models.ISO9660
/// 32-byte name of the intended system
/// Primary: a-characters or a1-characters only, padded to the right with spaces
/// </summary>
public byte[] SystemIdentifier { get; set; }
public byte[] SystemIdentifier { get; set; } = new byte[32];
/// <summary>
/// 64-bytes for system use
/// </summary>
public byte[] SystemUse { get; set; }
public byte[] SystemUse { get; set; } = new byte[64];
/// <summary>
/// Extended Attribyte Record Version
@@ -90,7 +90,7 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// 64-bytes reserved (0x00)
/// </summary>
public byte[] Reserved64Bytes { get; set; }
public byte[] Reserved64Bytes { get; set; } = new byte[64];
/// <summary>
/// Length of the Application use field
@@ -106,6 +106,6 @@ namespace SabreTools.Data.Models.ISO9660
/// EscapeSequencesLength-bytes list of escape sequences to interpret this file
/// Optional, and if present, padded to the right with 0x00
/// </summary>
public byte[]? EscapeSequences { get; set; }
public byte[] EscapeSequences { get; set; }
}
}

View File

@@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// Byte array of data within the file extent (after the Extended Attribyte Record)
/// </summary>
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
}
}

View File

@@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// 2041 bytes
/// </summary>
public byte[] Data { get; set; }
public byte[] Data { get; set; } = new byte[2041];
}
}

View File

@@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.ISO9660
/// 32 unused bytes at offset 88, should be all 0x00
/// Note: These is used for EscapeSequences on SupplementaryVolumeDescriptor
/// </summary>
public byte[] Unused32Bytes { get; set; }
public byte[] Unused32Bytes { get; set; } = new byte[32];
}
}

View File

@@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.ISO9660
/// If all bytes are set to 0x00, then a1-characters are identical to a-characters
/// Note: Joliet Extension implies Constants.JolietEscapeSequences
/// </summary>
public byte[] EscapeSequences { get; set; }
public byte[] EscapeSequences { get; set; } = new byte[32];
}
}

View File

@@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.ISO9660
/// Set to Constants.StandardIdentifier ("CD001")
/// On non-ISO9660 CD-i discs, set to Constants.StandardIdentifierCDI ("CD-I ")
/// </summary>
public byte[] Identifier { get; set; }
public byte[] Identifier { get; set; } = new byte[5];
/// <summary>
/// The Volume Descriptor version number

View File

@@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// 2041 reserved bytes, should be 0x00
/// </summary>
public byte[] Reserved2041Bytes { get; set; }
public byte[] Reserved2041Bytes { get; set; } = new byte[2041];
}
}

View File

@@ -18,13 +18,13 @@ namespace SabreTools.Data.Models.ISO9660
/// 32-byte name of the intended system that can use this record
/// a-characters only
/// </summary>
public byte[] SystemIdentifier { get; set; }
public byte[] SystemIdentifier { get; set; } = new byte[32];
/// <summary>
/// 32-byte name of this volume partition
/// d-characters only
/// </summary>
public byte[] VolumePartitionIdentifier { get; set; }
public byte[] VolumePartitionIdentifier { get; set; } = new byte[32];
/// <summary>
/// Logical block number of the first logical block allocated to this volume partition
@@ -39,6 +39,6 @@ namespace SabreTools.Data.Models.ISO9660
/// <summary>
/// 1960 bytes for System Use, contents not defined by ISO9660
/// </summary>
public byte[] SystemUse { get; set; }
public byte[] SystemUse { get; set; } = new byte[1960];
}
}

View File

@@ -94,13 +94,13 @@ namespace SabreTools.Data.Models.InstallShieldCabinet
/// Reserved
/// </summary>
/// <remarks>28 bytes, see CompAttrs</remarks>
public byte[]? Reserved2 { get; set; }
public byte[] Reserved2 { get; set; } = new byte[28];
/// <summary>
/// Reserved
/// </summary>
/// <remarks>2 bytes (<= v5), 1 byte (> v5)</remarks>
public byte[]? Reserved3 { get; set; }
public byte[] Reserved3 { get; set; }
/// <summary>
/// Number of depends(?)
@@ -172,4 +172,4 @@ namespace SabreTools.Data.Models.InstallShieldCabinet
/// </summary>
public uint OnUninstalledOffset { get; set; }
}
}
}

View File

@@ -41,7 +41,7 @@ namespace SabreTools.Data.Models.InstallShieldCabinet
/// <summary>
/// MD5 of the entry data
/// </summary>
public byte[]? MD5 { get; set; }
public byte[] MD5 { get; set; } = new byte[0x10];
/// <summary>
/// Volume number
@@ -63,4 +63,4 @@ namespace SabreTools.Data.Models.InstallShieldCabinet
/// </summary>
public LinkFlags LinkFlags { get; set; }
}
}
}

View File

@@ -13,7 +13,7 @@ namespace SabreTools.Data.Models.LZ
/// "KWAJ" signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public byte[]? Magic;
public byte[] Magic = new byte[8];
/// <summary>
/// Compression method
@@ -32,4 +32,4 @@ namespace SabreTools.Data.Models.LZ
[MarshalAs(UnmanagedType.U2)]
public KWAJHeaderFlags HeaderFlags;
}
}
}

View File

@@ -17,7 +17,7 @@ namespace SabreTools.Data.Models.LZ
public ushort? UnknownPurpose { get; set; }
/// <summary>
/// Length of <see cref="UnknownData"/>
/// Length of <see cref="UnknownData"/>
/// </summary>
public ushort? UnknownDataLength { get; set; }
@@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.LZ
/// Unknown purpose data whose length is defined
/// by <see cref="UnknownDataLength"/>
/// </summary>
public byte[]? UnknownData { get; set; }
public byte[] UnknownData { get; set; }
/// <summary>
/// Null-terminated string with max length 8: file name
@@ -38,7 +38,7 @@ namespace SabreTools.Data.Models.LZ
public string? FileExtension { get; set; }
/// <summary>
/// Length of <see cref="ArbitraryText"/>
/// Length of <see cref="ArbitraryText"/>
/// </summary>
public ushort? ArbitraryTextLength { get; set; }
@@ -46,6 +46,6 @@ namespace SabreTools.Data.Models.LZ
/// Arbitrary text data whose length is defined
/// by <see cref="ArbitraryTextLength"/>
/// </summary>
public byte[]? ArbitraryText { get; set; }
public byte[] ArbitraryText { get; set; }
}
}
}

View File

@@ -13,11 +13,11 @@ namespace SabreTools.Data.Models.LZ
/// "SZ" signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public byte[]? Magic;
public byte[] Magic = new byte[8];
/// <summary>
/// The integer length of the file when unpacked
/// </summary>
public uint RealLength;
}
}
}

View File

@@ -14,12 +14,12 @@ namespace SabreTools.Data.Models.LZ
/// "SZDD" signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public byte[]? Magic;
public byte[] Magic = new byte[8];
/// <summary>
/// Compression mode
/// </summary>
/// <remarks>Only <see cref="ExpandCompressionType.A"/> is supported</remarks>
/// <remarks>Only <see cref="ExpandCompressionType.A"/> is supported</remarks>
[MarshalAs(UnmanagedType.U1)]
public ExpandCompressionType CompressionType;
@@ -35,4 +35,4 @@ namespace SabreTools.Data.Models.LZ
/// </summary>
public uint RealLength;
}
}
}

View File

@@ -5,7 +5,7 @@
/// the linear EXE format or linker. The only data defined by the linear EXE
/// format relative to the debug information is it's offset in the EXE file and
/// length in bytes as defined in the linear EXE header.
///
///
/// To support multiple debuggers the first word of the debug information is a
/// type field which determines the format of the debug information.
/// </summary>
@@ -30,6 +30,6 @@
/// the responsibility of the linker or debugging tools to follow the convention
/// for the type field that is defined here.
/// </summary>
public byte[]? DebuggerData { get; set; }
public byte[] DebuggerData { get; set; }
}
}

View File

@@ -34,7 +34,7 @@
/// and the <see cref="CFHEADER.DataReservedSize"/> field value is non-zero, this field contains per-datablock application information.
/// This field is defined by the application, and it is used for application-defined purposes.
/// </summary>
public byte[]? ReservedData { get; set; }
public byte[] ReservedData { get; set; }
/// <summary>
/// The compressed data bytes, compressed by using the <see cref="CFFOLDER.CompressionType"/>
@@ -44,6 +44,6 @@
/// uncompressed data bytes. In this case, the <see cref="CompressedSize"/> and <see cref="UncompressedSize"/> field values will be equal unless
/// this CFDATA structure entry crosses a cabinet file boundary.
/// </summary>
public byte[]? CompressedData { get; set; }
public byte[] CompressedData { get; set; }
}
}

View File

@@ -5,17 +5,17 @@
/// this cabinet file, as shown in the following packet diagram.The first CFFOLDER structure entry
/// immediately follows the CFHEADER structure entry. The CFHEADER.cFolders field indicates how
/// many CFFOLDER structure entries are present.
///
///
/// Folders can start in one cabinet, and continue on to one or more succeeding cabinets. When the
/// cabinet file creator detects that a folder has been continued into another cabinet, it will complete
/// that folder as soon as the current file has been completely compressed.Any additional files will be
/// placed in the next folder.Generally, this means that a folder would span at most two cabinets, but it
/// could span more than two cabinets if the file is large enough.
///
///
/// CFFOLDER structure entries actually refer to folder fragments, not necessarily complete folders. A
/// CFFOLDER structure is the beginning of a folder if the iFolder field value in the first file that
/// references the folder does not indicate that the folder is continued from the previous cabinet file.
///
///
/// The typeCompress field can vary from one folder to the next, unless the folder is continued from a
/// previous cabinet file.
/// </summary>
@@ -46,7 +46,7 @@
/// and the cbCFFolder field is non-zero, then this field contains per-folder application information.
/// This field is defined by the application, and is used for application-defined purposes.
/// </summary>
public byte[]? ReservedData { get; set; }
public byte[] ReservedData { get; set; }
/// <summary>
/// Data blocks associated with this folder

View File

@@ -107,7 +107,7 @@
/// cbCFHeader field is non-zero, this field contains per-cabinet-file application information. This field
/// is defined by the application, and is used for application-defined purposes.
/// </summary>
public byte[]? ReservedData { get; set; }
public byte[] ReservedData { get; set; }
/// <summary>
/// If the flags.cfhdrPREV_CABINET field is not set, this

View File

@@ -140,37 +140,37 @@
/// MD5 of the block table before decryption
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? BlockTableMD5 { get; set; }
public byte[] BlockTableMD5 { get; set; } = new byte[0x10];
/// <summary>
/// MD5 of the hash table before decryption
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? HashTableMD5 { get; set; }
public byte[] HashTableMD5 { get; set; } = new byte[0x10];
/// <summary>
/// MD5 of the hi-block table
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? HiBlockTableMD5 { get; set; }
public byte[] HiBlockTableMD5 { get; set; } = new byte[0x10];
/// <summary>
/// MD5 of the BET table before decryption
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? BetTableMD5 { get; set; }
public byte[] BetTableMD5 { get; set; } = new byte[0x10];
/// <summary>
/// MD5 of the HET table before decryption
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? HetTableMD5 { get; set; }
public byte[] HetTableMD5 { get; set; } = new byte[0x10];
/// <summary>
/// MD5 of the MPQ header from signature to (including) HetTableMD5
/// </summary>
/// <remarks>0x10 bytes</remarks>
public byte[]? MpqHeaderMD5 { get; set; }
public byte[] MpqHeaderMD5 { get; set; } = new byte[0x10];
#endregion
}

View File

@@ -76,7 +76,7 @@ namespace SabreTools.Data.Models.MoPaQ
/// HET hash table. Each entry is 8 bits.
/// </summary>
/// <remarks>Size is derived from HashTableSize</remarks>
public byte[]? HashTable { get; set; }
public byte[] HashTable { get; set; }
/// <summary>
/// Array of file indexes. Bit size of each entry is taken from dwTotalIndexSize.

View File

@@ -46,12 +46,12 @@
/// <summary>
/// MD5 of the original (unpached) file
/// </summary>
public byte[]? Md5BeforePatch { get; set; } = new byte[0x10];
public byte[] Md5BeforePatch { get; set; } = new byte[0x10];
/// <summary>
/// MD5 of the patched file
/// </summary>
public byte[]? Md5AfterPatch { get; set; } = new byte[0x10];
public byte[] Md5AfterPatch { get; set; } = new byte[0x10];
#endregion
@@ -108,7 +108,7 @@
/// <summary>
/// File data are simply replaced by the data in the patch.
/// </summary>
public byte[]? PatchDataCopy { get; set; }
public byte[] PatchDataCopy { get; set; }
#endregion
}

View File

@@ -29,7 +29,7 @@ namespace SabreTools.Data.Models.MoPaQ
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? MD5;
public byte[] MD5 = new byte[0x10];
/// <summary>
/// The sector offset table (variable length)

View File

@@ -13,14 +13,14 @@ namespace SabreTools.Data.Models.N3DS
/// Descriptors
/// -------------------
/// Pattern of bits 20-31 Type Fields
/// 0b1110xxxxxxxx Interrupt info
/// 0b1110xxxxxxxx Interrupt info
/// 0b11110xxxxxxx System call mask Bits 24-26: System call mask table index; Bits 0-23: mask
/// 0b1111110xxxxx Kernel release version Bits 8-15: Major version; Bits 0-7: Minor version
/// 0b11111110xxxx Handle table size Bits 0-18: size
/// 0b111111110xxx Kernel flags
/// 0b11111111100x Map address range Describes a memory mapping like the 0b111111111110 descriptor, but an entire range rather than a single page is mapped.Another 0b11111111100x descriptor must follow this one to denote the(exclusive) end of the address range to map.
/// 0b111111111110 Map memory page Bits 0-19: page index to map(virtual address >> 12; the physical address is determined per-page according to Memory layout); Bit 20: Map read-only(otherwise read-write)
///
///
/// ARM11 Kernel Flags
/// -------------------
/// Bit Description
@@ -46,6 +46,6 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? Reserved;
public byte[] Reserved = new byte[0x10];
}
}

View File

@@ -70,7 +70,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x0F bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0F)]
public byte[]? Reserved;
public byte[] Reserved = new byte[0x0F];
/// <summary>
/// Resource limit category. (0 = APPLICATION, 1 = SYS_APPLET, 2 = LIB_APPLET, 3 = OTHER (sysmodules running under the BASE memregion))

View File

@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.N3DS
/// titles to the 3DS. CIA files and titles on Nintendo's CDN contain identical data.
/// As a consequence, valid CIA files can be generated from CDN content. This also
/// means CIA files can contain anything that titles on Nintendo's CDN can contain.
///
///
/// Under normal circumstances CIA files are used where downloading a title is
/// impractical or not possible. Such as distributing a Download Play child, or
/// installing forced Gamecard updates. Those CIA(s) are stored by the titles in
@@ -46,11 +46,11 @@ namespace SabreTools.Data.Models.N3DS
/// Content file data
/// </summary>
/// TODO: Parse the content file data
public byte[]? ContentFileData { get; set; }
public byte[] ContentFileData { get; set; }
/// <summary>
/// Meta file data (Not a necessary component)
/// </summary>
public MetaData? MetaData { get; set; }
}
}
}

View File

@@ -51,6 +51,6 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x2000 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x2000)]
public byte[]? ContentIndex;
public byte[] ContentIndex = new byte[0x2000];
}
}
}

View File

@@ -21,7 +21,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0xF8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xF8)]
public byte[]? Reserved1;
public byte[] Reserved1 = new byte[0xF8];
/// <summary>
/// Filled size of cartridge
@@ -33,7 +33,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x0C bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)]
public byte[]? Reserved2;
public byte[] Reserved2 = new byte[0x0C];
/// <summary>
/// Title version
@@ -50,14 +50,14 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x0C bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)]
public byte[]? Reserved3;
public byte[] Reserved3 = new byte[0x0C];
/// <summary>
/// Title ID of CVer in included update partition
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? CVerTitleID;
public byte[] CVerTitleID = new byte[8];
/// <summary>
/// Version number of CVer in included update partition
@@ -69,7 +69,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0xCD6 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xCD6)]
public byte[]? Reserved4;
public byte[] Reserved4 = new byte[0xCD6];
/// <summary>
/// This data is returned by 16-byte cartridge command 0x82.

View File

@@ -27,12 +27,12 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Signature
/// </summary>
public byte[]? Signature { get; set; }
public byte[] Signature { get; set; }
/// <summary>
/// Padding to align next data to 0x40 bytes
/// </summary>
public byte[]? Padding { get; set; }
public byte[] Padding { get; set; }
/// <summary>
/// Issuer
@@ -60,7 +60,7 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Modulus
/// </summary>
public byte[]? RSAModulus { get; set; }
public byte[] RSAModulus { get; set; }
/// <summary>
/// Public Exponent
@@ -70,7 +70,7 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Padding
/// </summary>
public byte[]? RSAPadding { get; set; }
public byte[] RSAPadding { get; set; }
#endregion
@@ -80,12 +80,12 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Public Key
/// </summary>
public byte[]? ECCPublicKey { get; set; }
public byte[] ECCPublicKey { get; set; }
/// <summary>
/// Padding
/// </summary>
public byte[]? ECCPadding { get; set; }
public byte[] ECCPadding { get; set; }
#endregion
}

View File

@@ -38,6 +38,6 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? SHA256Hash;
public byte[] SHA256Hash = new byte[0x20];
}
}
}

View File

@@ -24,6 +24,6 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? UnhashedContentRecordsSHA256Hash;
public byte[] UnhashedContentRecordsSHA256Hash = new byte[0x20];
}
}
}

View File

@@ -11,21 +11,21 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? CardDeviceReserved1;
public byte[] CardDeviceReserved1 = new byte[0x200];
/// <summary>
/// TitleKey
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? TitleKey;
public byte[] TitleKey = new byte[0x10];
/// <summary>
/// CardDeviceReserved2
/// </summary>
/// <remarks>0x1BF0 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1BF0)]
public byte[]? CardDeviceReserved2;
public byte[] CardDeviceReserved2 = new byte[0x1BF0];
/// <summary>
/// TestData

View File

@@ -2,8 +2,8 @@
{
/// <summary>
/// ExeFS or Executable Filesystem contains information related to the
/// executable program, and is the part of the CXI format.
///
/// executable program, and is the part of the CXI format.
///
/// The ExeFS usually contains one or more of the following files:
/// - .code Contains the code binary, which can be optionally reverse-LZSS compressed via an exheader flag.
/// - logo Contains distribution licensing Binary data.
@@ -22,7 +22,7 @@
/// Reserved
/// </summary>
/// <remarks>0x20 bytes</remarks>
public byte[]? Reserved { get; set; }
public byte[] Reserved { get; set; } = new byte[0x20];
/// <summary>
/// File hashes (10 hashes maximum, 32 bytes each, one for each header)

View File

@@ -11,35 +11,35 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? CardSeedKeyY;
public byte[] CardSeedKeyY = new byte[0x10];
/// <summary>
/// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED)
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? EncryptedCardSeed;
public byte[] EncryptedCardSeed = new byte[0x10];
/// <summary>
/// Card seed AES-MAC
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? CardSeedAESMAC;
public byte[] CardSeedAESMAC = new byte[0x10];
/// <summary>
/// Card seed nonce
/// </summary>
/// <remarks>0x0C bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)]
public byte[]? CardSeedNonce;
public byte[] CardSeedNonce = new byte[0x0C];
/// <summary>
/// Reserved3
/// </summary>
/// <remarks>0xC4 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC4)]
public byte[]? Reserved;
public byte[] Reserved = new byte[0xC4];
/// <summary>
/// Copy of first NCCH header (excluding RSA signature)

View File

@@ -12,14 +12,14 @@ namespace SabreTools.Data.Models.N3DS
/// TODO: Determine numeric format of each entry
/// <remarks>0x180 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x180)]
public byte[]? TitleIDDependencyList;
public byte[] TitleIDDependencyList = new byte[0x180];
/// <summary>
/// Reserved
/// </summary>
/// <remarks>0x180 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x180)]
public byte[]? Reserved1;
public byte[] Reserved1 = new byte[0x180];
/// <summary>
/// Core Version
@@ -31,13 +31,13 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0xFC bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xFC)]
public byte[]? Reserved2;
public byte[] Reserved2 = new byte[0xFC];
/// <summary>
/// Icon Data(.ICN) - Taken from the application's ExeFS
/// </summary>
/// <remarks>0x36C0 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x36C0)]
public byte[]? IconData;
public byte[] IconData = new byte[0x36C0];
}
}
}

View File

@@ -26,14 +26,14 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x100 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)]
public byte[]? AccessDescSignature;
public byte[] AccessDescSignature = new byte[0x100];
/// <summary>
/// NCCH HDR RSA-2048 public key
/// </summary>
/// <remarks>0x100 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)]
public byte[]? NCCHHDRPublicKey;
public byte[] NCCHHDRPublicKey = new byte[0x100];
/// <summary>
/// ACI (for limitation of first ACI)

View File

@@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x100 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)]
public byte[]? RSA2048Signature;
public byte[] RSA2048Signature = new byte[0x100];
/// <summary>
/// Magic ID, always 'NCCH'
@@ -53,21 +53,21 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? ProgramId;
public byte[] ProgramId = new byte[8];
/// <summary>
/// Reserved
/// </summary>
/// <remarks>0x10 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)]
public byte[]? Reserved1;
public byte[] Reserved1 = new byte[0x10];
/// <summary>
/// Logo Region SHA-256 hash. (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11)
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? LogoRegionHash;
public byte[] LogoRegionHash = new byte[0x20];
/// <summary>
/// Product code
@@ -81,7 +81,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? ExtendedHeaderHash;
public byte[] ExtendedHeaderHash = new byte[0x20];
/// <summary>
/// Extended header size, in bytes
@@ -164,7 +164,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? ExeFSSuperblockHash;
public byte[] ExeFSSuperblockHash = new byte[0x20];
/// <summary>
/// RomFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the RomFS over the number
@@ -172,6 +172,6 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? RomFSSuperblockHash;
public byte[] RomFSSuperblockHash = new byte[0x20];
}
}

View File

@@ -4,7 +4,7 @@
/// There are two known specialisations of the NCSD container format:
/// - The CTR Cart Image (CCI) format, the 3DS' raw NAND format
/// - CCI is the format of game ROM images.
///
///
/// CTR System Update (CSU) is a variant of CCI, where the only difference
/// is in the file extension.
/// </summary>
@@ -16,7 +16,8 @@
/// <summary>
/// RSA-2048 SHA-256 signature of the NCSD header
/// </summary>
public byte[]? RSA2048Signature { get; set; }
/// <remarks>0x100 bytes</remarks>
public byte[] RSA2048Signature { get; set; } = new byte[0x100];
/// <summary>
/// Magic Number 'NCSD'
@@ -31,7 +32,8 @@
/// <summary>
/// Media ID
/// </summary>
public byte[]? MediaId { get; set; }
/// <remarks>8 bytes</remarks>
public byte[] MediaId { get; set; } = new byte[8];
/// <summary>
/// Partitions FS type (0=None, 1=Normal, 3=FIRM, 4=AGB_FIRM save)
@@ -41,7 +43,8 @@
/// <summary>
/// Partitions crypt type (each byte corresponds to a partition in the partition table)
/// </summary>
public byte[]? PartitionsCryptType { get; set; }
/// <remarks>8 bytes</remarks>
public byte[] PartitionsCryptType { get; set; } = new byte[8];
/// <summary>
/// Offset & Length partition table, in media units
@@ -55,7 +58,8 @@
/// <summary>
/// Exheader SHA-256 hash
/// </summary>
public byte[]? ExheaderHash { get; set; }
/// <remarks>0x20 bytes</remarks>
public byte[] ExheaderHash { get; set; } = new byte[0x200];
/// <summary>
/// Additional header size
@@ -70,7 +74,7 @@
/// <summary>
/// Partition Flags
/// </summary>
public byte[]? PartitionFlags { get; set; }
public byte[] PartitionFlags { get; set; }
/// <summary>
/// Partition ID table
@@ -80,12 +84,14 @@
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved1 { get; set; }
/// <remarks>0x20 bytes</remarks>
public byte[] Reserved1 { get; set; } = new byte[0x20];
/// <summary>
/// Reserved?
/// </summary>
public byte[]? Reserved2 { get; set; }
/// <remarks>0x0E bytes</remarks>
public byte[] Reserved2 { get; set; } = new byte[0x0E];
/// <summary>
/// Support for this was implemented with 9.6.0-X FIRM. Bit0=1 enables using bits 1-2, it's unknown
@@ -107,12 +113,14 @@
/// <summary>
/// Unknown
/// </summary>
public byte[]? Unknown { get; set; }
/// <remarks>0x5E bytes</remarks>
public byte[] Unknown { get; set; } = new byte[0x5E];
/// <summary>
/// Encrypted MBR partition-table, for the TWL partitions(key-data used for this keyslot is console-unique).
/// </summary>
public byte[]? EncryptedMBR { get; set; }
/// <remarks>0x42 bytes</remarks>
public byte[] EncryptedMBR { get; set; } = new byte[0x42];
#endregion
}

View File

@@ -19,14 +19,14 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? SystemSavedataIDs;
public byte[] SystemSavedataIDs = new byte[8];
/// <summary>
/// Storage accessible unique IDs
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? StorageAccessibleUniqueIDs;
public byte[] StorageAccessibleUniqueIDs = new byte[8];
/// <summary>
/// Filesystem access info
@@ -35,7 +35,7 @@ namespace SabreTools.Data.Models.N3DS
/// TODO: Combine with "other attributes"
/// <remarks>7 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
public byte[]? FileSystemAccessInfo;
public byte[] FileSystemAccessInfo = new byte[7];
/// <summary>
/// Other attributes

View File

@@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>5 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[]? Reserved1;
public byte[] Reserved1 = new byte[5];
/// <summary>
/// Flag (bit 0: CompressExefsCode, bit 1: SDApplication)

View File

@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>0x30 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x30)]
public byte[]? Reserved;
public byte[] Reserved = new byte[0x30];
}
}

View File

@@ -14,63 +14,63 @@ namespace SabreTools.Data.Models.N3DS
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? Signature;
public byte[] Signature = new byte[8];
/// <summary>
/// An ascending byte sequence equal to the offset mod 256 (08 09 0A ... FE FF 00 01 ... FF).
/// </summary>
/// <remarks>0x1F8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1F8)]
public byte[]? AscendingByteSequence;
public byte[] AscendingByteSequence = new byte[0x1F8];
/// <summary>
/// A descending byte sequence equal to 255 minus the offset mod 256 (FF FE FD ... 00 FF DE ... 00).
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? DescendingByteSequence;
public byte[] DescendingByteSequence = new byte[0x200];
/// <summary>
/// Filled with 00 (0b00000000) bytes.
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? Filled00;
public byte[] Filled00 = new byte[0x200];
/// <summary>
/// Filled with FF (0b11111111) bytes.
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? FilledFF;
public byte[] FilledFF = new byte[0x200];
/// <summary>
/// Filled with 0F (0b00001111) bytes.
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? Filled0F;
public byte[] Filled0F = new byte[0x200];
/// <summary>
/// Filled with F0 (0b11110000) bytes.
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? FilledF0;
public byte[] FilledF0 = new byte[0x200];
/// <summary>
/// Filled with 55 (0b01010101) bytes.
/// </summary>
/// <remarks>0x200 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)]
public byte[]? Filled55;
public byte[] Filled55 = new byte[0x200];
/// <summary>
/// Filled with AA (0b10101010) bytes.
/// </summary>
/// <remarks>0x1FF bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1FF)]
public byte[]? FilledAA;
public byte[] FilledAA = new byte[0x1FF];
/// <summary>
/// The final byte is 00 (0b00000000).

View File

@@ -25,12 +25,12 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Signature
/// </summary>
public byte[]? Signature { get; set; }
public byte[] Signature { get; set; }
/// <summary>
/// Padding
/// </summary>
public byte[]? Padding { get; set; }
public byte[] Padding { get; set; }
/// <summary>
/// Issuer
@@ -40,7 +40,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// ECC PublicKey
/// </summary>
public byte[]? ECCPublicKey { get; set; }
/// <remarks>0x3C bytes</remarks>
public byte[] ECCPublicKey { get; set; } = new byte[0x3C];
/// <summary>
/// Version (For 3DS this is always 1)
@@ -61,17 +62,19 @@ namespace SabreTools.Data.Models.N3DS
/// TitleKey (normal-key encrypted using one of the common keyYs; see below)
/// </summary>
/// <remarks>
/// 0x10 bytes
///
/// The titlekey is decrypted by using the AES engine with the ticket common-key keyslot.
/// The keyY is selected through an index (ticket offset 0xB1) into a plaintext array
/// of 6 keys ("common keyYs") stored in the data section of Process9. AES-CBC mode is used
/// where the IV is the big-endian titleID. Note that on a retail unit index0 is a retail keyY,
/// while on a dev-unit index0 is the dev common-key which is a normal-key.
/// (On retail for these keyYs, the hardware key-scrambler is used)
///
///
/// The titlekey is used to decrypt content downloaded from the CDN using 128-bit AES-CBC with
/// the content index (as big endian u16, padded with trailing zeroes) as the IV.
/// </remarks>
public byte[]? TitleKey { get; set; }
public byte[] TitleKey { get; set; } = new byte[0x10];
/// <summary>
/// Reserved
@@ -96,7 +99,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved2 { get; set; }
/// <remarks>2 bytes</remarks>
public byte[] Reserved2 { get; set; } = new byte[2];
/// <summary>
/// Ticket title version
@@ -110,7 +114,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved3 { get; set; }
/// <remarks>8 bytes</remarks>
public byte[] Reserved3 { get; set; } = new byte[8];
/// <summary>
/// License Type
@@ -125,7 +130,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved4 { get; set; }
/// <remarks>0x2A bytes</remarks>
public byte[] Reserved4 { get; set; } = new byte[0x2A];
/// <summary>
/// eShop Account ID?
@@ -145,7 +151,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved6 { get; set; }
/// <remarks>0x42 bytes</remarks>
public byte[] Reserved6 { get; set; } = new byte[0x42];
/// <summary>
/// Limits
@@ -165,7 +172,7 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Content Index
/// </summary>
public byte[]? ContentIndex { get; set; }
public byte[] ContentIndex { get; set; }
/// <summary>
/// Certificate chain

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// A format used to store information about a title (installed title, DLC, etc.)
/// and all its installed contents, including which contents they consist of and
/// their SHA256 hashes.
/// their SHA256 hashes.
/// </summary>
/// <see href="https://www.3dbrew.org/wiki/Title_metadata"/>
public sealed class TitleMetadata
@@ -26,12 +26,12 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Signature
/// </summary>
public byte[]? Signature { get; set; }
public byte[] Signature { get; set; }
/// <summary>
/// Padding
/// </summary>
public byte[]? Padding1 { get; set; }
public byte[] Padding1 { get; set; }
/// <summary>
/// Signature Issuer
@@ -42,7 +42,7 @@ namespace SabreTools.Data.Models.N3DS
/// Version
/// </summary>
public byte Version { get; set; }
/// <summary>
/// CaCrlVersion
/// </summary>
@@ -91,7 +91,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved2 { get; set; }
/// <remarks>4 bytes</remarks>
public byte[] Reserved2 { get; set; } = new byte[4];
/// <summary>
/// SRL Flag
@@ -101,7 +102,8 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Reserved
/// </summary>
public byte[]? Reserved3 { get; set; }
/// <remarks>0x31 bytes</remarks>
public byte[] Reserved3 { get; set; } = new byte[0x31];
/// <summary>
/// Access Rights
@@ -126,12 +128,14 @@ namespace SabreTools.Data.Models.N3DS
/// <summary>
/// Padding
/// </summary>
public byte[]? Padding2 { get; set; }
/// <remarks>2 bytes</remarks>
public byte[] Padding2 { get; set; } = new byte[2];
/// <summary>
/// SHA-256 Hash of the Content Info Records
/// </summary>
public byte[]? SHA256HashContentInfoRecords { get; set; }
/// <remarks>0x20 bytes</remarks>
public byte[] SHA256HashContentInfoRecords { get; set; } = new byte[0x20];
/// <summary>
/// There are 64 of these records, usually only the first is used.
@@ -152,4 +156,4 @@ namespace SabreTools.Data.Models.N3DS
/// </remarks>
public Certificate[]? CertificateChain { get; set; }
}
}
}

View File

@@ -20,6 +20,6 @@
/// <summary>
/// ASCII text of the name string.
/// </summary>
public byte[]? NameString { get; set; }
public byte[] NameString { get; set; }
}
}

View File

@@ -20,7 +20,7 @@
/// <summary>
/// ASCII text of the name string.
/// </summary>
public byte[]? NameString { get; set; }
public byte[] NameString { get; set; }
/// <summary>
/// Ordinal number (index into entry table). This value is ignored

View File

@@ -19,7 +19,7 @@
/// <summary>
/// ASCII text of the name string.
/// </summary>
public byte[]? NameString { get; set; }
public byte[] NameString { get; set; }
/// <summary>
/// Ordinal number (index into entry table). This value is ignored

View File

@@ -18,6 +18,6 @@
/// <summary>
/// ASCII text of the type or name string.
/// </summary>
public byte[]? Text { get; set; }
public byte[] Text { get; set; }
}
}

View File

@@ -45,7 +45,7 @@ namespace SabreTools.Data.Models.NewExecutable
/// Data is not sequential to the entry header. It lives at
/// the <see cref="Offset"/> and has a size of <see cref="Length"/>
/// </remarks>
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
/// <summary>
/// Per-segment data

View File

@@ -18,7 +18,8 @@ namespace SabreTools.Data.Models.Nitro
/// <summary>
/// Secure area, may be encrypted or decrypted
/// </summary>
public byte[]? SecureArea { get; set; }
/// <remarks>0x800 bytes</remarks>
public byte[] SecureArea { get; set; } = new byte[0x800];
/// <summary>
/// Name table (folder allocation table, name list)
@@ -30,4 +31,4 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
public FileAllocationTableEntry[]? FileAllocationTable { get; set; }
}
}
}

View File

@@ -49,7 +49,7 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>7 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
public byte[]? Reserved1;
public byte[] Reserved1 = new byte[7];
/// <summary>
/// Game Revision (used by DSi titles)
@@ -186,7 +186,7 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? SecureDisable;
public byte[] SecureDisable = new byte[8];
/// <summary>
/// NTR region ROM size (excluding DSi area)
@@ -203,14 +203,14 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>56 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 56)]
public byte[]? Reserved2;
public byte[] Reserved2 = new byte[56];
/// <summary>
/// Nintendo Logo
/// </summary>
/// <remarks>156 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 156)]
public byte[]? NintendoLogo;
public byte[] NintendoLogo = new byte[156];
/// <summary>
/// Nintendo Logo CRC
@@ -227,6 +227,6 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>0x20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? DebuggerReserved;
public byte[] DebuggerReserved = new byte[0x20];
}
}
}

View File

@@ -165,7 +165,7 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>12 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[]? Unknown2;
public byte[] Unknown2 = new byte[12];
/// <summary>
/// Modcrypt area 1 offset
@@ -192,7 +192,7 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>8 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[]? TitleID;
public byte[] TitleID = new byte[8];
/// <summary>
/// DSiWare: "public.sav" size
@@ -209,90 +209,90 @@ namespace SabreTools.Data.Models.Nitro
/// </summary>
/// <remarks>176 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 176)]
public byte[]? ReservedZero;
public byte[] ReservedZero = new byte[176];
/// <summary>
/// Unknown (used by DSi)
/// </summary>
/// <remarks>16 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[]? Unknown3;
public byte[] Unknown3 = new byte[16];
/// <summary>
/// ARM9 (with encrypted secure area) SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ARM9WithSecureAreaSHA1HMACHash;
public byte[] ARM9WithSecureAreaSHA1HMACHash = new byte[20];
/// <summary>
/// ARM7 SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ARM7SHA1HMACHash;
public byte[] ARM7SHA1HMACHash = new byte[20];
/// <summary>
/// Digest master SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? DigestMasterSHA1HMACHash;
public byte[] DigestMasterSHA1HMACHash = new byte[20];
/// <summary>
/// Banner SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? BannerSHA1HMACHash;
public byte[] BannerSHA1HMACHash = new byte[20];
/// <summary>
/// ARM9i (decrypted) SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ARM9iDecryptedSHA1HMACHash;
public byte[] ARM9iDecryptedSHA1HMACHash = new byte[20];
/// <summary>
/// ARM7i (decrypted) SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ARM7iDecryptedSHA1HMACHash;
public byte[] ARM7iDecryptedSHA1HMACHash = new byte[20];
/// <summary>
/// Reserved
/// </summary>
/// <remarks>40 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)]
public byte[]? Reserved5;
public byte[] Reserved5 = new byte[40];
/// <summary>
/// ARM9 (without secure area) SHA1 HMAC hash
/// </summary>
/// <remarks>20 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[]? ARM9NoSecureAreaSHA1HMACHash;
public byte[] ARM9NoSecureAreaSHA1HMACHash = new byte[20];
/// <summary>
/// Reserved
/// </summary>
/// <remarks>2636 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2636)]
public byte[]? Reserved6;
public byte[] Reserved6 = new byte[2636];
/// <summary>
/// Reserved and unchecked region, always zero. Used for passing arguments in debug environment.
/// </summary>
/// <remarks>0x180 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x180)]
public byte[]? ReservedAndUnchecked;
public byte[] ReservedAndUnchecked = new byte[0x180];
/// <summary>
/// RSA signature (the first 0xE00 bytes of the header are signed with an 1024-bit RSA signature).
/// </summary>
/// <remarks>0x80 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x80)]
public byte[]? RSASignature;
public byte[] RSASignature = new byte[0x80];
}
}
}

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// The BLOB packet represents binary data
/// </summary>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
public class BLOB
{
/// <summary>
@@ -14,6 +14,6 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// MUST be an array of bytes, followed by zero padding to a multiple of 4 bytes.
/// </summary>
public byte[]? Bytes { get; set; }
public byte[] Bytes { get; set; }
}
}

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// The ClipboardData packet represents clipboard data
/// </summary>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
public class ClipboardData
{
/// <summary>
@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// MUST be an array of bytes, followed by zero padding to a multiple of 4 bytes
/// </summary>
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
}
}

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// The GUID (Packet Version) packet represents a GUID
/// </summary>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
public class GUID
{
/// <summary>
@@ -24,6 +24,6 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// The value of the Data4 field specified in [MS-DTYP] section 2.3.4
/// </summary>
public byte[]? Data4 { get; set; }
public byte[] Data4 { get; set; } = new byte[8];
}
}

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE
/// <summary>
/// The TypedPropertyValue structure represents the typed value of a property in a property set
/// </summary>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
public class TypedPropertyValue
{
/// <summary>
@@ -22,6 +22,6 @@ namespace SabreTools.Data.Models.OLE
/// the value of Type as follows.
/// </summary>
/// <remarks>See documentation for required lengths</remarks>
public byte[]? Value { get; set; }
public byte[] Value { get; set; }
}
}

View File

@@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.PIC
/// DI Unit Format dependent contents
/// </summary>
/// <remarks>52 bytes for BD-ROM, 100 bytes for BD-R/RE</remarks>
public byte[]? FormatDependentContents { get; set; }
public byte[] FormatDependentContents { get; set; }
}
}

View File

@@ -15,14 +15,14 @@ namespace SabreTools.Data.Models.PIC
/// </summary>
/// <remarks>6 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? DiscManufacturerID;
public byte[] DiscManufacturerID = new byte[6];
/// <summary>
/// Media Type ID
/// </summary>
/// <remarks>3 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[]? MediaTypeID;
public byte[] MediaTypeID = new byte[3];
/// <summary>
/// Time Stamp

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP
/// <summary>
/// AS/400 Extra Field (0x0065) Attribute [APPENDIX A]
/// </summary>
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
public class AS400ExtraFieldAttribute : ExtensibleDataField
{
/// <summary>
@@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.PKZIP
/// Data
/// </summary>
/// <remarks>Variable byte length based on field code</remarks>
public byte[]? Data { get; set; }
public byte[] Data { get; set; }
}
}

View File

@@ -15,7 +15,7 @@ namespace SabreTools.Data.Models.PKZIP
/// Optional archive decryption header, appears after all entries
/// </summary>
/// TODO: Determine the model
public byte[]? ArchiveDecryptionHeader { get; set; }
public byte[] ArchiveDecryptionHeader { get; set; }
/// <summary>
/// Optional archive extra data record, appears after either

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