mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-06 21:29:42 +00:00
Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81b53c9785 | ||
|
|
54c05f2746 | ||
|
|
4a4d7ceddf | ||
|
|
0f029c5979 | ||
|
|
bb4fee91d9 | ||
|
|
ed56e2543d | ||
|
|
d675673e50 | ||
|
|
ebee967c7f | ||
|
|
f5da54eaac | ||
|
|
2350c1af27 | ||
|
|
454d507b41 | ||
|
|
10de4acbb9 | ||
|
|
8ec91d8d04 | ||
|
|
1d62d69a53 | ||
|
|
5b5fed8932 | ||
|
|
32123d4b80 | ||
|
|
f5717c3929 | ||
|
|
e8db261d73 | ||
|
|
9557f43dab | ||
|
|
51b9c1a016 | ||
|
|
bb3cd54865 | ||
|
|
0c6060a901 | ||
|
|
c18770f627 | ||
|
|
c2a5d6770c | ||
|
|
4ef79ccdca | ||
|
|
cf5135f330 | ||
|
|
6d989209db | ||
|
|
cc48593646 | ||
|
|
415d571b65 | ||
|
|
4a6e244b38 | ||
|
|
771a39517f | ||
|
|
b072a3809c | ||
|
|
341585206a | ||
|
|
2dc2ab5dd1 | ||
|
|
144a3ce52b | ||
|
|
85199789f7 | ||
|
|
fb39216c82 | ||
|
|
1a2de39868 | ||
|
|
f18b6c8850 | ||
|
|
8f1e49e464 | ||
|
|
6547242f93 | ||
|
|
edf00f3ab2 | ||
|
|
bce4736037 | ||
|
|
81f28974c0 | ||
|
|
30ebe84af4 | ||
|
|
b07fbdedd6 | ||
|
|
cd8fff4a86 | ||
|
|
3d3275e3cb | ||
|
|
4c76ce1230 | ||
|
|
0c4e3b4bf2 | ||
|
|
e8f4386199 | ||
|
|
ab66ccf3c5 | ||
|
|
cc60d54a33 | ||
|
|
e805f4cb9a | ||
|
|
328c893a38 | ||
|
|
ab2a12c996 | ||
|
|
362b123661 | ||
|
|
4a8a4746a2 | ||
|
|
3f368a3be8 | ||
|
|
2749c2f5bd | ||
|
|
41ce962700 | ||
|
|
85b7103bd3 | ||
|
|
4c61a191e8 | ||
|
|
0f70598969 | ||
|
|
d6b057d808 | ||
|
|
3d8036e7b5 | ||
|
|
bb35946866 | ||
|
|
78f9f1b36f | ||
|
|
9d1b1ca36d | ||
|
|
6e1f8bf55e | ||
|
|
a19afc240c | ||
|
|
148e97ef64 | ||
|
|
676b446025 | ||
|
|
aeff75d8d3 | ||
|
|
e20e515f56 | ||
|
|
bf02266f0f | ||
|
|
b521e503c2 | ||
|
|
48e79d26ed | ||
|
|
989ef41c6d |
@@ -1,4 +1,4 @@
|
||||
name: Nuget Pack
|
||||
name: Build and Test
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -16,25 +16,22 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
8.0.x
|
||||
9.0.x
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: 'SabreTools.Models/bin/Release/*.nupkg'
|
||||
- name: Run publish script
|
||||
run: ./publish-nix.sh
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: 'SabreTools.Models/bin/Release/*.nupkg'
|
||||
artifacts: "*.nupkg,*.snupkg"
|
||||
body: 'Last built commit: ${{ github.sha }}'
|
||||
name: 'Rolling Release'
|
||||
prerelease: True
|
||||
10
.github/workflows/check_pr.yml
vendored
10
.github/workflows/check_pr.yml
vendored
@@ -11,7 +11,13 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 9.0.x
|
||||
dotnet-version: |
|
||||
6.0.x
|
||||
8.0.x
|
||||
9.0.x
|
||||
|
||||
- name: Build
|
||||
run: dotnet build
|
||||
run: dotnet build
|
||||
|
||||
- name: Run tests
|
||||
run: dotnet test
|
||||
|
||||
60
README.MD
60
README.MD
@@ -1,13 +1,63 @@
|
||||
# SabreTools.Models
|
||||
|
||||
[](https://github.com/SabreTools/SabreTools.Models/actions/workflows/build_and_test.yml)
|
||||
|
||||
This library comprises of models that represent either directly serializable or representative structures for all SabreTools projects. All of the main models representing metadata files should have parsers created outside of the current code.
|
||||
|
||||
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Models).
|
||||
|
||||
## Missing Metadata Models
|
||||
## Releases
|
||||
|
||||
The following metadata file formats do not have models included in this library yet and, as such, do not have serializers:
|
||||
For the most recent stable build, download the latest release here: [Releases Page](https://github.com/SabreTools/SabreTools.Models/releases)
|
||||
|
||||
- Missfile
|
||||
- SabreJSON
|
||||
- SabreDAT XML
|
||||
For the latest WIP build here: [Rolling Release](https://github.com/SabreTools/SabreTools.Models/releases/rolling)
|
||||
|
||||
## Notable Information Sources
|
||||
|
||||
Not all of this information was able to be gathered directly from the files in question, so here is a non-exhaustive list of sites and projects that allow this project to exist. Most of the models also have direct links to specific pages or code snippets, where available.
|
||||
|
||||
| Site/Project | Models Directory |
|
||||
| --- | --- |
|
||||
| [3DBrew](https://www.3dbrew.org/wiki/Main_Page) | N3DS |
|
||||
| [Aaru Data Preservation Suite](https://github.com/aaru-dps) | PIC |
|
||||
| [Advanced Access Content System Licensing Administrator (AACS LA)](https://aacsla.com/) | AACS |
|
||||
| [BYTE*](https://web.archive.org/web/20240703222951/https://bytepointer.com/index.htm) | NewExecutable |
|
||||
| [cabextract/libmspack](https://www.cabextract.org.uk/) | LZ |
|
||||
| [DBox](https://dbox.tools/) | Xbox |
|
||||
| [DebugInfo.com](https://www.debuginfo.com/index.html) | PortableExecutable |
|
||||
| [Devilsclaw](https://devilsclaws.net/) | PFF |
|
||||
| [DSiBrew](https://dsibrew.org/wiki/Main_Page) | Nitro |
|
||||
| [DVD Resources for Open Source Development](https://dvd.sourceforge.net/) | DVD |
|
||||
| [EDM/2](https://www.edm2.com/index.php/Main_Page) | LinearExecutable |
|
||||
| [faydoc.tripod.com](https://faydoc.tripod.com/formats/) | LinearExecutable |
|
||||
| [GuitarGame_ChartFormats](https://github.com/TheNathannator/GuitarGame_ChartFormats/) | Charts |
|
||||
| [HandWiki](https://handwiki.org/wiki/Start) | Quantum |
|
||||
| [HLLib](https://github.com/RavuAlHemio/hllib/) | BSP, GCF, NCF, PAK, SGA, VPK, WAD3, XZP |
|
||||
| [IBM Documentation](https://www.ibm.com/docs/en) | TAR |
|
||||
| [IETF](https://www.ietf.org/) | GZIP |
|
||||
| [Independent Commodore Library](https://petlibrary.tripod.com/) | PKZIP |
|
||||
| [Ladislav Zezula](http://zezula.net/en/tools/main.html) | MoPaQ |
|
||||
| [libbdplus](https://github.com/mwgoldsmith/bdplus) | BD+ |
|
||||
| [libexe](https://github.com/libyal/libexe/) | NewExecutable |
|
||||
| [MAME](https://github.com/mamedev/mame/) | CHD |
|
||||
| [Matthew Russotto](http://www.russotto.net/quantumcomp.html) | Compression/Quantum |
|
||||
| [Microsoft Learn](https://learn.microsoft.com/en-us/) | BMP, CFB, Compression/LZX, Compression/MSZIP, MicrosoftCabinet, OLE, PortableExecutable, SecuROM, WiseInstaller |
|
||||
| [msitools](https://github.com/GNOME/msitools/) | CFB |
|
||||
| [OSDev.org](https://wiki.osdev.org/Expanded_Main_Page) | MSDOS, NewExecutable |
|
||||
| [PInvoke.net](http://www.pinvoke.net/index.aspx) | MSDOS |
|
||||
| [PKWARE(?)](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) | PKZIP |
|
||||
| [PS3 Developer Wiki](https://www.psdevwiki.com/ps3/) | IRD, PlayStation3 |
|
||||
| [RanseiLink](https://github.com/Deijin27/RanseiLink) | Nitro |
|
||||
| [Reverse Engineering Wise](https://codeberg.org/CYBERDEV/REWise) | WiseInstaller |
|
||||
| [SharpCompress](https://github.com/adamhathcock/sharpcompress) | PKZIP |
|
||||
| [Source SDK 2013](https://github.com/ValveSoftware/source-sdk-2013) | BSP |
|
||||
| [Technical Committee T10](https://www.t10.org/) | PIC |
|
||||
| [The Go tools for Windows + Assembler](https://www.godevtool.com/) | PortableExecutable |
|
||||
| [The Whole Half-Life](https://twhl.info/wiki/page/Specification:_WAD3) | WAD3 |
|
||||
| [Unshield](https://github.com/twogood/unshield) | InstallShieldCabinet |
|
||||
| [unshieldv3](https://github.com/wfr/unshieldv3) | InstallShieldArchiveV3 |
|
||||
| [Valve Developer Community](https://developer.valvesoftware.com/wiki/Main_Page) | BSP, VPK |
|
||||
| [w4kfu's bl0g](https://web.archive.org/web/20250206143756/http://blog.w4kfu.com/) | SafeDisc |
|
||||
| [Wine](https://github.com/wine-mirror/wine/) | LZ |
|
||||
| [XboxDevWiki.net](https://xboxdevwiki.net/Main_Page) | Xbox |
|
||||
| [XeNTaX Game Research Forum](http://web.archive.org/web/20231031162306/https://forum.xentax.com/) | SFFS |
|
||||
|
||||
@@ -21,6 +21,6 @@ namespace SabreTools.Models.AACS
|
||||
/// <summary>
|
||||
/// Revocation list entries
|
||||
/// </summary>
|
||||
public DriveRevocationSignatureBlock?[]? SignatureBlocks { get; set; }
|
||||
public DriveRevocationSignatureBlock[]? SignatureBlocks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,6 @@ namespace SabreTools.Models.AACS
|
||||
/// A list of 8-byte Host Drive List Entry fields, the length of this
|
||||
/// list being equal to the number in the signature block.
|
||||
/// </summary>
|
||||
public DriveRevocationListEntry?[]? EntryFields { get; set; }
|
||||
public DriveRevocationListEntry[]? EntryFields { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Models.AACS
|
||||
/// <summary>
|
||||
/// In this record, each subset-difference is encoded with 5 bytes.
|
||||
/// </summary>
|
||||
public SubsetDifference?[]? SubsetDifferences { get; set; }
|
||||
public SubsetDifference[]? SubsetDifferences { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,6 @@ namespace SabreTools.Models.AACS
|
||||
/// <summary>
|
||||
/// Revocation list entries
|
||||
/// </summary>
|
||||
public HostRevocationSignatureBlock?[]? SignatureBlocks { get; set; }
|
||||
public HostRevocationSignatureBlock[]? SignatureBlocks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,6 @@ namespace SabreTools.Models.AACS
|
||||
/// A list of 8-byte Host Revocation List Entry fields, the length of this
|
||||
/// list being equal to the number in the signature block.
|
||||
/// </summary>
|
||||
public HostRevocationListEntry?[]? EntryFields { get; set; }
|
||||
public HostRevocationListEntry[]? EntryFields { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,6 @@ namespace SabreTools.Models.AACS
|
||||
/// <summary>
|
||||
/// Records
|
||||
/// </summary>
|
||||
public Record?[]? Records { get; set; }
|
||||
public Record[]? Records { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,6 @@ namespace SabreTools.Models.ArchiveDotOrg
|
||||
public class Files
|
||||
{
|
||||
[XmlElement("file")]
|
||||
public File?[]? File { get; set; }
|
||||
public File[]? File { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,6 @@ namespace SabreTools.Models.AttractMode
|
||||
[Required]
|
||||
public string[]? Header { get; set; }
|
||||
|
||||
public Row?[]? Row { get; set; }
|
||||
public Row[]? Row { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace SabreTools.Models.BSP
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class QAngle
|
||||
{
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
public float Z { get; set; }
|
||||
public float X;
|
||||
public float Y;
|
||||
public float Z;
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace SabreTools.Models.BSP
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class Vector3D
|
||||
{
|
||||
public float X { get; set; }
|
||||
public float Y { get; set; }
|
||||
public float Z { get; set; }
|
||||
public float X;
|
||||
public float Y;
|
||||
public float Z;
|
||||
}
|
||||
}
|
||||
10
SabreTools.Models/BZip2/Archive.cs
Normal file
10
SabreTools.Models/BZip2/Archive.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace SabreTools.Models.BZip2
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a placeholder model for future work
|
||||
/// </summary>
|
||||
public class Archive
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -22,18 +22,18 @@ namespace SabreTools.Models.CFB
|
||||
[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;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST match the length of the Directory Entry Name Unicode
|
||||
/// string in bytes. The length MUST be a multiple of 2 and include the
|
||||
/// terminating null character in the count. This length MUST NOT exceed 64,
|
||||
/// the maximum size of the Directory Entry Name field.
|
||||
/// </summary>
|
||||
public ushort NameLength;
|
||||
|
||||
/// <summary>
|
||||
/// This field MUST be 0x00, 0x01, 0x02, or 0x05, depending on the
|
||||
/// actual type of object. All other values are not valid.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public ObjectType ObjectType;
|
||||
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Models.ClrMamePro
|
||||
public ClrMamePro? ClrMamePro { get; set; }
|
||||
|
||||
/// <remarks>game, machine, resource, set</remarks>
|
||||
public GameBase?[]? Game { get; set; }
|
||||
public GameBase[]? Game { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public class BlockHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Set if and only if this is the last block of the data set.
|
||||
/// </summary>
|
||||
/// <remarks>Bit 0</remarks>
|
||||
public bool BFINAL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies how the data are compressed
|
||||
/// </summary>
|
||||
/// <remarks>Bits 1-2</remarks>
|
||||
public CompressionType BTYPE { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <summary>
|
||||
/// Compression with Huffman codes (BTYPE=01 or BTYPE=02)
|
||||
/// </summary>
|
||||
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public abstract class CompressedDataHeader : DataHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Huffman code lengths for the literal / length alphabet
|
||||
/// </summary>
|
||||
public virtual uint[]? LiteralLengths { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Huffman distance codes for the literal / length alphabet
|
||||
/// </summary>
|
||||
public virtual uint[]? DistanceCodes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Bits in base literal/length lookup table
|
||||
/// </summary>
|
||||
public const int ZIPLBITS = 9;
|
||||
|
||||
/// <summary>
|
||||
/// Bits in base distance lookup table
|
||||
/// </summary>
|
||||
public const int ZIPDBITS = 6;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum bit length of any code
|
||||
/// </summary>
|
||||
public const int ZIPBMAX = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum number of codes in any set
|
||||
/// </summary>
|
||||
public const int ZIPN_MAX = 288;
|
||||
|
||||
#region Fixed Huffman Codes
|
||||
|
||||
/// <summary>
|
||||
/// Fixed Huffman code lengths for the literal / length alphabet
|
||||
/// </summary>
|
||||
public static readonly uint[] FixedLiteralLengths =
|
||||
[
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9,
|
||||
7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7,
|
||||
8, 8, 8, 8, 8, 8, 8, 8,
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Fixed Huffman distance codes for the literal / length alphabet
|
||||
/// </summary>
|
||||
public static readonly uint[] FixedDistanceCodes =
|
||||
[
|
||||
5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5,
|
||||
];
|
||||
|
||||
#endregion
|
||||
|
||||
#region Literal and Length Alphabets
|
||||
|
||||
/// <summary>
|
||||
/// Extra bits for distance codes
|
||||
/// </summary>
|
||||
public static readonly ushort[] DistanceExtraBits =
|
||||
[
|
||||
0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
|
||||
4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
|
||||
9, 9, 10, 10, 11, 11, 12, 12, 13, 13
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Copy offsets for distance codes 0..29
|
||||
/// </summary>
|
||||
public static readonly ushort[] DistanceOffsets =
|
||||
[
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25,
|
||||
33, 49, 65, 97, 129, 193, 257, 385, 513, 769,
|
||||
1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Extra bits for literal codes 257..285
|
||||
/// </summary>
|
||||
public static readonly ushort[] LiteralExtraBits =
|
||||
[
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
|
||||
1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
|
||||
4, 4, 4, 4, 5, 5, 5, 5, 0,
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Copy lengths for literal codes 257..285
|
||||
/// </summary>
|
||||
public static readonly ushort[] LiteralLengths =
|
||||
[
|
||||
3, 4, 5, 6, 7, 8, 9, 10, 11, 13,
|
||||
15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
|
||||
67, 83, 99, 115, 131, 163, 195, 227, 258,
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Order of the bit length code lengths
|
||||
/// </summary>
|
||||
public static readonly byte[] BitLengthOrder =
|
||||
[
|
||||
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
|
||||
];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for all data headers (BTYPE=00, BTYPE=01, or BTYPE=02)
|
||||
/// </summary>
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public abstract class DataHeader
|
||||
{
|
||||
// No common fields between all data headers
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <summary>
|
||||
/// Compression with dynamic Huffman codes (BTYPE=10)
|
||||
/// </summary>
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public class DynamicCompressedDataHeader : CompressedDataHeader
|
||||
{
|
||||
// Codes are provided externally
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public enum CompressionType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// no compression
|
||||
/// </summary>
|
||||
NoCompression = 0b00,
|
||||
|
||||
/// <summary>
|
||||
/// Compressed with fixed Huffman codes
|
||||
/// </summary>
|
||||
FixedHuffman = 0b01,
|
||||
|
||||
/// <summary>
|
||||
/// Compressed with dynamic Huffman codes
|
||||
/// </summary>
|
||||
DynamicHuffman = 0b10,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved (error)
|
||||
/// </summary>
|
||||
Reserved = 0b11,
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <summary>
|
||||
/// Compression with fixed Huffman codes (BTYPE=01)
|
||||
/// </summary>
|
||||
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public class FixedCompressedDataHeader : CompressedDataHeader
|
||||
{
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Huffman code lengths for the literal / length alphabet
|
||||
/// </summary>
|
||||
public override uint[]? LiteralLengths => Constants.FixedLiteralLengths;
|
||||
|
||||
/// <summary>
|
||||
/// Huffman distance codes for the literal / length alphabet
|
||||
/// </summary>
|
||||
public override uint[]? DistanceCodes => Constants.FixedDistanceCodes;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.Deflate
|
||||
{
|
||||
/// <summary>
|
||||
/// Non-compressed blocks (BTYPE=00)
|
||||
/// </summary>
|
||||
/// <see href="https://www.rfc-editor.org/rfc/rfc1951"/>
|
||||
public class NonCompressedBlockHeader : DataHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// The number of data bytes in the block
|
||||
/// </summary>
|
||||
/// <remarks>Bytes 0-1</remarks>
|
||||
public ushort LEN { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The one's complement of LEN
|
||||
/// </summary>
|
||||
/// <remarks>Bytes 2-3</remarks>
|
||||
public ushort NLEN { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.LZ
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const int GETLEN = 2048;
|
||||
|
||||
public const int LZ_MAGIC_LEN = 8;
|
||||
|
||||
public const int LZ_HEADER_LEN = 14;
|
||||
|
||||
public static readonly byte[] MagicBytes = [0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33];
|
||||
|
||||
public static readonly string MagicString = System.Text.Encoding.ASCII.GetString(MagicBytes);
|
||||
|
||||
public const ulong MagicUInt64 = 0x3327f08844445a53;
|
||||
|
||||
public const int LZ_TABLE_SIZE = 0x1000;
|
||||
|
||||
public const int MAX_LZSTATES = 16;
|
||||
|
||||
public const int LZ_MIN_HANDLE = 0x400;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.LZ
|
||||
{
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/include/lzexpand.h"/>
|
||||
public enum LZERROR
|
||||
{
|
||||
LZERROR_OK = 1,
|
||||
LZERROR_NOT_LZ = 0,
|
||||
LZERROR_BADINHANDLE = -1,
|
||||
LZERROR_BADOUTHANDLE = -2,
|
||||
LZERROR_READ = -3,
|
||||
LZERROR_WRITE = -4,
|
||||
LZERROR_GLOBALLOC = -5,
|
||||
LZERROR_GLOBLOCK = -6,
|
||||
LZERROR_BADVALUE = -7,
|
||||
LZERROR_UNKNOWNALG = -8,
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.Compression.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// Format of first 14 byte of LZ compressed file
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class FileHeaader
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public string? Magic;
|
||||
|
||||
public byte CompressionType;
|
||||
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public char LastChar;
|
||||
|
||||
public uint RealLength;
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.IO;
|
||||
|
||||
namespace SabreTools.Models.Compression.LZ
|
||||
{
|
||||
public sealed class State
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal backing stream
|
||||
/// </summary>
|
||||
public Stream? Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The last char of the filename for replacement
|
||||
/// </summary>
|
||||
public char LastChar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Decompressed length of the file
|
||||
/// </summary>
|
||||
public uint RealLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position the decompressor currently is
|
||||
/// </summary>
|
||||
public uint RealCurrent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position the user wants to read from
|
||||
/// </summary>
|
||||
public uint RealWanted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The rotating LZ table
|
||||
/// </summary>
|
||||
public byte[]? Table { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CURrent TABle ENTry
|
||||
/// </summary>
|
||||
public uint CurrentTableEntry { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length and position of current string
|
||||
/// </summary>
|
||||
public byte StringLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// From stringtable
|
||||
/// </summary>
|
||||
public uint StringPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Bitmask within blocks
|
||||
/// </summary>
|
||||
public ushort ByteType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// GETLEN bytes
|
||||
/// </summary>
|
||||
public byte[]? Window { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current read
|
||||
/// </summary>
|
||||
public uint WindowCurrent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length last got
|
||||
/// </summary>
|
||||
public uint WindowLength { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.MSZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// Each MSZIP block MUST consist of a 2-byte MSZIP signature and one or more RFC 1951 blocks. The
|
||||
/// 2-byte MSZIP signature MUST consist of the bytes 0x43 and 0x4B. The MSZIP signature MUST be
|
||||
/// the first 2 bytes in the MSZIP block. The MSZIP signature is shown in the following packet diagram.
|
||||
///
|
||||
/// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951].
|
||||
/// The compressor that performs the compression operation MUST generate one or more RFC 1951
|
||||
/// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each
|
||||
/// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in
|
||||
/// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951]
|
||||
/// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer
|
||||
/// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data.
|
||||
///
|
||||
/// The maximum compressed size of each MSZIP block is 32 KB + 12 bytes. This enables the MSZIP
|
||||
/// block to contain 32 KB of data split between two noncompressed RFC 1951 blocks, each of which
|
||||
/// has a value of BTYPE = 00.
|
||||
/// </summary>
|
||||
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
|
||||
public class Block
|
||||
{
|
||||
/// <summary>
|
||||
/// Block header
|
||||
/// </summary>
|
||||
public BlockHeader? BlockHeader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compressed blocks
|
||||
/// </summary>
|
||||
public DeflateBlock[]? CompressedBlocks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,18 @@ namespace SabreTools.Models.Compression.MSZIP
|
||||
/// Each MSZIP block MUST consist of a 2-byte MSZIP signature and one or more RFC 1951 blocks. The
|
||||
/// 2-byte MSZIP signature MUST consist of the bytes 0x43 and 0x4B. The MSZIP signature MUST be
|
||||
/// the first 2 bytes in the MSZIP block. The MSZIP signature is shown in the following packet diagram.
|
||||
///
|
||||
/// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951].
|
||||
/// The compressor that performs the compression operation MUST generate one or more RFC 1951
|
||||
/// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each
|
||||
/// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in
|
||||
/// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951]
|
||||
/// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer
|
||||
/// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data.
|
||||
///
|
||||
/// The maximum compressed size of each MSZIP block is 32 KB + 12 bytes. This enables the MSZIP
|
||||
/// block to contain 32 KB of data split between two noncompressed RFC 1951 blocks, each of which
|
||||
/// has a value of BTYPE = 00.
|
||||
/// </summary>
|
||||
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
|
||||
public class BlockHeader
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.MSZIP
|
||||
{
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/cabinet/cabinet.h"/>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Window size
|
||||
/// </summary>
|
||||
public const ushort ZIPWSIZE = 0x8000;
|
||||
|
||||
/// <summary>
|
||||
/// And'ing with Zipmask[n] masks the lower n bits
|
||||
/// </summary>
|
||||
public static readonly ushort[] BitMasks =
|
||||
[
|
||||
0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
|
||||
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
namespace SabreTools.Models.Compression.MSZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// Each MSZIP block is the result of a single deflate compression operation, as defined in [RFC1951].
|
||||
/// The compressor that performs the compression operation MUST generate one or more RFC 1951
|
||||
/// blocks, as defined in [RFC1951]. The number, deflation mode, and type of RFC 1951 blocks in each
|
||||
/// MSZIP block is determined by the compressor, as defined in [RFC1951]. The last RFC 1951 block in
|
||||
/// each MSZIP block MUST be marked as the "end" of the stream(1), as defined by [RFC1951]
|
||||
/// section 3.2.3. Decoding trees MUST be discarded after each RFC 1951 block, but the history buffer
|
||||
/// MUST be maintained.Each MSZIP block MUST represent no more than 32 KB of uncompressed data.
|
||||
/// </summary>
|
||||
/// <see href="https://interoperability.blob.core.windows.net/files/MS-MCI/%5bMS-MCI%5d.pdf"/>
|
||||
public class DeflateBlock
|
||||
{
|
||||
/// <summary>
|
||||
/// Deflate block (RFC-1951) header
|
||||
/// </summary>
|
||||
public Deflate.BlockHeader? Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compression-specific data header
|
||||
/// </summary>
|
||||
public Deflate.DataHeader? DataHeader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MSZIP data
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Depending on the implementation of these models, this property could either be
|
||||
/// compressed or uncompressed data. Keep this in mind when using the built
|
||||
/// versions of this model.
|
||||
/// </remarks>
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace SabreTools.Models.Compression.Quantum
|
||||
{
|
||||
/// <see href="www.russotto.net/quantumcomp.html"/>
|
||||
/// <see href="http://www.russotto.net/quantumcomp.html"/>
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly int[] PositionSlot =
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace SabreTools.Models.Compression.Quantum
|
||||
/// order in the table, and with every symbol in the table
|
||||
/// having a frequency of 1
|
||||
/// </remarks>
|
||||
public ModelSymbol?[]? Symbols { get; set; }
|
||||
public ModelSymbol[]? Symbols { get; set; }
|
||||
|
||||
/// <remarks>
|
||||
/// The initial total frequency is equal to the number of entries
|
||||
|
||||
@@ -25,6 +25,6 @@ namespace SabreTools.Models.CueSheets
|
||||
/// <summary>
|
||||
/// List of TRACK in FILE
|
||||
/// </summary>
|
||||
public CueTrack?[]? Tracks { get; set; }
|
||||
public CueTrack[]? Tracks { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ namespace SabreTools.Models.CueSheets
|
||||
/// <summary>
|
||||
/// List of FILE in cuesheet
|
||||
/// </summary>
|
||||
public CueFile?[]? Files { get; set; }
|
||||
public CueFile[]? Files { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace SabreTools.Models.CueSheets
|
||||
/// List of INDEX in TRACK
|
||||
/// </summary>
|
||||
/// <remarks>Must start with 0 or 1 and then sequential</remarks>
|
||||
public CueIndex?[]? Indices { get; set; }
|
||||
public CueIndex[]? Indices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// POSTGAP
|
||||
|
||||
@@ -15,6 +15,9 @@ namespace SabreTools.Models.DosCenter
|
||||
[Required]
|
||||
public string? CRC { get; set; }
|
||||
|
||||
/// <remarks>sha1, attribute</remarks>
|
||||
public string? SHA1 { get; set; }
|
||||
|
||||
/// <remarks>date, attribute</remarks>
|
||||
public string? Date { get; set; }
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace SabreTools.Models.GCF
|
||||
/// <summary>
|
||||
/// Block entries data
|
||||
/// </summary>
|
||||
public BlockEntry?[]? BlockEntries { get; set; }
|
||||
public BlockEntry[]? BlockEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fragmentation map header data
|
||||
@@ -31,7 +31,7 @@ namespace SabreTools.Models.GCF
|
||||
/// <summary>
|
||||
/// Fragmentation map data
|
||||
/// </summary>
|
||||
public FragmentationMap?[]? FragmentationMaps { get; set; }
|
||||
public FragmentationMap[]? FragmentationMaps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Block entry map header data
|
||||
@@ -43,7 +43,7 @@ namespace SabreTools.Models.GCF
|
||||
/// Block entry map data
|
||||
/// </summary>
|
||||
/// <remarks>Part of version 5 but not version 6.</remarks>
|
||||
public BlockEntryMap?[]? BlockEntryMaps { get; set; }
|
||||
public BlockEntryMap[]? BlockEntryMaps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory header data
|
||||
@@ -53,7 +53,7 @@ namespace SabreTools.Models.GCF
|
||||
/// <summary>
|
||||
/// Directory entries data
|
||||
/// </summary>
|
||||
public DirectoryEntry?[]? DirectoryEntries { get; set; }
|
||||
public DirectoryEntry[]? DirectoryEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory names data
|
||||
@@ -63,22 +63,22 @@ namespace SabreTools.Models.GCF
|
||||
/// <summary>
|
||||
/// Directory info 1 entries data
|
||||
/// </summary>
|
||||
public DirectoryInfo1Entry?[]? DirectoryInfo1Entries { get; set; }
|
||||
public DirectoryInfo1Entry[]? DirectoryInfo1Entries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory info 2 entries data
|
||||
/// </summary>
|
||||
public DirectoryInfo2Entry?[]? DirectoryInfo2Entries { get; set; }
|
||||
public DirectoryInfo2Entry[]? DirectoryInfo2Entries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory copy entries data
|
||||
/// </summary>
|
||||
public DirectoryCopyEntry?[]? DirectoryCopyEntries { get; set; }
|
||||
public DirectoryCopyEntry[]? DirectoryCopyEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory local entries data
|
||||
/// </summary>
|
||||
public DirectoryLocalEntry?[]? DirectoryLocalEntries { get; set; }
|
||||
public DirectoryLocalEntry[]? DirectoryLocalEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory map header data
|
||||
@@ -88,7 +88,7 @@ namespace SabreTools.Models.GCF
|
||||
/// <summary>
|
||||
/// Directory map entries data
|
||||
/// </summary>
|
||||
public DirectoryMapEntry?[]? DirectoryMapEntries { get; set; }
|
||||
public DirectoryMapEntry[]? DirectoryMapEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Checksum header data
|
||||
@@ -103,12 +103,12 @@ namespace SabreTools.Models.GCF
|
||||
/// <summary>
|
||||
/// Checksum map entries data
|
||||
/// </summary>
|
||||
public ChecksumMapEntry?[]? ChecksumMapEntries { get; set; }
|
||||
public ChecksumMapEntry[]? ChecksumMapEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Checksum entries data
|
||||
/// </summary>
|
||||
public ChecksumEntry?[]? ChecksumEntries { get; set; }
|
||||
public ChecksumEntry[]? ChecksumEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data block header data
|
||||
|
||||
@@ -6,13 +6,13 @@ namespace SabreTools.Models.GZIP
|
||||
/// <summary>
|
||||
/// Header including optional fields
|
||||
/// </summary>
|
||||
public Header? Header;
|
||||
public Header? Header { get; set; }
|
||||
|
||||
// Compressed blocks live here
|
||||
|
||||
/// <summary>
|
||||
/// Trailer
|
||||
/// </summary>
|
||||
public Trailer? Trailer;
|
||||
public Trailer? Trailer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,20 +7,20 @@ namespace SabreTools.Models.GZIP
|
||||
/// SI1 and SI2 provide a subfield ID, typically two ASCII letters
|
||||
/// with some mnemonic value.
|
||||
/// </summary>
|
||||
public byte SI1;
|
||||
public byte SubfieldID1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SI1 and SI2 provide a subfield ID, typically two ASCII letters
|
||||
/// with some mnemonic value.
|
||||
/// </summary>
|
||||
public byte SI2;
|
||||
public byte SubfieldID2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LEN gives the length of the subfield data, excluding the 4
|
||||
/// initial bytes.
|
||||
/// </summary>
|
||||
public ushort LEN;
|
||||
public ushort Length { get; set; }
|
||||
|
||||
public byte[]? Data;
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,22 +6,22 @@ namespace SabreTools.Models.GZIP
|
||||
/// <summary>
|
||||
/// IDentification 1 (0x1F)
|
||||
/// </summary>
|
||||
public byte ID1;
|
||||
public byte ID1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IDentification 2 (0x8B)
|
||||
/// </summary>
|
||||
public byte ID2;
|
||||
public byte ID2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compression Method
|
||||
/// </summary>
|
||||
public CompressionMethod CM;
|
||||
public CompressionMethod CompressionMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FLaGs
|
||||
/// </summary>
|
||||
public Flags FLG;
|
||||
public Flags Flags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Modification TIME
|
||||
@@ -35,12 +35,12 @@ namespace SabreTools.Models.GZIP
|
||||
/// compression started. MTIME = 0 means no time stamp is
|
||||
/// available.
|
||||
/// </summary>
|
||||
public uint MTIME;
|
||||
public uint LastModifiedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// eXtra FLags
|
||||
/// </summary>
|
||||
public ExtraFlags XFL;
|
||||
public ExtraFlags ExtraFlags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Operating System
|
||||
@@ -49,7 +49,7 @@ namespace SabreTools.Models.GZIP
|
||||
/// took place. This may be useful in determining end-of-line
|
||||
/// convention for text files.
|
||||
/// </summary>
|
||||
public OperatingSystem OS;
|
||||
public OperatingSystem OperatingSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// eXtra LENgth
|
||||
@@ -57,7 +57,7 @@ namespace SabreTools.Models.GZIP
|
||||
/// If FLG.FEXTRA is set, this gives the length of the optional
|
||||
/// extra field.
|
||||
/// </summary>
|
||||
public ushort XLEN;
|
||||
public ushort ExtraLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Extra field
|
||||
@@ -66,23 +66,23 @@ namespace SabreTools.Models.GZIP
|
||||
/// the header, with total length XLEN bytes. It consists of a
|
||||
/// series of subfields, each of the form <see cref="ExtraFieldData"/>.
|
||||
/// </summary>
|
||||
public ExtraFieldData[]? ExtraField;
|
||||
public ExtraFieldData[]? ExtraField { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Original filename before compression, zero-terminated
|
||||
/// Original filename before compression, null-terminated
|
||||
/// </summary>
|
||||
public string? OriginalFileName;
|
||||
public string? OriginalFileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File comment, zero terminated
|
||||
/// File comment, null terminated
|
||||
/// </summary>
|
||||
public string? FileComment;
|
||||
public string? FileComment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The CRC16 consists of the two least significant bytes of the
|
||||
/// CRC32 for all bytes of the gzip header up to and not including
|
||||
/// the CRC16.
|
||||
/// </summary>
|
||||
public ushort? CRC16;
|
||||
public ushort? CRC16 { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace SabreTools.Models.GZIP
|
||||
/// ordering ISO documents. See gopher://info.itu.ch for an
|
||||
/// online version of ITU-T V.42.)
|
||||
/// </summary>
|
||||
public uint CRC32;
|
||||
public uint CRC32 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Input SIZE
|
||||
@@ -21,6 +21,6 @@ namespace SabreTools.Models.GZIP
|
||||
/// This contains the size of the original (uncompressed) input
|
||||
/// data modulo 2^32.
|
||||
/// </summary>
|
||||
public uint ISIZE;
|
||||
public uint InputSize { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace SabreTools.Models.InstallShieldCabinet
|
||||
/// <summary>
|
||||
/// Standard file descriptors
|
||||
/// </summary>
|
||||
public FileDescriptor?[]? FileDescriptors { get; set; }
|
||||
public FileDescriptor[]? FileDescriptors { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace SabreTools.Models.InstallShieldCabinet
|
||||
/// <summary>
|
||||
/// File groups
|
||||
/// </summary>
|
||||
public FileGroup?[]? FileGroups { get; set; }
|
||||
public FileGroup[]? FileGroups { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace SabreTools.Models.InstallShieldCabinet
|
||||
/// <summary>
|
||||
/// Components
|
||||
/// </summary>
|
||||
public Component?[]? Components { get; set; }
|
||||
public Component[]? Components { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
17
SabreTools.Models/LZ/Constants.cs
Normal file
17
SabreTools.Models/LZ/Constants.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const string KWAJPrefix = "KWAJ";
|
||||
|
||||
public static readonly byte[] KWAJSignatureBytes = [0x4B, 0x57, 0x41, 0x4A, 0x88, 0xF0, 0x27, 0xD1];
|
||||
|
||||
public const string QBasicPrefix = "SZ ";
|
||||
|
||||
public static readonly byte[] QBasicSignatureBytes = [0x53, 0x5A, 0x20, 0x88, 0xF0, 0x27, 0x33, 0xD1];
|
||||
|
||||
public const string SZDDPrefix = "SZDD";
|
||||
|
||||
public static readonly byte[] SZDDSignatureBytes = [0x53, 0x5A, 0x44, 0x44, 0x88, 0xF0, 0x27, 0x33];
|
||||
}
|
||||
}
|
||||
82
SabreTools.Models/LZ/Enums.cs
Normal file
82
SabreTools.Models/LZ/Enums.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
public enum KWAJCompressionType : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// No compression
|
||||
/// </summary>
|
||||
NoCompression = 0,
|
||||
|
||||
/// <summary>
|
||||
/// No compression, data is XORed with byte 0xFF
|
||||
/// </summary>
|
||||
NoCompressionXor = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The same compression method as the QBasic variant of SZDD
|
||||
/// </summary>
|
||||
QBasic = 2,
|
||||
|
||||
/// <summary>
|
||||
/// LZ + Huffman "Jeff Johnson" compression
|
||||
/// </summary>
|
||||
LZH = 3,
|
||||
|
||||
/// <summary>
|
||||
/// MS-ZIP
|
||||
/// </summary>
|
||||
MSZIP = 4,
|
||||
}
|
||||
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
[Flags]
|
||||
public enum KWAJHeaderFlags : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Header extensions contains 4-byte decompressed length
|
||||
/// </summary>
|
||||
HasDecompressedLength = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// Header extensions contains 2-byte unknown value
|
||||
/// </summary>
|
||||
HasUnknownFlag = 0x0002,
|
||||
|
||||
/// <summary>
|
||||
/// Header extensions contains 2-byte prefix followed by
|
||||
/// that many bytes of (unknown purpose) data
|
||||
/// </summary>
|
||||
HasPrefixedData = 0x0004,
|
||||
|
||||
/// <summary>
|
||||
/// Header extensions contains null-terminated string of
|
||||
/// max length 8 representing the file name
|
||||
/// </summary>
|
||||
HasFileName = 0x0008,
|
||||
|
||||
/// <summary>
|
||||
/// Header extensions contains null-terminated string of
|
||||
/// max length 3 representing the file name
|
||||
/// </summary>
|
||||
HasFileExtension = 0x0010,
|
||||
|
||||
/// <summary>
|
||||
/// Header extensions contains 2-byte prefix followed by
|
||||
/// that many bytes of (arbitrary text) data
|
||||
/// </summary>
|
||||
HasAdditionalText = 0x0020,
|
||||
}
|
||||
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
public enum ExpandCompressionType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// Only valid compression type: 'A'
|
||||
/// </summary>
|
||||
A = 0x41,
|
||||
}
|
||||
}
|
||||
21
SabreTools.Models/LZ/KWAJFile.cs
Normal file
21
SabreTools.Models/LZ/KWAJFile.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// LZ variant with variable compression
|
||||
/// </summary>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
public sealed class KWAJFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
public KWAJHeader? Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional extensions defined by <see cref="KWAJHeader.HeaderFlags"/>
|
||||
/// </summary>
|
||||
public KWAJHeaderExtensions? HeaderExtensions { get; set; }
|
||||
|
||||
// Followed immediately by compressed data
|
||||
}
|
||||
}
|
||||
35
SabreTools.Models/LZ/KWAJHeader.cs
Normal file
35
SabreTools.Models/LZ/KWAJHeader.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// LZ variant with variable compression
|
||||
/// </summary>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class KWAJHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// "KWAJ" signature
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? Magic;
|
||||
|
||||
/// <summary>
|
||||
/// Compression method
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.U2)]
|
||||
public KWAJCompressionType CompressionType;
|
||||
|
||||
/// <summary>
|
||||
/// File offset of compressed data
|
||||
/// </summary>
|
||||
public ushort DataOffset;
|
||||
|
||||
/// <summary>
|
||||
/// Header flags to mark header extensions
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.U2)]
|
||||
public KWAJHeaderFlags HeaderFlags;
|
||||
}
|
||||
}
|
||||
51
SabreTools.Models/LZ/KWAJHeaderExtensions.cs
Normal file
51
SabreTools.Models/LZ/KWAJHeaderExtensions.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// Additional information stored after the KWAJ header
|
||||
/// </summary>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
public sealed class KWAJHeaderExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Decompressed length of file
|
||||
/// </summary>
|
||||
public uint? DecompressedLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unknown purpose
|
||||
/// </summary>
|
||||
public ushort? UnknownPurpose { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of <see cref="UnknownData"/>
|
||||
/// </summary>
|
||||
public ushort? UnknownDataLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unknown purpose data whose length is defined
|
||||
/// by <see cref="UnknownDataLength"/>
|
||||
/// </summary>
|
||||
public byte[]? UnknownData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Null-terminated string with max length 8: file name
|
||||
/// </summary>
|
||||
public string? FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Null-terminated string with max length 3: file extension
|
||||
/// </summary>
|
||||
public string? FileExtension { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of <see cref="ArbitraryText"/>
|
||||
/// </summary>
|
||||
public ushort? ArbitraryTextLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Arbitrary text data whose length is defined
|
||||
/// by <see cref="ArbitraryTextLength"/>
|
||||
/// </summary>
|
||||
public byte[]? ArbitraryText { get; set; }
|
||||
}
|
||||
}
|
||||
16
SabreTools.Models/LZ/QBasicFile.cs
Normal file
16
SabreTools.Models/LZ/QBasicFile.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// LZ variant used in QBasic 4.5 installer
|
||||
/// </summary>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
public sealed class QBasicFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
public QBasicHeader? Header { get; set; }
|
||||
|
||||
// Followed immediately by compressed data
|
||||
}
|
||||
}
|
||||
23
SabreTools.Models/LZ/QBasicHeader.cs
Normal file
23
SabreTools.Models/LZ/QBasicHeader.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// LZ variant used in QBasic 4.5 installer
|
||||
/// </summary>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class QBasicHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// "SZ" signature
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? Magic;
|
||||
|
||||
/// <summary>
|
||||
/// The integer length of the file when unpacked
|
||||
/// </summary>
|
||||
public uint RealLength;
|
||||
}
|
||||
}
|
||||
17
SabreTools.Models/LZ/SZDDFile.cs
Normal file
17
SabreTools.Models/LZ/SZDDFile.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// Standard LZ variant
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
public sealed class SZDDFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
public SZDDHeader? Header { get; set; }
|
||||
|
||||
// Followed immediately by compressed data
|
||||
}
|
||||
}
|
||||
38
SabreTools.Models/LZ/SZDDHeader.cs
Normal file
38
SabreTools.Models/LZ/SZDDHeader.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.LZ
|
||||
{
|
||||
/// <summary>
|
||||
/// Standard LZ variant
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/kernel32/lzexpand.c"/>
|
||||
/// <see href="https://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class SZDDHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// "SZDD" signature
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
|
||||
public byte[]? Magic;
|
||||
|
||||
/// <summary>
|
||||
/// Compression mode
|
||||
/// </summary>
|
||||
/// <remarks>Only <see cref="ExpandCompressionType.A"/> is supported</remarks>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public ExpandCompressionType CompressionType;
|
||||
|
||||
/// <summary>
|
||||
/// The character missing from the end of the filename
|
||||
/// </summary>
|
||||
/// <remarks>0 means unknown</remarks>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public char LastChar;
|
||||
|
||||
/// <summary>
|
||||
/// The integer length of the file when unpacked
|
||||
/// </summary>
|
||||
public uint RealLength;
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,6 @@
|
||||
/// <summary>
|
||||
/// Table entries in the bundle
|
||||
/// </summary>
|
||||
public EntryTableEntry?[]? TableEntries { get; set; }
|
||||
public EntryTableEntry[]? TableEntries { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,69 +23,69 @@ namespace SabreTools.Models.LinearExecutable
|
||||
/// <summary>
|
||||
/// Object table
|
||||
/// </summary>
|
||||
public ObjectTableEntry?[]? ObjectTable { get; set; }
|
||||
public ObjectTableEntry[]? ObjectTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Object page map
|
||||
/// </summary>
|
||||
public ObjectPageMapEntry?[]? ObjectPageMap { get; set; }
|
||||
public ObjectPageMapEntry[]? ObjectPageMap { get; set; }
|
||||
|
||||
// TODO: Object iterate data map table (Undefined)
|
||||
|
||||
/// <summary>
|
||||
/// Resource table
|
||||
/// </summary>
|
||||
public ResourceTableEntry?[]? ResourceTable { get; set; }
|
||||
public ResourceTableEntry[]? ResourceTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Resident Name table
|
||||
/// </summary>
|
||||
public ResidentNamesTableEntry?[]? ResidentNamesTable { get; set; }
|
||||
public ResidentNamesTableEntry[]? ResidentNamesTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Entry table
|
||||
/// </summary>
|
||||
public EntryTableBundle?[]? EntryTable { get; set; }
|
||||
public EntryTableBundle[]? EntryTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Module format directives table (optional)
|
||||
/// </summary>
|
||||
public ModuleFormatDirectivesTableEntry?[]? ModuleFormatDirectivesTable { get; set; }
|
||||
public ModuleFormatDirectivesTableEntry[]? ModuleFormatDirectivesTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Verify record directive table (optional)
|
||||
/// </summary>
|
||||
public VerifyRecordDirectiveTableEntry?[]? VerifyRecordDirectiveTable { get; set; }
|
||||
public VerifyRecordDirectiveTableEntry[]? VerifyRecordDirectiveTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fix-up page table
|
||||
/// </summary>
|
||||
public FixupPageTableEntry?[]? FixupPageTable { get; set; }
|
||||
public FixupPageTableEntry[]? FixupPageTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fix-up record table
|
||||
/// </summary>
|
||||
public FixupRecordTableEntry?[]? FixupRecordTable { get; set; }
|
||||
public FixupRecordTableEntry[]? FixupRecordTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Import module name table
|
||||
/// </summary>
|
||||
public ImportModuleNameTableEntry?[]? ImportModuleNameTable { get; set; }
|
||||
public ImportModuleNameTableEntry[]? ImportModuleNameTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Import procedure name table
|
||||
/// </summary>
|
||||
public ImportModuleProcedureNameTableEntry?[]? ImportModuleProcedureNameTable { get; set; }
|
||||
public ImportModuleProcedureNameTableEntry[]? ImportModuleProcedureNameTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Per-Page checksum table
|
||||
/// </summary>
|
||||
public PerPageChecksumTableEntry?[]? PerPageChecksumTable { get; set; }
|
||||
public PerPageChecksumTableEntry[]? PerPageChecksumTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Non-Resident Name table
|
||||
/// </summary>
|
||||
public NonResidentNamesTableEntry?[]? NonResidentNamesTable { get; set; }
|
||||
public NonResidentNamesTableEntry[]? NonResidentNamesTable { get; set; }
|
||||
|
||||
// TODO: Non-resident directives data (Undefined)
|
||||
|
||||
|
||||
16
SabreTools.Models/Listxml/Mess.cs
Normal file
16
SabreTools.Models/Listxml/Mess.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace SabreTools.Models.Listxml
|
||||
{
|
||||
[XmlRoot("mess")]
|
||||
public class Mess
|
||||
{
|
||||
[XmlAttribute("version")]
|
||||
public string? Version { get; set; }
|
||||
|
||||
[XmlElement("machine", typeof(Machine))]
|
||||
[XmlElement("game", typeof(Game))]
|
||||
public GameBase[]? Game { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,9 @@ namespace SabreTools.Models.Logiqx
|
||||
[XmlAttribute("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[XmlElement("dir", typeof(Dir))]
|
||||
public Dir[]? Subdir { get; set; }
|
||||
|
||||
[XmlElement("game", typeof(Game))]
|
||||
[XmlElement("machine", typeof(Machine))]
|
||||
public GameBase[]? Game { get; set; }
|
||||
|
||||
@@ -24,6 +24,6 @@ namespace SabreTools.Models.MSDOS
|
||||
/// make the loader add start segment address to the value at offset
|
||||
/// 1*0x10+0x1A=0x2A within the program data.
|
||||
/// </summary>
|
||||
public RelocationEntry?[]? RelocationTable { get; set; }
|
||||
public RelocationEntry[]? RelocationTable { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace SabreTools.Models.Metadata
|
||||
|
||||
string[]? asArray = Read<string[]>(key);
|
||||
if (asArray != null)
|
||||
#if NETFRAMEWORK
|
||||
#if NETFRAMEWORK || NETSTANDARD2_0
|
||||
return string.Join(",", asArray);
|
||||
#else
|
||||
return string.Join(',', asArray);
|
||||
|
||||
@@ -51,6 +51,6 @@
|
||||
/// <summary>
|
||||
/// Data blocks associated with this folder
|
||||
/// </summary>
|
||||
public CFDATA?[]? DataBlocks { get; set; }
|
||||
public CFDATA[]? DataBlocks { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
/// <summary>
|
||||
/// One or more CFFOLDER entries
|
||||
/// </summary>
|
||||
public CFFOLDER?[]? Folders { get; set; }
|
||||
public CFFOLDER[]? Folders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A series of one or more cabinet file (CFFILE) entries
|
||||
/// </summary>
|
||||
public CFFILE?[]? Files { get; set; }
|
||||
public CFFILE[]? Files { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
/// <summary>
|
||||
/// Hash Table (optional)
|
||||
/// </summary>
|
||||
public HashEntry?[]? HashTable { get; set; }
|
||||
public HashEntry[]? HashTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Block Table (optional)
|
||||
/// </summary>
|
||||
public BlockEntry?[]? BlockTable { get; set; }
|
||||
public BlockEntry[]? BlockTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Hi-Block Table (optional)
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
/// <summary>
|
||||
/// Compressed size of the BET block
|
||||
/// </summary>
|
||||
public ulong BetTablesize { get; set; }
|
||||
public ulong BetTableSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of raw data chunk to calculate MD5.
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Models.N3DS
|
||||
/// <remarks>
|
||||
/// https://www.3dbrew.org/wiki/CIA#Certificate_Chain
|
||||
/// </remarks>
|
||||
public Certificate?[]? CertificateChain { get; set; }
|
||||
public Certificate[]? CertificateChain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ticket
|
||||
@@ -40,7 +40,7 @@ namespace SabreTools.Models.N3DS
|
||||
/// <summary>
|
||||
/// Content file data
|
||||
/// </summary>
|
||||
public NCCHHeader?[]? Partitions { get; set; }
|
||||
public NCCHHeader[]? Partitions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Content file data
|
||||
|
||||
@@ -23,21 +23,21 @@ namespace SabreTools.Models.N3DS
|
||||
/// <summary>
|
||||
/// NCCH partitions
|
||||
/// </summary>
|
||||
public NCCHHeader?[]? Partitions { get; set; }
|
||||
public NCCHHeader[]? Partitions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// NCCH extended headers
|
||||
/// </summary>
|
||||
public NCCHExtendedHeader?[]? ExtendedHeaders { get; set; }
|
||||
public NCCHExtendedHeader[]? ExtendedHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ExeFS headers associated with each partition
|
||||
/// </summary>
|
||||
public ExeFSHeader?[]? ExeFSHeaders { get; set; }
|
||||
public ExeFSHeader[]? ExeFSHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RomFS headers associated with each partition
|
||||
/// </summary>
|
||||
public RomFSHeader?[]? RomFSHeaders { get; set; }
|
||||
public RomFSHeader[]? RomFSHeaders { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@
|
||||
/// <summary>
|
||||
/// File headers (10 headers maximum, 16 bytes each)
|
||||
/// </summary>
|
||||
public ExeFSFileHeader?[]? FileHeaders { get; set; }
|
||||
public ExeFSFileHeader[]? FileHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reserved
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
/// <summary>
|
||||
/// Offset & Length partition table, in media units
|
||||
/// </summary>
|
||||
public PartitionTableEntry?[]? PartitionsTable { get; set; }
|
||||
public PartitionTableEntry[]? PartitionsTable { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -173,6 +173,6 @@ namespace SabreTools.Models.N3DS
|
||||
/// <remarks>
|
||||
/// https://www.3dbrew.org/wiki/Ticket#Certificate_Chain
|
||||
/// </remarks>
|
||||
public Certificate?[]? CertificateChain { get; set; }
|
||||
public Certificate[]? CertificateChain { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,13 +136,13 @@ namespace SabreTools.Models.N3DS
|
||||
/// <summary>
|
||||
/// There are 64 of these records, usually only the first is used.
|
||||
/// </summary>
|
||||
public ContentInfoRecord?[]? ContentInfoRecords { get; set; }
|
||||
public ContentInfoRecord[]? ContentInfoRecords { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// There is one of these for each content contained in this title.
|
||||
/// (Determined by "Content Count" in the TMD Header).
|
||||
/// </summary>
|
||||
public ContentChunkRecord?[]? ContentChunkRecords { get; set; }
|
||||
public ContentChunkRecord[]? ContentChunkRecords { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Certificate chain
|
||||
@@ -150,6 +150,6 @@ namespace SabreTools.Models.N3DS
|
||||
/// <remarks>
|
||||
/// https://www.3dbrew.org/wiki/Title_metadata#Certificate_Chain
|
||||
/// </remarks>
|
||||
public Certificate?[]? CertificateChain { get; set; }
|
||||
public Certificate[]? CertificateChain { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace SabreTools.Models.NCF
|
||||
/// <summary>
|
||||
/// Directory entries data
|
||||
/// </summary>
|
||||
public DirectoryEntry?[]? DirectoryEntries { get; set; }
|
||||
public DirectoryEntry[]? DirectoryEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory names data
|
||||
@@ -31,22 +31,22 @@ namespace SabreTools.Models.NCF
|
||||
/// <summary>
|
||||
/// Directory info 1 entries data
|
||||
/// </summary>
|
||||
public DirectoryInfo1Entry?[]? DirectoryInfo1Entries { get; set; }
|
||||
public DirectoryInfo1Entry[]? DirectoryInfo1Entries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory info 2 entries data
|
||||
/// </summary>
|
||||
public DirectoryInfo2Entry?[]? DirectoryInfo2Entries { get; set; }
|
||||
public DirectoryInfo2Entry[]? DirectoryInfo2Entries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory copy entries data
|
||||
/// </summary>
|
||||
public DirectoryCopyEntry?[]? DirectoryCopyEntries { get; set; }
|
||||
public DirectoryCopyEntry[]? DirectoryCopyEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Directory local entries data
|
||||
/// </summary>
|
||||
public DirectoryLocalEntry?[]? DirectoryLocalEntries { get; set; }
|
||||
public DirectoryLocalEntry[]? DirectoryLocalEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unknown header data
|
||||
@@ -56,7 +56,7 @@ namespace SabreTools.Models.NCF
|
||||
/// <summary>
|
||||
/// Unknown entries data
|
||||
/// </summary>
|
||||
public UnknownEntry?[]? UnknownEntries { get; set; }
|
||||
public UnknownEntry[]? UnknownEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Checksum header data
|
||||
@@ -71,11 +71,11 @@ namespace SabreTools.Models.NCF
|
||||
/// <summary>
|
||||
/// Checksum map entries data
|
||||
/// </summary>
|
||||
public ChecksumMapEntry?[]? ChecksumMapEntries { get; set; }
|
||||
public ChecksumMapEntry[]? ChecksumMapEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Checksum entries data
|
||||
/// </summary>
|
||||
public ChecksumEntry?[]? ChecksumEntries { get; set; }
|
||||
public ChecksumEntry[]? ChecksumEntries { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/// entry points within this bundle by their ordinal number. The following
|
||||
/// describes the format of the entry table bundles.
|
||||
/// </remarks>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class EntryTableBundle
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -148,6 +148,7 @@ namespace SabreTools.Models.NewExecutable
|
||||
|
||||
public enum OperatingSystem : byte
|
||||
{
|
||||
Unknown = 0x00,
|
||||
OS2 = 0x01,
|
||||
WINDOWS = 0x02,
|
||||
EU_MSDOS4 = 0x03,
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// internal data used by the loader to manage the loaded executable
|
||||
/// modules in the system and to support dynamic linking.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://wiki.osdev.org/NE"/>
|
||||
public sealed class Executable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -57,5 +58,10 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// Nonresident-Name table
|
||||
/// </summary>
|
||||
public NonResidentNameTableEntry[]? NonResidentNameTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Segment relocation data
|
||||
/// </summary>
|
||||
public PerSegmentData[]? SegmentRelocationData { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,14 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// The NE header is a relatively large structure with multiple characteristics.
|
||||
/// Because of the age of the format some items are unclear in meaning.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://github.com/libyal/libexe/blob/main/documentation/Executable%20(EXE)%20file%20format.asciidoc#24-ne-extended-header"/>
|
||||
/// <see href="https://wiki.osdev.org/NE"/>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public sealed class ExecutableHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Signature word.
|
||||
/// "N" is low-order byte.
|
||||
/// "E" is high-order byte.
|
||||
/// "NE"
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
|
||||
public string? Magic;
|
||||
@@ -22,20 +21,22 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// <summary>
|
||||
/// Version number of the linker.
|
||||
/// </summary>
|
||||
/// <remarks>Also known as the major linker version</remarks>
|
||||
public byte LinkerVersion;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Revision number of the linker.
|
||||
/// </summary>
|
||||
/// <remarks>Also known as the minor linker version</remarks>
|
||||
public byte LinkerRevision;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Entry Table file offset, relative to the beginning of the segmented EXE header.
|
||||
/// </summary>
|
||||
public ushort EntryTableOffset;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes in the entry table.
|
||||
/// Length of entry table in bytes
|
||||
/// </summary>
|
||||
public ushort EntryTableSize;
|
||||
|
||||
@@ -81,12 +82,15 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// <summary>
|
||||
/// Segment number:offset of CS:IP.
|
||||
/// </summary>
|
||||
/// <remarks>CS:IP entry point, CS is index into segment table</remarks>
|
||||
public uint InitialCSIPSetting;
|
||||
|
||||
/// <summary>
|
||||
/// Segment number:offset of SS:SP.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// SS:SP initial stack pointer, SS is index into segment table
|
||||
///
|
||||
/// If SS equals the automatic data segment and SP equals
|
||||
/// zero, the stack pointer is set to the top of the
|
||||
/// automatic data segment just below the additional heap
|
||||
@@ -105,7 +109,7 @@ namespace SabreTools.Models.NewExecutable
|
||||
public ushort ModuleReferenceTableSize;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes in the Non-Resident Name Table.
|
||||
/// Size of non-resident names table in bytes
|
||||
/// </summary>
|
||||
public ushort NonResidentNameTableSize;
|
||||
|
||||
@@ -166,18 +170,20 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public OperatingSystem TargetOperatingSystem;
|
||||
|
||||
|
||||
#region OS/2 Specific
|
||||
|
||||
/// <summary>
|
||||
/// Other OS/2 flags
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public OS2Flag AdditionalFlags;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Offset to return thunks or start of gangload area
|
||||
/// </summary>
|
||||
public ushort ReturnThunkOffset;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Offset to segment reference thunks or size of gangload area
|
||||
/// </summary>
|
||||
@@ -187,15 +193,17 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// Minimum code swap area size
|
||||
/// </summary>
|
||||
public ushort MinCodeSwapAreaSize;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Windows SDK revison number
|
||||
/// </summary>
|
||||
public byte WindowsSDKRevision;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Windows SDK version number
|
||||
/// </summary>
|
||||
public byte WindowsSDKVersion;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace SabreTools.Models.NewExecutable
|
||||
{
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class ImportNameRelocationRecord
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace SabreTools.Models.NewExecutable
|
||||
{
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class ImportOrdinalRelocationRecord
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// characters. The strings are not null-terminated and are case
|
||||
/// sensitive.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class ImportedNameTableEntry
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace SabreTools.Models.NewExecutable
|
||||
{
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class InternalRefRelocationRecord
|
||||
{
|
||||
@@ -13,7 +13,7 @@ namespace SabreTools.Models.NewExecutable
|
||||
public byte SegmentNumber;
|
||||
|
||||
/// <summary>
|
||||
/// 0
|
||||
/// Always 0
|
||||
/// </summary>
|
||||
public byte Reserved;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// contains an offset for the module-name string within the imported-
|
||||
/// names table; each entry is 2 bytes long.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class ModuleReferenceTableEntry
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/// strings follow the same format as those defined in the resident name
|
||||
/// table.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class NonResidentNameTableEntry
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace SabreTools.Models.NewExecutable
|
||||
{
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class OSFixupRelocationRecord
|
||||
{
|
||||
|
||||
@@ -7,7 +7,14 @@
|
||||
/// follow the segment data in the file. The relocation fixup information
|
||||
/// is defined as follows:
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <remarks>
|
||||
/// To find the relocation data for a segment, seek to:
|
||||
/// <see cref="SegmentTableEntry.Offset"/>
|
||||
/// * (1 << <see cref="ExecutableHeader.SegmentAlignmentShiftCount"/>)
|
||||
/// + <see cref="SegmentTableEntry.Length"/>
|
||||
/// </remarks>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://wiki.osdev.org/NE"/>
|
||||
public sealed class PerSegmentData
|
||||
{
|
||||
/// <summary>
|
||||
@@ -18,6 +25,6 @@
|
||||
/// <summary>
|
||||
/// A table of relocation records follows.
|
||||
/// </summary>
|
||||
public RelocationRecord?[]? RelocationRecords { get; set; }
|
||||
public RelocationRecord[]? RelocationRecords { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// A table of relocation records follows. The following is the format
|
||||
/// of each relocation record.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class RelocationRecord
|
||||
{
|
||||
/// <summary>
|
||||
@@ -33,25 +33,25 @@
|
||||
/// <summary>
|
||||
/// INTERNALREF
|
||||
/// </summary>
|
||||
/// <remarks>Must be <c>NULL</c> if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.INTERNALREF"/></remarks>
|
||||
/// <remarks>Must be null if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.INTERNALREF"/></remarks>
|
||||
public InternalRefRelocationRecord? InternalRefRelocationRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IMPORTNAME
|
||||
/// </summary>
|
||||
/// <remarks>Must be <c>NULL</c> if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.IMPORTNAME"/></remarks>
|
||||
/// <remarks>Must be null if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.IMPORTNAME"/></remarks>
|
||||
public ImportNameRelocationRecord? ImportNameRelocationRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IMPORTORDINAL
|
||||
/// </summary>
|
||||
/// <remarks>Must be <c>NULL</c> if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.IMPORTORDINAL"/></remarks>
|
||||
/// <remarks>Must be null if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.IMPORTORDINAL"/></remarks>
|
||||
public ImportOrdinalRelocationRecord? ImportOrdinalRelocationRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// IMPORTORDINAL
|
||||
/// </summary>
|
||||
/// <remarks>Must be <c>NULL</c> if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.OSFIXUP"/></remarks>
|
||||
/// <remarks>Must be null if <see cref="Flags"/> is not set to <see cref="RelocationRecordFlag.OSFIXUP"/></remarks>
|
||||
public OSFixupRelocationRecord? OSFixupRelocationRecord { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/// are case-sensitive and are not null-terminated. The following
|
||||
/// describes the format of the name strings:
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class ResidentNameTableEntry
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// resource. It also defines the location and size of the resource. The
|
||||
/// following describes the contents of each of these structures:
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class ResourceTable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,7 +23,7 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// <summary>
|
||||
/// A table of resource type information blocks follows.
|
||||
/// </summary>
|
||||
public ResourceTypeInformationEntry?[]? ResourceTypes { get; set; }
|
||||
public ResourceTypeInformationEntry[]? ResourceTypes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Resource type and name strings are stored at the end of the
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/// resource table. Note that these strings are NOT null terminated and
|
||||
/// are case sensitive.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class ResourceTypeAndNameString
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
/// A table of resource type information blocks follows. The following
|
||||
/// is the format of each type information block:
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
public sealed class ResourceTypeInformationEntry
|
||||
{
|
||||
/// <summary>
|
||||
@@ -29,6 +29,6 @@
|
||||
/// <summary>
|
||||
/// A table of resources for this type follows.
|
||||
/// </summary>
|
||||
public ResourceTypeResourceEntry?[]? Resources { get; set; }
|
||||
public ResourceTypeResourceEntry[]? Resources { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// A table of resources for this type follows. The following is
|
||||
/// the format of each resource (8 bytes each):
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://wiki.osdev.org/NE"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class ResourceTypeResourceEntry
|
||||
{
|
||||
@@ -16,11 +17,13 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// of the alignment shift count value specified at
|
||||
/// beginning of the resource table.
|
||||
/// </summary>
|
||||
/// <remarks>Byte offset is: Offset * (1 << <see cref="ResourceTable.AlignmentShiftCount"/>)</remarks>
|
||||
public ushort Offset;
|
||||
|
||||
/// <summary>
|
||||
/// Length of the resource in the file (in bytes).
|
||||
/// </summary>
|
||||
/// <remarks>Byte length is: Length * (1 << <see cref="ResourceTable.AlignmentShiftCount"/>)</remarks>
|
||||
public ushort Length;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,8 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// EXE header. The first entry in the segment table is segment number 1.
|
||||
/// The following is the structure of a segment table entry.
|
||||
/// </summary>
|
||||
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://web.archive.org/web/20240422070115/http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
|
||||
/// <see href="https://wiki.osdev.org/NE"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class SegmentTableEntry
|
||||
{
|
||||
@@ -17,12 +18,13 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// data, relative to the beginning of the file. Zero means no
|
||||
/// file data.
|
||||
/// </summary>
|
||||
public ushort Offset;
|
||||
/// <remarks>Byte offset is: Offset * (1 << <see cref="ExecutableHeader.SegmentAlignmentShiftCount"/>)</remarks>
|
||||
public ushort Offset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the segment in the file, in bytes. Zero means 64K.
|
||||
/// </summary>
|
||||
public ushort Length;
|
||||
public ushort Length { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Flag word.
|
||||
@@ -34,6 +36,25 @@ namespace SabreTools.Models.NewExecutable
|
||||
/// Minimum allocation size of the segment, in bytes. Total size
|
||||
/// of the segment. Zero means 64K.
|
||||
/// </summary>
|
||||
public ushort MinimumAllocationSize;
|
||||
public ushort MinimumAllocationSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Segment data
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Data is not sequential to the entry header. It lives at
|
||||
/// the <see cref="Offset"/> and has a size of <see cref="Length"/>
|
||||
/// </remarks>
|
||||
public byte[]? Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Per-segment data
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This only exists if <see cref="FlagWord"/> has a flag value
|
||||
/// of <see cref="SegmentTableEntryFlag.RELOCINFO"/>. It immediately
|
||||
/// follows <see cref="Data"/>.
|
||||
/// </remarks>
|
||||
public PerSegmentData? PerSegmentData { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ namespace SabreTools.Models.Nitro
|
||||
/// <summary>
|
||||
/// File allocation table
|
||||
/// </summary>
|
||||
public FileAllocationTableEntry?[]? FileAllocationTable { get; set; }
|
||||
public FileAllocationTableEntry[]? FileAllocationTable { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -15,11 +15,11 @@ namespace SabreTools.Models.Nitro
|
||||
/// <summary>
|
||||
/// Folder allocation table
|
||||
/// </summary>
|
||||
public FolderAllocationTableEntry?[]? FolderAllocationTable { get; set; }
|
||||
public FolderAllocationTableEntry[]? FolderAllocationTable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name list
|
||||
/// </summary>
|
||||
public NameListEntry?[]? NameList { get; set; }
|
||||
public NameListEntry[]? NameList { get; set; }
|
||||
}
|
||||
}
|
||||
23
SabreTools.Models/OLE/ArrayDimension.cs
Normal file
23
SabreTools.Models/OLE/ArrayDimension.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The ArrayDimension packet represents the size and index offset of a dimension of an array
|
||||
/// property type.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class ArrayDimension
|
||||
{
|
||||
/// <summary>
|
||||
/// An unsigned integer representing the size of the dimension.
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A signed integer representing the index offset of the dimension. For
|
||||
/// example, an array dimension that is to be accessed with a 0-based index would have the value
|
||||
/// zero, whereas an array dimension that is to be accessed with a 1-based index would have the
|
||||
/// value 0x00000001.
|
||||
/// </summary>
|
||||
public int Value { get; set; }
|
||||
}
|
||||
}
|
||||
29
SabreTools.Models/OLE/ArrayHeader.cs
Normal file
29
SabreTools.Models/OLE/ArrayHeader.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The ArrayHeader packet represents the type and dimensions of an array property type.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class ArrayHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be set to the value obtained by clearing the VT_ARRAY (0x2000) bit of
|
||||
/// this array property's PropertyType value.
|
||||
/// </summary>
|
||||
public PropertyType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An unsigned integer representing the number of dimensions in the array
|
||||
/// property. MUST be at least 1 and at most 31.
|
||||
/// </summary>
|
||||
public uint NumDimensions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be a sequence of ArrayDimension packets
|
||||
///
|
||||
/// The number of scalar values in an array property can be calculated from the ArrayHeader packet
|
||||
/// as the product of the Size fields of each of the ArrayDimension packets.
|
||||
/// </summary>
|
||||
public ArrayDimension[]? Dimensions { get; set; }
|
||||
}
|
||||
}
|
||||
19
SabreTools.Models/OLE/BLOB.cs
Normal file
19
SabreTools.Models/OLE/BLOB.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The BLOB packet represents binary data
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class BLOB
|
||||
{
|
||||
/// <summary>
|
||||
/// The size in bytes of the <see cref="Bytes"> field, not including padding (if any)
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be an array of bytes, followed by zero padding to a multiple of 4 bytes.
|
||||
/// </summary>
|
||||
public byte[]? Bytes { get; set; }
|
||||
}
|
||||
}
|
||||
15
SabreTools.Models/OLE/CURRENCY.cs
Normal file
15
SabreTools.Models/OLE/CURRENCY.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The CURRENCY (Packet Version) packet represents a CURRENCY as specified in [MS-OAUT]
|
||||
/// section 2.2.24.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class CURRENCY
|
||||
{
|
||||
/// <summary>
|
||||
/// The value of the int64 field specified in [MS-OAUT] section 2.2.24.
|
||||
/// </summary>
|
||||
public ulong Value { get; set; }
|
||||
}
|
||||
}
|
||||
26
SabreTools.Models/OLE/ClipboardData.cs
Normal file
26
SabreTools.Models/OLE/ClipboardData.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The ClipboardData packet represents clipboard data
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class ClipboardData
|
||||
{
|
||||
/// <summary>
|
||||
/// The total size in bytes of the <see cref="Format"> and <see cref="Data"> fields,
|
||||
/// not including padding (if any).
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An application-specific identifier for the format of the data in the
|
||||
/// <see cref="Data"> field.
|
||||
/// </summary>
|
||||
public uint Format { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be an array of bytes, followed by zero padding to a multiple of 4 bytes
|
||||
/// </summary>
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
33
SabreTools.Models/OLE/CodePageString.cs
Normal file
33
SabreTools.Models/OLE/CodePageString.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The CodePageString packet represents a string whose encoding depends on the
|
||||
/// value of the property set's CodePage property.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class CodePageString
|
||||
{
|
||||
/// <summary>
|
||||
/// The size in bytes of the <see cref="Characters"/> field, including the null terminator,
|
||||
/// but not including padding (if any). If the property set's CodePage property
|
||||
/// has the value CP_WINUNICODE (0x04B0), then the value MUST be a multiple of 2
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If <see cref="Size"/> is zero, this field MUST be zero bytes in length. If <see cref="Size"/>
|
||||
/// is nonzero and the CodePage property set's CodePage property has the value CP_WINUNICODE (0x04B0),
|
||||
/// then the value MUST be a null-terminated array of 16-bit Unicode characters, followed by zero
|
||||
/// padding to a multiple of 4 bytes. If <see cref="Size"/> is nonzero and the property set's CodePage
|
||||
/// property has any other value, it MUST be a null-terminated array of 8-bit characters from the code
|
||||
/// page identified by the CodePage property, followed by zero padding to a multiple of 4 bytes. The
|
||||
/// string represented by this field MAY contain embedded or additional trailing null characters and
|
||||
/// an OLEPS implementation MUST be able to handle such strings. However, the manner in which
|
||||
/// strings with embedded or additional trailing null characters are presented by the implementation
|
||||
/// to an application is implementation-specific. For maximum interoperability, an OLEPS
|
||||
/// implementation SHOULD NOT write strings with embedded or trailing null characters unless
|
||||
/// specifically requested to do so by an application.
|
||||
/// </summary>
|
||||
public string? Characters { get; set; }
|
||||
}
|
||||
}
|
||||
90
SabreTools.Models/OLE/Constants.cs
Normal file
90
SabreTools.Models/OLE/Constants.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
#region Format IDs
|
||||
|
||||
public const string SummaryInformationFMTIDString = "F29F85E0-4FF9-1068-AB91-08002B27B3D9";
|
||||
public static readonly GUID SummaryInformationFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0xF29F85E0,
|
||||
Data2 = 0x4FF9,
|
||||
Data3 = 0x1068,
|
||||
Data4 = [0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9],
|
||||
};
|
||||
|
||||
public const string DocSummaryInformationFMTIDString = "D5CDD502-2E9C-101B-9397-08002B2CF9AE";
|
||||
public static readonly GUID DocSummaryInformationFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0xD5CDD502,
|
||||
Data2 = 0x2E9C,
|
||||
Data3 = 0x101B,
|
||||
Data4 = [0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE],
|
||||
};
|
||||
|
||||
public const string UserDefinedPropertiesFMTIDString = "D5CDD502-2E9C-101B-9397-08002B2CF9AE";
|
||||
public static readonly GUID UserDefinedPropertiesFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0xD5CDD502,
|
||||
Data2 = 0x2E9C,
|
||||
Data3 = 0x101B,
|
||||
Data4 = [0x93, 0x97, 0x08, 0x00, 0x2B, 0x2C, 0xF9, 0xAE],
|
||||
};
|
||||
|
||||
public const string GlobalInfoFMTIDString = "56616F00-C154-11CE-8553-00AA00A1F95B";
|
||||
public static readonly GUID GlobalInfoFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0x56616F00,
|
||||
Data2 = 0xC154,
|
||||
Data3 = 0x11CE,
|
||||
Data4 = [0x85, 0x53, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x5B],
|
||||
};
|
||||
|
||||
public const string ImageContentsFMTIDString = "556616400-C154-11CE-8553-00AA00A1F95B";
|
||||
public static readonly GUID ImageContentsFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0x56616F00,
|
||||
Data2 = 0xC154,
|
||||
Data3 = 0x11CE,
|
||||
Data4 = [0x85, 0x53, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x5B],
|
||||
};
|
||||
|
||||
public const string ImageInfoFMTIDString = "556616400-C154-11CE-8553-00AA00A1F95B";
|
||||
public static readonly GUID ImageInfoFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0x56616F00,
|
||||
Data2 = 0xC154,
|
||||
Data3 = 0x11CE,
|
||||
Data4 = [0x85, 0x53, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x5B],
|
||||
};
|
||||
|
||||
public const string PropertyBagFMTIDString = "20001801-5DE6-11D1-8E38-00C04FB9386D";
|
||||
public static readonly GUID PropertyBagFMTIDGUID = new()
|
||||
{
|
||||
Data1 = 0x20001801,
|
||||
Data2 = 0x5DE6,
|
||||
Data3 = 0x11D1,
|
||||
Data4 = [0x8E, 0x38, 0x00, 0xC0, 0x4F, 0xB9, 0x38, 0x6D],
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
#region Stream or Storage Names
|
||||
|
||||
public static readonly string SummaryInformationName = (byte)0x05 + "SummaryInformation";
|
||||
|
||||
public static readonly string DocSummaryInformationName = (byte)0x05 + "DocumentSummaryInformation";
|
||||
|
||||
public static readonly string UserDefinedPropertiesName = (byte)0x05 + "DocumentSummaryInformation";
|
||||
|
||||
public static readonly string GlobalInfoName = (byte)0x05 + "GlobalInfo";
|
||||
|
||||
public static readonly string ImageContentsName = (byte)0x05 + "ImageContents";
|
||||
|
||||
public static readonly string ImageInfoName = (byte)0x05 + "ImageInfo";
|
||||
|
||||
public const string ControlStreamName = "{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}";
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
35
SabreTools.Models/OLE/ControlStream.cs
Normal file
35
SabreTools.Models/OLE/ControlStream.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// A file that has one or more property sets associated with it through the alternate
|
||||
/// stream binding MUST have a control stream, which is an alternate stream with the name
|
||||
/// "{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}". This stream MUST contain the following packet.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class ControlStream
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be set to zero, and nonzero values MUST be rejected.
|
||||
/// </summary>
|
||||
public ushort Reserved1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be set to zero, and MUST be ignored.
|
||||
/// </summary>
|
||||
public ushort Reserved2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An application-provided value that MUST NOT be interpreted by the
|
||||
/// OLEPS implementation. If the application did not provide a value,
|
||||
/// it SHOULD be set to zero.
|
||||
/// </summary>
|
||||
public uint ApplicationState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An application-provided value that MUST NOT be interpreted by the
|
||||
/// OLEPS implementation. If the application did not provide a value,
|
||||
/// it SHOULD be absent.
|
||||
/// </summary>
|
||||
public GUID? CLSID { get; set; }
|
||||
}
|
||||
}
|
||||
16
SabreTools.Models/OLE/DATE.cs
Normal file
16
SabreTools.Models/OLE/DATE.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The DATE (Packet Version) packet represents a DATE as specified in [MS-OAUT]
|
||||
/// section 2.2.25
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class DATE
|
||||
{
|
||||
/// <summary>
|
||||
/// The value of the DATE is an 8-byte IEEE floating-point number, as specified in
|
||||
/// [MS-OAUT] section 2.2.25.
|
||||
/// </summary>
|
||||
public ulong Value { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user