Start using more methods to make life easier

This commit is contained in:
Matt Nadareski
2021-09-11 21:03:36 -07:00
parent 9d52ca4b4c
commit afdd032f73
16 changed files with 120 additions and 129 deletions

View File

@@ -23,8 +23,8 @@ namespace BurnOutSharp.ProtectionType
return null;
// Get the .securom section, if it exists
var securomSection = sections.FirstOrDefault(s => Encoding.ASCII.GetString(s.Name).StartsWith(".securom"));
if (securomSection != null)
bool securomSection = pex.ContainsSection(".securom", exact: true);
if (securomSection)
return $"SecuROM {GetV7Version(fileContent)}";
// Search after the last section
@@ -97,9 +97,9 @@ namespace BurnOutSharp.ProtectionType
}
// Get the .cms_d and .cms_t sections, if they exist -- TODO: Confirm if both are needed or either/or is fine
var cmsdSection = pex.GetFirstSection(".cmd_d", true);
var cmstSection = pex.GetFirstSection(".cms_t", true);
if (cmsdSection != null || cmstSection != null)
bool cmsdSection = pex.ContainsSection(".cmd_d", true);
bool cmstSection = pex.ContainsSection(".cms_t", true);
if (cmsdSection || cmstSection)
return $"SecuROM 1-3";
return null;