Files
BinaryObjectScanner/BinaryObjectScanner.Packer/IntelInstallationFramework.cs

55 lines
1.9 KiB
C#
Raw Normal View History

using System;
2022-05-01 21:02:59 -07:00
using System.IO;
using BinaryObjectScanner.Interfaces;
2023-03-07 16:59:14 -05:00
using BinaryObjectScanner.Wrappers;
2023-03-09 23:52:58 -05:00
namespace BinaryObjectScanner.Packer
{
// TODO: Add extraction, seems to primarily use MSZip compression.
2023-03-09 16:02:51 -05:00
public class IntelInstallationFramework : IExtractable, IPortableExecutableCheck
{
/// <inheritdoc/>
2022-05-01 17:17:15 -07:00
public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
if (sections == null)
return null;
2022-04-02 16:12:23 -07:00
string name = pex.FileDescription;
2022-12-05 10:47:17 -08:00
if (name?.Equals("Intel(R) Installation Framework", StringComparison.OrdinalIgnoreCase) == true
|| name?.Equals("Intel Installation Framework", StringComparison.OrdinalIgnoreCase) == true)
{
return $"Intel Installation Framework {pex.GetInternalVersion()}";
}
2022-04-02 16:12:23 -07:00
name = pex.ProductName;
2022-12-05 15:46:56 -08:00
if (name?.Equals("Intel(R) Installation Framework", StringComparison.OrdinalIgnoreCase) == true
|| name?.Equals("Intel Installation Framework", StringComparison.OrdinalIgnoreCase) == true)
{
return $"Intel Installation Framework {pex.GetInternalVersion()}";
2021-08-30 11:47:49 -07:00
}
return null;
}
2022-05-01 21:02:59 -07:00
/// <inheritdoc/>
2023-03-09 17:16:39 -05:00
public string Extract(string file, bool includeDebug)
{
if (!File.Exists(file))
return null;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
{
2023-03-09 17:16:39 -05:00
return Extract(fs, file, includeDebug);
}
}
/// <inheritdoc/>
2023-03-09 17:16:39 -05:00
public string Extract(Stream stream, string file, bool includeDebug)
{
return null;
}
}
}