41 Commits
1.5.4 ... 1.6.0

Author SHA1 Message Date
Matt Nadareski
f18b6c8850 Bump version 2025-07-23 09:48:18 -04:00
Matt Nadareski
8f1e49e464 Add .NET Standard 2.0 and 2.1 2025-07-23 09:43:12 -04:00
Matt Nadareski
6547242f93 Clean up more Matroskha comments 2025-07-21 11:27:20 -04:00
Matt Nadareski
edf00f3ab2 Add analysis block comment 2025-07-21 11:25:18 -04:00
Matt Nadareski
bce4736037 Clean up more Matroskha comments 2025-07-21 11:23:25 -04:00
Matt Nadareski
81f28974c0 More remark corrections based on more samples 2025-07-21 11:10:35 -04:00
Matt Nadareski
30ebe84af4 Remove disproven theory 2025-07-21 11:08:01 -04:00
Matt Nadareski
b07fbdedd6 Add secondary length note 2025-07-21 09:39:31 -04:00
Matt Nadareski
cd8fff4a86 Slight tweaks to Matroska entry notes 2025-07-21 09:21:56 -04:00
Matt Nadareski
3d3275e3cb Add SecuROM Matroshka models
All research thanks to HeroponRikiBestest
2025-07-21 09:11:37 -04:00
Matt Nadareski
4c76ce1230 Add SecuROM DFA models
All research thanks to HeroponRikiBestest
2025-07-21 08:10:25 -04:00
Matt Nadareski
0c4e3b4bf2 Dirs can be nested 2025-06-24 12:32:14 -04:00
Matt Nadareski
e8f4386199 Add mess alternative ListXML model 2025-05-28 09:53:05 -04:00
Matt Nadareski
ab66ccf3c5 Update copyright 2024-12-30 21:19:05 -05:00
Matt Nadareski
cc60d54a33 Remove unnecessary action step 2024-12-30 21:18:59 -05:00
Matt Nadareski
e805f4cb9a Ensure .NET versions are installed for testing 2024-12-19 10:50:01 -05:00
Matt Nadareski
328c893a38 Ensure .NET versions are installed for testing 2024-12-19 10:45:08 -05:00
Matt Nadareski
ab2a12c996 Bump version 2024-12-16 12:10:13 -05:00
Matt Nadareski
362b123661 Allow symbols to be packed 2024-12-16 11:37:18 -05:00
Matt Nadareski
4a8a4746a2 Add big-endian note for PS4 PKG 2024-12-16 11:31:38 -05:00
Deterous
3f368a3be8 Create model for PS4 app.pkg header (#7)
* Create model for PS4 app.pkg header

* Rename PS4 app.pkg class

* Fix typo

* Requested changes

* Add newline
2024-12-15 20:12:06 -05:00
Matt Nadareski
2749c2f5bd Bump version 2024-12-11 11:25:41 -05:00
Matt Nadareski
41ce962700 Reorder LZ constants 2024-12-11 11:10:01 -05:00
Matt Nadareski
85b7103bd3 Re-rename Expand to SZDD for consistency 2024-12-11 11:09:28 -05:00
Matt Nadareski
4c61a191e8 Remove MS-ZIP Block type 2024-12-11 11:00:44 -05:00
Matt Nadareski
0f70598969 Add LZ prefixes for easier checking 2024-12-11 10:58:47 -05:00
Matt Nadareski
d6b057d808 Move LZ models out of Compression namespace 2024-12-11 10:54:10 -05:00
Matt Nadareski
3d8036e7b5 Remove things that Compression doesn't need anymore 2024-12-11 10:46:28 -05:00
Matt Nadareski
bb35946866 Ensure KWAJ header flags serialized 2024-12-11 04:19:02 -05:00
Matt Nadareski
78f9f1b36f Fix KWAJ serialization 2024-12-11 04:16:23 -05:00
Matt Nadareski
9d1b1ca36d Further simplify LZ models 2024-12-11 03:48:10 -05:00
Matt Nadareski
6e1f8bf55e Fix issues with MS-LZ models 2024-12-11 01:50:02 -05:00
Matt Nadareski
a19afc240c Bump version 2024-12-10 15:28:49 -05:00
Matt Nadareski
148e97ef64 Add now-supported DOSCenter SHA-1 attribute 2024-12-07 23:28:52 -05:00
Matt Nadareski
676b446025 Add badge for build status 2024-12-06 10:48:43 -05:00
Matt Nadareski
aeff75d8d3 Rename workflow file, add releases to README 2024-12-06 10:47:42 -05:00
Matt Nadareski
e20e515f56 Attempt to use publish script 2024-12-06 10:43:08 -05:00
Matt Nadareski
bf02266f0f Bump version 2024-11-29 19:51:47 -05:00
Matt Nadareski
b521e503c2 Rearrange SGA 2024-11-28 20:26:58 -05:00
Matt Nadareski
48e79d26ed Ensure nullable arrays are correct 2024-11-27 23:37:25 -05:00
Matt Nadareski
989ef41c6d Get/Set may be fully disallowed? 2024-11-27 21:31:33 -05:00
123 changed files with 1217 additions and 740 deletions

View File

@@ -1,4 +1,4 @@
name: Nuget Pack
name: Build and Test
on:
push:
@@ -16,25 +16,22 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack
- name: Run tests
run: dotnet test
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: 'SabreTools.Models/bin/Release/*.nupkg'
- name: Run publish script
run: ./publish-nix.sh
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: True
artifacts: 'SabreTools.Models/bin/Release/*.nupkg'
artifacts: "*.nupkg,*.snupkg"
body: 'Last built commit: ${{ github.sha }}'
name: 'Rolling Release'
prerelease: True

View File

@@ -11,7 +11,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Build
run: dotnet build
run: dotnet build
- name: Run tests
run: dotnet test

View File

@@ -1,9 +1,17 @@
# SabreTools.Models
[![Build and Test](https://github.com/SabreTools/SabreTools.Models/actions/workflows/build_and_test.yml/badge.svg?branch=main)](https://github.com/SabreTools/SabreTools.Models/actions/workflows/build_and_test.yml)
This library comprises of models that represent either directly serializable or representative structures for all SabreTools projects. All of the main models representing metadata files should have parsers created outside of the current code.
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Models).
## Releases
For the most recent stable build, download the latest release here: [Releases Page](https://github.com/SabreTools/SabreTools.Models/releases)
For the latest WIP build here: [Rolling Release](https://github.com/SabreTools/SabreTools.Models/releases/rolling)
## Missing Metadata Models
The following metadata file formats do not have models included in this library yet and, as such, do not have serializers:

View File

@@ -21,6 +21,6 @@ namespace SabreTools.Models.AACS
/// <summary>
/// Revocation list entries
/// </summary>
public DriveRevocationSignatureBlock?[]? SignatureBlocks { get; set; }
public DriveRevocationSignatureBlock[]? SignatureBlocks { get; set; }
}
}

View File

@@ -12,6 +12,6 @@ namespace SabreTools.Models.AACS
/// A list of 8-byte Host Drive List Entry fields, the length of this
/// list being equal to the number in the signature block.
/// </summary>
public DriveRevocationListEntry?[]? EntryFields { get; set; }
public DriveRevocationListEntry[]? EntryFields { get; set; }
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Models.AACS
/// <summary>
/// In this record, each subset-difference is encoded with 5 bytes.
/// </summary>
public SubsetDifference?[]? SubsetDifferences { get; set; }
public SubsetDifference[]? SubsetDifferences { get; set; }
}
}

View File

@@ -24,6 +24,6 @@ namespace SabreTools.Models.AACS
/// <summary>
/// Revocation list entries
/// </summary>
public HostRevocationSignatureBlock?[]? SignatureBlocks { get; set; }
public HostRevocationSignatureBlock[]? SignatureBlocks { get; set; }
}
}

View File

@@ -12,6 +12,6 @@ namespace SabreTools.Models.AACS
/// A list of 8-byte Host Revocation List Entry fields, the length of this
/// list being equal to the number in the signature block.
/// </summary>
public HostRevocationListEntry?[]? EntryFields { get; set; }
public HostRevocationListEntry[]? EntryFields { get; set; }
}
}

View File

@@ -9,6 +9,6 @@ namespace SabreTools.Models.AACS
/// <summary>
/// Records
/// </summary>
public Record?[]? Records { get; set; }
public Record[]? Records { get; set; }
}
}

View File

@@ -7,6 +7,6 @@ namespace SabreTools.Models.ArchiveDotOrg
public class Files
{
[XmlElement("file")]
public File?[]? File { get; set; }
public File[]? File { get; set; }
}
}

View File

@@ -8,6 +8,6 @@ namespace SabreTools.Models.AttractMode
[Required]
public string[]? Header { get; set; }
public Row?[]? Row { get; set; }
public Row[]? Row { get; set; }
}
}

View File

@@ -10,8 +10,8 @@ namespace SabreTools.Models.BSP
[StructLayout(LayoutKind.Sequential)]
public class QAngle
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public float X;
public float Y;
public float Z;
}
}

View File

@@ -10,8 +10,8 @@ namespace SabreTools.Models.BSP
[StructLayout(LayoutKind.Sequential)]
public class Vector3D
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public float X;
public float Y;
public float Z;
}
}

View File

@@ -6,6 +6,6 @@ namespace SabreTools.Models.ClrMamePro
public ClrMamePro? ClrMamePro { get; set; }
/// <remarks>game, machine, resource, set</remarks>
public GameBase?[]? Game { get; set; }
public GameBase[]? Game { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public class BlockHeader
{
/// <summary>
/// Set if and only if this is the last block of the data set.
/// </summary>
/// <remarks>Bit 0</remarks>
public bool BFINAL { get; set; }
/// <summary>
/// Specifies how the data are compressed
/// </summary>
/// <remarks>Bits 1-2</remarks>
public CompressionType BTYPE { get; set; }
}
}

View File

@@ -1,20 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <summary>
/// Compression with Huffman codes (BTYPE=01 or BTYPE=02)
/// </summary>
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public abstract class CompressedDataHeader : DataHeader
{
/// <summary>
/// Huffman code lengths for the literal / length alphabet
/// </summary>
public virtual uint[]? LiteralLengths { get; set; }
/// <summary>
/// Huffman distance codes for the literal / length alphabet
/// </summary>
public virtual uint[]? DistanceCodes { get; set; }
}
}

View File

@@ -1,136 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public static class Constants
{
/// <summary>
/// Bits in base literal/length lookup table
/// </summary>
public const int ZIPLBITS = 9;
/// <summary>
/// Bits in base distance lookup table
/// </summary>
public const int ZIPDBITS = 6;
/// <summary>
/// Maximum bit length of any code
/// </summary>
public const int ZIPBMAX = 16;
/// <summary>
/// Maximum number of codes in any set
/// </summary>
public const int ZIPN_MAX = 288;
#region Fixed Huffman Codes
/// <summary>
/// Fixed Huffman code lengths for the literal / length alphabet
/// </summary>
public static readonly uint[] FixedLiteralLengths =
[
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8, 8, 8, 8,
];
/// <summary>
/// Fixed Huffman distance codes for the literal / length alphabet
/// </summary>
public static readonly uint[] FixedDistanceCodes =
[
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5,
];
#endregion
#region Literal and Length Alphabets
/// <summary>
/// Extra bits for distance codes
/// </summary>
public static readonly ushort[] DistanceExtraBits =
[
0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
9, 9, 10, 10, 11, 11, 12, 12, 13, 13
];
/// <summary>
/// Copy offsets for distance codes 0..29
/// </summary>
public static readonly ushort[] DistanceOffsets =
[
1, 2, 3, 4, 5, 7, 9, 13, 17, 25,
33, 49, 65, 97, 129, 193, 257, 385, 513, 769,
1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
];
/// <summary>
/// Extra bits for literal codes 257..285
/// </summary>
public static readonly ushort[] LiteralExtraBits =
[
0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
4, 4, 4, 4, 5, 5, 5, 5, 0,
];
/// <summary>
/// Copy lengths for literal codes 257..285
/// </summary>
public static readonly ushort[] LiteralLengths =
[
3, 4, 5, 6, 7, 8, 9, 10, 11, 13,
15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
67, 83, 99, 115, 131, 163, 195, 227, 258,
];
/// <summary>
/// Order of the bit length code lengths
/// </summary>
public static readonly byte[] BitLengthOrder =
[
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
];
#endregion
}
}

View File

@@ -1,11 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <summary>
/// Base class for all data headers (BTYPE=00, BTYPE=01, or BTYPE=02)
/// </summary>
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public abstract class DataHeader
{
// No common fields between all data headers
}
}

View File

@@ -1,11 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <summary>
/// Compression with dynamic Huffman codes (BTYPE=10)
/// </summary>
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public class DynamicCompressedDataHeader : CompressedDataHeader
{
// Codes are provided externally
}
}

View File

@@ -1,26 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public enum CompressionType : byte
{
/// <summary>
/// no compression
/// </summary>
NoCompression = 0b00,
/// <summary>
/// Compressed with fixed Huffman codes
/// </summary>
FixedHuffman = 0b01,
/// <summary>
/// Compressed with dynamic Huffman codes
/// </summary>
DynamicHuffman = 0b10,
/// <summary>
/// Reserved (error)
/// </summary>
Reserved = 0b11,
}
}

View File

@@ -1,24 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <summary>
/// Compression with fixed Huffman codes (BTYPE=01)
/// </summary>
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public class FixedCompressedDataHeader : CompressedDataHeader
{
#region Properties
/// <summary>
/// Huffman code lengths for the literal / length alphabet
/// </summary>
public override uint[]? LiteralLengths => Constants.FixedLiteralLengths;
/// <summary>
/// Huffman distance codes for the literal / length alphabet
/// </summary>
public override uint[]? DistanceCodes => Constants.FixedDistanceCodes;
#endregion
}
}

View File

@@ -1,21 +0,0 @@
namespace SabreTools.Models.Compression.Deflate
{
/// <summary>
/// Non-compressed blocks (BTYPE=00)
/// </summary>
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
public class NonCompressedBlockHeader : DataHeader
{
/// <summary>
/// The number of data bytes in the block
/// </summary>
/// <remarks>Bytes 0-1</remarks>
public ushort LEN { get; set; }
/// <summary>
/// The one's complement of LEN
/// </summary>
/// <remarks>Bytes 2-3</remarks>
public ushort NLEN { get; set; }
}
}

View File

@@ -1,23 +0,0 @@
namespace SabreTools.Models.Compression.LZ
{
public static class Constants
{
public const int GETLEN = 2048;
public const int LZ_MAGIC_LEN = 8;
public const int LZ_HEADER_LEN = 14;
public static readonly byte[] MagicBytes = [0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33];
public static readonly string MagicString = System.Text.Encoding.ASCII.GetString(MagicBytes);
public const ulong MagicUInt64 = 0x3327f08844445a53;
public const int LZ_TABLE_SIZE = 0x1000;
public const int MAX_LZSTATES = 16;
public const int LZ_MIN_HANDLE = 0x400;
}
}

View File

@@ -1,17 +0,0 @@
namespace SabreTools.Models.Compression.LZ
{
/// <see href="https://github.com/wine-mirror/wine/blob/master/include/lzexpand.h"/>
public enum LZERROR
{
LZERROR_OK = 1,
LZERROR_NOT_LZ = 0,
LZERROR_BADINHANDLE = -1,
LZERROR_BADOUTHANDLE = -2,
LZERROR_READ = -3,
LZERROR_WRITE = -4,
LZERROR_GLOBALLOC = -5,
LZERROR_GLOBLOCK = -6,
LZERROR_BADVALUE = -7,
LZERROR_UNKNOWNALG = -8,
}
}

View File

@@ -1,22 +0,0 @@
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
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string? Magic;
public byte CompressionType;
[MarshalAs(UnmanagedType.U1)]
public char LastChar;
public uint RealLength;
}
}

View File

@@ -1,72 +0,0 @@
using System.IO;
namespace SabreTools.Models.Compression.LZ
{
public sealed class State
{
/// <summary>
/// Internal backing stream
/// </summary>
public Stream? Source { get; set; }
/// <summary>
/// The last char of the filename for replacement
/// </summary>
public char LastChar { get; set; }
/// <summary>
/// Decompressed length of the file
/// </summary>
public uint RealLength { get; set; }
/// <summary>
/// Position the decompressor currently is
/// </summary>
public uint RealCurrent { get; set; }
/// <summary>
/// Position the user wants to read from
/// </summary>
public uint RealWanted { get; set; }
/// <summary>
/// The rotating LZ table
/// </summary>
public byte[]? Table { get; set; }
/// <summary>
/// CURrent TABle ENTry
/// </summary>
public uint CurrentTableEntry { get; set; }
/// <summary>
/// Length and position of current string
/// </summary>
public byte StringLength { get; set; }
/// <summary>
/// From stringtable
/// </summary>
public uint StringPosition { get; set; }
/// <summary>
/// Bitmask within blocks
/// </summary>
public ushort ByteType { get; set; }
/// <summary>
/// GETLEN bytes
/// </summary>
public byte[]? Window { get; set; }
/// <summary>
/// Current read
/// </summary>
public uint WindowCurrent { get; set; }
/// <summary>
/// Length last got
/// </summary>
public uint WindowLength { get; set; }
}
}

View File

@@ -1,33 +0,0 @@
namespace SabreTools.Models.Compression.MSZIP
{
/// <summary>
/// Each MSZIP block MUST consist of a 2-byte MSZIP signature and one or more RFC 1951 blocks. The
/// 2-byte MSZIP signature MUST consist of the bytes 0x43 and 0x4B. The MSZIP signature MUST be
/// the first 2 bytes in the MSZIP block. The MSZIP signature is shown in the following packet diagram.
///
/// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951].
/// The compressor that performs the compression operation MUST generate one or more RFC 1951
/// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each
/// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in
/// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951]
/// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer
/// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data.
///
/// The maximum compressed size of each MSZIP block is 32 KB + 12 bytes. This enables the MSZIP
/// block to contain 32 KB of data split between two noncompressed RFC 1951 blocks, each of which
/// has a value of BTYPE = 00.
/// </summary>
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
public class Block
{
/// <summary>
/// Block header
/// </summary>
public BlockHeader? BlockHeader { get; set; }
/// <summary>
/// Compressed blocks
/// </summary>
public DeflateBlock[]? CompressedBlocks { get; set; }
}
}

View File

@@ -4,6 +4,18 @@ namespace SabreTools.Models.Compression.MSZIP
/// Each MSZIP block MUST consist of a 2-byte MSZIP signature and one or more RFC 1951 blocks. The
/// 2-byte MSZIP signature MUST consist of the bytes 0x43 and 0x4B. The MSZIP signature MUST be
/// the first 2 bytes in the MSZIP block. The MSZIP signature is shown in the following packet diagram.
///
/// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951].
/// The compressor that performs the compression operation MUST generate one or more RFC 1951
/// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each
/// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in
/// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951]
/// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer
/// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data.
///
/// The maximum compressed size of each MSZIP block is 32 KB + 12 bytes. This enables the MSZIP
/// block to contain 32 KB of data split between two noncompressed RFC 1951 blocks, each of which
/// has a value of BTYPE = 00.
/// </summary>
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
public class BlockHeader

View File

@@ -1,20 +0,0 @@
namespace SabreTools.Models.Compression.MSZIP
{
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/cabinet/cabinet.h"/>
public static class Constants
{
/// <summary>
/// Window size
/// </summary>
public const ushort ZIPWSIZE = 0x8000;
/// <summary>
/// And'ing with Zipmask[n] masks the lower n bits
/// </summary>
public static readonly ushort[] BitMasks =
[
0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
];
}
}

View File

@@ -1,35 +0,0 @@
namespace SabreTools.Models.Compression.MSZIP
{
/// <summary>
/// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951].
/// The compressor that performs the compression operation MUST generate one or more RFC 1951
/// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each
/// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in
/// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951]
/// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer
/// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data.
/// </summary>
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
public class DeflateBlock
{
/// <summary>
/// Deflate block (RFC-1951) header
/// </summary>
public Deflate.BlockHeader? Header { get; set; }
/// <summary>
/// Compression-specific data header
/// </summary>
public Deflate.DataHeader? DataHeader { get; set; }
/// <summary>
/// MSZIP data
/// </summary>
/// <remarks>
/// Depending on the implementation of these models, this property could either be
/// compressed or uncompressed data. Keep this in mind when using the built
/// versions of this model.
/// </remarks>
public byte[]? Data { get; set; }
}
}

View File

@@ -10,7 +10,7 @@ namespace SabreTools.Models.Compression.Quantum
/// order in the table, and with every symbol in the table
/// having a frequency of 1
/// </remarks>
public ModelSymbol?[]? Symbols { get; set; }
public ModelSymbol[]? Symbols { get; set; }
/// <remarks>
/// The initial total frequency is equal to the number of entries

View File

@@ -25,6 +25,6 @@ namespace SabreTools.Models.CueSheets
/// <summary>
/// List of TRACK in FILE
/// </summary>
public CueTrack?[]? Tracks { get; set; }
public CueTrack[]? Tracks { get; set; }
}
}

View File

@@ -36,6 +36,6 @@ namespace SabreTools.Models.CueSheets
/// <summary>
/// List of FILE in cuesheet
/// </summary>
public CueFile?[]? Files { get; set; }
public CueFile[]? Files { get; set; }
}
}

View File

@@ -53,7 +53,7 @@ namespace SabreTools.Models.CueSheets
/// List of INDEX in TRACK
/// </summary>
/// <remarks>Must start with 0 or 1 and then sequential</remarks>
public CueIndex?[]? Indices { get; set; }
public CueIndex[]? Indices { get; set; }
/// <summary>
/// POSTGAP

View File

@@ -15,6 +15,9 @@ namespace SabreTools.Models.DosCenter
[Required]
public string? CRC { get; set; }
/// <remarks>sha1, attribute</remarks>
public string? SHA1 { get; set; }
/// <remarks>date, attribute</remarks>
public string? Date { get; set; }
}

View File

@@ -21,7 +21,7 @@ namespace SabreTools.Models.GCF
/// <summary>
/// Block entries data
/// </summary>
public BlockEntry?[]? BlockEntries { get; set; }
public BlockEntry[]? BlockEntries { get; set; }
/// <summary>
/// Fragmentation map header data
@@ -31,7 +31,7 @@ namespace SabreTools.Models.GCF
/// <summary>
/// Fragmentation map data
/// </summary>
public FragmentationMap?[]? FragmentationMaps { get; set; }
public FragmentationMap[]? FragmentationMaps { get; set; }
/// <summary>
/// Block entry map header data
@@ -43,7 +43,7 @@ namespace SabreTools.Models.GCF
/// Block entry map data
/// </summary>
/// <remarks>Part of version 5 but not version 6.</remarks>
public BlockEntryMap?[]? BlockEntryMaps { get; set; }
public BlockEntryMap[]? BlockEntryMaps { get; set; }
/// <summary>
/// Directory header data
@@ -53,7 +53,7 @@ namespace SabreTools.Models.GCF
/// <summary>
/// Directory entries data
/// </summary>
public DirectoryEntry?[]? DirectoryEntries { get; set; }
public DirectoryEntry[]? DirectoryEntries { get; set; }
/// <summary>
/// Directory names data
@@ -63,22 +63,22 @@ namespace SabreTools.Models.GCF
/// <summary>
/// Directory info 1 entries data
/// </summary>
public DirectoryInfo1Entry?[]? DirectoryInfo1Entries { get; set; }
public DirectoryInfo1Entry[]? DirectoryInfo1Entries { get; set; }
/// <summary>
/// Directory info 2 entries data
/// </summary>
public DirectoryInfo2Entry?[]? DirectoryInfo2Entries { get; set; }
public DirectoryInfo2Entry[]? DirectoryInfo2Entries { get; set; }
/// <summary>
/// Directory copy entries data
/// </summary>
public DirectoryCopyEntry?[]? DirectoryCopyEntries { get; set; }
public DirectoryCopyEntry[]? DirectoryCopyEntries { get; set; }
/// <summary>
/// Directory local entries data
/// </summary>
public DirectoryLocalEntry?[]? DirectoryLocalEntries { get; set; }
public DirectoryLocalEntry[]? DirectoryLocalEntries { get; set; }
/// <summary>
/// Directory map header data
@@ -88,7 +88,7 @@ namespace SabreTools.Models.GCF
/// <summary>
/// Directory map entries data
/// </summary>
public DirectoryMapEntry?[]? DirectoryMapEntries { get; set; }
public DirectoryMapEntry[]? DirectoryMapEntries { get; set; }
/// <summary>
/// Checksum header data
@@ -103,12 +103,12 @@ namespace SabreTools.Models.GCF
/// <summary>
/// Checksum map entries data
/// </summary>
public ChecksumMapEntry?[]? ChecksumMapEntries { get; set; }
public ChecksumMapEntry[]? ChecksumMapEntries { get; set; }
/// <summary>
/// Checksum entries data
/// </summary>
public ChecksumEntry?[]? ChecksumEntries { get; set; }
public ChecksumEntry[]? ChecksumEntries { get; set; }
/// <summary>
/// Data block header data

View File

@@ -40,7 +40,7 @@ namespace SabreTools.Models.InstallShieldCabinet
/// <summary>
/// Standard file descriptors
/// </summary>
public FileDescriptor?[]? FileDescriptors { get; set; }
public FileDescriptor[]? FileDescriptors { get; set; }
#endregion
@@ -54,7 +54,7 @@ namespace SabreTools.Models.InstallShieldCabinet
/// <summary>
/// File groups
/// </summary>
public FileGroup?[]? FileGroups { get; set; }
public FileGroup[]? FileGroups { get; set; }
#endregion
@@ -68,7 +68,7 @@ namespace SabreTools.Models.InstallShieldCabinet
/// <summary>
/// Components
/// </summary>
public Component?[]? Components { get; set; }
public Component[]? Components { get; set; }
#endregion
}

View File

@@ -0,0 +1,17 @@
namespace SabreTools.Models.LZ
{
public static class Constants
{
public const string KWAJPrefix = "KWAJ";
public static readonly byte[] KWAJSignatureBytes = [0x4B, 0x57, 0x41, 0x4A, 0x88, 0xF0, 0x27, 0xD1];
public const string QBasicPrefix = "SZ ";
public static readonly byte[] QBasicSignatureBytes = [0x53, 0x5A, 0x20, 0x88, 0xF0, 0x27, 0x33, 0xD1];
public const string SZDDPrefix = "SZDD";
public static readonly byte[] SZDDSignatureBytes = [0x53, 0x5A, 0x44, 0x44, 0x88, 0xF0, 0x27, 0x33];
}
}

View File

@@ -0,0 +1,82 @@
using System;
namespace SabreTools.Models.LZ
{
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
public enum KWAJCompressionType : ushort
{
/// <summary>
/// No compression
/// </summary>
NoCompression = 0,
/// <summary>
/// No compression, data is XORed with byte 0xFF
/// </summary>
NoCompressionXor = 1,
/// <summary>
/// The same compression method as the QBasic variant of SZDD
/// </summary>
QBasic = 2,
/// <summary>
/// LZ + Huffman "Jeff Johnson" compression
/// </summary>
LZH = 3,
/// <summary>
/// MS-ZIP
/// </summary>
MSZIP = 4,
}
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
[Flags]
public enum KWAJHeaderFlags : ushort
{
/// <summary>
/// Header extensions contains 4-byte decompressed length
/// </summary>
HasDecompressedLength = 0x0001,
/// <summary>
/// Header extensions contains 2-byte unknown value
/// </summary>
HasUnknownFlag = 0x0002,
/// <summary>
/// Header extensions contains 2-byte prefix followed by
/// that many bytes of (unknown purpose) data
/// </summary>
HasPrefixedData = 0x0004,
/// <summary>
/// Header extensions contains null-terminated string of
/// max length 8 representing the file name
/// </summary>
HasFileName = 0x0008,
/// <summary>
/// Header extensions contains null-terminated string of
/// max length 3 representing the file name
/// </summary>
HasFileExtension = 0x0010,
/// <summary>
/// Header extensions contains 2-byte prefix followed by
/// that many bytes of (arbitrary text) data
/// </summary>
HasAdditionalText = 0x0020,
}
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
public enum ExpandCompressionType : byte
{
/// <summary>
/// Only valid compression type: 'A'
/// </summary>
A = 0x41,
}
}

View File

@@ -0,0 +1,21 @@
namespace SabreTools.Models.LZ
{
/// <summary>
/// LZ variant with variable compression
/// </summary>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
public sealed class KWAJFile
{
/// <summary>
/// Header
/// </summary>
public KWAJHeader? Header { get; set; }
/// <summary>
/// Optional extensions defined by <see cref="KWAJHeader.HeaderFlags"/>
/// </summary>
public KWAJHeaderExtensions? HeaderExtensions { get; set; }
// Followed immediately by compressed data
}
}

View File

@@ -0,0 +1,35 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LZ
{
/// <summary>
/// LZ variant with variable compression
/// </summary>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class KWAJHeader
{
/// <summary>
/// "KWAJ" signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public byte[]? Magic;
/// <summary>
/// Compression method
/// </summary>
[MarshalAs(UnmanagedType.U2)]
public KWAJCompressionType CompressionType;
/// <summary>
/// File offset of compressed data
/// </summary>
public ushort DataOffset;
/// <summary>
/// Header flags to mark header extensions
/// </summary>
[MarshalAs(UnmanagedType.U2)]
public KWAJHeaderFlags HeaderFlags;
}
}

View File

@@ -0,0 +1,51 @@
namespace SabreTools.Models.LZ
{
/// <summary>
/// Additional information stored after the KWAJ header
/// </summary>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
public sealed class KWAJHeaderExtensions
{
/// <summary>
/// Decompressed length of file
/// </summary>
public uint? DecompressedLength { get; set; }
/// <summary>
/// Unknown purpose
/// </summary>
public ushort? UnknownPurpose { get; set; }
/// <summary>
/// Length of <see cref="UnknownData"/>
/// </summary>
public ushort? UnknownDataLength { get; set; }
/// <summary>
/// Unknown purpose data whose length is defined
/// by <see cref="UnknownDataLength"/>
/// </summary>
public byte[]? UnknownData { get; set; }
/// <summary>
/// Null-terminated string with max length 8: file name
/// </summary>
public string? FileName { get; set; }
/// <summary>
/// Null-terminated string with max length 3: file extension
/// </summary>
public string? FileExtension { get; set; }
/// <summary>
/// Length of <see cref="ArbitraryText"/>
/// </summary>
public ushort? ArbitraryTextLength { get; set; }
/// <summary>
/// Arbitrary text data whose length is defined
/// by <see cref="ArbitraryTextLength"/>
/// </summary>
public byte[]? ArbitraryText { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
namespace SabreTools.Models.LZ
{
/// <summary>
/// LZ variant used in QBasic 4.5 installer
/// </summary>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
public sealed class QBasicFile
{
/// <summary>
/// Header
/// </summary>
public QBasicHeader? Header { get; set; }
// Followed immediately by compressed data
}
}

View File

@@ -0,0 +1,23 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LZ
{
/// <summary>
/// LZ variant used in QBasic 4.5 installer
/// </summary>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class QBasicHeader
{
/// <summary>
/// "SZ" signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public byte[]? Magic;
/// <summary>
/// The integer length of the file when unpacked
/// </summary>
public uint RealLength;
}
}

View File

@@ -0,0 +1,17 @@
namespace SabreTools.Models.LZ
{
/// <summary>
/// Standard LZ variant
/// </summary>
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
public sealed class SZDDFile
{
/// <summary>
/// Header
/// </summary>
public SZDDHeader? Header { get; set; }
// Followed immediately by compressed data
}
}

View File

@@ -0,0 +1,38 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LZ
{
/// <summary>
/// Standard LZ variant
/// </summary>
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class SZDDHeader
{
/// <summary>
/// "SZDD" signature
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public byte[]? Magic;
/// <summary>
/// Compression mode
/// </summary>
/// <remarks>Only <see cref="ExpandCompressionType.A"/> is supported</remarks>
[MarshalAs(UnmanagedType.U1)]
public ExpandCompressionType CompressionType;
/// <summary>
/// The character missing from the end of the filename
/// </summary>
/// <remarks>0 means unknown</remarks>
[MarshalAs(UnmanagedType.U1)]
public char LastChar;
/// <summary>
/// The integer length of the file when unpacked
/// </summary>
public uint RealLength;
}
}

View File

@@ -51,6 +51,6 @@
/// <summary>
/// Table entries in the bundle
/// </summary>
public EntryTableEntry?[]? TableEntries { get; set; }
public EntryTableEntry[]? TableEntries { get; set; }
}
}

View File

@@ -23,69 +23,69 @@ namespace SabreTools.Models.LinearExecutable
/// <summary>
/// Object table
/// </summary>
public ObjectTableEntry?[]? ObjectTable { get; set; }
public ObjectTableEntry[]? ObjectTable { get; set; }
/// <summary>
/// Object page map
/// </summary>
public ObjectPageMapEntry?[]? ObjectPageMap { get; set; }
public ObjectPageMapEntry[]? ObjectPageMap { get; set; }
// TODO: Object iterate data map table (Undefined)
/// <summary>
/// Resource table
/// </summary>
public ResourceTableEntry?[]? ResourceTable { get; set; }
public ResourceTableEntry[]? ResourceTable { get; set; }
/// <summary>
/// Resident Name table
/// </summary>
public ResidentNamesTableEntry?[]? ResidentNamesTable { get; set; }
public ResidentNamesTableEntry[]? ResidentNamesTable { get; set; }
/// <summary>
/// Entry table
/// </summary>
public EntryTableBundle?[]? EntryTable { get; set; }
public EntryTableBundle[]? EntryTable { get; set; }
/// <summary>
/// Module format directives table (optional)
/// </summary>
public ModuleFormatDirectivesTableEntry?[]? ModuleFormatDirectivesTable { get; set; }
public ModuleFormatDirectivesTableEntry[]? ModuleFormatDirectivesTable { get; set; }
/// <summary>
/// Verify record directive table (optional)
/// </summary>
public VerifyRecordDirectiveTableEntry?[]? VerifyRecordDirectiveTable { get; set; }
public VerifyRecordDirectiveTableEntry[]? VerifyRecordDirectiveTable { get; set; }
/// <summary>
/// Fix-up page table
/// </summary>
public FixupPageTableEntry?[]? FixupPageTable { get; set; }
public FixupPageTableEntry[]? FixupPageTable { get; set; }
/// <summary>
/// Fix-up record table
/// </summary>
public FixupRecordTableEntry?[]? FixupRecordTable { get; set; }
public FixupRecordTableEntry[]? FixupRecordTable { get; set; }
/// <summary>
/// Import module name table
/// </summary>
public ImportModuleNameTableEntry?[]? ImportModuleNameTable { get; set; }
public ImportModuleNameTableEntry[]? ImportModuleNameTable { get; set; }
/// <summary>
/// Import procedure name table
/// </summary>
public ImportModuleProcedureNameTableEntry?[]? ImportModuleProcedureNameTable { get; set; }
public ImportModuleProcedureNameTableEntry[]? ImportModuleProcedureNameTable { get; set; }
/// <summary>
/// Per-Page checksum table
/// </summary>
public PerPageChecksumTableEntry?[]? PerPageChecksumTable { get; set; }
public PerPageChecksumTableEntry[]? PerPageChecksumTable { get; set; }
/// <summary>
/// Non-Resident Name table
/// </summary>
public NonResidentNamesTableEntry?[]? NonResidentNamesTable { get; set; }
public NonResidentNamesTableEntry[]? NonResidentNamesTable { get; set; }
// TODO: Non-resident directives data (Undefined)

View File

@@ -0,0 +1,16 @@
using System.Xml;
using System.Xml.Serialization;
namespace SabreTools.Models.Listxml
{
[XmlRoot("mess")]
public class Mess
{
[XmlAttribute("version")]
public string? Version { get; set; }
[XmlElement("machine", typeof(Machine))]
[XmlElement("game", typeof(Game))]
public GameBase[]? Game { get; set; }
}
}

View File

@@ -10,6 +10,9 @@ namespace SabreTools.Models.Logiqx
[XmlAttribute("name")]
public string? Name { get; set; }
[XmlElement("dir", typeof(Game))]
public Dir[]? Subdir { get; set; }
[XmlElement("game", typeof(Game))]
[XmlElement("machine", typeof(Machine))]
public GameBase[]? Game { get; set; }

View File

@@ -24,6 +24,6 @@ namespace SabreTools.Models.MSDOS
/// make the loader add start segment address to the value at offset
/// 1*0x10+0x1A=0x2A within the program data.
/// </summary>
public RelocationEntry?[]? RelocationTable { get; set; }
public RelocationEntry[]? RelocationTable { get; set; }
}
}

View File

@@ -100,7 +100,7 @@ namespace SabreTools.Models.Metadata
string[]? asArray = Read<string[]>(key);
if (asArray != null)
#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD2_0
return string.Join(",", asArray);
#else
return string.Join(',', asArray);

View File

@@ -51,6 +51,6 @@
/// <summary>
/// Data blocks associated with this folder
/// </summary>
public CFDATA?[]? DataBlocks { get; set; }
public CFDATA[]? DataBlocks { get; set; }
}
}

View File

@@ -17,11 +17,11 @@
/// <summary>
/// One or more CFFOLDER entries
/// </summary>
public CFFOLDER?[]? Folders { get; set; }
public CFFOLDER[]? Folders { get; set; }
/// <summary>
/// A series of one or more cabinet file (CFFILE) entries
/// </summary>
public CFFILE?[]? Files { get; set; }
public CFFILE[]? Files { get; set; }
}
}

View File

@@ -37,12 +37,12 @@
/// <summary>
/// Hash Table (optional)
/// </summary>
public HashEntry?[]? HashTable { get; set; }
public HashEntry[]? HashTable { get; set; }
/// <summary>
/// Block Table (optional)
/// </summary>
public BlockEntry?[]? BlockTable { get; set; }
public BlockEntry[]? BlockTable { get; set; }
/// <summary>
/// Hi-Block Table (optional)

View File

@@ -25,7 +25,7 @@ namespace SabreTools.Models.N3DS
/// <remarks>
/// https://www.3dbrew.org/wiki/CIA#Certificate_Chain
/// </remarks>
public Certificate?[]? CertificateChain { get; set; }
public Certificate[]? CertificateChain { get; set; }
/// <summary>
/// Ticket
@@ -40,7 +40,7 @@ namespace SabreTools.Models.N3DS
/// <summary>
/// Content file data
/// </summary>
public NCCHHeader?[]? Partitions { get; set; }
public NCCHHeader[]? Partitions { get; set; }
/// <summary>
/// Content file data

View File

@@ -23,21 +23,21 @@ namespace SabreTools.Models.N3DS
/// <summary>
/// NCCH partitions
/// </summary>
public NCCHHeader?[]? Partitions { get; set; }
public NCCHHeader[]? Partitions { get; set; }
/// <summary>
/// NCCH extended headers
/// </summary>
public NCCHExtendedHeader?[]? ExtendedHeaders { get; set; }
public NCCHExtendedHeader[]? ExtendedHeaders { get; set; }
/// <summary>
/// ExeFS headers associated with each partition
/// </summary>
public ExeFSHeader?[]? ExeFSHeaders { get; set; }
public ExeFSHeader[]? ExeFSHeaders { get; set; }
/// <summary>
/// RomFS headers associated with each partition
/// </summary>
public RomFSHeader?[]? RomFSHeaders { get; set; }
public RomFSHeader[]? RomFSHeaders { get; set; }
}
}

View File

@@ -16,7 +16,7 @@
/// <summary>
/// File headers (10 headers maximum, 16 bytes each)
/// </summary>
public ExeFSFileHeader?[]? FileHeaders { get; set; }
public ExeFSFileHeader[]? FileHeaders { get; set; }
/// <summary>
/// Reserved

View File

@@ -46,7 +46,7 @@
/// <summary>
/// Offset & Length partition table, in media units
/// </summary>
public PartitionTableEntry?[]? PartitionsTable { get; set; }
public PartitionTableEntry[]? PartitionsTable { get; set; }
#endregion

View File

@@ -173,6 +173,6 @@ namespace SabreTools.Models.N3DS
/// <remarks>
/// https://www.3dbrew.org/wiki/Ticket#Certificate_Chain
/// </remarks>
public Certificate?[]? CertificateChain { get; set; }
public Certificate[]? CertificateChain { get; set; }
}
}

View File

@@ -136,13 +136,13 @@ namespace SabreTools.Models.N3DS
/// <summary>
/// There are 64 of these records, usually only the first is used.
/// </summary>
public ContentInfoRecord?[]? ContentInfoRecords { get; set; }
public ContentInfoRecord[]? ContentInfoRecords { get; set; }
/// <summary>
/// There is one of these for each content contained in this title.
/// (Determined by "Content Count" in the TMD Header).
/// </summary>
public ContentChunkRecord?[]? ContentChunkRecords { get; set; }
public ContentChunkRecord[]? ContentChunkRecords { get; set; }
/// <summary>
/// Certificate chain
@@ -150,6 +150,6 @@ namespace SabreTools.Models.N3DS
/// <remarks>
/// https://www.3dbrew.org/wiki/Title_metadata#Certificate_Chain
/// </remarks>
public Certificate?[]? CertificateChain { get; set; }
public Certificate[]? CertificateChain { get; set; }
}
}

View File

@@ -21,7 +21,7 @@ namespace SabreTools.Models.NCF
/// <summary>
/// Directory entries data
/// </summary>
public DirectoryEntry?[]? DirectoryEntries { get; set; }
public DirectoryEntry[]? DirectoryEntries { get; set; }
/// <summary>
/// Directory names data
@@ -31,22 +31,22 @@ namespace SabreTools.Models.NCF
/// <summary>
/// Directory info 1 entries data
/// </summary>
public DirectoryInfo1Entry?[]? DirectoryInfo1Entries { get; set; }
public DirectoryInfo1Entry[]? DirectoryInfo1Entries { get; set; }
/// <summary>
/// Directory info 2 entries data
/// </summary>
public DirectoryInfo2Entry?[]? DirectoryInfo2Entries { get; set; }
public DirectoryInfo2Entry[]? DirectoryInfo2Entries { get; set; }
/// <summary>
/// Directory copy entries data
/// </summary>
public DirectoryCopyEntry?[]? DirectoryCopyEntries { get; set; }
public DirectoryCopyEntry[]? DirectoryCopyEntries { get; set; }
/// <summary>
/// Directory local entries data
/// </summary>
public DirectoryLocalEntry?[]? DirectoryLocalEntries { get; set; }
public DirectoryLocalEntry[]? DirectoryLocalEntries { get; set; }
/// <summary>
/// Unknown header data
@@ -56,7 +56,7 @@ namespace SabreTools.Models.NCF
/// <summary>
/// Unknown entries data
/// </summary>
public UnknownEntry?[]? UnknownEntries { get; set; }
public UnknownEntry[]? UnknownEntries { get; set; }
/// <summary>
/// Checksum header data
@@ -71,11 +71,11 @@ namespace SabreTools.Models.NCF
/// <summary>
/// Checksum map entries data
/// </summary>
public ChecksumMapEntry?[]? ChecksumMapEntries { get; set; }
public ChecksumMapEntry[]? ChecksumMapEntries { get; set; }
/// <summary>
/// Checksum entries data
/// </summary>
public ChecksumEntry?[]? ChecksumEntries { get; set; }
public ChecksumEntry[]? ChecksumEntries { get; set; }
}
}

View File

@@ -18,6 +18,6 @@
/// <summary>
/// A table of relocation records follows.
/// </summary>
public RelocationRecord?[]? RelocationRecords { get; set; }
public RelocationRecord[]? RelocationRecords { get; set; }
}
}

View File

@@ -23,7 +23,7 @@ namespace SabreTools.Models.NewExecutable
/// <summary>
/// A table of resource type information blocks follows.
/// </summary>
public ResourceTypeInformationEntry?[]? ResourceTypes { get; set; }
public ResourceTypeInformationEntry[]? ResourceTypes { get; set; }
/// <summary>
/// Resource type and name strings are stored at the end of the

View File

@@ -29,6 +29,6 @@
/// <summary>
/// A table of resources for this type follows.
/// </summary>
public ResourceTypeResourceEntry?[]? Resources { get; set; }
public ResourceTypeResourceEntry[]? Resources { get; set; }
}
}

View File

@@ -28,6 +28,6 @@ namespace SabreTools.Models.Nitro
/// <summary>
/// File allocation table
/// </summary>
public FileAllocationTableEntry?[]? FileAllocationTable { get; set; }
public FileAllocationTableEntry[]? FileAllocationTable { get; set; }
}
}

View File

@@ -15,11 +15,11 @@ namespace SabreTools.Models.Nitro
/// <summary>
/// Folder allocation table
/// </summary>
public FolderAllocationTableEntry?[]? FolderAllocationTable { get; set; }
public FolderAllocationTableEntry[]? FolderAllocationTable { get; set; }
/// <summary>
/// Name list
/// </summary>
public NameListEntry?[]? NameList { get; set; }
public NameListEntry[]? NameList { get; set; }
}
}

View File

@@ -14,6 +14,6 @@ namespace SabreTools.Models.PAK
/// <summary>
/// Deserialized directory items data
/// </summary>
public DirectoryItem?[]? DirectoryItems { get; set; }
public DirectoryItem[]? DirectoryItems { get; set; }
}
}

View File

@@ -14,7 +14,7 @@ namespace SabreTools.Models.PFF
/// <summary>
/// Segments
/// </summary>
public Segment?[]? Segments { get; set; }
public Segment[]? Segments { get; set; }
/// <summary>
/// Footer

View File

@@ -29,6 +29,6 @@
/// <summary>
/// Disc information and emergency brake units
/// </summary>
public DiscInformationUnit?[]? Units { get; set; }
public DiscInformationUnit[]? Units { get; set; }
}
}

View File

@@ -17,7 +17,7 @@ namespace SabreTools.Models.PKZIP
/// Encryption headers, may appear second in each group
/// </summary>
/// TODO: Determine the model for the encryption headers
public byte[]?[]? EncryptionHeaders { get; set; }
public byte[][]? EncryptionHeaders { get; set; }
/// <summary>
/// File data, appears after the encryption header
@@ -28,12 +28,12 @@ namespace SabreTools.Models.PKZIP
/// <summary>
/// Data descriptors, appears after the file data
/// </summary>
public DataDescriptor?[]? DataDescriptors { get; set; }
public DataDescriptor[]? DataDescriptors { get; set; }
/// <summary>
/// ZIP64 Data descriptors, appears after the file data
/// </summary>
public DataDescriptor64?[]? ZIP64DataDescriptors { get; set; }
public DataDescriptor64[]? ZIP64DataDescriptors { get; set; }
#endregion

View File

@@ -40,7 +40,7 @@ namespace SabreTools.Models.PlayJ
/// <summary>
/// Data files (V2 only)
/// </summary>
public DataFile?[]? DataFiles { get; set; }
public DataFile[]? DataFiles { get; set; }
// After the data files is a block starting with 0x00000001
// This block then contains highly repeating data, possible audio samples?

View File

@@ -13,6 +13,6 @@ namespace SabreTools.Models.PlayJ
/// <summary>
/// Embedded audio files / headers
/// </summary>
public AudioFile?[]? AudioFiles { get; set; }
public AudioFile[]? AudioFiles { get; set; }
}
}

View File

@@ -4,6 +4,16 @@ namespace SabreTools.Models.PlayStation3
/// <see href="https://psdevwiki.com/ps3/PS3_DISC.SFB"/>
public static class Constants
{
/// <summary>
/// Identifying bytes for SFO file
/// </summary>
public const uint SFOMagic = 0x00505346;
/// <summary>
/// Identifying bytes for SFB file
/// </summary>
public const uint SFBMagic = 0x2E534642;
#region Hybrid Flags
/// <summary>

View File

@@ -9,8 +9,7 @@ namespace SabreTools.Models.PlayStation3
/// <summary>
/// ".SFB"
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? Magic;
public uint Magic;
/// <summary>
/// File version(?)

View File

@@ -9,8 +9,7 @@ namespace SabreTools.Models.PlayStation3
/// <summary>
/// "\0PSF"
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[]? Magic;
public uint Magic;
/// <summary>
/// Version

View File

@@ -0,0 +1,237 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PlayStation4
{
/// <see href="https://www.psdevwiki.com/ps4/PKG_files"/>
/// <remarks>All numeric values are big-endian</remarks>
[StructLayout(LayoutKind.Sequential)]
public class AppPkgHeader
{
/// <summary>
/// Identifying bytes for app.pkg file, "\7FCNT"
/// </summary>
public uint Magic;
/// <summary>
/// PKG Type
/// </summary>
public uint Type;
/// <summary>
/// PKG Unknown Field
/// </summary>
public uint PKGUnknown;
/// <summary>
/// PKG File count
/// </summary>
public uint FileCount;
/// <summary>
/// PKG Entry count
/// </summary>
public uint EntryCount;
/// <summary>
/// SC Entry count
/// </summary>
public ushort SCEntryCount;
/// <summary>
/// PKG Entry count (duplicated)
/// </summary>
public ushort EntryCount2;
/// <summary>
/// PKG File Table offset
/// </summary>
public uint TableOffset;
/// <summary>
/// PKG Entry data size
/// </summary>
public uint EntryDataSize;
/// <summary>
/// Offset of PKG Entries
/// </summary>
public ulong BodyOffset;
/// <summary>
/// Length of all PKG Entries
/// </summary>
public ulong BodySize;
/// <summary>
/// PKG Content offset
/// </summary>
public ulong ContentOffset;
/// <summary>
/// PKG Content size
/// </summary>
public ulong ContentSize;
/// <summary>
/// PKG Content ID
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x24)]
public string? ContentID;
/// <summary>
/// PKG Content Padding (Zeroes)
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC)]
public byte[]? ContentZeroes;
/// <summary>
/// PKG DRM Type
/// </summary>
public uint DRMType;
/// <summary>
/// PKG Content Type
/// </summary>
public uint ContentType;
/// <summary>
/// PKG Content Flags
/// </summary>
public uint ContentFlags;
/// <summary>
/// PKG Promote Size
/// </summary>
public uint PromoteSize;
/// <summary>
/// PKG Version Date
/// </summary>
public uint VersionDate;
/// <summary>
/// PKG Content Flags
/// </summary>
public uint VersionHash;
/// <summary>
/// PKG Padding Section 1
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x78)]
public byte[]? Zeroes1;
/// <summary>
/// PKG SHA256 for Main Entry 1
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? MainEntry1SHA256;
/// <summary>
/// PKG SHA256 for Main Entry 2
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? MainEntry2SHA256;
/// <summary>
/// PKG SHA256 for Digest Table
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? DigestTableSHA256;
/// <summary>
/// PKG SHA256 for Main Table
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? MainTableSHA256;
/// <summary>
/// PKG Padding Section 2
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x280)]
public byte[]? Zeroes2;
/// <summary>
/// PFS Unknown Field
/// </summary>
public uint PFSUnknown;
/// <summary>
/// PFS Image Count
/// </summary>
public uint PFSImageCount;
/// <summary>
/// PFS Image Flags
/// </summary>
public ulong PFSImageFlags;
/// <summary>
/// PFS Image Offset
/// </summary>
public ulong PFSImageOffset;
/// <summary>
/// PFS Image Size
/// </summary>
public ulong PFSImageSize;
/// <summary>
/// Mount Image Offset
/// </summary>
public ulong MountImageOffset;
/// <summary>
/// Mount Image Size
/// </summary>
public ulong MountImageSize;
/// <summary>
/// PKG Size
/// </summary>
public ulong PKGSize;
/// <summary>
/// PKG Signed Size
/// </summary>
public uint PKGSignedSize;
/// <summary>
/// PKG Signed Size
/// </summary>
public uint PKGCacheSize;
/// <summary>
/// SHA256 for PFS Image
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? PFSImageSHA256;
/// <summary>
/// SHA256 for PFS Signed
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? PFSSignedSHA256;
/// <summary>
/// PFS Split Size nth 0
/// </summary>
public ulong PFSSplitSize0;
/// <summary>
/// PFS Split Size nth 1
/// </summary>
public ulong PFSSplitSize1;
/// <summary>
/// PKG Padding Section 3
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xB50)]
public byte[]? Zeroes3;
/// <summary>
/// SHA256 for PKG
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[]? PKGSHA256;
}
}

View File

@@ -0,0 +1,11 @@
namespace SabreTools.Models.PlayStation4
{
/// <see href="https://www.psdevwiki.com/ps4/PKG_files"/>
public class Constants
{
/// <summary>
/// Identifying bytes for app.pkg file, "\7FCNT"
/// </summary>
public const uint AppPkgMagic = 0x7F434E54;
}
}

View File

@@ -12,10 +12,10 @@ namespace SabreTools.Models.PortableExecutable
#region Group
[XmlElement("assemblyIdentity")]
public AssemblyIdentity?[]? AssemblyIdentities { get; set; }
public AssemblyIdentity[]? AssemblyIdentities { get; set; }
[XmlElement("noInheritable")]
public AssemblyNoInheritable?[]? NoInheritables { get; set; }
public AssemblyNoInheritable[]? NoInheritables { get; set; }
#endregion
@@ -31,19 +31,19 @@ namespace SabreTools.Models.PortableExecutable
//public AssemblyNoInheritable NoInheritable { get; set; }
[XmlElement("comInterfaceExternalProxyStub")]
public AssemblyCOMInterfaceExternalProxyStub?[]? COMInterfaceExternalProxyStub { get; set; }
public AssemblyCOMInterfaceExternalProxyStub[]? COMInterfaceExternalProxyStub { get; set; }
[XmlElement("dependency")]
public AssemblyDependency?[]? Dependency { get; set; }
public AssemblyDependency[]? Dependency { get; set; }
[XmlElement("file")]
public AssemblyFile?[]? File { get; set; }
public AssemblyFile[]? File { get; set; }
[XmlElement("clrClass")]
public AssemblyCommonLanguageRuntimeClass?[]? CLRClass { get; set; }
public AssemblyCommonLanguageRuntimeClass[]? CLRClass { get; set; }
[XmlElement("clrSurrogate")]
public AssemblyCommonLanguageSurrogateClass?[]? CLRSurrogate { get; set; }
public AssemblyCommonLanguageSurrogateClass[]? CLRSurrogate { get; set; }
#endregion
@@ -94,7 +94,7 @@ namespace SabreTools.Models.PortableExecutable
public string? Description { get; set; }
[XmlElement("progid")]
public AssemblyProgID?[]? ProgIDs { get; set; }
public AssemblyProgID[]? ProgIDs { get; set; }
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
@@ -166,7 +166,7 @@ namespace SabreTools.Models.PortableExecutable
public string? ThreadingModel { get; set; }
[XmlElement("progid")]
public AssemblyProgID?[]? ProgIDs { get; set; }
public AssemblyProgID[]? ProgIDs { get; set; }
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
@@ -199,7 +199,7 @@ namespace SabreTools.Models.PortableExecutable
public AssemblyIdentity? AssemblyIdentity { get; set; }
[XmlElement("bindingRedirect")]
public AssemblyBindingRedirect?[]? BindingRedirect { get; set; }
public AssemblyBindingRedirect[]? BindingRedirect { get; set; }
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
@@ -255,16 +255,16 @@ namespace SabreTools.Models.PortableExecutable
#region Group
[XmlElement("comClass")]
public AssemblyCOMClass?[]? COMClass { get; set; }
public AssemblyCOMClass[]? COMClass { get; set; }
[XmlElement("comInterfaceProxyStub")]
public AssemblyCOMInterfaceProxyStub?[]? COMInterfaceProxyStub { get; set; }
public AssemblyCOMInterfaceProxyStub[]? COMInterfaceProxyStub { get; set; }
[XmlElement("typelib")]
public AssemblyTypeLib?[]? Typelib { get; set; }
public AssemblyTypeLib[]? Typelib { get; set; }
[XmlElement("windowClass")]
public AssemblyWindowClass?[]? WindowClass { get; set; }
public AssemblyWindowClass[]? WindowClass { get; set; }
#endregion
}

View File

@@ -46,6 +46,6 @@
/// in the Page RVA field for the block. This offset
/// specifies where the base relocation is to be applied.
/// </summary>
public BaseRelocationTypeOffsetFieldEntry?[]? TypeOffsetFieldEntries { get; set; }
public BaseRelocationTypeOffsetFieldEntry[]? TypeOffsetFieldEntries { get; set; }
}
}

View File

@@ -33,6 +33,6 @@
/// file and is not mapped into the run-time address space). If it is mapped,
/// the RVA is its address.
/// </summary>
public DebugDirectoryEntry?[]? DebugDirectoryTable { get; set; }
public DebugDirectoryEntry[]? DebugDirectoryTable { get; set; }
}
}

View File

@@ -31,7 +31,7 @@
/// box. The cdit member specifies the number of DLGITEMTEMPLATE structures in the template.
/// These DLGITEMTEMPLATE structures must be aligned on DWORD boundaries.
/// </summary>
public DialogItemTemplate?[]? DialogItemTemplates { get; set; }
public DialogItemTemplate[]? DialogItemTemplates { get; set; }
/// <summary>
/// Following the DLGTEMPLATEEX header in an extended dialog box template is one or more
@@ -39,7 +39,7 @@
/// member of the DLGITEMTEMPLATEEX structure specifies the number of DLGITEMTEMPLATEEX
/// structures that follow in the template.
/// </summary>
public DialogItemTemplateExtended?[]? ExtendedDialogItemTemplates { get; set; }
public DialogItemTemplateExtended[]? ExtendedDialogItemTemplates { get; set; }
#endregion
}

View File

@@ -40,12 +40,12 @@ namespace SabreTools.Models.PortableExecutable
/// <summary>
/// Section table
/// </summary>
public SectionHeader?[]? SectionTable { get; set; }
public SectionHeader[]? SectionTable { get; set; }
/// <summary>
/// COFF symbol table
/// </summary>
public COFFSymbolTableEntry?[]? COFFSymbolTable { get; set; }
public COFFSymbolTableEntry[]? COFFSymbolTable { get; set; }
/// <summary>
/// COFF string table
@@ -55,7 +55,7 @@ namespace SabreTools.Models.PortableExecutable
/// <summary>
/// Attribute certificate table
/// </summary>
public AttributeCertificateTableEntry?[]? AttributeCertificateTable { get; set; }
public AttributeCertificateTableEntry[]? AttributeCertificateTable { get; set; }
/// <summary>
/// Delay-load directory table
@@ -71,7 +71,7 @@ namespace SabreTools.Models.PortableExecutable
/// <summary>
/// Base relocation table (.reloc)
/// </summary>
public BaseRelocationBlock?[]? BaseRelocationTable { get; set; }
public BaseRelocationBlock[]? BaseRelocationTable { get; set; }
/// <summary>
/// Debug table (.debug*)

View File

@@ -27,7 +27,7 @@
/// can import a symbol by using an index to this table (an ordinal) or, optionally, by
/// using the public name that corresponds to the ordinal if a public name is defined.
/// </summary>
public ExportAddressTableEntry?[]? ExportAddressTable { get; set; }
public ExportAddressTableEntry[]? ExportAddressTable { get; set; }
/// <summary>
/// An array of pointers to the public export names, sorted in ascending order.

View File

@@ -16,6 +16,6 @@
/// A structure that contains a unique ordinal identifier for each font in the resource. The DE
/// member is a placeholder for the variable-length array of DIRENTRY structures.
/// </summary>
public DirEntry?[]? DE { get; set; }
public DirEntry[]? DE { get; set; }
}
}

View File

@@ -23,23 +23,23 @@ namespace SabreTools.Models.PortableExecutable
/// The import information begins with the import directory table, which describes the
/// remainder of the import information.
/// </summary>
public ImportDirectoryTableEntry?[]? ImportDirectoryTable { get; set; }
public ImportDirectoryTableEntry[]? ImportDirectoryTable { get; set; }
/// <summary>
/// An import lookup table is an array of 32-bit numbers for PE32 or an array of 64-bit
/// numbers for PE32+.
/// </summary>
public Dictionary<int, ImportLookupTableEntry?[]?>? ImportLookupTables { get; set; }
public Dictionary<int, ImportLookupTableEntry[]?>? ImportLookupTables { get; set; }
/// <summary>
/// These addresses are the actual memory addresses of the symbols, although technically
/// they are still called "virtual addresses".
/// </summary>
public Dictionary<int, ImportAddressTableEntry?[]?>? ImportAddressTables { get; set; }
public Dictionary<int, ImportAddressTableEntry[]?>? ImportAddressTables { get; set; }
/// <summary>
/// One hint/name table suffices for the entire import section.
/// </summary>
public HintNameTableEntry?[]? HintNameTable { get; set; }
public HintNameTableEntry[]? HintNameTable { get; set; }
}
}

View File

@@ -17,6 +17,6 @@
/// <summary>
/// Menu items
/// </summary>
public MenuItem?[]? MenuItems { get; set; }
public MenuItem[]? MenuItems { get; set; }
}
}

View File

@@ -17,7 +17,7 @@ namespace SabreTools.Models.PortableExecutable
/// <summary>
/// An array of structures. The array is the size indicated by the NumberOfBlocks member.
/// </summary>
public MessageResourceBlock?[]? Blocks { get; set; }
public MessageResourceBlock[]? Blocks { get; set; }
/// <summary>
/// Message resource entries

View File

@@ -54,6 +54,6 @@
/// strings to identify Type, Name, or Language entries (depending on the
/// level of the table).
/// </summary>
public ResourceDirectoryEntry?[]? Entries { get; set; }
public ResourceDirectoryEntry[]? Entries { get; set; }
}
}

View File

@@ -100,11 +100,11 @@
/// <summary>
/// COFF Relocations (Object Only)
/// </summary>
public COFFRelocation?[]? COFFRelocations { get; set; }
public COFFRelocation[]? COFFRelocations { get; set; }
/// <summary>
/// COFF Line Numbers (Deprecated)
/// </summary>
public COFFLineNumber?[]? COFFLineNumbers { get; set; }
public COFFLineNumber[]? COFFLineNumbers { get; set; }
}
}

View File

@@ -56,6 +56,6 @@ namespace SabreTools.Models.PortableExecutable
/// <summary>
/// Entry table
/// </summary>
public SecuROMAddDEntry?[]? Entries { get; set; }
public SecuROMAddDEntry[]? Entries { get; set; }
}
}

View File

@@ -38,6 +38,6 @@
/// member indicates the appropriate language and code page for displaying the text in
/// that StringTable structure.
/// </summary>
public StringTable?[]? Children { get; set; }
public StringTable[]? Children { get; set; }
}
}

View File

@@ -41,6 +41,6 @@
/// <summary>
/// An array of one or more StringData structures.
/// </summary>
public StringData?[]? Children { get; set; }
public StringData[]? Children { get; set; }
}
}

View File

@@ -36,6 +36,6 @@
/// <summary>
/// Typically contains a list of languages that the application or DLL supports.
/// </summary>
public VarData?[]? Children { get; set; }
public VarData[]? Children { get; set; }
}
}

View File

@@ -14,7 +14,7 @@ namespace SabreTools.Models.Quantum
/// <summary>
/// This is immediately followed by the list of files
/// </summary>
public FileDescriptor?[]? FileList { get; set; }
public FileDescriptor[]? FileList { get; set; }
/// <summary>
/// Immediately following the list of files is the compressed data

View File

@@ -23,11 +23,11 @@
/// <summary>
/// Files
/// </summary>
public FileEntry?[]? Files { get; set; }
public FileEntry[]? Files { get; set; }
/// <summary>
/// File headers
/// </summary>
public FileHeader?[]? FileHeaders { get; set; }
public FileHeader[]? FileHeaders { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
namespace SabreTools.Models.SGA
{
/// <summary>
/// SGA game archive
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Archive
{
/// <summary>
///Header data
/// </summary>
public Header? Header { get; set; }
/// <summary>
/// Directory data
/// </summary>
public Directory? Directory { get; set; }
}
}

View File

@@ -1,5 +1,50 @@
using System.Collections.Generic;
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public abstract class Directory { }
public abstract class Directory
{
/// <summary>
/// Source SGA file
/// </summary>
public Archive? File { get; set; }
}
/// <summary>
/// Specialization File7 and up where the CRC moved to the header and the CRC is of the compressed data and there are stronger hashes.
/// </summary>
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class Directory<THeader, TDirectoryHeader, TSection, TFolder, TFile, U> : Directory
where THeader : Header
where TDirectoryHeader : DirectoryHeader<U>
where TSection : Section<U>
where TFolder : Folder<U>
where TFile : File
{
/// <summary>
/// Directory header data
/// </summary>
public TDirectoryHeader? DirectoryHeader { get; set; }
/// <summary>
/// Sections data
/// </summary>
public TSection[]? Sections { get; set; }
/// <summary>
/// Folders data
/// </summary>
public TFolder[]? Folders { get; set; }
/// <summary>
/// Files data
/// </summary>
public TFile[]? Files { get; set; }
/// <summary>
/// String table data
/// </summary>
public Dictionary<long, string?>? StringTable { get; set; }
}
}

View File

@@ -1,5 +1,5 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Directory4 : SpecializedDirectory<Header4, DirectoryHeader4, Section4, Folder4, File4, ushort> { }
public sealed class Directory4 : Directory<Header4, DirectoryHeader4, Section4, Folder4, File4, ushort> { }
}

View File

@@ -1,5 +1,5 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Directory5 : SpecializedDirectory<Header4, DirectoryHeader5, Section5, Folder5, File4, uint> { }
public sealed class Directory5 : Directory<Header4, DirectoryHeader5, Section5, Folder5, File4, uint> { }
}

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