mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-07 21:31:10 +00:00
Compare commits
59 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 |
16
.github/workflows/build_and_test.yml
vendored
16
.github/workflows/build_and_test.yml
vendored
@@ -16,22 +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: Run tests
|
||||
run: dotnet test
|
||||
|
||||
- name: Run publish script
|
||||
run: ./publish-nix.sh
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: 'Nuget Package'
|
||||
path: '*.nupkg'
|
||||
|
||||
- name: Upload to rolling
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
with:
|
||||
allowUpdates: True
|
||||
artifacts: '*.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
|
||||
|
||||
52
README.MD
52
README.MD
@@ -12,10 +12,52 @@ For the most recent stable build, download the latest release here: [Releases Pa
|
||||
|
||||
For the latest WIP build here: [Rolling Release](https://github.com/SabreTools/SabreTools.Models/releases/rolling)
|
||||
|
||||
## Missing Metadata Models
|
||||
## Notable Information Sources
|
||||
|
||||
The following metadata file formats do not have models included in this library yet and, as such, do not have serializers:
|
||||
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.
|
||||
|
||||
- Missfile
|
||||
- SabreJSON
|
||||
- SabreDAT XML
|
||||
| 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 |
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
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; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
35
SabreTools.Models/OLE/DECIMAL.cs
Normal file
35
SabreTools.Models/OLE/DECIMAL.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The DECIMAL (Packet Version) packet represents a DECIMAL as specified in [MS-OAUT] section
|
||||
/// 2.2.26
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class DECIMAL
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be set to zero and MUST be ignored
|
||||
/// </summary>
|
||||
public ushort Reserved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the scale field specified in [MS-OAUT] section 2.2.26
|
||||
/// </summary>
|
||||
public byte Scale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the sign field specified in [MS-OAUT] section 2.2.26
|
||||
/// </summary>
|
||||
public byte Sign { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the Hi32 field specified in [MS-OAUT] section 2.2.26
|
||||
/// </summary>
|
||||
public uint Hi32 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the Lo64 field specified in [MS-OAUT] section 2.2.26
|
||||
/// </summary>
|
||||
public ulong Lo64 { get; set; }
|
||||
}
|
||||
}
|
||||
24
SabreTools.Models/OLE/Dictionary.cs
Normal file
24
SabreTools.Models/OLE/Dictionary.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The Dictionary packet represents all mappings between property identifiers and
|
||||
/// property names in a property set
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class Dictionary
|
||||
{
|
||||
/// <summary>
|
||||
/// n unsigned integer representing the number of entries in the Dictionary
|
||||
/// </summary>
|
||||
public uint NumEntries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// All Entry fields MUST be a sequence of DictionaryEntry packets. Entries are
|
||||
/// not required to appear in any particular order.
|
||||
/// </summary>
|
||||
public DictionaryEntry[]? Entries { get; set; }
|
||||
|
||||
// Padding (variable): Padding, if necessary, to a total length that is a multiple of 4 bytes.
|
||||
// Padding would be after each dictionary entry
|
||||
}
|
||||
}
|
||||
35
SabreTools.Models/OLE/DictionaryEntry.cs
Normal file
35
SabreTools.Models/OLE/DictionaryEntry.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The DictionaryEntry packet represents a mapping between a property identifier and a
|
||||
/// property name
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class DictionaryEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// An unsigned integer representing a property identifier. MUST be a valid
|
||||
/// PropertyIdentifier value in the range 0x00000002 to 0x7FFFFFFF, inclusive
|
||||
/// (this specifically excludes the property identifiers for any of the special
|
||||
/// properties specified in section 2.18).
|
||||
/// </summary>
|
||||
public PropertyIdentifier PropertyIdentifier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the property set's CodePage property has the value CP_WINUNICODE (0x04B0),
|
||||
/// MUST be the length of the Name field in 16-bit Unicode characters, including
|
||||
/// the null terminator but not including padding (if any). Otherwise, MUST be the
|
||||
/// length of the Name field in 8-bit characters, including the null terminator.
|
||||
/// </summary>
|
||||
public uint Length { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the property set's CodePage property has the value CP_WINUNICODE (0x04B0),
|
||||
/// MUST be a null-terminated array of 16-bit Unicode characters, followed by zero
|
||||
/// padding to a multiple of 4 bytes. Otherwise, MUST be a null-terminated array of
|
||||
/// 8-bit characters from the code page identified by the CodePage property and MUST
|
||||
/// NOT be padded.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
||||
503
SabreTools.Models/OLE/Enums.cs
Normal file
503
SabreTools.Models/OLE/Enums.cs
Normal file
@@ -0,0 +1,503 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The PropertyIdentifier data type represents the property identifier of a property in a property set
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The SummaryInformation property set format, identified by FMTID_SummaryInformation
|
||||
/// ({F29F85E0-4FF9-1068-AB91-08002B27B3D9}), represents generic properties of a document. The properties
|
||||
/// specific to the SummaryInformation property set are specified in the following table. Except where
|
||||
/// otherwise stated, a SummaryInformation property set SHOULD have all of these properties, and SHOULD
|
||||
/// NOT have any other properties, except for the special properties specified in section 2.18.
|
||||
/// </remarks>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public enum PropertyIdentifier : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Property identifier for the Dictionary property
|
||||
/// </summary>
|
||||
DICTIONARY_PROPERTY_IDENTIFIER = 0x00000000,
|
||||
|
||||
/// <summary>
|
||||
/// Property identifier for the CodePage property
|
||||
/// </summary>
|
||||
CODEPAGE_PROPERTY_IDENTIFIER = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// Property identifier for the Locale property
|
||||
/// </summary>
|
||||
LOCALE_PROPERTY_IDENTIFIER = 0x80000000,
|
||||
|
||||
/// <summary>
|
||||
/// Property identifier for the Behavior property
|
||||
/// </summary>
|
||||
BEHAVIOR_PROPERTY_IDENTIFIER = 0x80000003,
|
||||
|
||||
#region SummaryInformation
|
||||
|
||||
/// <summary>
|
||||
/// The title of the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_TITLE = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// The subject of the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_SUBJECT = 0x00000003,
|
||||
|
||||
/// <summary>
|
||||
/// The author of the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_AUTHOR = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// Keywords related to the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_KEYWORDS = 0x00000005,
|
||||
|
||||
/// <summary>
|
||||
/// Comments related the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_COMMENTS = 0x00000006,
|
||||
|
||||
/// <summary>
|
||||
/// The application-specific template from which the document was created.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_TEMPLATE = 0x00000007,
|
||||
|
||||
/// <summary>
|
||||
/// The last author of the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_LASTAUTHOR = 0x00000008,
|
||||
|
||||
/// <summary>
|
||||
/// An application-specific revision number for this version of the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_REVNUMBER = 0x00000009,
|
||||
|
||||
/// <summary>
|
||||
/// A 64-bit unsigned integer indicating the total amount of time that
|
||||
/// has been spent editing the document in 100-nanosecond
|
||||
/// increments. MUST be encoded as a FILETIME by setting the
|
||||
/// dwLowDataTime field to the low 32-bits and the dwHighDateTime
|
||||
/// field to the high 32-bits.
|
||||
/// </summary>
|
||||
/// <remarks>VT_FILETIME</remarks>
|
||||
PIDSI_EDITTIME = 0x0000000A,
|
||||
|
||||
/// <summary>
|
||||
/// The most recent time that the document was printed.
|
||||
/// </summary>
|
||||
/// <remarks>VT_FILETIME</remarks>
|
||||
PIDSI_LASTPRINTED = 0x0000000B,
|
||||
|
||||
/// <summary>
|
||||
/// The time that the document was created.
|
||||
/// </summary>
|
||||
/// <remarks>VT_FILETIME</remarks>
|
||||
PIDSI_CREATE_DTM = 0x0000000C,
|
||||
|
||||
/// <summary>
|
||||
/// The most recent time that the document was saved.
|
||||
/// </summary>
|
||||
/// <remarks>VT_FILETIME</remarks>
|
||||
PIDSI_LASTSAVE_DTM = 0x0000000D,
|
||||
|
||||
/// <summary>
|
||||
/// The total number of pages in the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_I4</remarks>
|
||||
PIDSI_PAGECOUNT = 0x0000000E,
|
||||
|
||||
/// <summary>
|
||||
/// The total number of words in the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_I4</remarks>
|
||||
PIDSI_WORDCOUNT = 0x0000000F,
|
||||
|
||||
/// <summary>
|
||||
/// The total number of characters in the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_I4</remarks>
|
||||
PIDSI_CHARCOUNT = 0x00000010,
|
||||
|
||||
/// <summary>
|
||||
/// Application-specific clipboard data containing a thumbnail
|
||||
/// representing the document's contents. MAY be absent.
|
||||
/// </summary>
|
||||
/// <remarks>VT_CF</remarks>
|
||||
PIDSI_THUMBNAIL = 0x00000011,
|
||||
|
||||
/// <summary>
|
||||
/// The name of the application that was used to create the document.
|
||||
/// </summary>
|
||||
/// <remarks>VT_LPSTR</remarks>
|
||||
PIDSI_APPNAME = 0x00000012,
|
||||
|
||||
/// <summary>
|
||||
/// A 32-bit signed integer representing a set of application-suggested
|
||||
/// access control flags with the following values:
|
||||
/// - 0x00000001: Password protected
|
||||
/// - 0x00000002: Read-only recommended
|
||||
/// - 0x00000004: Read-only enforced
|
||||
/// - 0x00000008: Locked for annotations
|
||||
/// </summary>
|
||||
/// <remarks>VT_I4</remarks>
|
||||
PIDSI_DOC_SECURITY = 0x00000013,
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The PropertyType enumeration represents the type of a property in a property set. The set of types
|
||||
/// supported depends on the version of the property set, which is indicated by the Version field of the
|
||||
/// PropertySetStream packet. In addition, the property types not supported in simple property sets
|
||||
/// are specified as such. PropertyType is an enumeration, which MUST be one of the following values
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public enum PropertyType : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Type is undefined, and the minimum property set version is 0
|
||||
/// </summary>
|
||||
VT_EMPTY = 0x0000,
|
||||
|
||||
/// <summary>
|
||||
/// Type is null, and the minimum property set version is 0
|
||||
/// </summary>
|
||||
VT_NULL = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 16-bit signed integer, and the minimum property set version is 0
|
||||
/// </summary>
|
||||
VT_I2 = 0x0002,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 32-bit signed integer, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_I4 = 0x0003,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 4-byte (single-precision) IEEE floating-point number, and the
|
||||
/// minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_R4 = 0x0004,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 8-byte (double-precision) IEEE floating-point number, and the
|
||||
/// minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_R8 = 0x0005,
|
||||
|
||||
/// <summary>
|
||||
/// Type is CURRENCY, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_CY = 0x0006,
|
||||
|
||||
/// <summary>
|
||||
/// Type is DATE, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_DATE = 0x0007,
|
||||
|
||||
/// <summary>
|
||||
/// Type is CodePageString, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_BSTR = 0x0008,
|
||||
|
||||
/// <summary>
|
||||
/// Type is HRESULT, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_ERROR = 0x000A,
|
||||
|
||||
/// <summary>
|
||||
/// Type is VARIANT_BOOL, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_BOOL = 0x000B,
|
||||
|
||||
/// <summary>
|
||||
/// Type is DECIMAL, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_DECIMAL = 0x000E,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 1-byte signed integer, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_I1 = 0x0010,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 1-byte unsigned integer, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_UI1 = 0x0011,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 2-byte unsigned integer, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_UI2 = 0x0012,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 4-byte unsigned integer, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_UI4 = 0x0013,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 8-byte signed integer, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_I8 = 0x0014,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 8-byte unsigned integer, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_UI8 = 0x0015,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 4-byte signed integer, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_INT = 0x0016,
|
||||
|
||||
/// <summary>
|
||||
/// Type is 4-byte unsigned integer, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_UINT = 0x0017,
|
||||
|
||||
/// <summary>
|
||||
/// Type is CodePageString, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_LPSTR = 0x001E,
|
||||
|
||||
/// <summary>
|
||||
/// Type is UnicodeString, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_LPWSTR = 0x001F,
|
||||
|
||||
/// <summary>
|
||||
/// Type is FILETIME, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_FILETIME = 0x0040,
|
||||
|
||||
/// <summary>
|
||||
/// Type is binary large object (BLOB), and the minimum property set
|
||||
/// version is 0.
|
||||
/// </summary>
|
||||
VT_BLOB = 0x0041,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Stream, and the minimum property set version is 0. VT_STREAM
|
||||
/// is not allowed in a simple property set.
|
||||
/// </summary>
|
||||
VT_STREAM = 0x0042,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Storage, and the minimum property set version is 0. VT_STORAGE
|
||||
/// is not allowed in a simple property set.
|
||||
/// </summary>
|
||||
VT_STORAGE = 0x0043,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Stream representing an Object in an application-specific manner,
|
||||
/// and the minimum property set version is 0. VT_STREAMED_Object is not
|
||||
/// allowed in a simple property set.
|
||||
/// </summary>
|
||||
VT_STREAMED_Object = 0x0044,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Storage representing an Object in an application-specific manner,
|
||||
/// and the minimum property set version is 0. VT_STORED_Object is not
|
||||
/// allowed in a simple property set.
|
||||
/// </summary>
|
||||
VT_STORED_Object = 0x0045,
|
||||
|
||||
/// <summary>
|
||||
/// Type is BLOB representing an object in an application-specific manner.
|
||||
/// The minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_BLOB_Object = 0x0046,
|
||||
|
||||
/// <summary>
|
||||
/// Type is PropertyIdentifier, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_CF = 0x0047,
|
||||
|
||||
/// <summary>
|
||||
/// Type is CLSID, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_CLSID = 0x0048,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Stream with application-specific version GUID (VersionedStream).
|
||||
/// The minimum property set version is 0. VT_VERSIONED_STREAM is not allowed
|
||||
/// in a simple property set.
|
||||
/// </summary>
|
||||
VT_VERSIONED_STREAM = 0x0049,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector, and the minimum property set version is 0
|
||||
/// </summary>
|
||||
VT_VECTOR = 0x1000,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of 1-byte unsigned integers, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_UI1 = 0x1011,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of 2-byte unsigned integers, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_UI2 = 0x1012,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of 4-byte unsigned integers, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_UI4 = 0x1013,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of 8-byte signed integers, and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_I8 = 0x1014,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of 8-byte unsigned integers and the minimum property set version
|
||||
/// is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_UI8 = 0x1015,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of CodePageString, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_LPSTR = 0x101E,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of UnicodeString, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_LPWSTR = 0x101F,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of FILETIME, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_FILETIME = 0x1040,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of PropertyIdentifier, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_CF = 0x1047,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Vector of CLSID, and the minimum property set version is 0.
|
||||
/// </summary>
|
||||
VT_VECTOR_CLSID = 0x1048,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 16-bit signed integers, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_I2 = 0x2002,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 32-bit signed integers, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_I4 = 0x2003,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 4-byte (single-precision) IEEE floating-point numbers, and the
|
||||
/// minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_R4 = 0x2004,
|
||||
|
||||
/// <summary>
|
||||
/// Type is IEEE floating-point numbers, and the minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_R8 = 0x2005,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of CURRENCY, and the minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_CY = 0x2006,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of DATE, and the minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_DATE = 0x2007,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of CodePageString, and the minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_BSTR = 0x2008,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of HRESULT, and the minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_ERROR = 0x200A,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of VARIANT_BOOL, and the minimum property set version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_BOOL = 0x200B,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of variable-typed properties, and the minimum property set
|
||||
/// version is 1
|
||||
/// </summary>
|
||||
VT_ARRAY_VARIANT = 0x200C,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of DECIMAL, and the minimum property set version is 1
|
||||
/// </summary>
|
||||
VT_ARRAY_DECIMAL = 0x200E,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 1-byte signed integers, and the minimum property set
|
||||
/// version is 1
|
||||
/// </summary>
|
||||
VT_ARRAY_I1 = 0x2010,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 1-byte unsigned integers, and the minimum property set
|
||||
/// version is 1
|
||||
/// </summary>
|
||||
VT_ARRAY_UI1 = 0x2011,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 2-byte unsigned integers, and the minimum property set
|
||||
/// version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_UI2 = 0x2012,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 4-byte unsigned integers, and the minimum property set
|
||||
/// version is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_UI4 = 0x2013,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 4-byte signed integers, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_INT = 0x2016,
|
||||
|
||||
/// <summary>
|
||||
/// Type is Array of 4-byte unsigned integers, and the minimum property set version
|
||||
/// is 1.
|
||||
/// </summary>
|
||||
VT_ARRAY_UINT = 0x2017,
|
||||
}
|
||||
}
|
||||
19
SabreTools.Models/OLE/FILETIME.cs
Normal file
19
SabreTools.Models/OLE/FILETIME.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The FILETIME (Packet Version) packet represents a FILETIME structure ([MS-DTYP] section 2.3.3
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class FILETIME
|
||||
{
|
||||
/// <summary>
|
||||
/// The value of the dwLowDateTime field specified in [MS-DTYP] section 2.3.3.
|
||||
/// </summary>
|
||||
public uint LowDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the dwHighDateTime field specified in [MS-DTYP] section 2.3.3.
|
||||
/// </summary>
|
||||
public uint HighDateTime { get; set; }
|
||||
}
|
||||
}
|
||||
29
SabreTools.Models/OLE/GUID.cs
Normal file
29
SabreTools.Models/OLE/GUID.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The GUID (Packet Version) packet represents a GUID
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class GUID
|
||||
{
|
||||
/// <summary>
|
||||
/// The value of the Data1 field specified in [MS-DTYP] section 2.3.4
|
||||
/// </summary>
|
||||
public uint Data1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the Data2 field specified in [MS-DTYP] section 2.3.4
|
||||
/// </summary>
|
||||
public ushort Data2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the Data3 field specified in [MS-DTYP] section 2.3.4
|
||||
/// </summary>
|
||||
public ushort Data3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the Data4 field specified in [MS-DTYP] section 2.3.4
|
||||
/// </summary>
|
||||
public byte[]? Data4 { get; set; }
|
||||
}
|
||||
}
|
||||
19
SabreTools.Models/OLE/IndirectPropertyName.cs
Normal file
19
SabreTools.Models/OLE/IndirectPropertyName.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The IndirectPropertyName packet represents the name of a stream or storage as used in the
|
||||
/// representation of the following property types in a non-simple property set: VT_STREAM (0x0042),
|
||||
/// VT_STORAGE (0x0043), VT_STREAMED_OBJECT (0x0044), VT_STORED_OBJECT (0x0044), and
|
||||
/// VT_VERSIONED_STREAM (0x0049). It MUST be represented as a CodePageString, and its value MUST
|
||||
/// be derived from the property identifier of the property represented according to the following
|
||||
/// Augmented Backus–Naur Form (ABNF) [RFC4234] syntax.
|
||||
///
|
||||
/// Indirectproperty = "prop" propertyIdentifier
|
||||
///
|
||||
/// Where PropertyIdentifier is the decimal string representation of the property identifier. This property
|
||||
/// identifier MUST be a valid PropertyIdentifier value and MUST NOT be the property identifier for any of
|
||||
/// the special properties specified in section 2.18.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class IndirectPropertyName : CodePageString { }
|
||||
}
|
||||
23
SabreTools.Models/OLE/PropertyIdentifierAndOffset.cs
Normal file
23
SabreTools.Models/OLE/PropertyIdentifierAndOffset.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The PropertyIdentifierAndOffset packet is used in the PropertySet packet to represent a
|
||||
/// property identifier and the byte offset of the property in the PropertySet packet
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class PropertyIdentifierAndOffset
|
||||
{
|
||||
/// <summary>
|
||||
/// An unsigned integer representing the property identifier of a property
|
||||
/// in the property set. MUST be a valid PropertyIdentifier value.
|
||||
/// </summary>
|
||||
public PropertyIdentifier PropertyIdentifier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An unsigned integer representing the offset in bytes from the beginning
|
||||
/// of the PropertySet packet to the beginning of the Property field for the
|
||||
/// property represented. MUST be a multiple of 4 bytes.
|
||||
/// </summary>
|
||||
public uint Offset { get; set; }
|
||||
}
|
||||
}
|
||||
36
SabreTools.Models/OLE/PropertySet.cs
Normal file
36
SabreTools.Models/OLE/PropertySet.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The PropertySet packet represents a property set.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class PropertySet
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be the total size in bytes of the PropertySet packet
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An unsigned integer representing the number of properties in the
|
||||
/// property set.
|
||||
/// </summary>
|
||||
public uint NumProperties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// All PropertyIdentifierAndOffset fields MUST be a sequence of
|
||||
/// PropertyIdentifierAndOffset packets. The sequence MUST be in order of
|
||||
/// increasing value of the Offset field. Packets are not required to be
|
||||
/// in any particular order with regard to the value of the PropertyIdentifier
|
||||
/// field.
|
||||
/// </summary>
|
||||
public PropertyIdentifierAndOffset[]? PropertyIdentifierAndOffsets { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Each Property field is a sequence of property values, each of which MUST
|
||||
/// be represented by a TypedPropertyValue packet or a Dictionary packet in
|
||||
/// the special case of the Dictionary property.
|
||||
/// </summary>
|
||||
public object[]? Properties { get; set; }
|
||||
}
|
||||
}
|
||||
106
SabreTools.Models/OLE/PropertySetStream.cs
Normal file
106
SabreTools.Models/OLE/PropertySetStream.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The PropertySetStream packet specifies the stream format for simple property
|
||||
/// sets and the stream format for the CONTENTS stream in the Non-Simple Property
|
||||
/// Set Storage Format. A simple property set MUST be represented by a stream
|
||||
/// containing a PropertySetStream packet.
|
||||
///
|
||||
/// The PropertySetStream packet usually represents exactly one property set, but
|
||||
/// for historical reasons, the DocumentSummaryInfo and UserDefinedProperties
|
||||
/// property sets are represented in the same stream.In this special case, a
|
||||
/// PropertySetStream might represent two property sets.
|
||||
///
|
||||
/// An implementation SHOULD enforce a limit on the total size of a PropertySetStream
|
||||
/// packet. This limit MUST be at least 262,144 bytes, and for maximum interoperability
|
||||
/// SHOULD be 2,097,152 bytes.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class PropertySetStream
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be set to 0xFFFE
|
||||
/// </summary>
|
||||
public ushort ByteOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An unsigned integer indicating the version number of the property set (or
|
||||
/// property sets). MUST be 0x0000 or 0x0001. An OLEPS implementation MUST
|
||||
/// accept version 0 property sets and SHOULD<5> also accept version 1 property
|
||||
/// sets. This field MUST be set to 0x0001 if the property set or property sets
|
||||
/// use any of the following features not supported by version 0 property sets:
|
||||
/// - Property types not supported for version 0 property sets, as specified in
|
||||
/// the PropertyType enumeration.
|
||||
/// - The Behavior property.
|
||||
///
|
||||
/// If the property set does not use any of these features, this field SHOULD be
|
||||
/// set to 0x0000 for maximum interoperability.
|
||||
/// </summary>
|
||||
public ushort Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An implementation-specific value that SHOULD be ignored, except possibly to
|
||||
/// report this value to applications. It SHOULD NOT be interpreted by the
|
||||
/// OLEPS implementation.
|
||||
/// </summary>
|
||||
public uint SystemIdentifier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be a GUID (Packet Version) packet representing the associated CLSID of
|
||||
/// the property set (or property sets). If no CLSID is provided by the
|
||||
/// application, it SHOULD be set to GUID_NULL by default.
|
||||
/// </summary>
|
||||
public GUID? CLSID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An unsigned integer indicating the number of property sets represented by
|
||||
/// this PropertySetStream structure. MUST be either 0x00000001 or 0x00000002.
|
||||
///
|
||||
/// - 0x00000001: This structure contains one property set
|
||||
/// - 0x00000002: This structure contains two property sets.
|
||||
/// The optional fields for PropertySet 1 are present.
|
||||
/// </summary>
|
||||
public uint NumPropertySets { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A GUID that MUST be set to the FMTID of the property set represented by the
|
||||
/// field PropertySet 0. If NumPropertySets has the value 0x00000002, then this
|
||||
/// GUID MUST be set to FMTID_DocSummaryInformation
|
||||
/// ({D5CDD502-2E9C-101B-9397-08002B2CF9AE}).
|
||||
/// </summary>
|
||||
public GUID? FMTID0 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An unsigned integer that MUST be set to the offset in bytes from the beginning
|
||||
/// of this PropertySetStream structure to the beginning of the field PropertySet 0.
|
||||
/// </summary>
|
||||
public uint Offset0 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If NumPropertySets has the value 0x00000002, it MUST be set to FMTID_UserDefinedProperties
|
||||
/// ({D5CDD505-2E9C-101B-9397-08002B2CF9AE}). Otherwise, it MUST be absent.
|
||||
/// </summary>
|
||||
public GUID? FMTID1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If NumPropertySets has the value 0x00000002, it MUST be set to the offset in bytes
|
||||
/// from the beginning of this PropertySetStream structure to the beginning of the
|
||||
/// field PropertySet 1. Otherwise, it MUST be absent.
|
||||
/// </summary>
|
||||
public uint? Offset1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be a PropertySet packet
|
||||
/// </summary>
|
||||
public PropertySet? PropertySet0 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If NumPropertySets has the value 0x00000002, it MUST be a PropertySet packet.
|
||||
/// Otherwise, it MUST be absent.
|
||||
/// </summary>
|
||||
public PropertySet? PropertySet1 { get; set; }
|
||||
|
||||
// Padding (variable): Contains additional padding added by the implementation.
|
||||
// If present, padding MUST be zeroes and MUST be ignored.
|
||||
}
|
||||
}
|
||||
27
SabreTools.Models/OLE/TypedPropertyValue.cs
Normal file
27
SabreTools.Models/OLE/TypedPropertyValue.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The TypedPropertyValue structure represents the typed value of a property in a property set
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class TypedPropertyValue
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be a value from the PropertyType enumeration, indicating the type of
|
||||
/// property represented.
|
||||
/// </summary>
|
||||
public PropertyType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be set to zero, and any nonzero value SHOULD be rejected
|
||||
/// </summary>
|
||||
public ushort Padding { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be the value of the property represented and serialized according to
|
||||
/// the value of Type as follows.
|
||||
/// </summary>
|
||||
/// <remarks>See documentation for required lengths</remarks>
|
||||
public byte[]? Value { get; set; }
|
||||
}
|
||||
}
|
||||
23
SabreTools.Models/OLE/UnicodeString.cs
Normal file
23
SabreTools.Models/OLE/UnicodeString.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The UnicodeString packet represents a Unicode string.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class UnicodeString
|
||||
{
|
||||
/// <summary>
|
||||
/// The length in 16-bit Unicode characters of the <see cref="Characters"/> field, including the null
|
||||
/// terminator, but not including padding (if any).
|
||||
/// </summary>
|
||||
public uint Length { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If <see cref="Length"/> is zero, this field MUST be zero bytes in length. If <see cref="Length"/> is
|
||||
/// nonzero, this field MUST be a null-terminated array of 16-bit Unicode characters, followed by zero
|
||||
/// padding to a multiple of 4 bytes. The string represented by this field SHOULD NOT contain
|
||||
/// embedded or additional trailing null characters.
|
||||
/// </summary>
|
||||
public string? Characters { get; set; }
|
||||
}
|
||||
}
|
||||
14
SabreTools.Models/OLE/VectorHeader.cs
Normal file
14
SabreTools.Models/OLE/VectorHeader.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The VectorHeader packet represents the number of scalar values in a vector property type.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class VectorHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// An unsigned integer indicating the number of scalar values following the header.
|
||||
/// </summary>
|
||||
public uint Length { get; set; }
|
||||
}
|
||||
}
|
||||
19
SabreTools.Models/OLE/VersionedStream.cs
Normal file
19
SabreTools.Models/OLE/VersionedStream.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace SabreTools.Models.OLE
|
||||
{
|
||||
/// <summary>
|
||||
/// The VersionedStream packet represents a stream with an application-specific version GUID.
|
||||
/// </summary>
|
||||
/// <see href="https://winprotocoldoc.z19.web.core.windows.net/MS-OLEPS/%5bMS-OLEPS%5d.pdf"/>
|
||||
public class VersionedStream
|
||||
{
|
||||
/// <summary>
|
||||
/// MUST be a GUID (Packet Version).
|
||||
/// </summary>
|
||||
public GUID? VersionGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MUST be an IndirectPropertyName.
|
||||
/// </summary>
|
||||
public IndirectPropertyName? StreamName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -23,4 +23,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <remarks>Variable byte length based on field code</remarks>
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
SabreTools.Models/PKZIP/AesEncryptionStructure.cs
Normal file
33
SabreTools.Models/PKZIP/AesEncryptionStructure.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// WinZip AES encryption data
|
||||
/// </summary>
|
||||
/// <remarks>Header ID = 0x9901</remarks>
|
||||
/// <see href="https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Zip/Headers/LocalEntryHeaderExtraFactory.cs"/>
|
||||
public class AesEncryptionStructure : ExtensibleDataField
|
||||
{
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
/// <remarks>Values 0f 0x01 and 0x02 are accepted</remarks>
|
||||
public ushort CompressionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Vendor ID
|
||||
/// </summary>
|
||||
/// <remarks>Should be 0x4541</remarks>
|
||||
public ushort VendorID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
/// <remarks>This value is unreferenced</remarks>
|
||||
public byte Unknown { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compression method
|
||||
/// </summary>
|
||||
public CompressionMethod CompressionMethod { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -6,36 +6,10 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <remarks>PKZIP archives are meant to be read from the end</remarks>
|
||||
public class Archive
|
||||
{
|
||||
#region Entries, Interleaved
|
||||
|
||||
/// <summary>
|
||||
/// Local file headers, always appear first in each group
|
||||
/// Local file entries
|
||||
/// </summary>
|
||||
public LocalFileHeader[]? LocalFileHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Encryption headers, may appear second in each group
|
||||
/// </summary>
|
||||
/// TODO: Determine the model for the encryption headers
|
||||
public byte[][]? EncryptionHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File data, appears after the encryption header
|
||||
/// if it exists or after the local file header otherwise
|
||||
/// </summary>
|
||||
public byte[][]? FileData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data descriptors, appears after the file data
|
||||
/// </summary>
|
||||
public DataDescriptor[]? DataDescriptors { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ZIP64 Data descriptors, appears after the file data
|
||||
/// </summary>
|
||||
public DataDescriptor64[]? ZIP64DataDescriptors { get; set; }
|
||||
|
||||
#endregion
|
||||
public LocalFile[]? LocalFiles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional archive decryption header, appears after all entries
|
||||
@@ -69,4 +43,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public EndOfCentralDirectoryRecord? EndOfCentralDirectoryRecord { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? ExtraFieldData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,11 +109,11 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <summary>
|
||||
/// Extra field (variable size)
|
||||
/// </summary>
|
||||
public byte[]? ExtraField { get; set; }
|
||||
public ExtensibleDataField? ExtraField { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File comment (variable size)
|
||||
/// </summary>
|
||||
public string? FileComment { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,4 +82,4 @@ namespace SabreTools.Models.PKZIP
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public uint UncompressedSize { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public ulong UncompressedSize { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? Padding { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? SignatureData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public uint TotalDisks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,4 +76,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public string? FileComment { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,4 +69,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? ExtensibleDataSector { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
|
||||
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
|
||||
/// <see href="https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Zip/Headers/LocalEntryHeaderExtraFactory.cs"/>
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
[Flags]
|
||||
@@ -1002,6 +1003,18 @@ namespace SabreTools.Models.PKZIP
|
||||
*/
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum RecordedTimeFlag : byte
|
||||
{
|
||||
None = 0,
|
||||
|
||||
LastModified = 1,
|
||||
|
||||
LastAccessed = 2,
|
||||
|
||||
Created = 4,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ZipItInternalSettings : ushort
|
||||
{
|
||||
@@ -1805,4 +1818,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </remarks>8 bytes Big Endian</remarks>
|
||||
IBMCMPSCCompressionSize = 0x4102,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
SabreTools.Models/PKZIP/ExtendedTimestampExtraField.cs
Normal file
33
SabreTools.Models/PKZIP/ExtendedTimestampExtraField.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// The unix modified time, last access time, and creation time, if set
|
||||
/// </summary>
|
||||
/// <remarks>Header ID = 0x5455</remarks>
|
||||
/// <see href="https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Zip/Headers/LocalEntryHeaderExtraFactory.cs"/>
|
||||
public class ExtendedTimestampExtraField : ExtensibleDataField
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates what tiemstamps are included
|
||||
/// </summary>
|
||||
public RecordedTimeFlag Flags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last modified time
|
||||
/// </summary>
|
||||
/// <remarks>Only available when <see cref="RecordedTimeFlag.LastModified"/> is set</remarks>
|
||||
public uint? LastModified { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Last accessed time
|
||||
/// </summary>
|
||||
/// <remarks>Only available when <see cref="RecordedTimeFlag.LastAccessed"/> is set</remarks>
|
||||
public uint? LastAccessed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Created on time
|
||||
/// </summary>
|
||||
/// <remarks>Only available when <see cref="RecordedTimeFlag.Created"/> is set</remarks>
|
||||
public uint? CreatedOn { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public ushort DataSize { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,4 +36,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <remarks>16 bytes</remarks>
|
||||
public byte[]? MD5 { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,4 +51,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public string? UnicodeCom { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,4 +51,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public string? UnicodeName { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? TData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
40
SabreTools.Models/PKZIP/LocalFile.cs
Normal file
40
SabreTools.Models/PKZIP/LocalFile.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// PKZIP local file
|
||||
/// </summary>
|
||||
/// <see href="https://petlibrary.tripod.com/ZIP.HTM"/>
|
||||
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
|
||||
public class LocalFile
|
||||
{
|
||||
/// <summary>
|
||||
/// Local file header
|
||||
/// </summary>
|
||||
public LocalFileHeader? LocalFileHeader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Encryption header
|
||||
/// </summary>
|
||||
/// TODO: Determine the model for the encryption headers
|
||||
public byte[]? EncryptionHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File data, appears after the encryption header
|
||||
/// if it exists or after the local file header otherwise
|
||||
/// </summary>
|
||||
public byte[]? FileData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Data descriptors, appears after the file data
|
||||
/// </summary>
|
||||
/// <remarks>Cannot exist if <see cref="ZIP64DataDescriptor"/> is populated</remarks>
|
||||
public DataDescriptor? DataDescriptor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ZIP64 Data descriptors, appears after the file data
|
||||
/// </summary>
|
||||
/// <remarks>Cannot exist if <see cref="DataDescriptor"/> is populated</remarks>
|
||||
public DataDescriptor64? ZIP64DataDescriptor { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,6 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <summary>
|
||||
/// Extra field (variable size)
|
||||
/// </summary>
|
||||
public byte[]? ExtraField { get; set; }
|
||||
public ExtensibleDataField? ExtraField { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? Var { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? Padding { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,23 +14,9 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public uint Reserved { get; set; }
|
||||
|
||||
#region Tags, Interleaved
|
||||
|
||||
/// <summary>
|
||||
/// NTFS attribute tag values
|
||||
/// NTFS attribute tags
|
||||
/// </summary>
|
||||
public ushort[]? Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of attributes, in bytes
|
||||
/// </summary>
|
||||
public ushort[]? Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attribute data
|
||||
/// </summary>
|
||||
public byte[]? Vars { get; set; }
|
||||
|
||||
#endregion
|
||||
public TagSizeVar[]? TagSizeVars { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,21 +16,21 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <summary>
|
||||
/// Uncompressed Block Size
|
||||
/// </summary>
|
||||
public uint BSize { get; set; }
|
||||
public uint UncompressedBlockSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compression type
|
||||
/// </summary>
|
||||
public ushort CType { get; set; }
|
||||
public ushort CompressionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CRC value for uncompress block
|
||||
/// </summary>
|
||||
public uint EACRC { get; set; }
|
||||
public uint CRC32 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compressed block
|
||||
/// </summary>
|
||||
public byte[]? Var { get; set; }
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <summary>
|
||||
/// Attribute data (see APPENDIX A)
|
||||
/// </summary>
|
||||
public byte[]? Var { get; set; }
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,23 +28,9 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public uint CRC { get; set; }
|
||||
|
||||
#region Tags, Interleaved
|
||||
|
||||
/// <summary>
|
||||
/// OpenVMS attribute tag values
|
||||
/// OpenVMS attribute tags
|
||||
/// </summary>
|
||||
public ushort[]? Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of attributes, in bytes
|
||||
/// </summary>
|
||||
public ushort[]? Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attribute data
|
||||
/// </summary>
|
||||
public byte[]? Vars { get; set; }
|
||||
|
||||
#endregion
|
||||
public TagSizeVar[]? TagSizeVars { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? CStore { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? TData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,4 +47,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public uint NewCRC { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? TData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? TData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,23 +4,9 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
|
||||
public class RecordManagementControls : ExtensibleDataField
|
||||
{
|
||||
#region Tags, Interleaved
|
||||
|
||||
/// <summary>
|
||||
/// NTFS attribute tag values
|
||||
/// Record management control attribute tags
|
||||
/// </summary>
|
||||
public ushort[]? Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Size of attributes, in bytes
|
||||
/// </summary>
|
||||
public ushort[]? Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attribute data
|
||||
/// </summary>
|
||||
public byte[]? Vars { get; set; }
|
||||
|
||||
#endregion
|
||||
public TagSizeVar[]? TagSizeVars { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// TODO: Implement models for all extra field types - 4.5.3
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </remarks>
|
||||
public byte[]? CertData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
SabreTools.Models/PKZIP/TagSizeVar.cs
Normal file
24
SabreTools.Models/PKZIP/TagSizeVar.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents a common tag/size/data combination
|
||||
/// structure that is used by multiple extra field types.
|
||||
/// </summary>
|
||||
public class TagSizeVar
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute tag
|
||||
/// </summary>
|
||||
public ushort Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attribute size
|
||||
/// </summary>
|
||||
public ushort Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Variable-length data
|
||||
/// </summary>
|
||||
public byte[]? Var { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -24,26 +24,26 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <summary>
|
||||
/// File last access time
|
||||
/// </summary>
|
||||
public uint Atime { get; set; }
|
||||
public uint FileLastAccessTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File last modification time
|
||||
/// </summary>
|
||||
public uint Mtime { get; set; }
|
||||
public uint FileLastModificationTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File user ID
|
||||
/// </summary>
|
||||
public ushort Uid { get; set; }
|
||||
public ushort FileUserID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File group ID
|
||||
/// </summary>
|
||||
public ushort Gid { get; set; }
|
||||
public ushort FileGroupID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Variable length data field
|
||||
/// </summary>
|
||||
public byte[]? Var { get; set; }
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
SabreTools.Models/PKZIP/UnknownExtraField.cs
Normal file
15
SabreTools.Models/PKZIP/UnknownExtraField.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace SabreTools.Models.PKZIP
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents any unknown extras fields that are either
|
||||
/// unmapped or undiscovered. All unknown header IDs map to
|
||||
/// this data type.
|
||||
/// </summary>
|
||||
public class UnknownExtraField : ExtensibleDataField
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? TData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// </summary>
|
||||
public byte[]? TData { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <remarks>Variable byte length based on field code</remarks>
|
||||
public byte[]? Data { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,4 +45,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <remarks>Only exists if parent entry corresponding value is max</remarks>
|
||||
public uint? DiskStartNumber { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ namespace SabreTools.Models.PKZIP
|
||||
/// <remarks>4 bytes</remarks>
|
||||
public byte[]? Creator { 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