Add PE content checks for Uplay

This commit is contained in:
Matt Nadareski
2022-03-14 14:56:41 -07:00
parent edfc3c6c5d
commit 70e64e57dd
2 changed files with 54 additions and 6 deletions

View File

@@ -1,18 +1,59 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using BurnOutSharp.ExecutableType.Microsoft.PE;
using BurnOutSharp.Matching;
using BurnOutSharp.Tools;
namespace BurnOutSharp.ProtectionType
{
public class Uplay : IPathCheck
// Got renamed to Ubisoft Connect / Ubisoft Game Launcher
public class Uplay : IPEContentCheck, IPathCheck
{
/// <inheritdoc/>
public string CheckPEContents(string file, byte[] fileContent, bool includeDebug, PortableExecutable pex)
{
// Get the sections from the executable, if possible
var sections = pex?.SectionTable;
if (sections == null)
return null;
string name = Utilities.GetFileDescription(pex);
if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect Installer"))
return "Uplay / Ubisoft Connect";
else if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect Service"))
return "Uplay / Ubisoft Connect";
else if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect WebCore"))
return "Uplay / Ubisoft Connect";
else if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Crash Reporter"))
return "Uplay / Ubisoft Connect";
else if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Game Launcher"))
return "Uplay / Ubisoft Connect";
else if (!string.IsNullOrEmpty(name) && name.Contains("Uplay launcher"))
return "Uplay / Ubisoft Connect";
name = Utilities.GetProductName(pex);
if (!string.IsNullOrEmpty(name) && name.Contains("Ubisoft Connect"))
return "Uplay / Ubisoft Connect";
else if (!string.IsNullOrEmpty(name) && name.Contains("Uplay"))
return "Uplay / Ubisoft Connect";
return null;
}
/// <inheritdoc/>
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
{
var matchers = new List<PathMatchSet>
{
new PathMatchSet(new PathMatch("UbisoftGameLauncherInstaller.exe", useEndsWith: true), "Uplay"),
new PathMatchSet(new PathMatch("UplayInstaller.exe", useEndsWith: true), "Uplay"),
new PathMatchSet(new PathMatch("UbisoftConnect.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UbisoftGameLauncher.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UbisoftGameLauncher64.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UbisoftGameLauncherInstaller.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("Uplay.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayCrashReporter.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayInstaller.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayService.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayWebCore.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
@@ -23,8 +64,15 @@ namespace BurnOutSharp.ProtectionType
{
var matchers = new List<PathMatchSet>
{
new PathMatchSet(new PathMatch("UbisoftGameLauncherInstaller.exe", useEndsWith: true), "Uplay"),
new PathMatchSet(new PathMatch("UplayInstaller.exe", useEndsWith: true), "Uplay"),
new PathMatchSet(new PathMatch("UbisoftConnect.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UbisoftGameLauncher.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UbisoftGameLauncher64.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UbisoftGameLauncherInstaller.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("Uplay.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayCrashReporter.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayInstaller.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayService.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
new PathMatchSet(new PathMatch("UplayWebCore.exe", useEndsWith: true), "Uplay / Ubisoft Connect"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);

View File

@@ -76,7 +76,7 @@ Below is a list of protections detected by BurnOutSharp. The two columns explain
| TAGES | True | True | Partially unconfirmed² |
| Tivola Ring Protection | False | True | |
| TZCopyProtector | False | True | Unconfirmed¹ |
| Uplay | False | True | |
| Uplay | True | True | |
| Winlock | False | True | Unconfirmed¹ |
| WTM CD Protect | True | True | |
| XCP | True | True | |