From ee0193eb713cab696353869d9cadc552c64518d7 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 27 Aug 2021 13:30:24 -0700 Subject: [PATCH] Clean up some usings, add note to NSIS --- BurnOutSharp/PackerType/AdvancedInstaller.cs | 1 - BurnOutSharp/PackerType/Armadillo.cs | 1 - BurnOutSharp/PackerType/InnoSetup.cs | 1 - BurnOutSharp/PackerType/InstallerVISE.cs | 1 - .../PackerType/IntelInstallationFramework.cs | 3 --- BurnOutSharp/PackerType/NSIS.cs | 18 +++++++++++++++++- BurnOutSharp/Tools/Utilities.cs | 5 ++++- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/BurnOutSharp/PackerType/AdvancedInstaller.cs b/BurnOutSharp/PackerType/AdvancedInstaller.cs index 8e6737ce..c033c893 100644 --- a/BurnOutSharp/PackerType/AdvancedInstaller.cs +++ b/BurnOutSharp/PackerType/AdvancedInstaller.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Text; using BurnOutSharp.ExecutableType.Microsoft; using BurnOutSharp.Matching; -using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { diff --git a/BurnOutSharp/PackerType/Armadillo.cs b/BurnOutSharp/PackerType/Armadillo.cs index b2398751..e1334ecd 100644 --- a/BurnOutSharp/PackerType/Armadillo.cs +++ b/BurnOutSharp/PackerType/Armadillo.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Text; using BurnOutSharp.ExecutableType.Microsoft; using BurnOutSharp.Matching; -using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { diff --git a/BurnOutSharp/PackerType/InnoSetup.cs b/BurnOutSharp/PackerType/InnoSetup.cs index be1b6b49..5892c1fd 100644 --- a/BurnOutSharp/PackerType/InnoSetup.cs +++ b/BurnOutSharp/PackerType/InnoSetup.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Text; using BurnOutSharp.ExecutableType.Microsoft; using BurnOutSharp.Matching; -using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { diff --git a/BurnOutSharp/PackerType/InstallerVISE.cs b/BurnOutSharp/PackerType/InstallerVISE.cs index 0060c7ed..52fb2ab9 100644 --- a/BurnOutSharp/PackerType/InstallerVISE.cs +++ b/BurnOutSharp/PackerType/InstallerVISE.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text; using BurnOutSharp.ExecutableType.Microsoft; using BurnOutSharp.Matching; -using BurnOutSharp.Tools; namespace BurnOutSharp.PackerType { diff --git a/BurnOutSharp/PackerType/IntelInstallationFramework.cs b/BurnOutSharp/PackerType/IntelInstallationFramework.cs index 54bd66d2..a234a6aa 100644 --- a/BurnOutSharp/PackerType/IntelInstallationFramework.cs +++ b/BurnOutSharp/PackerType/IntelInstallationFramework.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using BurnOutSharp.ExecutableType.Microsoft; using BurnOutSharp.Matching; using BurnOutSharp.Tools; diff --git a/BurnOutSharp/PackerType/NSIS.cs b/BurnOutSharp/PackerType/NSIS.cs index 3522e0fd..221a8b02 100644 --- a/BurnOutSharp/PackerType/NSIS.cs +++ b/BurnOutSharp/PackerType/NSIS.cs @@ -31,7 +31,23 @@ namespace BurnOutSharp.PackerType } /// - public string CheckContents(string file, byte[] fileContent, bool includeDebug = false) => null; + public string CheckContents(string file, byte[] fileContent, bool includeDebug = false) + { + // Get the sections from the executable, if possible + // PortableExecutable pex = PortableExecutable.Deserialize(fileContent, 0); + // var sections = pex?.SectionTable; + // if (sections == null) + // return null; + + // TODO: Implement resource finding instead of using the built in methods + // Assembly information lives in the .rsrc section + // I need to find out how to navigate the resources in general + // as well as figure out the specific resources for both + // file info and MUI (XML) info. Once I figure this out, + // that also opens the doors to easier assembly XML checks. + + return null; + } public static string GetVersion(string file, byte[] fileContent, List positions) { diff --git a/BurnOutSharp/Tools/Utilities.cs b/BurnOutSharp/Tools/Utilities.cs index 1e51eacf..54b0a368 100644 --- a/BurnOutSharp/Tools/Utilities.cs +++ b/BurnOutSharp/Tools/Utilities.cs @@ -367,7 +367,10 @@ namespace BurnOutSharp.Tools /// /// Byte array representing the file contents /// Embedded assembly manifest as a string, if possible - /// TODO: How do we find the manifest specifically better? + /// + /// TODO: How do we find the manifest specifically better + /// TODO: This should be derived specifically in the .rsrc section + /// private static string GetEmbeddedAssemblyManifest(byte[] fileContent) { //