mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-08 18:06:34 +00:00
Add BOS gcf output (#413)
This commit is contained in:
committed by
GitHub
parent
53d4757e5c
commit
ff02fdb5c3
34
BinaryObjectScanner/FileType/GCF.cs
Normal file
34
BinaryObjectScanner/FileType/GCF.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.IO;
|
||||
|
||||
namespace BinaryObjectScanner.FileType
|
||||
{
|
||||
/// <summary>
|
||||
/// Game Cache File (GCF)
|
||||
/// </summary>
|
||||
public class GCF : DetectableBase<SabreTools.Serialization.Wrappers.GCF>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public GCF(SabreTools.Serialization.Wrappers.GCF wrapper) : base(wrapper) { }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string? Detect(Stream stream, string file, bool includeDebug)
|
||||
{
|
||||
// Filename is worth reporting, since it's descriptive and has to match the Steam2 CDN in order to work.
|
||||
string fileName = Path.GetFileName(file);
|
||||
uint depotId = _wrapper.Model.Header.CacheID;
|
||||
uint manifestVersion = _wrapper.Model.Header.LastVersionPlayed;
|
||||
|
||||
// At the moment, all samples of GCF files on redump are unencrypted. Combined with being uncertain about
|
||||
// whether this is the best way to check whether the GCF is encrypted, this block will be left commented
|
||||
// out until further research is done.
|
||||
/*bool encrypted = false;
|
||||
if (_wrapper.Files != null && _wrapper.Files.Length > 0)
|
||||
encrypted = _wrapper.Files[0].Encrypted;
|
||||
|
||||
string encryptedString = encrypted ? "encrypted" : "unencrypted";
|
||||
string returnString = $"{fileName} - {depotId} (v{manifestVersion}, {encryptedString})";*/
|
||||
string returnString = $"{fileName} - {depotId} (v{manifestVersion})";
|
||||
return returnString;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -493,6 +493,7 @@ namespace BinaryObjectScanner
|
||||
{
|
||||
AACSMediaKeyBlock obj => new FileType.AACSMediaKeyBlock(obj),
|
||||
BDPlusSVM obj => new FileType.BDPlusSVM(obj),
|
||||
GCF obj => new FileType.GCF(obj),
|
||||
ISO9660 obj => new FileType.ISO9660(obj),
|
||||
LDSCRYPT obj => new FileType.LDSCRYPT(obj),
|
||||
LinearExecutable obj => new FileType.LinearExecutable(obj),
|
||||
|
||||
Reference in New Issue
Block a user