-
Notifications
You must be signed in to change notification settings - Fork 15
Update GCF output string for encrypted GCFs #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| using System; | ||
| using System.IO; | ||
|
|
||
| namespace BinaryObjectScanner.FileType | ||
|
|
@@ -16,19 +17,19 @@ public GCF(SabreTools.Wrappers.GCF wrapper) : base(wrapper) { } | |
| // 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; | ||
| uint depotVersion = _wrapper.Model.Header.LastVersionPlayed; | ||
|
|
||
| // At the moment, all samples of GCF files on redump are unencrypted. Combined with being uncertain about | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was wrong, there are plenty of encrypted GCFs on redump already. |
||
| // 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; | ||
| // While there is a depot-level encrypted flag on the GCF, it's unfortunately completely unreliable. | ||
| // Technically speaking, there are some known GCFs that only have some files encrypted. HL2 discs from | ||
| // 2004 have several GCFs like this, one being base_source_engine.gcf (depot 200). Thus, it's necessary | ||
| // to iterate all file info to check if any files are encrypted | ||
| bool encrypted = false; | ||
| if (_wrapper.Files != null && _wrapper.Files.Length > 0) | ||
| encrypted = Array.Exists(_wrapper.Files, fileInfo => fileInfo.Encrypted); | ||
|
|
||
| // string encryptedString = encrypted ? "encrypted" : "unencrypted"; | ||
| // string returnString = $"{fileName} - {depotId} (v{manifestVersion}, {encryptedString})"; | ||
|
|
||
| string returnString = $"{fileName} - {depotId} (v{manifestVersion})"; | ||
| // Only note encryption status if the GCF is encrypted | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you feel otherwise, let me know, but it seems redundant to put a string saying it's unencrypted, imo it's better to just only note it when it's encrypted.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really have a good enough grasp on the file type to know if stating that it is unencrypted is valuable or not. At the very least, it can be tweaked here if necessary. |
||
| string encryptedString = encrypted ? ", encrypted" : ""; | ||
| string returnString = $"{fileName} - {depotId} (v{depotVersion}{encryptedString})"; | ||
| return returnString; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated terminology in code slightly; calling a steam2 version a manifest is possibly inaccurate.