mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-25 00:04:57 +00:00
Fixed formatting, hopefully
This commit is contained in:
@@ -47,24 +47,32 @@ namespace BinaryObjectScanner.Protection
|
|||||||
//I don't need this to check optgraph.dll, that's redundant. Unsure how to exclude that.
|
//I don't need this to check optgraph.dll, that's redundant. Unsure how to exclude that.
|
||||||
if (pex.OverlayStrings != null)
|
if (pex.OverlayStrings != null)
|
||||||
{
|
{
|
||||||
if (pex.OverlayStrings.Any(s => s.Contains("optgraph.dll"))) //Checks if main executable contains reference to optgraph.dll. Emergency 4's is missing this for some reason.
|
if (pex.OverlayStrings.Any(s =>
|
||||||
// TODO: TKKG also has an NE 3.1x executable with a reference. This can be added later.
|
s.Contains(
|
||||||
|
"optgraph.dll"))) //Checks if main executable contains reference to optgraph.dll. Emergency 4's is missing this for some reason.
|
||||||
|
// TODO: TKKG also has an NE 3.1x executable with a reference. This can be added later.
|
||||||
return "copy-X";
|
return "copy-X";
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string? CheckFilePath(string path) //Checks for Professional
|
public string? CheckFilePath(string path) //Checks for Professional
|
||||||
{
|
{
|
||||||
if (Path.GetFileName(path).Equals("optgraph.dll", StringComparison.OrdinalIgnoreCase)) //Filename check for optgraph.dll disc check
|
if (Path.GetFileName(path)
|
||||||
|
.Equals("optgraph.dll",
|
||||||
|
StringComparison.OrdinalIgnoreCase)) //Filename check for optgraph.dll disc check
|
||||||
{
|
{
|
||||||
return "copy-X";
|
return "copy-X";
|
||||||
}
|
}
|
||||||
if (Path.GetFileName(path).Equals("iofile.x64", StringComparison.OrdinalIgnoreCase)) //Filename check for seemingly comorbid file.
|
|
||||||
|
if (Path.GetFileName(path)
|
||||||
|
.Equals("iofile.x64", StringComparison.OrdinalIgnoreCase)) //Filename check for seemingly comorbid file.
|
||||||
{
|
{
|
||||||
return "copy-X";
|
return "copy-X";
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,14 +101,13 @@ namespace BinaryObjectScanner.Protection
|
|||||||
FileStream stream = new FileStream(fileList[0], FileMode.Open, FileAccess.Read);
|
FileStream stream = new FileStream(fileList[0], FileMode.Open, FileAccess.Read);
|
||||||
byte[] block = new byte[1024];
|
byte[] block = new byte[1024];
|
||||||
stream.Read(block, 0, 1024);
|
stream.Read(block, 0, 1024);
|
||||||
if (block.All(thisByte => thisByte.Equals(0x00))) //Checks arbitrary number of bytes at the beginning of the first file in ZDAT* to see if they're all 0x00
|
if (block.All(thisByte => thisByte.Equals(0x00)))
|
||||||
{
|
{
|
||||||
protections.Enqueue("x-Copy");
|
protections.Enqueue("x-Copy");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return protections;
|
return protections;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user