From 4e3eed89f4dd9c80c1115df0fddfbb61b4241625 Mon Sep 17 00:00:00 2001 From: yoshida_teruhisa Date: Tue, 15 Jul 2008 01:49:37 +0000 Subject: [PATCH] =?UTF-8?q?=E6=97=A7loadSysmVersion=E3=81=8C=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@1888 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/systemMenu_RED/Launcher/ARM9/Makefile | 2 +- .../Launcher/ARM9/src/loadSysmVersion.c | 120 ------------------ .../Launcher/ARM9/src/loadSysmVersion.h | 40 ------ build/systemMenu_RED/Launcher/ARM9/src/main.c | 1 - 4 files changed, 1 insertion(+), 162 deletions(-) delete mode 100644 build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.c delete mode 100644 build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.h diff --git a/build/systemMenu_RED/Launcher/ARM9/Makefile b/build/systemMenu_RED/Launcher/ARM9/Makefile index 592babba..b2313508 100644 --- a/build/systemMenu_RED/Launcher/ARM9/Makefile +++ b/build/systemMenu_RED/Launcher/ARM9/Makefile @@ -78,7 +78,7 @@ BG_DIR = ../../data SRCS_LOGO = logoDemo.c logoData.c SRCS = main.c launcher.c sound.c loadWlanFirm.c \ - loadSharedFont.c scanWDS.c loadSysmVersion.c \ + loadSharedFont.c scanWDS.c \ $(addprefix $(LOGO_DIR)/, $(SRCS_LOGO)) \ $(MISC_DIR)/src/misc.c $(MISC_DIR)/src/cmn.c \ $(BG_DIR)/BGData_Launcher.c diff --git a/build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.c b/build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.c deleted file mode 100644 index c6192d17..00000000 --- a/build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.c +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlIPL - File: loadSysmVersion.c - - Copyright 2007 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$ - *---------------------------------------------------------------------------*/ - -#include -#include "launcher.h" -#include "misc.h" -#include "loadSysmVersion.h" - -// extern data----------------------------------------------------------------- - -// define data----------------------------------------------------------------- -#define VER_TITLEID 0x0003000F484E4C41 //HNLA - -#define VERSION_DATA_SIGN_SIZE 128 -#define VERSION_DATA_HEADER_SIZE 96 -#define VERSION_DATA_PADDING1_SIZE 12 -#define VERSION_DATA_PADDING2_SIZE 44 - -typedef struct VersionDataHeader -{ - u8 rsa_sign[VERSION_DATA_SIGN_SIZE]; - union - { - u8 header[VERSION_DATA_HEADER_SIZE]; - struct - { - u32 timestamp; - u32 version; - u32 userAreaSize; - u32 data1Offset; - u32 data1Size; - u8 padding1[VERSION_DATA_PADDING1_SIZE]; - u8 data1Digest; - u8 padding2[VERSION_DATA_PADDING2_SIZE]; - }; - }; -} -VersionDataHeader; - -// function's prototype------------------------------------------------------- - -// global variable------------------------------------------------------------- - -// static variable------------------------------------------------------------- -static u32 s_version = 0; -// const data------------------------------------------------------------------ - - -// ============================================================================ -// バージョン -// ============================================================================ -BOOL LoadSysmVersion( void ) -{ - char path[256]; - VersionDataHeader vdh; - FSFile file[1]; - BOOL bSuccess; - s32 len; - - // ファイル読み込み - NAM_GetTitleBootContentPathFast(path, VER_TITLEID); - - FS_InitFile( file ); - bSuccess = FS_OpenFileEx(file, path, FS_FILEMODE_R); - - if( ! bSuccess ) - { -OS_TPrintf("LoadSysmVersion failed: cant open file\n"); - (void)FS_CloseFile(file); - return FALSE; - } - - len = FS_ReadFile(file, &vdh, sizeof(vdh)); - if( len != sizeof(vdh) ) - { -OS_TPrintf("LoadSysmVersion failed: read file error!\n"); - (void)FS_CloseFile(file); - return FALSE; - } - - (void)FS_CloseFile(file); - - // 検証 - // [TODO:]署名処理 - - s_version = vdh.version; - if( vdh.timestamp > 0 ) OS_TPrintf( "VersionData timestamp : %08x\n", vdh.timestamp ); - - return TRUE; -} - -u32 GetSysmVersion( void ) -{ - return s_version; -} - -u16 GetSysmMajorVersion( void ) -{ - return (u16)( ( 0xffff0000 & s_version ) >> 16 ); -} - -u16 GetSysmMinorVersion( void ) -{ - return (u16)( 0xffff & s_version ); -} - diff --git a/build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.h b/build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.h deleted file mode 100644 index be6966a2..00000000 --- a/build/systemMenu_RED/Launcher/ARM9/src/loadSysmVersion.h +++ /dev/null @@ -1,40 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlIPL - File: loadSysmVersion.h - - Copyright 2007 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 __LOAD_SYSM_VERSION_H__ -#define __LOAD_SYSM_VERSION_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// define data------------------------------------------------------- -// global variables-------------------------------------------------- -// function---------------------------------------------------------- -BOOL LoadSysmVersion( void ); -u32 GetSysmVersion( void ); -u16 GetSysmMajorVersion( void ); -u16 GetSysmMinorVersion( void ); - -#ifdef __cplusplus -} -#endif - -#endif // __LOAD_SYSM_VERSION_H__ diff --git a/build/systemMenu_RED/Launcher/ARM9/src/main.c b/build/systemMenu_RED/Launcher/ARM9/src/main.c index 9da81c9a..1d8491eb 100644 --- a/build/systemMenu_RED/Launcher/ARM9/src/main.c +++ b/build/systemMenu_RED/Launcher/ARM9/src/main.c @@ -26,7 +26,6 @@ #include "sound.h" #include "loadWlanFirm.h" #include "loadSharedFont.h" -#include "loadSysmVersion.h" #include "scanWDS.h" // extern data-----------------------------------------------------------------