Skip to content

Commit 968bd46

Browse files
committed
Refine platform detection (unsigned Xbox 360)
Use FastFileInfo.Platform to better distinguish unsigned Xbox 360 FastFiles from PS3 by treating OpenedFastFileHeader.Platform == "Xbox 360" as Xbox360 in IsXbox360. Add a Platform string property to FastFileHeader (with docs and default empty string) and initialize it from info.Platform, and update the exposed Platform mapping to rely on IsXbox360. This enables accurate detection for unsigned console files (e.g. converter output or unsigned MW2 Xbox 360) where header bytes alone look like PS3 but zone-peek identification is available.
1 parent 998742e commit 968bd46

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

Call of Duty FastFile Editor/Models/FastFile.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public class FastFile
4343
/// </summary>
4444
public bool IsXbox360 => !IsPC && !IsWii && !IsGhostsFile && (
4545
OpenedFastFileHeader.IsSigned ||
46-
OpenedFastFileHeader.GameVersion == FastFileLib.GameDefinitions.MW2Definition.DevBuildVersionValue);
46+
OpenedFastFileHeader.GameVersion == FastFileLib.GameDefinitions.MW2Definition.DevBuildVersionValue ||
47+
// Unsigned Xbox 360 (e.g. converter output, unsigned MW2 Xbox 360): the header
48+
// looks identical to PS3, but FastFileInfo's zone peek positively identified it.
49+
OpenedFastFileHeader.Platform == "Xbox 360");
4750

4851
/// <summary>
4952
/// Indicates if this FastFile is from a PC version.
@@ -73,7 +76,7 @@ public bool IsWii
7376
public string Platform => IsPC ? "PC"
7477
: IsWii ? "Wii"
7578
: IsGhostsFile ? "PS3" // Ghosts is signed on PS3 retail; no Xbox 360 samples tested yet
76-
: OpenedFastFileHeader.IsSigned ? "Xbox 360"
79+
: IsXbox360 ? "Xbox 360" // signed, dev-build, or zone-peek-confirmed unsigned Xbox 360
7780
: "PS3";
7881

7982
/// <summary>
@@ -222,6 +225,15 @@ public class FastFileHeader
222225
/// </summary>
223226
public bool IsWii { get; private set; }
224227

228+
/// <summary>
229+
/// Refined platform string from <see cref="FastFileInfo.FromFile"/> — for unsigned
230+
/// big-endian console FFs this is the result of peeking the decompressed zone
231+
/// (WaW MemAlloc1 magic / MW2 header layout) to split PS3 from Xbox 360, rather
232+
/// than the header-only "PS3/Xbox 360". Empty for zone-loaded FastFiles. Values:
233+
/// "PS3", "Xbox 360", "PC", "Wii", or "PS3/Xbox 360" when genuinely undecidable.
234+
/// </summary>
235+
public string Platform { get; private set; } = "";
236+
225237
public FastFileHeader(string filePath)
226238
{
227239
// Single source of truth: delegate to FastFileLib.FastFileInfo so detection
@@ -245,6 +257,7 @@ public FastFileHeader(string filePath)
245257
IsSigned = info.IsSigned;
246258
IsPC = info.IsPC;
247259
IsWii = info.IsWii;
260+
Platform = info.Platform ?? "";
248261

249262
switch (info.GameVersion)
250263
{

0 commit comments

Comments
 (0)