mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-08 21:31:45 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0d49f52a5 | ||
|
|
6f9bcc2111 | ||
|
|
0fb0ecd28a | ||
|
|
6194d88aec | ||
|
|
b02c3121fe | ||
|
|
580db0cb65 |
@@ -7,8 +7,9 @@
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||
<!-- <TreatWarningsAsErrors>true</TreatWarningsAsErrors> --> <!-- Can't be enabled because of external code -->
|
||||
<Version>3.0.0</Version>
|
||||
<Version>3.0.1</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
@@ -21,8 +22,8 @@
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Exclude certain parts of external modules for .NET Framework -->
|
||||
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net4`))">
|
||||
<!-- Exclude certain parts of external modules for .NET Framework 4.5.2 and above -->
|
||||
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net4`)) AND !$(TargetFramework.StartsWith(`net40`))">
|
||||
<DefaultItemExcludes>
|
||||
$(DefaultItemExcludes);
|
||||
**\AssemblyInfo.cs;
|
||||
@@ -31,7 +32,7 @@
|
||||
</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Exclude all external modules for .NET Core and modern .NET -->
|
||||
<!-- Exclude all external modules for .NET Framework 4.0, .NET Core and modern .NET -->
|
||||
<PropertyGroup Condition="!$(TargetFramework.StartsWith(`net4`)) OR $(TargetFramework.StartsWith(`net40`))">
|
||||
<DefaultItemExcludes>
|
||||
$(DefaultItemExcludes);
|
||||
@@ -59,11 +60,15 @@
|
||||
<PackageReference Include="SabreTools.IO" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Matching" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Models" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Serialization" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Serialization" Version="1.2.1" />
|
||||
<PackageReference Include="UnshieldSharp" Version="1.7.0" />
|
||||
<PackageReference Include="WiseUnpacker" Version="1.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net40`))">
|
||||
<PackageReference Include="Microsoft.Bcl" Version="1.1.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))">
|
||||
<PackageReference Include="SharpCompress" Version="0.34.1" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||
|
||||
@@ -399,10 +399,8 @@ namespace BinaryObjectScanner.FileType
|
||||
/// <summary>
|
||||
/// Initialize all implementations of a type
|
||||
/// </summary>
|
||||
private static IEnumerable<T>? InitCheckClasses<T>()
|
||||
=> InitCheckClasses<T>(typeof(GameEngine._DUMMY).Assembly) ?? Enumerable.Empty<T>()
|
||||
.Concat(InitCheckClasses<T>(typeof(Packer._DUMMY).Assembly) ?? Enumerable.Empty<T>())
|
||||
.Concat(InitCheckClasses<T>(typeof(Protection._DUMMY).Assembly) ?? Enumerable.Empty<T>());
|
||||
private static IEnumerable<T>? InitCheckClasses<T>() =>
|
||||
InitCheckClasses<T>(typeof(Handler).Assembly) ?? Enumerable.Empty<T>();
|
||||
|
||||
/// <summary>
|
||||
/// Initialize all implementations of a type
|
||||
@@ -412,11 +410,7 @@ namespace BinaryObjectScanner.FileType
|
||||
return assembly.GetTypes()?
|
||||
.Where(t => t.IsClass && t.GetInterface(typeof(T).Name) != null)?
|
||||
.Select(t => (T?)Activator.CreateInstance(t))
|
||||
#if NET40 || NET452
|
||||
.Cast<T>() ?? [];
|
||||
#else
|
||||
.Cast<T>() ?? Array.Empty<T>();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace BinaryObjectScanner.GameEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// This class exists for reflection purposes and should not be used
|
||||
/// </summary>
|
||||
public sealed class _DUMMY { }
|
||||
}
|
||||
@@ -171,12 +171,8 @@ namespace BinaryObjectScanner
|
||||
/// <summary>
|
||||
/// Initialize all implementations of a type
|
||||
/// </summary>
|
||||
private static IEnumerable<T?> InitCheckClasses<T>()
|
||||
{
|
||||
return InitCheckClasses<T>(typeof(GameEngine._DUMMY).Assembly)
|
||||
.Concat(InitCheckClasses<T>(typeof(Packer._DUMMY).Assembly))
|
||||
.Concat(InitCheckClasses<T>(typeof(Protection._DUMMY).Assembly));
|
||||
}
|
||||
private static IEnumerable<T?> InitCheckClasses<T>() =>
|
||||
InitCheckClasses<T>(typeof(Handler).Assembly);
|
||||
|
||||
/// <summary>
|
||||
/// Initialize all implementations of a type
|
||||
@@ -185,11 +181,7 @@ namespace BinaryObjectScanner
|
||||
{
|
||||
return assembly.GetTypes()?
|
||||
.Where(t => t.IsClass && t.GetInterface(typeof(T).Name) != null)?
|
||||
#if NET40 || NET452
|
||||
.Select(t => (T?)Activator.CreateInstance(t)) ?? [];
|
||||
#else
|
||||
.Select(t => (T?)Activator.CreateInstance(t)) ?? Array.Empty<T>();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#if NET40
|
||||
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System
|
||||
{
|
||||
/// <summary>Defines a provider for progress updates.</summary>
|
||||
/// <typeparam name="T">The type of progress update value.</typeparam>
|
||||
/// <see href="https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/IProgress.cs"/>
|
||||
public interface IProgress<in T>
|
||||
{
|
||||
/// <summary>Reports a progress update.</summary>
|
||||
/// <param name="value">The value of the updated progress.</param>
|
||||
void Report(T value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace BinaryObjectScanner.Packer
|
||||
{
|
||||
/// <summary>
|
||||
/// This class exists for reflection purposes and should not be used
|
||||
/// </summary>
|
||||
public sealed class _DUMMY { }
|
||||
}
|
||||
@@ -146,7 +146,6 @@ namespace BinaryObjectScanner.Protection
|
||||
new PathMatch("drvmgt.dll", useEndsWith: true),
|
||||
new PathMatch("mcp.dll", useEndsWith: true),
|
||||
new PathMatch("secdrv.sys", useEndsWith: true),
|
||||
|
||||
}, "SafeDisc 1.45.011-1.50.020"),
|
||||
|
||||
// TODO: Research "splash16.bmp" and "splash256.bmp".
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace BinaryObjectScanner.Protection
|
||||
{
|
||||
/// <summary>
|
||||
/// This class exists for reflection purposes and should not be used
|
||||
/// </summary>
|
||||
public sealed class _DUMMY { }
|
||||
}
|
||||
@@ -236,10 +236,8 @@ namespace BinaryObjectScanner
|
||||
// Open the file and begin scanning
|
||||
try
|
||||
{
|
||||
using (FileStream fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read))
|
||||
{
|
||||
return GetInternalProtections(file, fs);
|
||||
}
|
||||
using FileStream fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
return GetInternalProtections(file, fs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
|
||||
<OutputType>Exe</OutputType>
|
||||
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -16,11 +17,15 @@
|
||||
<PackageReference Include="SabreTools.IO" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Matching" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Models" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Printing" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Serialization" Version="1.2.0" />
|
||||
<PackageReference Include="SabreTools.Printing" Version="1.2.1" />
|
||||
<PackageReference Include="SabreTools.Serialization" Version="1.2.1" />
|
||||
<PackageReference Include="UnshieldSharp" Version="1.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(TargetFramework.StartsWith(`net40`))">
|
||||
<PackageReference Include="Microsoft.Bcl" Version="1.1.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="App.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
||||
Reference in New Issue
Block a user