From 64e67b8daaf122235a3af9adac443a8ac6de8ead Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 31 Oct 2020 23:17:03 -0700 Subject: [PATCH] Gate non-core compatible includes --- BurnOutSharp/BurnOutSharp.csproj | 11 +++++++---- BurnOutSharp/FileType/MSI.cs | 6 ++++++ BurnOutSharp/FileType/MicrosoftCAB.cs | 7 ++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/BurnOutSharp/BurnOutSharp.csproj b/BurnOutSharp/BurnOutSharp.csproj index 659fdad5..ea3fce3b 100644 --- a/BurnOutSharp/BurnOutSharp.csproj +++ b/BurnOutSharp/BurnOutSharp.csproj @@ -21,15 +21,18 @@ true + + + NET_FRAMEWORK + - - + + - - + diff --git a/BurnOutSharp/FileType/MSI.cs b/BurnOutSharp/FileType/MSI.cs index 9c5f6738..1a690dbb 100644 --- a/BurnOutSharp/FileType/MSI.cs +++ b/BurnOutSharp/FileType/MSI.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.IO; +#if NET_FRAMEWORK using Microsoft.Deployment.WindowsInstaller; +#endif namespace BurnOutSharp.FileType { @@ -9,8 +11,10 @@ namespace BurnOutSharp.FileType { public static bool ShouldScan(byte[] magic) { +#if NET_FRAMEWORK if (magic.StartsWith(new byte[] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 })) return true; +#endif return false; } @@ -18,6 +22,7 @@ namespace BurnOutSharp.FileType // TODO: Add stream opening support public static Dictionary> Scan(Scanner scanner, string file) { +#if NET_FRAMEWORK // If the MSI file itself fails try { @@ -45,6 +50,7 @@ namespace BurnOutSharp.FileType return protections; } catch { } +#endif return null; } diff --git a/BurnOutSharp/FileType/MicrosoftCAB.cs b/BurnOutSharp/FileType/MicrosoftCAB.cs index 932ff599..f0cdb230 100644 --- a/BurnOutSharp/FileType/MicrosoftCAB.cs +++ b/BurnOutSharp/FileType/MicrosoftCAB.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.IO; +#if NET_FRAMEWORK using LibMSPackN; +#endif namespace BurnOutSharp.FileType { @@ -9,8 +11,10 @@ namespace BurnOutSharp.FileType { public static bool ShouldScan(byte[] magic) { +#if NET_FRAMEWORK if (magic.StartsWith(new byte[] { 0x4d, 0x53, 0x43, 0x46 })) return true; +#endif return false; } @@ -18,6 +22,7 @@ namespace BurnOutSharp.FileType // TODO: Add stream opening support public static Dictionary> Scan(Scanner scanner, string file) { +#if NET_FRAMEWORK // If the cab file itself fails try { @@ -54,7 +59,7 @@ namespace BurnOutSharp.FileType return protections; } catch { } - +#endif return null; } }