#[repr(C)]pub struct Header {Show 92 fields
pub title: AsciiArray<12>,
pub gamecode: AsciiArray<4>,
pub makercode: AsciiArray<2>,
pub unitcode: u8,
pub seed_select: u8,
pub capacity: Capacity,
pub reserved0: [u8; 7],
pub dsi_flags: DsiFlags,
pub ds_flags: DsFlags,
pub rom_version: u8,
pub autostart: u8,
pub arm9: ProgramOffset,
pub arm7: ProgramOffset,
pub file_names: TableOffset,
pub file_allocs: TableOffset,
pub arm9_overlays: TableOffset,
pub arm7_overlays: TableOffset,
pub normal_cmd_setting: u32,
pub key1_cmd_setting: u32,
pub banner_offset: u32,
pub secure_area_crc: u16,
pub secure_area_delay: Delay,
pub arm9_autoload_callback: u32,
pub arm7_autoload_callback: u32,
pub secure_area_disable: u64,
pub rom_size_ds: u32,
pub header_size: u32,
pub arm9_build_info_offset: u32,
pub arm7_build_info_offset: u32,
pub ds_rom_region_end: u16,
pub dsi_rom_region_end: u16,
pub rom_nand_end: u16,
pub rw_nand_end: u16,
pub reserved1: [u8; 24],
pub reserved2: [u8; 16],
pub logo: [u8; 156],
pub logo_crc: u16,
pub header_crc: u16,
pub debug_rom_offset: u32,
pub debug_size: u32,
pub debug_ram_addr: u32,
pub reserved3: [u8; 4],
pub reserved4: [u8; 16],
pub memory_banks_wram: [u32; 5],
pub memory_banks_arm9: [u32; 3],
pub memory_banks_arm7: [u32; 3],
pub memory_bank_9: u32,
pub region_flags: RegionFlags,
pub access_control: AccessControl,
pub arm7_scfg_ext7_setting: u32,
pub dsi_flags_2: DsiFlags2,
pub arm9i: ProgramOffset,
pub arm7i: ProgramOffset,
pub digest_ds_area: TableOffset,
pub digest_dsi_area: TableOffset,
pub digest_sector_hashtable: TableOffset,
pub digest_block_hashtable: TableOffset,
pub digest_sector_size: u32,
pub digest_sector_count: u32,
pub banner_size: u32,
pub sd_shared2_0000_size: u8,
pub sd_shared2_0001_size: u8,
pub eula_version: u8,
pub use_ratings: bool,
pub rom_size_dsi: u32,
pub sd_shared2_0002_size: u8,
pub sd_shared2_0003_size: u8,
pub sd_shared2_0004_size: u8,
pub sd_shared2_0005_size: u8,
pub arm9i_build_info_offset: u32,
pub arm7i_build_info_offset: u32,
pub modcrypt_area_1: TableOffset,
pub modcrypt_area_2: TableOffset,
pub gamecode_rev: AsciiArray<4>,
pub file_type: u32,
pub sd_public_sav_size: u32,
pub sd_private_sav_size: u32,
pub reserved5: [u8; 176],
pub age_ratings: [u8; 16],
pub sha1_hmac_arm9_with_secure_area: [u8; 20],
pub sha1_hmac_arm7: [u8; 20],
pub sha1_hmac_digest: [u8; 20],
pub sha1_hmac_banner: [u8; 20],
pub sha1_hmac_arm9i: [u8; 20],
pub sha1_hmac_arm7i: [u8; 20],
pub sha1_hmac_unk1: [u8; 20],
pub sha1_hmac_unk2: [u8; 20],
pub sha1_hmac_arm9: [u8; 20],
pub reserved6: [u8; 2636],
pub debug_args: [u8; 384],
pub rsa_sha1: [u8; 128],
pub reserved7: [u8; 12288],
}Expand description
ROM header.
Fields§
§title: AsciiArray<12>Short game title, normally in uppercase letters.
gamecode: AsciiArray<4>4-character game code in uppercase letters.
makercode: AsciiArray<2>2-character maker code, normally “01”.
unitcode: u8Unit code, depends on which platform (DS, DSi) this game is for.
seed_select: u8Encryption seed select.
capacity: CapacityROM capacity, powers of two starting from 128kB.
reserved0: [u8; 7]Reserved, zero.
dsi_flags: DsiFlagsDSi-specific flags.
ds_flags: DsFlagsFlags for both DS and DSi.
rom_version: u8ROM version, usually zero.
autostart: u8Autostart, can skip “Health and Safety” screen.
arm9: ProgramOffsetARM9 program offset.
arm7: ProgramOffsetARM7 program offset.
file_names: TableOffsetFile Name Table (FNT) offset.
file_allocs: TableOffsetFile Allocation Table (FAT) offset.
arm9_overlays: TableOffsetARM9 overlay table offset.
arm7_overlays: TableOffsetARM7 overlay table offset.
normal_cmd_setting: u32Port 0x40001a4 setting for normal commands.
key1_cmd_setting: u32Port 0x40001a4 setting for KEY1 commands.
Banner offset.
secure_area_crc: u16CRC checksum of ARM9 secure area.
secure_area_delay: DelayDelay to wait for secure area.
arm9_autoload_callback: u32ARM9 autoload callback.
arm7_autoload_callback: u32ARM7 autoload callback.
secure_area_disable: u64Can be set to encrypted “NmMdOnly” to disable secure area de/encryption.
rom_size_ds: u32Total ROM size. If this is a DSi game, this value excludes the DSi area.
header_size: u32Size of header, always 0x4000.
arm9_build_info_offset: u32ARM9 build info offset, see super::BuildInfo.
arm7_build_info_offset: u32ARM7 build info offset, see super::BuildInfo.
ds_rom_region_end: u16DS ROM region end in multiples of 0x80000. Zero for non-DSi games.
dsi_rom_region_end: u16DSi ROM region end in multiples of 0x80000. Zero for non-DSi games.
rom_nand_end: u16NAND end of ROM area in multiples of 0x20000 (0x80000 on DSi).
rw_nand_end: u16NAND end of RW area in multiples of 0x20000 (0x80000 on DSi).
reserved1: [u8; 24]Reserved, zero.
reserved2: [u8; 16]Reserved, zero.
logo: [u8; 156]Compressed logo, see Logo.
logo_crc: u16CRC checksum of Self::logo.
header_crc: u16CRC checksum of everything before this member.
debug_rom_offset: u32Debug ROM offset, only for debug builds.
debug_size: u32Debug ROM size, only for debug builds.
debug_ram_addr: u32Debug RAM address, only for debug builds.
reserved3: [u8; 4]Reserved, zero
reserved4: [u8; 16]Reserved, zero
memory_banks_wram: [u32; 5]MBK1 to MBK5
memory_banks_arm9: [u32; 3]MBK6 to MBK8
memory_banks_arm7: [u32; 3]MBK6 to MBK8
memory_bank_9: u32MBK9
region_flags: RegionFlagsRegion flags.
access_control: AccessControlAccess control.
arm7_scfg_ext7_setting: u32ARM7 SCFG_EXT7 setting.
dsi_flags_2: DsiFlags2DSi-exclusive flags.
arm9i: ProgramOffsetARM9i program offset.
arm7i: ProgramOffsetARM7i program offset.
digest_ds_area: TableOffsetDS area digest range.
digest_dsi_area: TableOffsetDSi area digest range.
digest_sector_hashtable: TableOffsetDigest sector hashtable offset.
digest_block_hashtable: TableOffsetDigest block hashtable offset.
digest_sector_size: u32Digest sector size.
digest_sector_count: u32Digest sector count.
Banner size.
SD/MMC size of shared2/0000 file
SD/MMC size of shared2/0001 file
eula_version: u8EULA version.
use_ratings: boolUse age ratings.
rom_size_dsi: u32Total ROM size, including DSi area.
SD/MMC size of shared/0002 file
SD/MMC size of shared/0003 file
SD/MMC size of shared/0004 file
SD/MMC size of shared/0005 file
arm9i_build_info_offset: u32ARM9i build info offset.
arm7i_build_info_offset: u32ARM7i build info offset.
modcrypt_area_1: TableOffsetModcrypt area 1 offset.
modcrypt_area_2: TableOffsetModcrypt area 1 offset.
gamecode_rev: AsciiArray<4>Same as Self::gamecode but byte.reversed.
file_type: u32File type.
sd_public_sav_size: u32SD/MMC public.sav file size.
sd_private_sav_size: u32SD/MMC private.sav file size.
reserved5: [u8; 176]Reserved, zero.
age_ratings: [u8; 16]Age ratings.
sha1_hmac_arm9_with_secure_area: [u8; 20]SHA1-HMAC of ARM9 program including secure area.
sha1_hmac_arm7: [u8; 20]SHA1-HMAC of ARM7 program.
sha1_hmac_digest: [u8; 20]SHA1-HMAC of digest section.
SHA1-HMAC of banner.
sha1_hmac_arm9i: [u8; 20]SHA1-HMAC of decrypted ARM9i.
sha1_hmac_arm7i: [u8; 20]SHA1-HMAC of decrypted ARM7i.
sha1_hmac_unk1: [u8; 20]Unknown SHA1-HMAC, defined by some games.
sha1_hmac_unk2: [u8; 20]Unknown SHA1-HMAC, defined by some games.
sha1_hmac_arm9: [u8; 20]SHA1-HMAC of ARM9 program excluding secure area.
reserved6: [u8; 2636]Reserved, zero.
debug_args: [u8; 384]Used for passing arguments in debug environment.
rsa_sha1: [u8; 128]RSA-SHA1 signature up to Self::debug_args.
reserved7: [u8; 12288]Reserved, zero.
Implementations§
Source§impl Header
impl Header
Sourcepub fn version(&self) -> HeaderVersion
pub fn version(&self) -> HeaderVersion
Returns the version of this Header.
Sourcepub fn borrow_from_slice(data: &[u8]) -> Result<&Self, RawHeaderError>
pub fn borrow_from_slice(data: &[u8]) -> Result<&Self, RawHeaderError>
Sourcepub fn borrow_from_slice_mut(
data: &mut [u8],
) -> Result<&mut Self, RawHeaderError>
pub fn borrow_from_slice_mut( data: &mut [u8], ) -> Result<&mut Self, RawHeaderError>
Sourcepub fn display(&self, indent: usize) -> DisplayHeader<'_>
pub fn display(&self, indent: usize) -> DisplayHeader<'_>
Creates a DisplayHeader which implements Display.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.