From 8bdb464c3bc3ac5293ca6e69f73a34f873e0abc2 Mon Sep 17 00:00:00 2001 From: n1481 Date: Fri, 15 Jun 2012 08:02:45 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E8=B6=B3=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@582 7061adef-622a-194b-ae81-725974e89856 --- .../twl_format_rom_certificate.h | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 build/tools/TamperDetectorForSrl/twl_format_rom_certificate.h diff --git a/build/tools/TamperDetectorForSrl/twl_format_rom_certificate.h b/build/tools/TamperDetectorForSrl/twl_format_rom_certificate.h new file mode 100644 index 0000000..4c78515 --- /dev/null +++ b/build/tools/TamperDetectorForSrl/twl_format_rom_certificate.h @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tools - makerom.TWL + File: format_rom_certificate.h + + Copyright 2007-2008 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: $ + $Rev$ + $Author$ + *---------------------------------------------------------------------------*/ + +#ifndef FORMAT_ROM_CERTIFICATE_H_ +#define FORMAT_ROM_CERTIFICATE_H_ + +/*===========================================================================* + * ROM CERTIFICATE FORMAT + *===========================================================================*/ + +#define TWL_ROM_CERT_MAGIC_NUMBER 0x54524543 // "CERT"‚Ì•¶Žš—ñ +#define RSA_KEY_LENGTH ( 1024 / 8 ) // RSAŒöŠJŒ®’· +#define ROM_CERT_SIGN_OFFSET 256 // ROMƒwƒbƒ_Ø–¾‘“à‚Ì–¼ƒIƒtƒZƒbƒg +#define ROM_HEADER_SIGN_TARGET_SIZE 0xe00 // ROMƒwƒbƒ_–¼‘ÎÛƒTƒCƒY + +// ROMØ–¾‘ƒwƒbƒ_ +typedef struct RomCertificateHeader { + u32 magicNumber; + u32 version; + u32 serialNo; + u32 gameCode; +}RomCertificateHeader; + +// ROMØ–¾‘ +typedef struct RomCertificate { + RomCertificateHeader header; + u8 reserved[ ROM_CERT_SIGN_OFFSET - sizeof(RomCertificateHeader) - RSA_KEY_LENGTH ]; + u8 pubKeyMod[ RSA_KEY_LENGTH ]; + u8 sign[ RSA_KEY_LENGTH ]; +}RomCertificate; + +#endif //FORMAT_ROM_CERTIFICATE_H_