mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-04 13:45:37 +00:00
Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5282db965f | ||
|
|
33217a7efe | ||
|
|
c8583589d6 | ||
|
|
6ed2b406d7 | ||
|
|
4b08e0f5dd | ||
|
|
e8259fed12 | ||
|
|
d06df28f72 | ||
|
|
f73ff87922 | ||
|
|
dd6b79a21b | ||
|
|
d3daa2c4aa | ||
|
|
1620d00edf | ||
|
|
5565fa2fc3 | ||
|
|
e088e203ea | ||
|
|
acc8d95930 | ||
|
|
1a76c59827 | ||
|
|
8725ec0337 | ||
|
|
8991cc460d | ||
|
|
98ce8b65ec | ||
|
|
ca58343c30 | ||
|
|
2f637e0012 | ||
|
|
80172942fd | ||
|
|
aa0960b42f | ||
|
|
2554f64277 | ||
|
|
4c5c960915 | ||
|
|
1cb49163dd | ||
|
|
d144dd47a1 | ||
|
|
c4247c7ccb | ||
|
|
1e77437167 | ||
|
|
3d79e07d76 | ||
|
|
9d50d577ab | ||
|
|
494ca175fb | ||
|
|
73b3d4a7a8 | ||
|
|
bd40158423 | ||
|
|
149a45d871 | ||
|
|
e18d8d7543 | ||
|
|
38f0d4aef5 | ||
|
|
3959993255 | ||
|
|
00df5bdd6e | ||
|
|
00c087d8e0 | ||
|
|
6bc948784a | ||
|
|
c4f14854c2 | ||
|
|
adaac68898 | ||
|
|
a9bc4a2bfe | ||
|
|
262b91de65 | ||
|
|
62bd6a4bde | ||
|
|
7f14f0c5b0 | ||
|
|
33d63fddae | ||
|
|
209be57bf4 | ||
|
|
a1581e9d9b | ||
|
|
521664d5a8 | ||
|
|
73a8d91a83 | ||
|
|
438e87f833 | ||
|
|
2cdedbb456 | ||
|
|
b57a545598 | ||
|
|
8dc6eb2eee | ||
|
|
b58436d71a | ||
|
|
925c20021f | ||
|
|
9bebf95599 | ||
|
|
089e13ca03 | ||
|
|
de07b3b0dd | ||
|
|
22cb5360e6 | ||
|
|
a422ec7e6d | ||
|
|
f60afd6368 | ||
|
|
b8f67a8ab0 | ||
|
|
d844a8b582 | ||
|
|
8583baa862 | ||
|
|
8f3be17850 | ||
|
|
5856967794 | ||
|
|
8f78c73c6f | ||
|
|
af4ff3d383 | ||
|
|
3e638a5c57 | ||
|
|
638d0226c1 | ||
|
|
07c6d5b43a | ||
|
|
108e63a099 | ||
|
|
c636d3252b | ||
|
|
b19dbf2254 | ||
|
|
111b84170c | ||
|
|
2d7df0d4fb | ||
|
|
aba02663e5 | ||
|
|
594fec923a | ||
|
|
b5cf4e870d | ||
|
|
e6976796c2 | ||
|
|
295d8c7612 | ||
|
|
4dd184583c | ||
|
|
081c9c9245 | ||
|
|
b974380ccf | ||
|
|
41ed2cbc9a | ||
|
|
2cfcb49e35 | ||
|
|
b3f3f12b3e | ||
|
|
b41700ff92 | ||
|
|
e8a357546b | ||
|
|
68f0201c11 |
43
.github/workflows/build_nupkg.yml
vendored
Normal file
43
.github/workflows/build_nupkg.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Nuget Pack
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: 'SabreTools.Models/bin/Release/*.nupkg'
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: 'SabreTools.Models/bin/Release/*.nupkg'
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
replacesArtifacts: True
|
||||
tag: "rolling"
|
||||
updateOnlyUnreleased: True
|
||||
17
.github/workflows/check_pr.yml
vendored
Normal file
17
.github/workflows/check_pr.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Build PR
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.ArchiveDotOrg
|
||||
{
|
||||
[XmlRoot("files")]
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("file")]
|
||||
public File?[]? File { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
42
CHD/Enums.cs
42
CHD/Enums.cs
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public enum CompressionType : uint
|
||||
{
|
||||
#region V1
|
||||
|
||||
CHDCOMPRESSION_NONE = 0,
|
||||
CHDCOMPRESSION_ZLIB = 1,
|
||||
|
||||
#endregion
|
||||
|
||||
#region V3
|
||||
|
||||
CHDCOMPRESSION_ZLIB_PLUS = 2,
|
||||
|
||||
#endregion
|
||||
|
||||
#region V4
|
||||
|
||||
CHDCOMPRESSION_AV = 3,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[Flags]
|
||||
public enum Flags : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Set if this drive has a parent
|
||||
/// </summary>
|
||||
DriveHasParent = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// Set if this drive allows writes
|
||||
/// </summary>
|
||||
DriveAllowsWrites = 0x00000002,
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
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"/>
|
||||
public sealed class FileHeaader
|
||||
{
|
||||
public string? Magic { get; set; }
|
||||
|
||||
public byte CompressionType { get; set; }
|
||||
|
||||
public char LastChar { get; set; }
|
||||
|
||||
public uint RealLength { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
|
||||
public class Directory
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
|
||||
public ushort FileCount { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
|
||||
public class File
|
||||
{
|
||||
public byte VolumeEnd { get; set; }
|
||||
|
||||
public ushort Index { get; set; }
|
||||
|
||||
public uint UncompressedSize { get; set; }
|
||||
|
||||
public uint CompressedSize { get; set; }
|
||||
|
||||
public uint Offset { get; set; }
|
||||
|
||||
public uint DateTime { get; set; }
|
||||
|
||||
public uint Reserved0 { get; set; }
|
||||
|
||||
public ushort ChunkSize { get; set; }
|
||||
|
||||
public Attributes Attrib { get; set; }
|
||||
|
||||
public byte IsSplit { get; set; }
|
||||
|
||||
public byte Reserved1 { get; set; }
|
||||
|
||||
public byte VolumeStart { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
|
||||
public class Header
|
||||
{
|
||||
public uint Signature1 { get; set; }
|
||||
|
||||
public uint Signature2 { get; set; }
|
||||
|
||||
public ushort Reserved0 { get; set; }
|
||||
|
||||
public ushort IsMultivolume { get; set; }
|
||||
|
||||
public ushort FileCount { get; set; }
|
||||
|
||||
public uint DateTime { get; set; }
|
||||
|
||||
public uint CompressedSize { get; set; }
|
||||
|
||||
public uint UncompressedSize { get; set; }
|
||||
|
||||
public uint Reserved1 { get; set; }
|
||||
|
||||
/// <remarks>
|
||||
/// Set in first vol only, zero in subsequent vols
|
||||
/// </remarks>
|
||||
public byte VolumeTotal { get; set; }
|
||||
|
||||
/// <remarks>
|
||||
/// [1...n]
|
||||
/// </remarks>
|
||||
public byte VolumeNumber { get; set; }
|
||||
|
||||
public byte Reserved2 { get; set; }
|
||||
|
||||
public uint SplitBeginAddress { get; set; }
|
||||
|
||||
public uint SplitEndAddress { get; set; }
|
||||
|
||||
public uint TocAddress { get; set; }
|
||||
|
||||
public uint Reserved3 { get; set; }
|
||||
|
||||
public ushort DirCount { get; set; }
|
||||
|
||||
public uint Reserved4 { get; set; }
|
||||
|
||||
public uint Reserved5 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.InstallShieldCabinet
|
||||
{
|
||||
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
|
||||
[Flags]
|
||||
public enum FileFlags : ushort
|
||||
{
|
||||
FILE_SPLIT = 1,
|
||||
FILE_OBFUSCATED = 2,
|
||||
FILE_COMPRESSED = 4,
|
||||
FILE_INVALID = 8,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
|
||||
public enum LinkFlags : byte
|
||||
{
|
||||
LINK_NONE = 0,
|
||||
LINK_PREV = 1,
|
||||
LINK_NEXT = 2,
|
||||
LINK_BOTH = 3,
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace SabreTools.Models.Listrom
|
||||
{
|
||||
public class MetadataFile
|
||||
{
|
||||
public Set[]? Set { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("analog")]
|
||||
public class Analog
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("mask")]
|
||||
public string? Mask { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("device_ref")]
|
||||
public class DeviceRef
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("extension")]
|
||||
public class Extension
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("port")]
|
||||
public class Port
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("tag")]
|
||||
public string? Tag { get; set; }
|
||||
|
||||
[XmlElement("analog")]
|
||||
public Analog[]? Analog { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("sample")]
|
||||
public class Sample
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("slot")]
|
||||
public class Slot
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[XmlElement("slotoption")]
|
||||
public SlotOption[]? SlotOption { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("sound")]
|
||||
public class Sound
|
||||
{
|
||||
/// <remarks>Numeric</remarks>
|
||||
[Required]
|
||||
[XmlAttribute("channels")]
|
||||
public string? Channels { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Logiqx
|
||||
{
|
||||
[XmlRoot("archive")]
|
||||
public class Archive
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Logiqx
|
||||
{
|
||||
[XmlRoot("device_ref")]
|
||||
public class DeviceRef
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Logiqx
|
||||
{
|
||||
[XmlRoot("sample")]
|
||||
public class Sample
|
||||
{
|
||||
[Required]
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#Card_Info_Header"/>
|
||||
public sealed class CardInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// CARD2: Writable Address In Media Units (For 'On-Chip' Savedata). CARD1: Always 0xFFFFFFFF.
|
||||
/// </summary>
|
||||
public uint WritableAddressMediaUnits { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card Info Bitmask
|
||||
/// </summary>
|
||||
public uint CardInfoBitmask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled size of cartridge
|
||||
/// </summary>
|
||||
public uint FilledSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title version
|
||||
/// </summary>
|
||||
public ushort TitleVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card revision
|
||||
/// </summary>
|
||||
public ushort CardRevision { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Title ID of CVer in included update partition
|
||||
/// </summary>
|
||||
public byte[]? CVerTitleID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Version number of CVer in included update partition
|
||||
/// </summary>
|
||||
public ushort CVerVersionNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved4 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#Development_Card_Info_Header_Extension"/>
|
||||
public sealed class DevelopmentCardInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// InitialData
|
||||
/// </summary>
|
||||
public InitialData? InitialData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CardDeviceReserved1
|
||||
/// </summary>
|
||||
public byte[]? CardDeviceReserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TitleKey
|
||||
/// </summary>
|
||||
public byte[]? TitleKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CardDeviceReserved2
|
||||
/// </summary>
|
||||
public byte[]? CardDeviceReserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TestData
|
||||
/// </summary>
|
||||
public TestData? TestData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#InitialData"/>
|
||||
public sealed class InitialData
|
||||
{
|
||||
/// <summary>
|
||||
/// Card seed keyY (first u64 is Media ID (same as first NCCH partitionId))
|
||||
/// </summary>
|
||||
public byte[]? CardSeedKeyY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED)
|
||||
/// </summary>
|
||||
public byte[]? EncryptedCardSeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card seed AES-MAC
|
||||
/// </summary>
|
||||
public byte[]? CardSeedAESMAC { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Card seed nonce
|
||||
/// </summary>
|
||||
public byte[]? CardSeedNonce { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved3
|
||||
/// </summary>
|
||||
public byte[]? Reserved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Copy of first NCCH header (excluding RSA signature)
|
||||
/// </summary>
|
||||
public NCCHHeader? BackupHeader { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <see href="https://www.3dbrew.org/wiki/CIA#Meta"/>
|
||||
public sealed class MetaData
|
||||
{
|
||||
/// <summary>
|
||||
/// Title ID dependency list - Taken from the application's ExHeader
|
||||
/// </summary>
|
||||
/// TODO: Determine numeric format of each entry
|
||||
public byte[]? TitleIDDependencyList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Core Version
|
||||
/// </summary>
|
||||
public uint CoreVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
/// </summary>
|
||||
public byte[]? Reserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Icon Data(.ICN) - Taken from the application's ExeFS
|
||||
/// </summary>
|
||||
public byte[]? IconData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
namespace SabreTools.Models.N3DS
|
||||
{
|
||||
/// <summary>
|
||||
/// The test data is the same one encountered in development DS/DSi cartridges.
|
||||
/// </summary>
|
||||
/// <see href="https://www.3dbrew.org/wiki/NCSD#TestData"/>
|
||||
public sealed class TestData
|
||||
{
|
||||
/// <summary>
|
||||
/// The bytes FF 00 FF 00 AA 55 AA 55.
|
||||
/// </summary>
|
||||
public byte[]? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An ascending byte sequence equal to the offset mod 256 (08 09 0A ... FE FF 00 01 ... FF).
|
||||
/// </summary>
|
||||
public byte[]? AscendingByteSequence { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A descending byte sequence equal to 255 minus the offset mod 256 (FF FE FD ... 00 FF DE ... 00).
|
||||
/// </summary>
|
||||
public byte[]? DescendingByteSequence { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with 00 (0b00000000) bytes.
|
||||
/// </summary>
|
||||
public byte[]? Filled00 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with FF (0b11111111) bytes.
|
||||
/// </summary>
|
||||
public byte[]? FilledFF { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with 0F (0b00001111) bytes.
|
||||
/// </summary>
|
||||
public byte[]? Filled0F { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with F0 (0b11110000) bytes.
|
||||
/// </summary>
|
||||
public byte[]? FilledF0 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with 55 (0b01010101) bytes.
|
||||
/// </summary>
|
||||
public byte[]? Filled55 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Filled with AA (0b10101010) bytes.
|
||||
/// </summary>
|
||||
public byte[]? FilledAA { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The final byte is 00 (0b00000000).
|
||||
/// </summary>
|
||||
public byte FinalByte { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("canOpen")]
|
||||
public class CanOpen
|
||||
{
|
||||
[XmlElement("extension")]
|
||||
public string[]? Extension { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("datURL")]
|
||||
public class DatUrl
|
||||
{
|
||||
[XmlAttribute("fileName")]
|
||||
public string? FileName { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string? Content { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("romCRC")]
|
||||
public class FileRomCRC
|
||||
{
|
||||
[XmlAttribute("extension")]
|
||||
public string? Extension { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string? Content { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("files")]
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("romCRC")]
|
||||
public FileRomCRC[]? RomCRC { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("gui")]
|
||||
public class GUI
|
||||
{
|
||||
[XmlElement("images")]
|
||||
public Images? Images { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("games")]
|
||||
public class Games
|
||||
{
|
||||
[XmlElement("game")]
|
||||
public Game[]? Game { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OfflineList
|
||||
{
|
||||
[XmlRoot("search")]
|
||||
public class Search
|
||||
{
|
||||
[XmlElement("to")]
|
||||
public To[]? To { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OpenMSX
|
||||
{
|
||||
[XmlRoot("original")]
|
||||
public class Original
|
||||
{
|
||||
/// <remarks>Boolean?</remarks>
|
||||
[XmlAttribute("value")]
|
||||
public string? Value { get; set; }
|
||||
|
||||
[XmlText]
|
||||
public string? Content { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.OpenMSX
|
||||
{
|
||||
[XmlRoot("softwaredb")]
|
||||
public class SoftwareDb
|
||||
{
|
||||
[XmlAttribute("timestamp")]
|
||||
public string? Timestamp { get; set; }
|
||||
|
||||
[XmlElement("software")]
|
||||
public Software[]? Software { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
namespace SabreTools.Models.PortableExecutable
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains information about each item in a menu resource that does not open a menu
|
||||
/// or a submenu. The structure definition provided here is for explanation only; it
|
||||
/// is not present in any standard header file.
|
||||
///
|
||||
/// Contains information about the menu items in a menu resource that open a menu
|
||||
/// or a submenu. The structure definition provided here is for explanation only;
|
||||
/// it is not present in any standard header file.
|
||||
/// </summary>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/normalmenuitem"/>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/popupmenuitem"/>
|
||||
public sealed class MenuItem
|
||||
{
|
||||
#region NORMALMENUITEM
|
||||
|
||||
/// <summary>
|
||||
/// The type of menu item.
|
||||
/// </summary>
|
||||
public MenuFlags NormalResInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A null-terminated Unicode string that contains the text for this menu item.
|
||||
/// There is no fixed limit on the size of this string.
|
||||
/// </summary>
|
||||
public string? NormalMenuText { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region POPUPMENUITEM
|
||||
|
||||
/// <summary>
|
||||
/// Describes the menu item.
|
||||
/// </summary>
|
||||
public MenuFlags PopupItemType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Describes the menu item.
|
||||
/// </summary>
|
||||
public MenuFlags PopupState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A numeric expression that identifies the menu item that is passed in the
|
||||
/// WM_COMMAND message.
|
||||
/// </summary>
|
||||
public uint PopupID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A set of bit flags that specify the type of menu item.
|
||||
/// </summary>
|
||||
public MenuFlags PopupResInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A null-terminated Unicode string that contains the text for this menu item.
|
||||
/// There is no fixed limit on the size of this string.
|
||||
/// </summary>
|
||||
public string? PopupMenuText { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
18
README.MD
18
README.MD
@@ -4,24 +4,6 @@ This library comprises of models that represent either directly serializable or
|
||||
|
||||
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Models).
|
||||
|
||||
In most completed models for serialization, there is a section that looks like the following:
|
||||
|
||||
```c#
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
```
|
||||
|
||||
This code should be removed before the models are used. This is only included during debugging and implementation as to ensure that there are no notable holes in the models that would disallow 1:1 replication of inputs.
|
||||
|
||||
## Missing Metadata Models
|
||||
|
||||
The following metadata file formats do not have models included in this library yet and, as such, do not have serializers:
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace SabreTools.Models.RomCenter
|
||||
{
|
||||
/// <remarks>[games]</remarks>
|
||||
public class Games
|
||||
{
|
||||
public Rom[]? Rom { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.3.0</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
<Description>Common models used by other SabreTools projects</Description>
|
||||
<Copyright>Copyright (c) Matt Nadareski 2022-2023</Copyright>
|
||||
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Models</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageTags>model models executable protection archive</PackageTags>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="README.md" Pack="true" PackagePath="" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Support for old .NET versions -->
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))">
|
||||
<PackageReference Include="MinValueTupleBridge" Version="0.2.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net4`))">
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Models", "SabreTools.Models.csproj", "{51F0D5D9-7C2B-445A-8ECD-4A47B33609C4}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Models", "SabreTools.Models\SabreTools.Models.csproj", "{51F0D5D9-7C2B-445A-8ECD-4A47B33609C4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.AACS
|
||||
{
|
||||
/// <summary>
|
||||
/// This record type is undocumented but found in real media key blocks
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CopyrightRecord : Record
|
||||
{
|
||||
/// <summary>
|
||||
/// Null-terminated ASCII string representing the copyright
|
||||
/// </summary>
|
||||
public string? Copyright { get; set; }
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
public string? Copyright;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.AACS
|
||||
{
|
||||
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class DriveRevocationListEntry
|
||||
{
|
||||
/// <summary>
|
||||
@@ -9,13 +12,14 @@ namespace SabreTools.Models.AACS
|
||||
/// field indicates that only one ID is being revoked, a value of one
|
||||
/// in the Range field indicates two ID’s are being revoked, and so on.
|
||||
/// </summary>
|
||||
public ushort Range { get; set; }
|
||||
public ushort Range;
|
||||
|
||||
/// <summary>
|
||||
/// A 6-byte Drive ID value identifying the Licensed Drive being revoked
|
||||
/// (or the first in a range of Licensed Drives being revoked, in the
|
||||
/// case of a non-zero Range value).
|
||||
/// </summary>
|
||||
public byte[]? DriveID { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public byte[]? DriveID;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.AACS
|
||||
{
|
||||
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class HostRevocationListEntry
|
||||
{
|
||||
/// <summary>
|
||||
@@ -9,13 +12,14 @@ namespace SabreTools.Models.AACS
|
||||
/// field indicates that only one ID is being revoked, a value of one
|
||||
/// in the Range field indicates two ID’s are being revoked, and so on.
|
||||
/// </summary>
|
||||
public ushort Range { get; set; }
|
||||
public ushort Range;
|
||||
|
||||
/// <summary>
|
||||
/// A 6-byte Host ID value identifying the host being revoked (or the
|
||||
/// first in a range of hosts being revoked, in the case of a non-zero
|
||||
/// Range value).
|
||||
/// </summary>
|
||||
public byte[]? HostID { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public byte[]? HostID;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.AACS
|
||||
{
|
||||
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class SubsetDifference
|
||||
{
|
||||
/// <summary>
|
||||
@@ -9,12 +12,12 @@ namespace SabreTools.Models.AACS
|
||||
/// the mask. For example, the value 0x01 denotes a mask of
|
||||
/// 0xFFFFFFFE; value 0x0A denotes a mask of 0xFFFFFC00.
|
||||
/// </summary>
|
||||
public byte Mask { get; set; }
|
||||
public byte Mask;
|
||||
|
||||
/// <summary>
|
||||
/// The last 4 bytes are the uv number, most significant
|
||||
/// byte first.
|
||||
/// </summary>
|
||||
public uint Number { get; set; }
|
||||
public uint Number;
|
||||
}
|
||||
}
|
||||
@@ -201,17 +201,5 @@ namespace SabreTools.Models.ArchiveDotOrg
|
||||
public string? Width { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyAttribute]
|
||||
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
[XmlAnyElement]
|
||||
public object[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
12
SabreTools.Models/ArchiveDotOrg/Files.cs
Normal file
12
SabreTools.Models/ArchiveDotOrg/Files.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.ArchiveDotOrg
|
||||
{
|
||||
[XmlRoot("files")]
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("file")]
|
||||
public File?[]? File { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -47,12 +47,5 @@ namespace SabreTools.Models.AttractMode
|
||||
public string? PlayedTime { get; set; }
|
||||
|
||||
public string? FileIsAvailable { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,13 @@ namespace SabreTools.Models.BDPlus
|
||||
/// <summary>
|
||||
/// "BDSVM_CC"
|
||||
/// </summary>
|
||||
/// <remarks>8 bytes</remarks>
|
||||
public string? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 5 bytes of unknown data
|
||||
/// Unknown data
|
||||
/// </summary>
|
||||
/// <remarks>5 bytes</remarks>
|
||||
public byte[]? Unknown1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -29,8 +31,9 @@ namespace SabreTools.Models.BDPlus
|
||||
public byte Day { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 4 bytes of unknown data
|
||||
/// Unknown data
|
||||
/// </summary>
|
||||
/// <remarks>4 bytes</remarks>
|
||||
public byte[]? Unknown2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -14,6 +14,6 @@
|
||||
/// <summary>
|
||||
/// Files
|
||||
/// </summary>
|
||||
public FileEntry?[]? Files { get; set; }
|
||||
public FileEntry[]? Files { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace SabreTools.Models.BFPK
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly byte[] SignatureBytes = new byte[] { 0x42, 0x46, 0x50, 0x4b };
|
||||
public static readonly byte[] SignatureBytes = [0x42, 0x46, 0x50, 0x4b];
|
||||
|
||||
public const string SignatureString = "BFPK";
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
namespace SabreTools.Models.BFPK
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BFPK
|
||||
{
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
/// <see cref="https://forum.xentax.com/viewtopic.php?t=5102"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// "BFPK"
|
||||
/// </summary>
|
||||
public string? Magic { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
|
||||
public string? Magic;
|
||||
|
||||
/// <summary>
|
||||
/// Version
|
||||
/// </summary>
|
||||
public int Version { get; set; }
|
||||
public int Version;
|
||||
|
||||
/// <summary>
|
||||
/// Files
|
||||
/// </summary>
|
||||
public int Files { get; set; }
|
||||
public int Files;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BMP
|
||||
{
|
||||
/// <summary>
|
||||
@@ -5,31 +7,32 @@ namespace SabreTools.Models.BMP
|
||||
/// and layout of a file that contains a DIB.
|
||||
/// </summary>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapfileheader"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BITMAPFILEHEADER
|
||||
{
|
||||
/// <summary>
|
||||
/// The file type; must be BM.
|
||||
/// </summary>
|
||||
public ushort Type { get; set; }
|
||||
public ushort Type;
|
||||
|
||||
/// <summary>
|
||||
/// The size, in bytes, of the bitmap file.
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
public uint Size;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved; must be zero.
|
||||
/// </summary>
|
||||
public ushort Reserved1 { get; set; }
|
||||
public ushort Reserved1;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved; must be zero.
|
||||
/// </summary>
|
||||
public ushort Reserved2 { get; set; }
|
||||
public ushort Reserved2;
|
||||
|
||||
/// <summary>
|
||||
/// The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
|
||||
/// </summary>
|
||||
public uint OffBits { get; set; }
|
||||
public uint OffBits;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BMP
|
||||
{
|
||||
/// <summary>
|
||||
/// The BITMAPINFOHEADER structure contains information about the dimensions and
|
||||
/// color format of a device-independent bitmap (DIB).
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BITMAPINFOHEADER
|
||||
{
|
||||
/// <summary>
|
||||
@@ -11,12 +14,12 @@ namespace SabreTools.Models.BMP
|
||||
/// not include the size of the color table or the size of the color masks,
|
||||
/// if they are appended to the end of structure.
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
public uint Size;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the width of the bitmap, in pixels.
|
||||
/// </summary>
|
||||
public int Width { get; set; }
|
||||
public int Width;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the height of the bitmap, in pixels.
|
||||
@@ -30,19 +33,19 @@ namespace SabreTools.Models.BMP
|
||||
/// or negative biHeight.
|
||||
/// - For compressed formats, biHeight must be positive, regardless of image orientation.
|
||||
/// </summary>
|
||||
public int Height { get; set; }
|
||||
public int Height;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of planes for the target device. This value must be set to 1.
|
||||
/// </summary>
|
||||
public ushort Planes { get; set; }
|
||||
public ushort Planes;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of bits per pixel (bpp). For uncompressed formats, this value
|
||||
/// is the average number of bits per pixel. For compressed formats, this value is the
|
||||
/// implied bit depth of the uncompressed image, after the image has been decoded.
|
||||
/// </summary>
|
||||
public ushort BitCount { get; set; }
|
||||
public ushort BitCount;
|
||||
|
||||
/// <summary>
|
||||
/// For compressed video and YUV formats, this member is a FOURCC code, specified as a
|
||||
@@ -59,36 +62,36 @@ namespace SabreTools.Models.BMP
|
||||
/// If biCompression equals BI_BITFIELDS, the format is either RGB 555 or RGB 565. Use
|
||||
/// the subtype GUID in the AM_MEDIA_TYPE structure to determine the specific RGB type.
|
||||
/// </summary>
|
||||
public uint Compression { get; set; }
|
||||
public uint Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed
|
||||
/// RGB bitmaps.
|
||||
/// </summary>
|
||||
public uint SizeImage { get; set; }
|
||||
public uint SizeImage;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the horizontal resolution, in pixels per meter, of the target device for
|
||||
/// the bitmap.
|
||||
/// </summary>
|
||||
public int XPelsPerMeter { get; set; }
|
||||
public int XPelsPerMeter;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the vertical resolution, in pixels per meter, of the target device for
|
||||
/// the bitmap.
|
||||
/// </summary>
|
||||
public int YPelsPerMeter { get; set; }
|
||||
public int YPelsPerMeter;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of color indices in the color table that are actually used by
|
||||
/// the bitmap.
|
||||
/// </summary>
|
||||
public uint ClrUsed { get; set; }
|
||||
public uint ClrUsed;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of color indices that are considered important for displaying
|
||||
/// the bitmap. If this value is zero, all colors are important.
|
||||
/// </summary>
|
||||
public uint ClrImportant { get; set; }
|
||||
public uint ClrImportant;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Version
|
||||
/// </summary>
|
||||
public uint Version { get; set; }
|
||||
public uint Version;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset
|
||||
/// </summary>
|
||||
public uint Offset { get; set; }
|
||||
public uint Offset;
|
||||
|
||||
/// <summary>
|
||||
/// Length
|
||||
/// </summary>
|
||||
public uint Length { get; set; }
|
||||
public uint Length;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ namespace SabreTools.Models.BSP
|
||||
/// <summary>
|
||||
/// Offsets
|
||||
/// </summary>
|
||||
/// <remarks>TextureCount entries</remarks>
|
||||
public uint[]? Offsets { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Models.CFB
|
||||
///
|
||||
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
|
||||
/// </remarks>
|
||||
public SectorNumber?[]? FATSectorNumbers { get; set; }
|
||||
public SectorNumber[]? FATSectorNumbers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The mini FAT is used to allocate space in the mini stream.
|
||||
@@ -38,7 +38,7 @@ namespace SabreTools.Models.CFB
|
||||
///
|
||||
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
|
||||
/// </remarks>
|
||||
public SectorNumber?[]? MiniFATSectorNumbers { get; set; }
|
||||
public SectorNumber[]? MiniFATSectorNumbers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The DIFAT array is used to represent storage of the FAT sectors.
|
||||
@@ -55,7 +55,7 @@ namespace SabreTools.Models.CFB
|
||||
/// If Header Major Version is 4, there MUST be 1,023 fields specified
|
||||
/// to fill a 4,096-byte sector minus the "Next DIFAT Sector Location" field.
|
||||
/// </remarks>
|
||||
public SectorNumber?[]? DIFATSectorNumbers { get; set; }
|
||||
public SectorNumber[]? DIFATSectorNumbers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The directory entry array is an array of directory entries that
|
||||
@@ -87,6 +87,6 @@ namespace SabreTools.Models.CFB
|
||||
/// all zeroes. The Modified Time field in the root storage directory
|
||||
/// entry MAY be all zeroes.
|
||||
/// <remarks>
|
||||
public DirectoryEntry?[]? DirectoryEntries { get; set; }
|
||||
public DirectoryEntry[]? DirectoryEntries { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace SabreTools.Models.CFB
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly byte[] SignatureBytes = new byte[] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 };
|
||||
public static readonly byte[] SignatureBytes = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];
|
||||
|
||||
public const ulong SignatureUInt64 = 0xE11AB1A1E011CFD0;
|
||||
|
||||
@@ -15,17 +15,17 @@ namespace SabreTools.Models.CFB
|
||||
/// <summary>
|
||||
/// Installer Package (msi), Merge Module (msm), Patch Creation Properties (pcp)
|
||||
/// </summary>
|
||||
public static readonly Guid InstallerPackage = new Guid("000c1084-0000-0000-c000-000000000046");
|
||||
public static readonly Guid InstallerPackage = new("000c1084-0000-0000-c000-000000000046");
|
||||
|
||||
/// <summary>
|
||||
/// Patch Package (msp)
|
||||
/// </summary>
|
||||
public static readonly Guid PatchPackage = new Guid("000C1086-0000-0000-C000-000000000046");
|
||||
public static readonly Guid PatchPackage = new("000C1086-0000-0000-C000-000000000046");
|
||||
|
||||
/// <summary>
|
||||
/// Transform (mst)
|
||||
/// </summary>
|
||||
public static readonly Guid Transform = new Guid("000C1082-0000-0000-C000-000000000046");
|
||||
public static readonly Guid Transform = new("000C1082-0000-0000-C000-000000000046");
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -35,17 +35,17 @@ namespace SabreTools.Models.CFB
|
||||
/// <summary>
|
||||
/// The Summary Information Property Set
|
||||
/// </summary>
|
||||
public static readonly Guid FMTID_SummaryInformation = new Guid("F29F85E0-4FF9-1068-AB91-08002B27B3D9");
|
||||
public static readonly Guid FMTID_SummaryInformation = new("F29F85E0-4FF9-1068-AB91-08002B27B3D9");
|
||||
|
||||
/// <summary>
|
||||
/// The DocumentSummaryInformation and UserDefined Property Sets
|
||||
/// </summary>
|
||||
public static readonly Guid FMTID_DocSummaryInformation = new Guid("D5CDD502-2E9C-101B-9397-08002B2CF9AE");
|
||||
public static readonly Guid FMTID_DocSummaryInformation = new("D5CDD502-2E9C-101B-9397-08002B2CF9AE");
|
||||
|
||||
/// <summary>
|
||||
/// The DocumentSummaryInformation and UserDefined Property Sets
|
||||
/// </summary>
|
||||
public static readonly Guid FMTID_UserDefinedProperties = new Guid("D5CDD505-2E9C-101B-9397-08002B2CF9AE");
|
||||
public static readonly Guid FMTID_UserDefinedProperties = new("D5CDD505-2E9C-101B-9397-08002B2CF9AE");
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CFB
|
||||
{
|
||||
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public sealed class DirectoryEntry
|
||||
{
|
||||
/// <summary>
|
||||
@@ -16,13 +18,15 @@ namespace SabreTools.Models.CFB
|
||||
/// The following characters are illegal and MUST NOT be part of the
|
||||
/// name: '/', '\', ':', '!'.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
/// <remarks>64 bytes</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
|
||||
public string? Name;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be 0x00, 0x01, 0x02, or 0x05, depending on the
|
||||
/// actual type of object. All other values are not valid.
|
||||
/// </summary>
|
||||
public ushort NameLength { get; set; }
|
||||
public ushort NameLength;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST match the length of the Directory Entry Name Unicode
|
||||
@@ -30,31 +34,36 @@ namespace SabreTools.Models.CFB
|
||||
/// terminating null character in the count. This length MUST NOT exceed 64,
|
||||
/// the maximum size of the Directory Entry Name field.
|
||||
/// </summary>
|
||||
public ObjectType ObjectType { get; set; }
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public ObjectType ObjectType;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be 0x00 (red) or 0x01 (black). All other values are not valid.
|
||||
/// </summary>
|
||||
public ColorFlag ColorFlag { get; set; }
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public ColorFlag ColorFlag;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the stream ID of the left sibling. If there
|
||||
/// is no left sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF).
|
||||
/// </summary>
|
||||
public StreamID LeftSiblingID { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public StreamID LeftSiblingID;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the stream ID of the right sibling. If there
|
||||
/// is no right sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF).
|
||||
/// </summary>
|
||||
public StreamID RightSiblingID { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public StreamID RightSiblingID;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the stream ID of a child object. If there is no
|
||||
/// child object, including all entries for stream objects, the field
|
||||
/// MUST be set to NOSTREAM (0xFFFFFFFF).
|
||||
/// </summary>
|
||||
public StreamID ChildID { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public StreamID ChildID;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains an object class GUID, if this entry is for a
|
||||
@@ -67,7 +76,7 @@ namespace SabreTools.Models.CFB
|
||||
/// this value is not all zeroes, the object class GUID can be used as a
|
||||
/// parameter to start applications.
|
||||
/// </summary>
|
||||
public Guid CLSID { get; set; }
|
||||
public Guid CLSID;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the user-defined flags if this entry is for a storage
|
||||
@@ -78,7 +87,7 @@ namespace SabreTools.Models.CFB
|
||||
/// objects without explicitly setting state bits, it MUST write all zeroes
|
||||
/// by default.
|
||||
/// </summary>
|
||||
public uint StateBits { get; set; }
|
||||
public uint StateBits;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the creation time for a storage object, or all zeroes
|
||||
@@ -88,7 +97,7 @@ namespace SabreTools.Models.CFB
|
||||
/// object, this field MUST be all zeroes, and the creation time is retrieved
|
||||
/// or set on the compound file itself.
|
||||
/// </summary>
|
||||
public ulong CreationTime { get; set; }
|
||||
public ulong CreationTime;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the modification time for a storage object, or all
|
||||
@@ -98,7 +107,7 @@ namespace SabreTools.Models.CFB
|
||||
/// storage object, this field MAY<2> be set to all zeroes, and the modified
|
||||
/// time is retrieved or set on the compound file itself.
|
||||
/// </summary>
|
||||
public ulong ModifiedTime { get; set; }
|
||||
public ulong ModifiedTime;
|
||||
|
||||
/// <summary>
|
||||
/// This field contains the first sector location if this is a stream object.
|
||||
@@ -106,7 +115,7 @@ namespace SabreTools.Models.CFB
|
||||
/// mini stream, if the mini stream exists. For a storage object, this field MUST
|
||||
/// be set to all zeroes.
|
||||
/// </summary>
|
||||
public uint StartingSectorLocation { get; set; }
|
||||
public uint StartingSectorLocation;
|
||||
|
||||
/// <summary>
|
||||
/// This 64-bit integer field contains the size of the user-defined data if this
|
||||
@@ -128,6 +137,6 @@ namespace SabreTools.Models.CFB
|
||||
/// unless there is a specific reason to do otherwise (for example, a parser whose
|
||||
/// purpose is to verify the correctness of a compound file).
|
||||
/// </remarks>
|
||||
public ulong StreamSize { get; set; }
|
||||
public ulong StreamSize;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,40 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CFB
|
||||
{
|
||||
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class FileHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Iddentification signature for the compound file structure, and MUST be
|
||||
/// set to the value 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1.
|
||||
/// </summary>
|
||||
public ulong Signature { get; set; }
|
||||
public ulong Signature;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved and unused class ID that MUST be set to all zeroes (CLSID_NULL)
|
||||
/// </summary>
|
||||
public Guid CLSID { get; set; }
|
||||
public Guid CLSID;
|
||||
|
||||
/// <summary>
|
||||
/// Version number for nonbreaking changes. This field SHOULD be set to
|
||||
/// 0x003E if the major version field is either 0x0003 or 0x0004.
|
||||
/// </summary>
|
||||
public ushort MinorVersion { get; set; }
|
||||
public ushort MinorVersion;
|
||||
|
||||
/// <summary>
|
||||
/// Version number for breaking changes. This field MUST be set to either
|
||||
/// 0x0003 (version 3) or 0x0004 (version 4).
|
||||
/// </summary>
|
||||
public ushort MajorVersion { get; set; }
|
||||
public ushort MajorVersion;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be set to 0xFFFE. This field is a byte order mark for
|
||||
/// all integer fields, specifying little-endian byte order.
|
||||
/// </summary>
|
||||
public ushort ByteOrder { get; set; }
|
||||
public ushort ByteOrder;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be set to 0x0009, or 0x000c, depending on the Major
|
||||
@@ -45,19 +47,21 @@ namespace SabreTools.Models.CFB
|
||||
/// If Major Version is 4, the Sector Shift MUST be 0x000C, specifying a
|
||||
/// sector size of 4096 bytes.
|
||||
/// </summary>
|
||||
public ushort SectorShift { get; set; }
|
||||
public ushort SectorShift;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be set to 0x0006. This field specifies the sector size
|
||||
/// of the Mini Stream as a power of 2. The sector size of the Mini Stream
|
||||
/// MUST be 64 bytes.
|
||||
/// </summary>
|
||||
public ushort MiniSectorShift { get; set; }
|
||||
public ushort MiniSectorShift;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be set to all zeroes.
|
||||
/// </summary>
|
||||
public byte[]? Reserved { get; set; }
|
||||
/// <remarks>6 bytes</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public byte[]? Reserved;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the count of the number of directory sectors
|
||||
@@ -66,18 +70,18 @@ namespace SabreTools.Models.CFB
|
||||
/// If Major Version is 3, the Number of Directory Sectors MUST be zero. This
|
||||
/// field is not supported for version 3 compound files.
|
||||
/// </summary>
|
||||
public uint NumberOfDirectorySectors { get; set; }
|
||||
public uint NumberOfDirectorySectors;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the count of the number of FAT sectors in the
|
||||
/// compound file.
|
||||
/// </summary>
|
||||
public uint NumberOfFATSectors { get; set; }
|
||||
public uint NumberOfFATSectors;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the starting sector number for the directory stream.
|
||||
/// </summary>
|
||||
public uint FirstDirectorySectorLocation { get; set; }
|
||||
public uint FirstDirectorySectorLocation;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field MAY contain a sequence number that is incremented every time
|
||||
@@ -85,7 +89,7 @@ namespace SabreTools.Models.CFB
|
||||
/// This is the field that MUST be set to all zeroes if file transactions are not
|
||||
/// implemented.
|
||||
/// </summary>
|
||||
public uint TransactionSignatureNumber { get; set; }
|
||||
public uint TransactionSignatureNumber;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field MUST be set to 0x00001000. This field specifies the maximum
|
||||
@@ -94,34 +98,36 @@ namespace SabreTools.Models.CFB
|
||||
/// greater than or equal to this cutoff size must be allocated as normal sectors from
|
||||
/// the FAT.
|
||||
/// </summary>
|
||||
public uint MiniStreamCutoffSize { get; set; }
|
||||
public uint MiniStreamCutoffSize;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the starting sector number for the mini FAT.
|
||||
/// </summary>
|
||||
public uint FirstMiniFATSectorLocation { get; set; }
|
||||
public uint FirstMiniFATSectorLocation;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the count of the number of mini FAT sectors in the
|
||||
/// compound file.
|
||||
/// </summary>
|
||||
public uint NumberOfMiniFATSectors { get; set; }
|
||||
public uint NumberOfMiniFATSectors;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the starting sector number for the DIFAT.
|
||||
/// </summary>
|
||||
public uint FirstDIFATSectorLocation { get; set; }
|
||||
public uint FirstDIFATSectorLocation;
|
||||
|
||||
/// <summary>
|
||||
/// This integer field contains the count of the number of DIFAT sectors in the
|
||||
/// compound file.
|
||||
/// </summary>
|
||||
public uint NumberOfDIFATSectors { get; set; }
|
||||
public uint NumberOfDIFATSectors;
|
||||
|
||||
/// <summary>
|
||||
/// This array of 32-bit integer fields contains the first 109 FAT sector
|
||||
/// locations of the compound file
|
||||
/// </summary>
|
||||
public SectorNumber?[]? DIFAT { get; set; }
|
||||
/// <remarks>109 entries</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 109)]
|
||||
public SectorNumber[]? DIFAT;
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Models.CFB
|
||||
/// Properties
|
||||
/// </summary>
|
||||
/// <remarks>Each Variant might be followed by an index and offset value</remarks>
|
||||
public Variant?[]? Properties { get; set; }
|
||||
public Variant[]? Properties { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,28 +1,31 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public class CompressedMapEntryV5
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CompressedMapEntryV5
|
||||
{
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
public byte Compression { get; set; }
|
||||
public byte Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Compressed length
|
||||
/// </summary>
|
||||
/// <remarks>Actually UInt24</remarks>
|
||||
public uint CompLength { get; set; }
|
||||
public uint CompLength;
|
||||
|
||||
/// <summary>
|
||||
/// Offset
|
||||
/// </summary>
|
||||
/// <remarks>Actually UInt48</remarks>
|
||||
public ulong Offset { get; set; }
|
||||
public ulong Offset;
|
||||
|
||||
/// <summary>
|
||||
/// CRC-16 of the data
|
||||
/// </summary>
|
||||
public ushort CRC { get; set; }
|
||||
public ushort CRC;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,45 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public class CompressedMapHeaderV5
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CompressedMapHeaderV5
|
||||
{
|
||||
/// <summary>
|
||||
/// Length of compressed map
|
||||
/// </summary>
|
||||
public uint Length { get; set; }
|
||||
public uint Length;
|
||||
|
||||
/// <summary>
|
||||
/// Offset of first block
|
||||
/// </summary>
|
||||
/// <remarks>Actually UInt48</remarks>
|
||||
public ulong DataStart { get; set; }
|
||||
public ulong DataStart;
|
||||
|
||||
/// <summary>
|
||||
/// CRC-16 of the map
|
||||
/// </summary>
|
||||
public ushort CRC { get; set; }
|
||||
public ushort CRC;
|
||||
|
||||
/// <summary>
|
||||
/// Bits used to encode complength
|
||||
/// </summary>
|
||||
public byte LengthBits { get; set; }
|
||||
public byte LengthBits;
|
||||
|
||||
/// <summary>
|
||||
/// Bits used to encode self-refs
|
||||
/// </summary>
|
||||
public byte HunkBits { get; set; }
|
||||
public byte HunkBits;
|
||||
|
||||
/// <summary>
|
||||
/// Bits used to encode parent unit refs
|
||||
/// </summary>
|
||||
public byte ParentUnitBits { get; set; }
|
||||
public byte ParentUnitBits;
|
||||
|
||||
/// <summary>
|
||||
/// Future use
|
||||
/// </summary>
|
||||
public byte Reserved { get; set; }
|
||||
public byte Reserved;
|
||||
}
|
||||
}
|
||||
23
SabreTools.Models/CHD/Constants.cs
Normal file
23
SabreTools.Models/CHD/Constants.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string SignatureString = "MComprHD";
|
||||
|
||||
#region Header Sizes
|
||||
|
||||
public const int HeaderV1Size = 76;
|
||||
public const int HeaderV2Size = 80;
|
||||
public const int HeaderV3Size = 120;
|
||||
public const int HeaderV4Size = 108;
|
||||
public const int HeaderV5Size = 124;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Metadata Parameters
|
||||
|
||||
public const uint CHDMETAINDEX_APPEND = uint.MaxValue;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
358
SabreTools.Models/CHD/Enums.cs
Normal file
358
SabreTools.Models/CHD/Enums.cs
Normal file
@@ -0,0 +1,358 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chdcodec.h"/>
|
||||
public enum AVHuffCodec
|
||||
{
|
||||
DECOMPRESS_CONFIG = 1,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chdcodec.h"/>
|
||||
public enum CodecType : uint
|
||||
{
|
||||
CHD_CODEC_NONE = 0,
|
||||
|
||||
#region General Codecs
|
||||
|
||||
/// <remarks>"zlib"</remarks>
|
||||
ZLIB = 0x7a6c6962,
|
||||
|
||||
/// <remarks>"zstd"</remarks>
|
||||
ZSTD = 0x7a737464,
|
||||
|
||||
/// <remarks>"lzma"</remarks>
|
||||
LZMA = 0x6c7a6d61,
|
||||
|
||||
/// <remarks>"huff"</remarks>
|
||||
HUFFMAN = 0x68756666,
|
||||
|
||||
/// <remarks>"flac"</remarks>
|
||||
FLAC = 0x666c6163,
|
||||
|
||||
#endregion
|
||||
|
||||
#region General Codecs with CD Frontend
|
||||
|
||||
/// <remarks>"cdzl"</remarks>
|
||||
CD_ZLIB = 0x63647a6c,
|
||||
|
||||
/// <remarks>"cdzs"</remarks>
|
||||
CD_ZSTD = 0x63647a73,
|
||||
|
||||
/// <remarks>"cdlz"</remarks>
|
||||
CD_LZMA = 0x63646c7a,
|
||||
|
||||
/// <remarks>"cdfl"</remarks>
|
||||
CD_FLAC = 0x6364666c,
|
||||
|
||||
#endregion
|
||||
|
||||
#region A/V Codecs
|
||||
|
||||
/// <remarks>"avhu"</remarks>
|
||||
AVHUFF = 0x61766875,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pseudo-Codecs Returned by hunk_info
|
||||
|
||||
/// <summary>
|
||||
/// Copy of another hunk
|
||||
/// </summary>
|
||||
CHD_CODEC_SELF = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Copy of a parent's hunk
|
||||
/// </summary>
|
||||
CHD_CODEC_PARENT = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Legacy "mini" 8-byte repeat
|
||||
/// </summary>
|
||||
CHD_CODEC_MINI = 3,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public enum CompressionType : uint
|
||||
{
|
||||
#region V1
|
||||
|
||||
CHDCOMPRESSION_NONE = 0,
|
||||
CHDCOMPRESSION_ZLIB = 1,
|
||||
|
||||
#endregion
|
||||
|
||||
#region V3
|
||||
|
||||
CHDCOMPRESSION_ZLIB_PLUS = 2,
|
||||
|
||||
#endregion
|
||||
|
||||
#region V4
|
||||
|
||||
CHDCOMPRESSION_AV = 3,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public enum Error : uint
|
||||
{
|
||||
NO_INTERFACE = 1,
|
||||
NOT_OPEN,
|
||||
ALREADY_OPEN,
|
||||
INVALID_FILE,
|
||||
INVALID_DATA,
|
||||
REQUIRES_PARENT,
|
||||
FILE_NOT_WRITEABLE,
|
||||
CODEC_ERROR,
|
||||
INVALID_PARENT,
|
||||
HUNK_OUT_OF_RANGE,
|
||||
DECOMPRESSION_ERROR,
|
||||
COMPRESSION_ERROR,
|
||||
CANT_VERIFY,
|
||||
METADATA_NOT_FOUND,
|
||||
INVALID_METADATA_SIZE,
|
||||
UNSUPPORTED_VERSION,
|
||||
VERIFY_INCOMPLETE,
|
||||
INVALID_METADATA,
|
||||
INVALID_STATE,
|
||||
OPERATION_PENDING,
|
||||
UNSUPPORTED_FORMAT,
|
||||
UNKNOWN_COMPRESSION,
|
||||
WALKING_PARENT,
|
||||
COMPRESSING
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[Flags]
|
||||
public enum Flags : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Set if this drive has a parent
|
||||
/// </summary>
|
||||
DriveHasParent = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// Set if this drive allows writes
|
||||
/// </summary>
|
||||
DriveAllowsWrites = 0x00000002,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[Flags]
|
||||
public enum MetadataFlags : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates data is checksummed
|
||||
/// </summary>
|
||||
CHD_MDFLAGS_CHECKSUM = 0x01,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public enum MetadataTag : uint
|
||||
{
|
||||
CHDMETATAG_WILDCARD = 0,
|
||||
|
||||
#region Hard Disk
|
||||
|
||||
/// <summary>
|
||||
/// Standard hard disk metadata
|
||||
/// </summary>
|
||||
/// <remarks>"GDDD"</remarks>
|
||||
HARD_DISK_METADATA_TAG = 0x47444444,
|
||||
|
||||
/// <summary>
|
||||
/// Hard disk identify information
|
||||
/// </summary>
|
||||
/// <remarks>"IDNT"</remarks>
|
||||
HARD_DISK_IDENT_METADATA_TAG = 0x49444e54,
|
||||
|
||||
/// <summary>
|
||||
/// Hard disk key information
|
||||
/// </summary>
|
||||
/// <remarks>"KEY "</remarks>
|
||||
HARD_DISK_KEY_METADATA_TAG = 0x4b455920,
|
||||
|
||||
#endregion
|
||||
|
||||
#region PCMCIA
|
||||
|
||||
/// <summary>
|
||||
/// PCMCIA CIS information
|
||||
/// </summary>
|
||||
/// <remarks>"CIS "</remarks>
|
||||
PCMCIA_CIS_METADATA_TAG = 0x43495320,
|
||||
|
||||
#endregion
|
||||
|
||||
#region CD-ROM
|
||||
|
||||
/// <remarks>"CHCD"</remarks>
|
||||
CDROM_OLD_METADATA_TAG = 0x43484344,
|
||||
|
||||
/// <remarks>"CHTR"</remarks>
|
||||
CDROM_TRACK_METADATA_TAG = 0x43485452,
|
||||
|
||||
/// <remarks>"CHT2"</remarks>
|
||||
CDROM_TRACK_METADATA2_TAG = 0x43485432,
|
||||
|
||||
#endregion
|
||||
|
||||
#region GD-ROM
|
||||
|
||||
/// <remarks>"CHGT"</remarks>
|
||||
GDROM_OLD_METADATA_TAG = 0x43484754,
|
||||
|
||||
/// <remarks>"CHGD"</remarks>
|
||||
GDROM_TRACK_METADATA_TAG = 0x43484744,
|
||||
|
||||
#endregion
|
||||
|
||||
#region DVD
|
||||
|
||||
/// <summary>
|
||||
/// Standard DVD metadata
|
||||
/// </summary>
|
||||
/// <remarks>"DVD "</remarks>
|
||||
DVD_METADATA_TAG = 0x44564420,
|
||||
|
||||
#endregion
|
||||
|
||||
#region A/V
|
||||
|
||||
/// <summary>
|
||||
/// Standard A/V metadata
|
||||
/// </summary>
|
||||
/// <remarks>"AVAV"</remarks>
|
||||
AV_METADATA_TAG = 0x41564156,
|
||||
|
||||
/// <summary>
|
||||
/// A/V laserdisc frame metadata
|
||||
/// </summary>
|
||||
/// <remarks>"AVLD"</remarks>
|
||||
AV_LD_METADATA_TAG = 0x41564c44,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.cpp"/>
|
||||
public enum V34EntryType : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Invalid type
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_INVALID = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Standard compression
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_COMPRESSED = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Uncompressed data
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_UNCOMPRESSED = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Mini: use offset as raw data
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_MINI = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Same as another hunk in this file
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_SELF_HUNK = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Same as a hunk in the parent file
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_PARENT_HUNK = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Compressed with secondary algorithm (usually FLAC CDDA)
|
||||
/// </summary>
|
||||
V34_MAP_ENTRY_TYPE_2ND_COMPRESSED = 6,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.cpp"/>
|
||||
public enum V5CompressionType : uint
|
||||
{
|
||||
// These types are live when running
|
||||
|
||||
/// <summary>
|
||||
/// Codec #0
|
||||
/// </summary>
|
||||
COMPRESSION_TYPE_0 = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Codec #1
|
||||
/// </summary>
|
||||
COMPRESSION_TYPE_1 = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Codec #2
|
||||
/// </summary>
|
||||
COMPRESSION_TYPE_2 = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Codec #3
|
||||
/// </summary>
|
||||
COMPRESSION_TYPE_3 = 3,
|
||||
|
||||
/// <summary>
|
||||
/// No compression; implicit length = hunkbytes
|
||||
/// </summary>
|
||||
COMPRESSION_NONE = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Same as another block in this CHD
|
||||
/// </summary>
|
||||
COMPRESSION_SELF = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Same as a hunk's worth of units in the parent CHD
|
||||
/// </summary>
|
||||
COMPRESSION_PARENT = 6,
|
||||
|
||||
// These additional pseudo-types are used for compressed encodings
|
||||
|
||||
/// <summary>
|
||||
/// Start of small RLE run (4-bit length)
|
||||
/// </summary>
|
||||
COMPRESSION_RLE_SMALL,
|
||||
|
||||
/// <summary>
|
||||
/// Start of large RLE run (8-bit length)
|
||||
/// </summary>
|
||||
COMPRESSION_RLE_LARGE,
|
||||
|
||||
/// <summary>
|
||||
/// Same as the last COMPRESSION_SELF block
|
||||
/// </summary>
|
||||
COMPRESSION_SELF_0,
|
||||
|
||||
/// <summary>
|
||||
/// Same as the last COMPRESSION_SELF block + 1
|
||||
/// </summary>
|
||||
COMPRESSION_SELF_1,
|
||||
|
||||
/// <summary>
|
||||
/// Same block in the parent
|
||||
/// </summary>
|
||||
COMPRESSION_PARENT_SELF,
|
||||
|
||||
/// <summary>
|
||||
/// Same as the last COMPRESSION_PARENT block
|
||||
/// </summary>
|
||||
COMPRESSION_PARENT_0,
|
||||
|
||||
/// <summary>
|
||||
/// Same as the last COMPRESSION_PARENT block + 1
|
||||
/// </summary>
|
||||
COMPRESSION_PARENT_1
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,25 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public abstract class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// 'MComprHD'
|
||||
/// </summary>
|
||||
public string? Tag { get; set; }
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public string? Tag;
|
||||
|
||||
/// <summary>
|
||||
/// Length of header (including tag and length fields)
|
||||
/// </summary>
|
||||
public uint Length { get; set; }
|
||||
public uint Length;
|
||||
|
||||
/// <summary>
|
||||
/// Drive format version
|
||||
/// </summary>
|
||||
public uint Version { get; set; }
|
||||
public uint Version;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +1,58 @@
|
||||
namespace SabreTools.Models.CHD
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public class HeaderV1 : Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Flags
|
||||
/// </summary>
|
||||
public Flags Flags { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public Flags Flags;
|
||||
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
public CompressionType Compression { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public CompressionType Compression;
|
||||
|
||||
/// <summary>
|
||||
/// 512-byte sectors per hunk
|
||||
/// </summary>
|
||||
public uint HunkSize { get; set; }
|
||||
public uint HunkSize;
|
||||
|
||||
/// <summary>
|
||||
/// Total # of hunks represented
|
||||
/// </summary>
|
||||
public uint TotalHunks { get; set; }
|
||||
public uint TotalHunks;
|
||||
|
||||
/// <summary>
|
||||
/// Number of cylinders on hard disk
|
||||
/// </summary>
|
||||
public uint Cylinders { get; set; }
|
||||
public uint Cylinders;
|
||||
|
||||
/// <summary>
|
||||
/// Number of heads on hard disk
|
||||
/// </summary>
|
||||
public uint Heads { get; set; }
|
||||
public uint Heads;
|
||||
|
||||
/// <summary>
|
||||
/// Number of sectors on hard disk
|
||||
/// </summary>
|
||||
public uint Sectors { get; set; }
|
||||
public uint Sectors;
|
||||
|
||||
/// <summary>
|
||||
/// MD5 checksum of raw data
|
||||
/// </summary>
|
||||
public byte[]? MD5 { get; set; } = new byte[16];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[] MD5 = new byte[16];
|
||||
|
||||
/// <summary>
|
||||
/// MD5 checksum of parent file
|
||||
/// </summary>
|
||||
public byte[]? ParentMD5 { get; set; } = new byte[16];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[] ParentMD5 = new byte[16];
|
||||
}
|
||||
}
|
||||
@@ -1,56 +1,63 @@
|
||||
namespace SabreTools.Models.CHD
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public class HeaderV2 : Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Flags
|
||||
/// </summary>
|
||||
public Flags Flags { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public Flags Flags;
|
||||
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
public CompressionType Compression { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public CompressionType Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Seclen-byte sectors per hunk
|
||||
/// </summary>
|
||||
public uint HunkSize { get; set; }
|
||||
public uint HunkSize;
|
||||
|
||||
/// <summary>
|
||||
/// Total # of hunks represented
|
||||
/// </summary>
|
||||
public uint TotalHunks { get; set; }
|
||||
public uint TotalHunks;
|
||||
|
||||
/// <summary>
|
||||
/// Number of cylinders on hard disk
|
||||
/// </summary>
|
||||
public uint Cylinders { get; set; }
|
||||
public uint Cylinders;
|
||||
|
||||
/// <summary>
|
||||
/// Number of heads on hard disk
|
||||
/// </summary>
|
||||
public uint Heads { get; set; }
|
||||
public uint Heads;
|
||||
|
||||
/// <summary>
|
||||
/// Number of sectors on hard disk
|
||||
/// </summary>
|
||||
public uint Sectors { get; set; }
|
||||
public uint Sectors;
|
||||
|
||||
/// <summary>
|
||||
/// MD5 checksum of raw data
|
||||
/// </summary>
|
||||
public byte[]? MD5 { get; set; } = new byte[16];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[]? MD5 = new byte[16];
|
||||
|
||||
/// <summary>
|
||||
/// MD5 checksum of parent file
|
||||
/// </summary>
|
||||
public byte[]? ParentMD5 { get; set; } = new byte[16];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[]? ParentMD5 = new byte[16];
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes per sector
|
||||
/// </summary>
|
||||
public uint BytesPerSector { get; set; }
|
||||
public uint BytesPerSector;
|
||||
}
|
||||
}
|
||||
@@ -1,56 +1,65 @@
|
||||
namespace SabreTools.Models.CHD
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public class HeaderV3 : Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Flags
|
||||
/// </summary>
|
||||
public Flags Flags { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public Flags Flags;
|
||||
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
public CompressionType Compression { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public CompressionType Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Total # of hunks represented
|
||||
/// </summary>
|
||||
public uint TotalHunks { get; set; }
|
||||
public uint TotalHunks;
|
||||
|
||||
/// <summary>
|
||||
/// Logical size of the data (in bytes)
|
||||
/// </summary>
|
||||
public ulong LogicalBytes { get; set; }
|
||||
public ulong LogicalBytes;
|
||||
|
||||
/// <summary>
|
||||
/// Offset to the first blob of metadata
|
||||
/// </summary>
|
||||
public ulong MetaOffset { get; set; }
|
||||
public ulong MetaOffset;
|
||||
|
||||
/// <summary>
|
||||
/// MD5 checksum of raw data
|
||||
/// </summary>
|
||||
public byte[]? MD5 { get; set; } = new byte[16];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[]? MD5 = new byte[16];
|
||||
|
||||
/// <summary>
|
||||
/// MD5 checksum of parent file
|
||||
/// </summary>
|
||||
public byte[]? ParentMD5 { get; set; } = new byte[16];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[]? ParentMD5 = new byte[16];
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes per hunk
|
||||
/// </summary>
|
||||
public uint HunkBytes { get; set; }
|
||||
public uint HunkBytes;
|
||||
|
||||
/// <summary>
|
||||
/// SHA1 checksum of raw data
|
||||
/// </summary>
|
||||
public byte[]? SHA1 { get; set; } = new byte[20];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
||||
public byte[]? SHA1 = new byte[20];
|
||||
|
||||
/// <summary>
|
||||
/// SHA1 checksum of parent file
|
||||
/// </summary>
|
||||
public byte[]? ParentSHA1 { get; set; } = new byte[20];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
||||
public byte[]? ParentSHA1 = new byte[20];
|
||||
}
|
||||
}
|
||||
@@ -1,51 +1,59 @@
|
||||
namespace SabreTools.Models.CHD
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public class HeaderV4 : Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Flags
|
||||
/// </summary>
|
||||
public Flags Flags { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public Flags Flags;
|
||||
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
public CompressionType Compression { get; set; }
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public CompressionType Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Total # of hunks represented
|
||||
/// </summary>
|
||||
public uint TotalHunks { get; set; }
|
||||
public uint TotalHunks;
|
||||
|
||||
/// <summary>
|
||||
/// Logical size of the data (in bytes)
|
||||
/// </summary>
|
||||
public ulong LogicalBytes { get; set; }
|
||||
public ulong LogicalBytes;
|
||||
|
||||
/// <summary>
|
||||
/// Offset to the first blob of metadata
|
||||
/// </summary>
|
||||
public ulong MetaOffset { get; set; }
|
||||
public ulong MetaOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes per hunk
|
||||
/// </summary>
|
||||
public uint HunkBytes { get; set; }
|
||||
public uint HunkBytes;
|
||||
|
||||
/// <summary>
|
||||
/// Combined raw+meta SHA1
|
||||
/// </summary>
|
||||
public byte[]? SHA1 { get; set; } = new byte[20];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
||||
public byte[]? SHA1 = new byte[20];
|
||||
|
||||
/// <summary>
|
||||
/// Combined raw+meta SHA1 of parent
|
||||
/// </summary>
|
||||
public byte[]? ParentSHA1 { get; set; } = new byte[20];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
||||
public byte[]? ParentSHA1 = new byte[20];
|
||||
|
||||
/// <summary>
|
||||
/// Raw data SHA1
|
||||
/// </summary>
|
||||
public byte[]? RawSHA1 { get; set; } = new byte[20];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
||||
public byte[]? RawSHA1 = new byte[20];
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
namespace SabreTools.Models.CHD
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public class HeaderV5 : Header
|
||||
{
|
||||
/// <summary>
|
||||
/// Which custom compressors are used?
|
||||
/// </summary>
|
||||
public uint[] Compressors { get; set; } = new uint[4];
|
||||
public CodecType[] Compressors { get; set; } = new CodecType[4];
|
||||
|
||||
/// <summary>
|
||||
/// Logical size of the data (in bytes)
|
||||
@@ -1,16 +1,19 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public class MapV1
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class MapV1
|
||||
{
|
||||
/// <summary>
|
||||
/// Starting offset within the file
|
||||
/// </summary>
|
||||
public ulong StartingOffset { get; set; }
|
||||
public ulong StartingOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Length of data; If == hunksize, data is uncompressed
|
||||
/// </summary>
|
||||
public ulong Length { get; set; }
|
||||
public ulong Length;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,34 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
public class MapV3
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class MapV3
|
||||
{
|
||||
/// <summary>
|
||||
/// Starting offset within the file
|
||||
/// </summary>
|
||||
public ulong StartingOffset { get; set; }
|
||||
public ulong StartingOffset;
|
||||
|
||||
/// <summary>
|
||||
/// 32-bit CRC of the uncompressed data
|
||||
/// </summary>
|
||||
public uint CRC32 { get; set; }
|
||||
public uint CRC32;
|
||||
|
||||
/// <summary>
|
||||
/// Lower 16 bits of length
|
||||
/// </summary>
|
||||
public ushort LengthLo { get; set; }
|
||||
public ushort LengthLo;
|
||||
|
||||
/// <summary>
|
||||
/// Upper 8 bits of length
|
||||
/// </summary>
|
||||
public byte LengthHi { get; set; }
|
||||
public byte LengthHi;
|
||||
|
||||
/// <summary>
|
||||
/// Flags, indicating compression info
|
||||
/// </summary>
|
||||
public byte Flags { get; set; }
|
||||
public byte Flags;
|
||||
}
|
||||
}
|
||||
39
SabreTools.Models/CHD/MetadataEntry.cs
Normal file
39
SabreTools.Models/CHD/MetadataEntry.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.cpp"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class MetadataEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Offset within the file of the header
|
||||
/// </summary>
|
||||
public ulong Offset;
|
||||
|
||||
/// <summary>
|
||||
/// Offset within the file of the next header
|
||||
/// </summary>
|
||||
public ulong Next;
|
||||
|
||||
/// <summary>
|
||||
/// Offset within the file of the previous header
|
||||
/// </summary>
|
||||
public ulong Prev;
|
||||
|
||||
/// <summary>
|
||||
/// Length of the metadata
|
||||
/// </summary>
|
||||
public uint Length;
|
||||
|
||||
/// <summary>
|
||||
/// Metadata tag
|
||||
/// </summary>
|
||||
public MetadataTag Metatag;
|
||||
|
||||
/// <summary>
|
||||
/// Flag bits
|
||||
/// </summary>
|
||||
public MetadataFlags Flags;
|
||||
}
|
||||
}
|
||||
20
SabreTools.Models/CHD/MetadataHash.cs
Normal file
20
SabreTools.Models/CHD/MetadataHash.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.cpp"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class MetadataHash
|
||||
{
|
||||
/// <summary>
|
||||
/// Tag of the metadata in big-endian
|
||||
/// </summary>
|
||||
public MetadataTag Tag;
|
||||
|
||||
/// <summary>
|
||||
/// Hash data
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
|
||||
public byte[]? SHA1;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.CHD
|
||||
{
|
||||
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class UncompressedMapV5
|
||||
{
|
||||
/// <summary>
|
||||
/// Starting offset / hunk size
|
||||
/// </summary>
|
||||
public uint StartingOffset { get; set; }
|
||||
public uint StartingOffset;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace SabreTools.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/tree/main/doc/FileFormats/song.ini"/>
|
||||
/// <remarks>[song]/[Song]</remarks>
|
||||
internal class SongIni
|
||||
public class SongIni
|
||||
{
|
||||
#region Song/Chart Metadata
|
||||
|
||||
16
SabreTools.Models/Charts/Tier.cs
Normal file
16
SabreTools.Models/Charts/Tier.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace SabreTools.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
public class Tier
|
||||
{
|
||||
/// <summary>
|
||||
/// Display name of the tier.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name used for associating a song with this tier, and for checking unlock requirements.
|
||||
/// </summary>
|
||||
public string? UnlockId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SabreTools.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
/// <remarks>[titles]</remarks>
|
||||
internal class TitlesIni
|
||||
public class TitlesIni
|
||||
{
|
||||
/// <summary>
|
||||
/// A space-separated list of .ini sections to include in the career.
|
||||
@@ -13,9 +11,8 @@ namespace SabreTools.Models.Charts
|
||||
public string[]? SectionList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// `name` - Display name of the tier.
|
||||
/// `unlock_id` - Name used for associating a song with this tier, and for checking unlock requirements.
|
||||
/// This entry points to other sections that should be used as part of the career.
|
||||
/// </summary>
|
||||
public Dictionary<string, (string? Name, string? UnlockId)>? Sections { get; set; }
|
||||
public Tier[]? Sections { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,5 @@ namespace SabreTools.Models.ClrMamePro
|
||||
/// <remarks>name</remarks>
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
|
||||
#region DO NOT USE IN PRODUCTION
|
||||
|
||||
/// <remarks>Should be empty</remarks>
|
||||
public string[]? ADDITIONAL_ELEMENTS { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user