diff --git a/BurnOutSharp/BurnOutSharp.csproj b/BurnOutSharp/BurnOutSharp.csproj index 9ca4b16a..bcada3f1 100644 --- a/BurnOutSharp/BurnOutSharp.csproj +++ b/BurnOutSharp/BurnOutSharp.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0;net6.0 BurnOutSharp BurnOutSharp Port of BurnOut to C#, with additions @@ -57,14 +57,23 @@ - - - - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -76,7 +85,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/BurnOutSharp/FileType/MicrosoftCAB.cs b/BurnOutSharp/FileType/MicrosoftCAB.cs index 05df5791..884d3110 100644 --- a/BurnOutSharp/FileType/MicrosoftCAB.cs +++ b/BurnOutSharp/FileType/MicrosoftCAB.cs @@ -8,8 +8,10 @@ using System.Text; using BurnOutSharp.Interfaces; using BurnOutSharp.Tools; using ComponentAce.Compression.Libs.zlib; +#if NETSTANDARD2_0 using WixToolset.Dtf.Compression; using WixToolset.Dtf.Compression.Cab; +#endif namespace BurnOutSharp.FileType { @@ -34,6 +36,10 @@ namespace BurnOutSharp.FileType /// public ConcurrentDictionary> Scan(Scanner scanner, Stream stream, string file) { +#if NET6_0_OR_GREATER + // WixToolset does not work with .NET 6.0 and is bound to Windows + return null; +#else // If the cab file itself fails try { @@ -67,9 +73,10 @@ namespace BurnOutSharp.FileType } return null; +#endif } - #region LibMSPackSharp +#region LibMSPackSharp // TODO: Add stream opening support /// @@ -157,14 +164,14 @@ namespace BurnOutSharp.FileType // return null; //} - #endregion +#endregion - #region TEMPORARY AREA FOR MS-CAB FORMAT +#region TEMPORARY AREA FOR MS-CAB FORMAT // TODO: Add multi-cabinet reading internal class MSCABCabinet { - #region Constants +#region Constants /// /// A maximum uncompressed size of an input file to store in CAB @@ -191,9 +198,9 @@ namespace BurnOutSharp.FileType /// public const uint MaximumUncompressedFolderSize = 0x7FFF8000; - #endregion +#endregion - #region Properties +#region Properties /// /// Cabinet header @@ -210,9 +217,9 @@ namespace BurnOutSharp.FileType /// public CFFILE[] Files { get; private set; } - #endregion +#endregion - #region Serialization +#region Serialization /// /// Deserialize at into a MSCABCabinet object @@ -254,9 +261,9 @@ namespace BurnOutSharp.FileType return cabinet; } - #endregion +#endregion - #region Public Functionality +#region Public Functionality /// /// Find the start of an MS-CAB cabinet in a set of data, if possible @@ -358,7 +365,7 @@ namespace BurnOutSharp.FileType /// public void PrintInfo() { - #region CFHEADER +#region CFHEADER if (Header == null) { @@ -368,9 +375,9 @@ namespace BurnOutSharp.FileType Header.PrintInfo(); - #endregion +#endregion - #region CFFOLDER +#region CFFOLDER if (Folders == null || Folders.Length == 0) { @@ -397,9 +404,9 @@ namespace BurnOutSharp.FileType Console.WriteLine(); - #endregion +#endregion - #region CFFILE +#region CFFILE if (Files == null || Files.Length == 0) { @@ -426,12 +433,12 @@ namespace BurnOutSharp.FileType Console.WriteLine(); - #endregion +#endregion } - #endregion +#endregion - #region Internal Functionality +#region Internal Functionality /// /// Get a null-terminated string as a byte array from input data @@ -449,7 +456,7 @@ namespace BurnOutSharp.FileType return str; } - #endregion +#endregion } /// @@ -458,7 +465,7 @@ namespace BurnOutSharp.FileType /// internal class CFHEADER { - #region Constants +#region Constants /// /// Human-readable signature @@ -475,9 +482,9 @@ namespace BurnOutSharp.FileType /// public static readonly byte[] SignatureBytes = new byte[] { 0x4D, 0x53, 0x43, 0x46 }; - #endregion +#endregion - #region Properties +#region Properties /// /// Contains the characters "M", "S", "C", and "F" (bytes 0x4D, 0x53, 0x43, @@ -619,9 +626,9 @@ namespace BurnOutSharp.FileType /// public byte[] DiskNext { get; private set; } - #endregion +#endregion - #region Serialization +#region Serialization /// /// Deserialize at into a CFHEADER object @@ -723,9 +730,9 @@ namespace BurnOutSharp.FileType return header; } - #endregion +#endregion - #region Public Functionality +#region Public Functionality /// /// Print all info about the cabinet file @@ -770,7 +777,7 @@ namespace BurnOutSharp.FileType Console.WriteLine(); } - #endregion +#endregion } [Flags] @@ -819,7 +826,7 @@ namespace BurnOutSharp.FileType /// internal class CFFOLDER { - #region Properties +#region Properties /// /// Specifies the absolute file offset of the first CFDATA field block for the folder. @@ -852,9 +859,9 @@ namespace BurnOutSharp.FileType /// public Dictionary DataBlocks { get; private set; } = new Dictionary(); - #endregion +#endregion - #region Generated Properties +#region Generated Properties /// /// Get the uncompressed data associated with this folder, if possible @@ -900,9 +907,9 @@ namespace BurnOutSharp.FileType } } - #endregion +#endregion - #region Serialization +#region Serialization /// /// Deserialize at into a CFFOLDER object @@ -939,9 +946,9 @@ namespace BurnOutSharp.FileType return folder; } - #endregion +#endregion - #region Public Functionality +#region Public Functionality /// /// Print all info about the cabinet file @@ -956,7 +963,7 @@ namespace BurnOutSharp.FileType Console.WriteLine(); } - #endregion +#endregion } internal enum CompressionType : ushort @@ -998,7 +1005,7 @@ namespace BurnOutSharp.FileType /// internal class CFFILE { - #region Properties +#region Properties /// /// Specifies the uncompressed size of this file, in bytes. @@ -1050,9 +1057,9 @@ namespace BurnOutSharp.FileType /// public byte[] Name { get; private set; } - #endregion +#endregion - #region Generated Properties +#region Generated Properties /// /// Name value as a string (not null-terminated) @@ -1106,9 +1113,9 @@ namespace BurnOutSharp.FileType } } - #endregion +#endregion - #region Serialization +#region Serialization /// /// Deserialize at into a CFFILE object @@ -1136,9 +1143,9 @@ namespace BurnOutSharp.FileType return file; } - #endregion +#endregion - #region Public Functionality +#region Public Functionality /// /// Print all info about the cabinet file @@ -1155,7 +1162,7 @@ namespace BurnOutSharp.FileType Console.WriteLine(); } - #endregion +#endregion } internal enum FolderIndex : ushort @@ -1227,7 +1234,7 @@ namespace BurnOutSharp.FileType /// internal class CFDATA { - #region Properties +#region Properties /// /// Checksum of this CFDATA structure, from the through the @@ -1266,9 +1273,9 @@ namespace BurnOutSharp.FileType /// public byte[] CompressedData { get; private set; } - #endregion +#endregion - #region Serialization +#region Serialization /// /// Deserialize at into a CFDATA object @@ -1304,7 +1311,7 @@ namespace BurnOutSharp.FileType return dataBlock; } - #endregion +#endregion } /// @@ -1322,9 +1329,9 @@ namespace BurnOutSharp.FileType //} } - #endregion +#endregion - #region TEMPORARY AREA FOR MS-ZIP COMPRESSION FORMAT +#region TEMPORARY AREA FOR MS-ZIP COMPRESSION FORMAT /// /// Each MSZIP block MUST consist of a 2-byte MSZIP signature and one or more RFC 1951 blocks. The @@ -1333,7 +1340,7 @@ namespace BurnOutSharp.FileType /// internal class MSZIPBlock { - #region Constants +#region Constants /// /// Human-readable signature @@ -1350,9 +1357,9 @@ namespace BurnOutSharp.FileType /// public static readonly byte[] SignatureBytes = new byte[] { 0x43, 0x4B }; - #endregion +#endregion - #region Properties +#region Properties /// /// 'CB' @@ -1374,15 +1381,15 @@ namespace BurnOutSharp.FileType /// public byte[] Data { get; private set; } - #endregion +#endregion - #region Static Properties +#region Static Properties public static ZStream DecompressionStream { get; set; } = new ZStream(); - #endregion +#endregion - #region Serialization +#region Serialization public static MSZIPBlock Deserialize(byte[] data) { @@ -1403,9 +1410,9 @@ namespace BurnOutSharp.FileType return block; } - #endregion +#endregion - #region Public Functionality +#region Public Functionality /// /// Decompress a single block of MS-ZIP data @@ -1460,12 +1467,12 @@ namespace BurnOutSharp.FileType } } - #endregion +#endregion } - #endregion +#endregion - #region TEMPORARY AREA FOR QUANTUM COMPRESSION FORMAT +#region TEMPORARY AREA FOR QUANTUM COMPRESSION FORMAT // See http://www.russotto.net/quantumcomp.html for details about implementation @@ -1512,7 +1519,7 @@ namespace BurnOutSharp.FileType SELECTOR_6_LENGTH = 7, } - #region LZ Compression Tables +#region LZ Compression Tables internal static readonly uint[] PositionBaseTable = new uint[] { @@ -1550,7 +1557,7 @@ namespace BurnOutSharp.FileType 5, 5, 0, }; - #endregion +#endregion /// /// Number of position slots for (tsize - 10) @@ -1648,15 +1655,15 @@ namespace BurnOutSharp.FileType public ModelSymbol[] Symbols { get; private set; } } - #endregion +#endregion - #region TEMPORARY AREA FOR LZX COMPRESSION FORMAT +#region TEMPORARY AREA FOR LZX COMPRESSION FORMAT // See the following for details about implementation (there is no open spec): // https://github.com/kyz/libmspack/blob/master/libmspack/mspack/lzx.h // https://github.com/kyz/libmspack/blob/master/libmspack/mspack/lzxc.c // https://github.com/kyz/libmspack/blob/master/libmspack/mspack/lzxd.c - #endregion +#endregion } } diff --git a/HLLibSharp b/HLLibSharp index e2448d44..5dbd81f7 160000 --- a/HLLibSharp +++ b/HLLibSharp @@ -1 +1 @@ -Subproject commit e2448d44eda4b0bfb840a1a853115856b00e336a +Subproject commit 5dbd81f76e995a400f22dd3f7473ba1f0044512b diff --git a/LibMSPackSharp b/LibMSPackSharp index 57baf4d0..13dacdd6 160000 --- a/LibMSPackSharp +++ b/LibMSPackSharp @@ -1 +1 @@ -Subproject commit 57baf4d05a88f4d448f9e8d3bf268da19ecb04a6 +Subproject commit 13dacdd6f2cce7beea47fca56db4b6499075f3b1