Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/GameFinder.StoreHandlers.EADesktop/Crypto/Decryption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static class Decryption
{
private const string AllUsersGenericId = "allUsersGenericId";
private const string IS = "IS";
private const string Salt = "l)%ge7fomILhfj*Qfi+,";

private static readonly byte[] preComputedIV =
{
Expand All @@ -18,10 +19,7 @@ public static class Decryption

public static byte[] CreateDecryptionKey(IHardwareInfoProvider hardwareInfoProvider)
{
var hardwareString = HardwareInformation.GenerateHardwareString(hardwareInfoProvider);

var hardwareHash = Hashing.CalculateSHA1Hash(hardwareString);
var hashInput = AllUsersGenericId + IS + hardwareHash;
var hashInput = AllUsersGenericId + IS + Salt;
var key = Hashing.CalculateSHA3_256Hash(hashInput);

return key;
Expand Down
12 changes: 8 additions & 4 deletions src/GameFinder.StoreHandlers.EADesktop/EADesktopHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class EADesktopHandler : AHandler<EADesktopGame, EADesktopGameId>
/// The supported schema version of this handler. You can change the schema policy with
/// <see cref="SchemaPolicy"/>.
/// </summary>
public const int SupportedSchemaVersion = 21;
public const int SupportedSchemaVersion = 24;

/// <summary>
/// Policy to use when the schema version does not match <see cref="SupportedSchemaVersion"/>.
Expand Down Expand Up @@ -249,7 +249,11 @@ internal static (string? message, bool isError) CreateSchemaVersionMessage(
internal static string ParseInstallerDataFile(IFileSystem fileSystem, string baseInstallPath, out IList<string> contentIds)
{
var title = "";
contentIds = new List<string>();
contentIds = [];

// Skip processing if baseInstallPath is not rooted
if (string.IsNullOrEmpty(baseInstallPath) || !Path.IsPathRooted(baseInstallPath))
return title;

var dataFile = fileSystem.FromUnsanitizedFullPath(Path.Combine(baseInstallPath, "__Installer", "installerdata.xml"));
if (dataFile.FileExists)
Expand Down Expand Up @@ -363,7 +367,7 @@ internal static OneOf<EADesktopGame, ErrorMessage> InstallInfoToGame(IRegistry r
else if (Path.IsPathRooted(baseInstallPath))
isInstalled = true;

if (installCheck.StartsWith('['))
if (installCheck.StartsWith('[') && Path.IsPathRooted(baseInstallPath))
{
var j = installCheck.IndexOf(']', StringComparison.Ordinal);
if (j > 1)
Expand Down Expand Up @@ -393,7 +397,7 @@ internal static OneOf<EADesktopGame, ErrorMessage> InstallInfoToGame(IRegistry r
if (!executable.FileExists)
isInstalled = false;
}
else if (!string.IsNullOrEmpty(executableCheck) && executableCheck.StartsWith('['))
else if (!string.IsNullOrEmpty(executableCheck) && executableCheck.StartsWith('[') && Path.IsPathRooted(baseInstallPath))
{
var j = executableCheck.IndexOf(']', StringComparison.Ordinal);

Expand Down
Loading