2023-02-08 14:04:47 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Linq;
|
2023-03-09 11:52:28 -05:00
|
|
|
|
using BinaryObjectScanner.Interfaces;
|
2023-03-07 16:59:14 -05:00
|
|
|
|
using BinaryObjectScanner.Wrappers;
|
2023-02-08 12:43:15 -07:00
|
|
|
|
|
2023-03-09 23:19:27 -05:00
|
|
|
|
namespace BinaryObjectScanner.Protection
|
2023-02-08 12:43:15 -07:00
|
|
|
|
{
|
|
|
|
|
|
public class MGIRegistration : IPortableExecutableCheck
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
2023-02-08 14:04:47 -07:00
|
|
|
|
string name = pex.ProductName;
|
|
|
|
|
|
|
|
|
|
|
|
// Found in "Register.dll" in IA item "MGIPhotoSuite4.0AndPhotoVista2.02001".
|
|
|
|
|
|
if (name?.Equals("MGI Registration Utility", StringComparison.Ordinal) == true)
|
2023-03-09 23:19:27 -05:00
|
|
|
|
return $"MGI Registration {pex.GetInternalVersion()}";
|
2023-02-08 14:04:47 -07:00
|
|
|
|
|
2023-02-08 12:43:15 -07:00
|
|
|
|
// Found in "Register.dll" from "VideoWaveIII" in IA item "mgi-videowave-iii-version-3.00-mgi-software-2000".
|
|
|
|
|
|
var resources = pex.FindStringTableByEntry("MGI Registration");
|
|
|
|
|
|
if (resources.Any())
|
|
|
|
|
|
return "MGI Registration";
|
|
|
|
|
|
|
2023-02-08 14:04:47 -07:00
|
|
|
|
// Found in "Register.dll" in IA item "MGIPhotoSuite4.0AndPhotoVista2.02001".
|
|
|
|
|
|
resources = pex.FindStringTableByEntry("Register@register.mgisoft.com");
|
|
|
|
|
|
if (resources.Any())
|
|
|
|
|
|
return "MGI Registration";
|
|
|
|
|
|
|
2023-02-08 12:43:15 -07:00
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|