Filename is no longer expected

This commit is contained in:
Matt Nadareski
2019-09-30 11:08:44 -07:00
parent fd866465b4
commit 4b1cae2ba2
16 changed files with 426 additions and 197 deletions

View File

@@ -1,12 +1,17 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2026
# Visual Studio Version 16
VisualStudioVersion = 16.0.29306.81
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BurnOutSharp", "BurnOutSharp\BurnOutSharp.csproj", "{1DA4212E-6071-4951-B45D-BB74A7838246}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{88735BA2-778D-4192-8EB2-FFF6843719E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68D10531-99CB-40B1-8912-73FA286C9433}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View File

@@ -37,6 +37,9 @@ namespace BurnOutSharp
private static Process StartSafe(string file)
{
if (file == null)
return string.Empty;
Process startingprocess = new Process();
startingprocess.StartInfo.FileName = file;
startingprocess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
@@ -56,6 +59,9 @@ namespace BurnOutSharp
private static string MakeTempFile(string file, string sExtension = ".exe")
{
if (file == null)
return string.Empty;
FileInfo filei = new FileInfo(file);
try
{
@@ -69,6 +75,9 @@ namespace BurnOutSharp
private static bool IsEXE(string file)
{
if (file == null)
return false;
BinaryReader breader = new BinaryReader(File.OpenRead(file));
breader.ReadBytes(60);
int PEHeaderOffset = breader.ReadInt32();
@@ -85,6 +94,9 @@ namespace BurnOutSharp
private static string[] CopyDependentDlls(string exefile)
{
if (exefile == null)
return null;
FileInfo fiExe = new FileInfo(exefile);
Section[] sections = ReadSections(exefile);
BinaryReader breader = new BinaryReader(File.OpenRead(exefile), Encoding.Default);
@@ -141,6 +153,9 @@ namespace BurnOutSharp
private static Section[] ReadSections(string exefile)
{
if (exefile == null)
return null;
BinaryReader breader = new BinaryReader(File.OpenRead(exefile));
breader.ReadBytes(60);
uint PEHeaderOffset = breader.ReadUInt32();
@@ -184,6 +199,9 @@ namespace BurnOutSharp
public static string SearchProtectDiscVersion(string file)
{
if (file == null)
return string.Empty;
Process exe = new Process();
Process[] processes = new Process[0];
string version = "";
@@ -339,6 +357,9 @@ namespace BurnOutSharp
public static string SearchSafeDiscVersion(string file)
{
if (file == null)
return string.Empty;
Process exe = new Process();
string version = "";
DateTime timestart;

View File

@@ -116,7 +116,7 @@ namespace BurnOutSharp
/// <param name="path"></param>
/// <param name="isDirectory"></param>
/// <returns></returns>
private static string ScanPath(string path, bool isDirectory)
public static string ScanPath(string path, bool isDirectory)
{
List<string> protections = new List<string>();
string protection;
@@ -353,7 +353,8 @@ namespace BurnOutSharp
/// <summary>
/// Scan an individual file for copy protection
/// </summary>
private static string ScanInFile(string file)
/// <param name="file">File path for scanning</param>
public static string ScanInFile(string file)
{
// Get the extension for certain checks
string extension = Path.GetExtension(file).ToLower().TrimStart('.');
@@ -383,196 +384,14 @@ namespace BurnOutSharp
{
try
{
// Load the current file and check for specialty strings first
StreamReader sr = new StreamReader(file, Encoding.Default);
string protection;
string fileContent = sr.ReadToEnd();
sr.Close();
// Load the current file content
string fileContent = null;
using (StreamReader sr = new StreamReader(file))
{
fileContent = sr.ReadToEnd();
}
// 3PLock
protection = ThreePLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// ActiveMARK
protection = ActiveMARK.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Alpha-ROM
protection = AlphaROM.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Armadillo
protection = Armadillo.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CD-Cops
protection = CDCops.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CD-Lock
protection = CDLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CDSHiELD SE
protection = CDSHiELDSE.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CD Check
protection = CDCheck.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Cenega ProtectDVD
protection = CengaProtectDVD.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Code Lock
protection = CodeLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CopyKiller
protection = CopyKiller.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Cucko (EA Custom)
protection = Cucko.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// dotFuscator
protection = dotFuscator.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// DVD-Cops
protection = DVDCops.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// EA CdKey Registration Module
protection = EACdKey.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// EXE Stealth
protection = EXEStealth.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Games for Windows - Live
protection = GFWL.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Impulse Reactor
protection = ImpulseReactor.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Inno Setup
protection = InnoSetup.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// JoWooD X-Prot
protection = JoWooDXProt.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Key-Lock (Dongle)
protection = KeyLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// LaserLock
protection = LaserLock.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// PE Compact
protection = PECompact.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// ProtectDisc
protection = ProtectDisc.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Ring PROTECH
protection = RingPROTECH.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SafeDisc / SafeCast
protection = SafeDisc.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SafeLock
protection = SafeLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SecuROM
protection = SecuROM.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SmartE
protection = SmartE.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SolidShield
protection = SolidShield.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// StarForce
protection = StarForce.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SVK Protector
protection = SVKProtector.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Sysiphus / Sysiphus DVD
protection = Sysiphus.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// TAGES
protection = Tages.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// VOB ProtectCD/DVD
protection = VOBProtectCDDVD.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// WTM CD Protect
protection = WTMCDProtect.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Xtreme-Protector
protection = XtremeProtector.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
protections.AddRange(ScanFileContent(file, fileContent));
}
catch { }
}
@@ -602,7 +421,6 @@ namespace BurnOutSharp
{
// We don't care what the error was
}
// No-op
}
#endregion
@@ -704,6 +522,325 @@ namespace BurnOutSharp
return string.Join(", ", protections);
}
/// <summary>
/// Scan an individual stream for copy protection
/// </summary>
/// <param name="stream">Generic stream to scan</param>
/// <param name="file">File path to be used for name checks (optional)</param>
public static string ScanInFile(Stream stream, string file = null)
{
// Assume the first part of the stream is the start of a file
string magic = "";
try
{
using (BinaryReader br = new BinaryReader(stream, Encoding.Default, true))
{
magic = new string(br.ReadChars(8));
}
}
catch
{
// We don't care what the issue was, we can't open the file
return null;
}
// If we can, seek to the beginning of the stream
if (stream.CanSeek)
stream.Seek(0, SeekOrigin.Begin);
// Files can be protected in multiple ways
List<string> protections = new List<string>();
#region Executable Content Checks
// Windows Executable and DLL
if (magic.StartsWith("MZ"))
{
try
{
// Load the current file content
string fileContent = null;
using (StreamReader sr = new StreamReader(stream))
{
fileContent = sr.ReadToEnd();
}
protections.AddRange(ScanFileContent(file, fileContent));
}
catch { }
}
#endregion
#region Textfile Content Checks
if (magic.StartsWith("{\rtf") // Rich Text File
|| magic.StartsWith("" + (char)0xd0 + (char)0xcf + (char)0x11 + (char)0xe0 + (char)0xa1 + (char)0xb1 + (char)0x1a + (char)0xe1)) // Microsoft Office File (old)
{
try
{
// Load the current file content
string fileContent = null;
using (StreamReader sr = new StreamReader(stream))
{
fileContent = sr.ReadToEnd();
}
// CD-Key
if (fileContent.Contains("a valid serial number is required")
|| fileContent.Contains("serial number is located"))
{
protections.Add("CD-Key / Serial");
}
}
catch
{
// We don't care what the error was
}
}
#endregion
#region Archive Content Checks
// 7-zip
if (magic.StartsWith("7z" + (char)0xbc + (char)0xaf + (char)0x27 + (char)0x1c))
{
// No-op
}
// InstallShield CAB
else if (magic.StartsWith("ISc"))
{
// TODO: Update UnshieldSharp to include generic stream support
}
// Microsoft CAB
else if (magic.StartsWith("MSCF"))
{
// TODO: See if LibMSPackN can use generic streams
}
// PKZIP
else if (magic.StartsWith("PK" + (char)03 + (char)04)
|| magic.StartsWith("PK" + (char)05 + (char)06)
|| magic.StartsWith("PK" + (char)07 + (char)08))
{
// No-op
}
// RAR
else if (magic.StartsWith("Rar!"))
{
// No-op
}
#endregion
// Return blank if nothing found, or comma-separated list of protections
if (protections.Count() == 0)
return string.Empty;
else
return string.Join(", ", protections);
}
/// <summary>
/// Scan the contents of a file for protection
/// </summary>
private static List<string> ScanFileContent(string file, string fileContent)
{
// Files can be protected in multiple ways
List<string> protections = new List<string>();
string protection;
// 3PLock
protection = ThreePLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// ActiveMARK
protection = ActiveMARK.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Alpha-ROM
protection = AlphaROM.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Armadillo
protection = Armadillo.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CD-Cops
protection = CDCops.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CD-Lock
protection = CDLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CDSHiELD SE
protection = CDSHiELDSE.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CD Check
protection = CDCheck.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Cenega ProtectDVD
protection = CengaProtectDVD.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Code Lock
protection = CodeLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// CopyKiller
protection = CopyKiller.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Cucko (EA Custom)
protection = Cucko.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// dotFuscator
protection = dotFuscator.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// DVD-Cops
protection = DVDCops.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// EA CdKey Registration Module
protection = EACdKey.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// EXE Stealth
protection = EXEStealth.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Games for Windows - Live
protection = GFWL.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Impulse Reactor
protection = ImpulseReactor.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Inno Setup
protection = InnoSetup.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// JoWooD X-Prot
protection = JoWooDXProt.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Key-Lock (Dongle)
protection = KeyLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// LaserLock
protection = LaserLock.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// PE Compact
protection = PECompact.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// ProtectDisc
protection = ProtectDisc.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Ring PROTECH
protection = RingPROTECH.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SafeDisc / SafeCast
protection = SafeDisc.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SafeLock
protection = SafeLock.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SecuROM
protection = SecuROM.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SmartE
protection = SmartE.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SolidShield
protection = SolidShield.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// StarForce
protection = StarForce.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// SVK Protector
protection = SVKProtector.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Sysiphus / Sysiphus DVD
protection = Sysiphus.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// TAGES
protection = Tages.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// VOB ProtectCD/DVD
protection = VOBProtectCDDVD.CheckContents(file, fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// WTM CD Protect
protection = WTMCDProtect.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
// Xtreme-Protector
protection = XtremeProtector.CheckContents(fileContent);
if (!string.IsNullOrWhiteSpace(protection))
protections.Add(protection);
return protections;
}
/// <summary>
/// Scan a disc sector by sector for protection
/// </summary>

View File

@@ -49,6 +49,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -15,6 +15,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -17,6 +17,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -27,6 +27,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -28,7 +28,7 @@ namespace BurnOutSharp.ProtectionType
return "LaserLock " + GetVersion(fileContent, --position) + " " + GetBuild(fileContent, false);
}
if (Path.GetFileName(file) == "NOMOUSE.SP")
if (file != null && Path.GetFileName(file) == "NOMOUSE.SP")
return "LaserLock " + GetVersion16Bit(file);
if (fileContent.Contains(":\\LASERLOK\\LASERLOK.IN" + (char)0x00 + "C:\\NOMOUSE.SP"))

View File

@@ -41,6 +41,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersionBuild6till8(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{
@@ -89,6 +92,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersionBuild76till10(string file, int position, out int irefBuild)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -97,6 +97,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetDPlayerXVersion(string file)
{
if (file == null)
return string.Empty;
FileInfo fi = new FileInfo(file);
if (fi.Length == 81408)
return "SafeDisc 1.0x";
@@ -122,6 +125,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetDrvmgtVersion(string file)
{
if (file == null)
return string.Empty;
FileInfo fi = new FileInfo(file);
if (fi.Length == 34816)
return "SafeDisc 1.0x";
@@ -147,6 +153,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetSecdrvVersion(string file)
{
if (file == null)
return string.Empty;
FileInfo fi = new FileInfo(file);
if (fi.Length == 20128)
return "SafeDisc 2.10";
@@ -178,6 +187,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -80,6 +80,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetV4Version(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{
@@ -103,6 +106,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetV5Version(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{
@@ -129,6 +135,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetV7Version(string file)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -27,7 +27,10 @@ namespace BurnOutSharp.ProtectionType
+ "a" + (char)0x00 + "t" + (char)0x00 + "i" + (char)0x00 + "o" + (char)0x00 + "n" + (char)0x00 + " " + (char)0x00
+ "L" + (char)0x00 + "i" + (char)0x00 + "b" + (char)0x00 + "r" + (char)0x00 + "a" + (char)0x00 + "r" + (char)0x00 + "y"))
{
string companyName = FileVersionInfo.GetVersionInfo(file).CompanyName.ToLower();
string companyName = string.Empty;
if (file != null)
companyName = FileVersionInfo.GetVersionInfo(file).CompanyName.ToLower();
if (companyName.Contains("solidshield") || companyName.Contains("tages"))
return "SolidShield Core.dll " + Utilities.GetFileVersion(file);
}
@@ -47,7 +50,10 @@ namespace BurnOutSharp.ProtectionType
+ "a" + (char)0x00 + "t" + (char)0x00 + "i" + (char)0x00 + "o" + (char)0x00 + "n" + (char)0x00 + " " + (char)0x00
+ "M" + (char)0x00 + "a" + (char)0x00 + "n" + (char)0x00 + "a" + (char)0x00 + "g" + (char)0x00 + "e" + (char)0x00 + "r"))
{
string companyName = FileVersionInfo.GetVersionInfo(file).CompanyName.ToLower();
string companyName = string.Empty;
if (file != null)
companyName = FileVersionInfo.GetVersionInfo(file).CompanyName.ToLower();
if (companyName.Contains("solidshield") || companyName.Contains("tages"))
return "SolidShield Activation Manager Module " + Utilities.GetFileVersion(file);
}
@@ -125,6 +131,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -18,6 +18,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -80,6 +80,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -58,6 +58,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetBuild(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{
@@ -73,6 +76,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetOldVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{
@@ -92,6 +98,9 @@ namespace BurnOutSharp.ProtectionType
private static string GetVersion(string file, int position)
{
if (file == null)
return string.Empty;
using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var br = new BinaryReader(fs))
{

View File

@@ -14,6 +14,9 @@ namespace BurnOutSharp
/// </summary>
public static string GetFileVersion(string file)
{
if (file == null)
return string.Empty;
FileVersionInfo fvinfo = FileVersionInfo.GetVersionInfo(file);
if (fvinfo.FileVersion == null)
return "";