diff --git a/include/firm/format/format_rom.h b/include/firm/format/format_rom.h index 8f8c8e56..13772acd 100644 --- a/include/firm/format/format_rom.h +++ b/include/firm/format/format_rom.h @@ -33,6 +33,8 @@ #define ROM_TWL_LTD_ALIGN_SHIFT 19 // 上記の単位をビットシフトに換算 #define ROM_TWL_ALL_NORMAL_AREA_FLAG 0x8000 +#define DS_DLPLAY_SIGNATURE_PADDING_SIZE 512 // DSダウンロードプレイ署名格納エリアサイズ + #define DIGEST_SIZE_SHA1 20 #define DEFAULT_ALIGN 512 @@ -272,8 +274,13 @@ typedef struct ROM_Header_Short u32 banner_twl_offset; u32 banner_twl_size; - // 0x0210 - 0x0220 for AES key/seed - u8 aes_key[ 16 ]; + // 0x0210 - 0x0218 for AES target offset & size + u32 aes_target_rom_offset; + u32 aes_target_size; + + // 0x0218 - 0x0220 for TWL rom valid size + u32 twl_rom_valid_size; // ROM Original Size + u8 reserved_ltd_D[ 4 ]; // 0x220 - 0x298 Rom Segment Digest u8 main_static_digest[ DIGEST_SIZE_SHA1 ]; diff --git a/include/firm/format/format_rom_certificate.h b/include/firm/format/format_rom_certificate.h index 0a7ae854..859d40a8 100644 --- a/include/firm/format/format_rom_certificate.h +++ b/include/firm/format/format_rom_certificate.h @@ -27,8 +27,6 @@ #define TWL_ROM_CERT_MAGIC_NUMBER 0x54524543 // "CERT"の文字列 #define RSA_KEY_LENGTH ( 1024 / 8 ) -#define RSA_PUBKEY_1024_DER_MAX 0xc0 // 少しマージンをとってこの値 -#define RSA_PRVKEY_1024_DER_MAX 0x280 #define ROM_CERT_SIGN_OFFSET 256 #define ROM_HEADER_SIGN_TARGET_SIZE 0xe00 @@ -44,8 +42,8 @@ typedef struct RomCertificateHeader { // ROM証明書 typedef struct RomCertificate { RomCertificateHeader header; - u8 reserved[ ( ROM_CERT_SIGN_OFFSET - sizeof(RomCertificateHeader) - RSA_PUBKEY_1024_DER_MAX ) ]; - u8 pubKey[ RSA_PUBKEY_1024_DER_MAX ]; + u8 reserved[ ROM_CERT_SIGN_OFFSET - sizeof(RomCertificateHeader) - RSA_KEY_LENGTH ]; + u8 pubKeyMod[ RSA_KEY_LENGTH ]; u8 sign[ RSA_KEY_LENGTH ]; }RomCertificate;