namespace BinaryObjectScanner.Models.N3DS
{
///
public sealed class NCCHHeader
{
///
/// RSA-2048 signature of the NCCH header, using SHA-256.
///
public byte[] RSA2048Signature;
///
/// Magic ID, always 'NCCH'
///
public string MagicID;
///
/// Content size, in media units (1 media unit = 0x200 bytes)
///
public uint ContentSizeInMediaUnits;
///
/// Partition ID
///
public ulong PartitionId;
///
/// Maker code
///
public ushort MakerCode;
///
/// Version
///
public ushort Version;
///
/// When ncchflag[7] = 0x20 starting with FIRM 9.6.0-X, this is compared with the first output u32 from a
/// SHA256 hash. The data used for that hash is 0x18-bytes: [0x10-long title-unique content lock seed]
/// [programID from NCCH + 0x118]. This hash is only used for verification of the content lock seed, and
/// is not the actual keyY.
///
public uint VerificationHash;
///
/// Program ID
///
public byte[] ProgramId;
///
/// Reserved
///
public byte[] Reserved1;
///
/// Logo Region SHA-256 hash. (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11)
///
public byte[] LogoRegionHash;
///
/// Product code
///
public string ProductCode;
///
/// Extended header SHA-256 hash (SHA256 of 2x Alignment Size, beginning at 0x0 of ExHeader)
///
public byte[] ExtendedHeaderHash;
///
/// Extended header size, in bytes
///
public uint ExtendedHeaderSizeInBytes;
///
/// Reserved
///
public byte[] Reserved2;
///
/// Flags
///
public NCCHHeaderFlags Flags;
///
/// Plain region offset, in media units
///
public uint PlainRegionOffsetInMediaUnits;
///
/// Plain region size, in media units
///
public uint PlainRegionSizeInMediaUnits;
///
/// Logo Region offset, in media units (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11)
///
public uint LogoRegionOffsetInMediaUnits;
///
/// Logo Region size, in media units (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11)
///
public uint LogoRegionSizeInMediaUnits;
///
/// ExeFS offset, in media units
///
public uint ExeFSOffsetInMediaUnits;
///
/// ExeFS size, in media units
///
public uint ExeFSSizeInMediaUnits;
///
/// ExeFS hash region size, in media units
///
public uint ExeFSHashRegionSizeInMediaUnits;
///
/// Reserved
///
public byte[] Reserved3;
///
/// RomFS offset, in media units
///
public uint RomFSOffsetInMediaUnits;
///
/// RomFS size, in media units
///
public uint RomFSSizeInMediaUnits;
///
/// RomFS hash region size, in media units
///
public uint RomFSHashRegionSizeInMediaUnits;
///
/// Reserved
///
public byte[] Reserved4;
///
/// ExeFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the ExeFS over the number of
/// media units specified in the ExeFS hash region size)
///
public byte[] ExeFSSuperblockHash;
///
/// RomFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the RomFS over the number
/// of media units specified in the RomFS hash region size)
///
public byte[] RomFSSuperblockHash;
}
}