9 Commits
1.1.4 ... 1.1.5

Author SHA1 Message Date
Matt Nadareski
21e22a1476 Bump version 2023-10-25 12:36:33 -04:00
Matt Nadareski
016057a837 Add mapping dictionaries for Xbox 2023-10-24 22:48:41 -04:00
Matt Nadareski
69ca889ac7 Add version guards around LZX.Chunk 2023-10-24 21:45:32 -04:00
Matt Nadareski
cd67a7282b Add version guards to IRD model 2023-10-23 11:33:50 -04:00
Matt Nadareski
948edbad58 Merge pull request #4 from Deterous/Deterous-patch-1
Improve IRD Model
2023-10-23 10:54:21 -04:00
Deterous
d445f02ba6 Specify the reserved attributes 2023-10-23 12:23:55 +13:00
Deterous
835fce7876 Comment on UID 2023-10-23 12:00:05 +13:00
Deterous
97513840e0 ID and UID are the same Property 2023-10-23 11:53:34 +13:00
Matt Nadareski
6112dcb391 Add IRD model 2023-10-22 01:03:34 -04:00
4 changed files with 406 additions and 1 deletions

View File

@@ -15,11 +15,19 @@ namespace SabreTools.Models.Compression.LZX
/// <summary>
/// Chunk header
/// </summary>
#if NET48
public ChunkHeader Header { get; set; }
#else
public ChunkHeader? Header { get; set; }
#endif
/// <summary>
/// Block headers and data
/// </summary>
#if NET48
public Block[] Blocks { get; set; }
#else
public Block[]? Blocks { get; set; }
#endif
}
}

196
IRD/File.cs Normal file
View File

@@ -0,0 +1,196 @@
namespace SabreTools.Models.IRD
{
/// <see href="https://psdevwiki.com/ps3/Bluray_disc#IRD_file"/>
/// <see href="https://github.com/SabreTools/MPF/files/13062347/IRD.File.Format.pdf"/>
public class IRD
{
/// <summary>
/// "3IRD"
/// </summary>
#if NET48
public byte[] Magic { get; set; }
#else
public byte[]? Magic { get; set; }
#endif
/// <summary>
/// Version
/// </summary>
/// <remarks>Versions 6 - 9 are accepted</remarks>
public byte Version { get; set; }
/// <summary>
/// The same value stored in PARAM.SFO / TITLE_ID
/// </summary>
/// <remarks>9 bytes, ASCII, stored without dashes</remarks>
#if NET48
public string TitleID { get; set; }
#else
public string? TitleID { get; set; }
#endif
/// <summary>
/// Number of bytes that follow containing the title
/// </summary>
public byte TitleLength { get; set; }
/// <summary>
/// The same value stored in PARAM.SFO / TITLE
/// </summary>
/// <remarks><see cref="TitleLength"/> bytes, ASCII</remarks>
#if NET48
public string Title { get; set; }
#else
public string? Title { get; set; }
#endif
/// <summary>
/// The same value stored in PARAM.SFO / PS3_SYSTEM_VER
/// </summary>
/// <remarks>4 bytes, ASCII, missing uses "0000"</remarks>
#if NET48
public string SystemVersion { get; set; }
#else
public string? SystemVersion { get; set; }
#endif
/// <summary>
/// The same value stored in PARAM.SFO / VERSION
/// </summary>
/// <remarks>5 bytes, ASCII</remarks>
#if NET48
public string GameVersion { get; set; }
#else
public string? GameVersion { get; set; }
#endif
/// <summary>
/// The same value stored in PARAM.SFO / APP_VER
/// </summary>
/// <remarks>5 bytes, ASCII</remarks>
#if NET48
public string AppVersion { get; set; }
#else
public string? AppVersion { get; set; }
#endif
/// <summary>
/// Length of the gzip-compressed header data
/// </summary>
public uint HeaderLength { get; set; }
/// <summary>
/// Gzip-compressed header data
/// </summary>
#if NET48
public byte[] Header { get; set; }
#else
public byte[]? Header { get; set; }
#endif
/// <summary>
/// Length of the gzip-compressed footer data
/// </summary>
public uint FooterLength { get; set; }
/// <summary>
/// Gzip-compressed footer data
/// </summary>
#if NET48
public byte[] Footer { get; set; }
#else
public byte[]? Footer { get; set; }
#endif
/// <summary>
/// Number of complete regions in the image
/// </summary>
public byte RegionCount { get; set; }
/// <summary>
/// MD5 hashes for all complete regions in the image
/// </summary>
/// <remarks><see cref="RegionCount"/> regions, 16-bytes per hash</remarks>
#if NET48
public byte[][] RegionHashes { get; set; }
#else
public byte[][]? RegionHashes { get; set; }
#endif
/// <summary>
/// Number of decrypted files in the image
/// </summary>
public uint FileCount { get; set; }
/// <summary>
/// Starting sector for each decrypted file
/// </summary>
/// <remarks><see cref="FileCount"/> files, alternating with each <see cref="FileHashes"/> entry</remarks>
#if NET48
public ulong[] FileKeys { get; set; }
#else
public ulong[]? FileKeys { get; set; }
#endif
/// <summary>
/// MD5 hashes for all decrypted files in the image
/// </summary>
/// <remarks><see cref="FileCount"/> files, 16-bytes per hash, alternating with each <see cref="FileHashes"/> entry</remarks>
#if NET48
public byte[][] FileHashes { get; set; }
#else
public byte[][]? FileHashes { get; set; }
#endif
/// <summary>
/// Extra Config, usually 0x0000
/// </summary>
public ushort ExtraConfig { get; set; }
/// <summary>
/// Attachments, usually 0x0000
/// </summary>
public ushort Attachments { get; set; }
/// <summary>
/// D1 key
/// </summary>
/// <remarks>16 bytes</remarks>
#if NET48
public byte[] Data1Key { get; set; }
#else
public byte[]? Data1Key { get; set; }
#endif
/// <summary>
/// D2 key
/// </summary>
/// <remarks>16 bytes</remarks>
#if NET48
public byte[] Data2Key { get; set; }
#else
public byte[]? Data2Key { get; set; }
#endif
/// <summary>
/// Uncompressed PIC data
/// </summary>
/// <remarks>115 bytes, before D1/D2 keys on version 9</remarks>
#if NET48
public byte[] PIC { get; set; }
#else
public byte[]? PIC { get; set; }
#endif
/// <summary>
/// Unique Identifier
/// </summary>
/// <remarks>Not present on version 6 and prior, after AppVersion on version 7</remarks>
public uint UID { get; set; }
/// <summary>
/// IRD content CRC
/// </summary>
public uint CRC { get; set; }
}
}

View File

@@ -4,7 +4,7 @@
<!-- Assembly Properties -->
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Version>1.1.4</Version>
<Version>1.1.5</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>

201
Xbox/Constants.cs Normal file
View File

@@ -0,0 +1,201 @@
using System.Collections.Generic;
namespace SabreTools.Models.Xbox
{
/// <see href="https://xboxdevwiki.net/Xbe"/>
/// <see href="http://wiki.redump.org/index.php?title=Xbox_Title_IDs"/>
/// <see href="https://dbox.tools/publishers/"/>
public static class Constants
{
/// <summary>
/// Mapping of all Xbox 360 media subtypes to long names
/// </summary>
public static readonly Dictionary<char, string> MediaSubtypes = new Dictionary<char, string>
{
{ 'F', "XGD3" },
{ 'X', "XGD2" },
{ 'Z', "Games on Demand / Marketplace Demo" },
};
/// <summary>
/// Mapping of all publisher 2-letter codes to long names
/// </summary>
public static readonly Dictionary<string, string> Publishers = new Dictionary<string, string>
{
{ "AB", "Ambush Reality" },
{ "AC", "Acclaim Entertainment" },
{ "AD", "Andamiro USA Corp." },
{ "AH", "Arush Entertainment" },
{ "AK", "Artdink" },
{ "AP", "Aquaplus" },
{ "AQ", "Aqua System" },
{ "AS", "ASK" },
{ "AT", "Atlus" },
{ "AV", "Activision" },
{ "AW", "Arc System Works" },
{ "AX", "Aksys Games" },
{ "AY", "Aspyr Media" },
{ "BA", "Bandai" },
{ "BB", "BigBen" },
{ "BD", "Bravado" },
{ "BE", "Blueside Inc." },
{ "BF", "Blind Ferret Entertainment" },
{ "BG", "BradyGames" },
{ "BH", "Blackhole" },
{ "BL", "Black Box" },
{ "BM", "BAM! Entertainment" },
{ "BR", "Broccoli Co." },
{ "BS", "Bethesda Softworks" },
{ "BT", "Brash Entertainment" },
{ "BU", "Bunkasha Co." },
{ "BV", "Buena Vista Games" },
{ "BW", "BBC Multimedia" },
{ "BZ", "Blizzard" },
{ "CC", "Capcom" },
{ "CK", "Kemco Corporation" }, // TODO: Confirm
{ "CM", "Codemasters" },
{ "CT", "CTO" },
{ "CV", "Crave Entertainment" },
{ "DC", "DreamCatcher Interactive" },
{ "DE", "Destineer" },
{ "DX", "Davilex" },
{ "EA", "Electronic Arts" },
{ "EC", "Encore Software" },
{ "EF", "E-Frontier" },
{ "EL", "Enlight Software" },
{ "EM", "Empire Interactive" },
{ "ES", "Eidos Interactive" },
{ "EV", "Evolved Games" },
{ "FE", "Focus Entertainment (formerly Focus Home Interactive)" }, // TODO: Confirm
{ "FI", "Fox Interactive" },
{ "FL", "Fluent Entertainment" },
{ "FO", "505 Games" },
{ "FS", "From Software" },
{ "GE", "Genki Co." },
{ "GF", "Gameloft" },
{ "GV", "Groove Games" },
{ "HE", "Tru Blu (Entertainment division of Home Entertainment Suppliers)" },
{ "HP", "Hip Games" },
{ "HU", "Hudson Soft" },
{ "HW", "Highwaystar" },
{ "IA", "Mad Catz Interactive" }, // TODO: Confirm
{ "IF", "Idea Factory" },
{ "IG", "Infogrames" },
{ "IL", "Interlex Corporation" },
{ "IM", "Imagine Media" },
{ "IO", "Ignition Entertainment" },
{ "IP", "Interplay Entertainment" },
{ "IX", "InXile Entertainment" },
{ "JA", "Jaleco Entertainment" },
{ "JW", "JoWooD Entertainment" },
{ "KA", "Konami Osaka / Major A" },
{ "KB", "Kemco" }, // TODO: Confirm
{ "KI", "Kids Station Inc." }, // TODO: Confirm
{ "KN", "Konami" },
{ "KO", "Koei" },
{ "KT", "Konami Tokyo" },
{ "KU", "Kobi and/or GAE (formerly Global A Entertainment)" }, // TODO: Confirm
{ "KY", "Kalypso" },
{ "LA", "LucasArts" },
{ "LS", "Black Bean Games (publishing arm of Leader S.p.A.)" }, // TODO: Confirm
{ "MD", "Metro3D" },
{ "ME", "Medix" },
{ "MI", "Microïds" }, // TODO: Confirm
{ "MJ", "Majesco Entertainment" },
{ "MM", "Myelin Media" },
{ "MP", "MediaQuest" }, // TODO: Confirm
{ "MS", "Microsoft Game Studios" },
{ "MW", "Midway Games" },
{ "MX", "Empire Interactive" }, // TODO: Confirm
{ "NK", "NewKidCo" },
{ "NL", "NovaLogic" },
{ "NM", "Namco" },
{ "OG", "O-Games" },
{ "OX", "Oxygen Interactive" },
{ "PC", "Playlogic Entertainment" },
{ "PL", "Phantagram Co., Ltd. / Playlogic Entertainment" }, // TODO: Confirm
{ "RA", "Rage" },
{ "SA", "Sammy" },
{ "SC", "SCi Games" },
{ "SE", "Sega" },
{ "SN", "SNK" },
{ "SP", "Southpeak Games" },
{ "SQ", "Square Enix" },
{ "SS", "Simon & Schuster" },
{ "ST", "Studio Nine" },
{ "SU", "Success Corporation" },
{ "SW", "Swing! Deutschland" },
{ "TA", "Takara" },
{ "TC", "Tecmo" },
{ "TD", "The 3DO Company" },
{ "TK", "Takuyo" },
{ "TM", "TDK Mediactive" },
{ "TQ", "THQ" },
{ "TS", "Titus Interactive" },
{ "TT", "Take-Two Interactive Software" },
{ "US", "Ubisoft" },
{ "VC", "Victor Interactive Software" },
{ "VG", "Valcon Games" },
{ "VN", "Vivendi Universal Games (Former Interplay)" }, // TODO: Confirm
{ "VU", "Vivendi Universal Games" },
{ "VV", "Vicarious Visions" },
{ "WE", "Wanadoo Edition" },
{ "WR", "Warner Bros. Interactive Entertainment" },
{ "XA", "Xbox Live Arcade" },
{ "XI", "Xicat Interactive / XPEC Entertainment and Idea Factory" }, // TODO: Confirm
{ "XK", "Xbox Kiosk" },
{ "XL", "Xbox Live" },
{ "XM", "Evolved Games" }, // TODO: Confirm
{ "XP", "XPEC Entertainment" },
{ "XR", "Panorama" }, // TODO: Confirm
{ "YB", "YBM Sisa (South-Korea)" },
{ "ZD", "Zushi Games (formerly Zoo Digital Publishing)" },
{ "" + (char)0x00 + (char)0x01, "Microsoft Downloadable Content" },
{ "" + (char)0x05 + (char)0x04, "Zuma's Revenge" },
{ "" + (char)0xAA + (char)0xAA, "Arcania - Gothic 4" },
{ "" + (char)0xFF + (char)0xED, "Microsoft Downloadable Content" },
{ "" + (char)0xFF + (char)0xFD, "Microsoft Downloadable Content" },
{ "" + (char)0xFF + (char)0xFE, "Microsoft Downloadable Content" },
{ "" + (char)0xFF + (char)0xFF, "Microsoft Downloadable Content" },
};
/// <summary>
/// Mapping of all region 1-letter codes to long names
/// </summary>
public static readonly Dictionary<char, string> Regions = new Dictionary<char, string>
{
{ 'A', "USA" },
{ 'E', "Europe" },
{ 'H', "Japan / Europe" },
{ 'J', "Japan / Asia" },
{ 'K', "USA / Japan" },
{ 'L', "USA / Europe" },
{ 'W', "World" },
};
}
}