63 Commits

Author SHA1 Message Date
Matt Nadareski
d144dd47a1 Bump version 2024-08-08 14:19:26 -04:00
Matt Nadareski
c4247c7ccb Move readme back to where it should be 2024-08-08 14:16:26 -04:00
Matt Nadareski
1e77437167 Fixup csproj a bit 2024-08-08 14:15:30 -04:00
Matt Nadareski
3d79e07d76 Move project to subfolder 2024-08-08 14:11:45 -04:00
Matt Nadareski
9d50d577ab Fix things found during NDecrypt usage 2024-08-08 13:18:47 -04:00
Matt Nadareski
494ca175fb Fix layout of ISv3 directory 2024-06-03 11:57:30 -04:00
Matt Nadareski
73b3d4a7a8 Bump version 2024-05-15 14:09:49 -04:00
Matt Nadareski
bd40158423 Forgot to check... 2024-05-15 14:08:14 -04:00
Matt Nadareski
149a45d871 Bump version 2024-05-15 14:00:54 -04:00
Matt Nadareski
e18d8d7543 Fix menu header parsing/serialization 2024-05-15 14:00:30 -04:00
Matt Nadareski
38f0d4aef5 Bump version 2024-05-13 13:18:47 -04:00
Matt Nadareski
3959993255 Fix XMID/XeMID comments 2024-05-09 21:40:43 -04:00
Matt Nadareski
00df5bdd6e UTF-8 treated like ASCII for old .NET 2024-05-07 05:28:46 -04:00
Matt Nadareski
00c087d8e0 Add third-party expansion fields for PKZIP 2024-04-28 02:30:46 -04:00
Matt Nadareski
6bc948784a Add PKZIP appendix A and B 2024-04-28 02:02:58 -04:00
Matt Nadareski
c4f14854c2 Add extensible data field definitions 2024-04-28 01:11:27 -04:00
Matt Nadareski
adaac68898 Bump version 2024-04-24 10:04:06 -04:00
Matt Nadareski
a9bc4a2bfe Fix getopts 2024-04-24 01:35:59 -04:00
Matt Nadareski
262b91de65 32 unicode characters, 64 bytes 2024-04-24 01:25:30 -04:00
Matt Nadareski
62bd6a4bde Add a couple of constants from UnshieldSharp 2024-04-24 00:36:41 -04:00
Matt Nadareski
7f14f0c5b0 Fix encoding for DirectoryEntry 2024-04-23 21:43:17 -04:00
Matt Nadareski
33d63fddae Bump version 2024-04-23 21:01:52 -04:00
Matt Nadareski
209be57bf4 Add layouts for some BD+ models 2024-04-23 20:59:47 -04:00
Matt Nadareski
a1581e9d9b Add layouts for some BFPK models 2024-04-23 20:58:51 -04:00
Matt Nadareski
521664d5a8 Add layouts for some BSP models 2024-04-23 20:57:24 -04:00
Matt Nadareski
73a8d91a83 Add layouts for some CFB models 2024-04-23 20:55:10 -04:00
Matt Nadareski
438e87f833 Add layouts for some CHD models 2024-04-23 20:50:09 -04:00
Matt Nadareski
2cdedbb456 Add layouts for some DVD models 2024-04-23 20:47:33 -04:00
Matt Nadareski
b57a545598 Add layouts for some GCF models 2024-04-23 20:38:11 -04:00
Matt Nadareski
8dc6eb2eee Add layouts for some IS-CAB models 2024-04-23 20:26:18 -04:00
Matt Nadareski
b58436d71a Add layouts for some MoPaQ models 2024-04-23 20:18:26 -04:00
Matt Nadareski
925c20021f Add layouts for some MSDOS models 2024-04-23 20:13:07 -04:00
Matt Nadareski
9bebf95599 Add layouts for some N3DS models 2024-04-23 20:09:39 -04:00
Matt Nadareski
089e13ca03 Add layouts for some NCF models 2024-04-23 19:34:56 -04:00
Matt Nadareski
de07b3b0dd Make some types non-nullable 2024-04-23 19:13:47 -04:00
Matt Nadareski
22cb5360e6 Add notes about prefixed strings 2024-04-23 17:20:05 -04:00
Matt Nadareski
a422ec7e6d Add layouts for some Nitro models 2024-04-23 17:15:15 -04:00
Matt Nadareski
f60afd6368 Add layouts for some PE models 2024-04-23 16:42:29 -04:00
Matt Nadareski
b8f67a8ab0 Add layouts for some VBSP models 2024-04-23 16:06:09 -04:00
Matt Nadareski
d844a8b582 Add layouts for some VPK models 2024-04-23 16:03:20 -04:00
Matt Nadareski
8583baa862 Add layouts for some WAD models 2024-04-23 15:56:43 -04:00
Matt Nadareski
8f3be17850 Add layouts for some XZP models 2024-04-23 15:49:41 -04:00
Matt Nadareski
5856967794 Fill and fix some ISAv3 information 2024-04-23 15:43:33 -04:00
Matt Nadareski
8f78c73c6f Fix publish scripts 2024-04-23 14:12:10 -04:00
Matt Nadareski
af4ff3d383 Bump version 2024-04-23 14:10:58 -04:00
Matt Nadareski
3e638a5c57 Make Linux publish script executable 2024-04-23 14:10:27 -04:00
Matt Nadareski
638d0226c1 Add publish scripts 2024-04-23 14:10:03 -04:00
Matt Nadareski
07c6d5b43a Obsolete is not an error... for now 2024-04-23 13:38:37 -04:00
Matt Nadareski
108e63a099 Add some null-terminated type flags 2024-04-23 13:36:24 -04:00
Matt Nadareski
c636d3252b Migrate many models to StructLayout 2024-04-23 13:30:43 -04:00
Matt Nadareski
b19dbf2254 Update APPNOTE link, add more Header IDs 2024-04-17 16:43:02 -04:00
Matt Nadareski
111b84170c Add relevant information to PKZIP archive 2024-04-17 16:09:30 -04:00
Matt Nadareski
2d7df0d4fb Add PKZIP archive model 2024-04-17 15:59:56 -04:00
Matt Nadareski
aba02663e5 Start adding PKZIP models 2024-04-17 15:47:41 -04:00
Matt Nadareski
594fec923a Bump version 2024-04-03 22:44:18 -04:00
Deterous
b5cf4e870d Add fields for v1.0 catalog.js files (#6) 2024-04-03 19:43:17 -07:00
Matt Nadareski
e6976796c2 Initial attempt at Delphi models 2024-04-02 10:58:20 -04:00
Deterous
295d8c7612 XboxOne/XboxSX catalog.js Model (#5)
* XboxOne catalog.js model

* Split Catalog object, bump version

* Minor fixes

* Custom JsonConverter for launchPackage

* Make launchPackage an abstract object

* Don't ignore packages

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

View File

@@ -28,13 +28,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: 'bin/Release/*.nupkg'
path: 'SabreTools.Models/bin/Release/*.nupkg'
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: True
artifacts: 'bin/Release/*.nupkg'
artifacts: 'SabreTools.Models/bin/Release/*.nupkg'
body: 'Last built commit: ${{ github.sha }}'
name: 'Rolling Release'
prerelease: True

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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; }
}
}

View File

@@ -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
}
}

View File

@@ -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-2024</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>

View File

@@ -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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,8 +1,10 @@
using System;
using System.Runtime.InteropServices;
namespace SabreTools.Models.CFB
{
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.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;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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