diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.cpp deleted file mode 100644 index 04eec8f..0000000 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.cpp +++ /dev/null @@ -1,808 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: BgsCommunicator.cpp - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#include "BgsCommunicator.h" -#include "Util.h" -#include "CommonLogger.h" - -#include -#include -#include -#include - -namespace ConsoleRestore -{ - -namespace -{ -// Buffer for POST data must be 4096-byte aligned, and a multiple of 4096 bytes. -static unsigned char s_PostBuffer[4096] NN_ATTRIBUTE_ALIGN(4096); - -// DEV6接続用証明書 -u8 USER_ORIGIN_CLIENT_CERT_DATA[] = -{ -#ifndef BUILD_FOR_PROD_BGS - #ifndef BUILD_FOR_TEST_BGS - // DEV6 -0x30, 0x82, 0x03, 0xef, 0x30, 0x82, 0x02, 0xd7, 0xa0, 0x03, 0x02, -0x01, 0x02, 0x02, 0x01, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, -0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30, 0x81, -0x93, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, -0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, -0x08, 0x13, 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, -0x69, 0x61, 0x31, 0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, -0x13, 0x0d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, -0x56, 0x69, 0x65, 0x77, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, -0x04, 0x0a, 0x13, 0x0b, 0x69, 0x47, 0x77, 0x61, 0x72, 0x65, 0x20, -0x49, 0x6e, 0x63, 0x2e, 0x31, 0x23, 0x30, 0x21, 0x06, 0x03, 0x55, -0x04, 0x0b, 0x13, 0x1a, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x2d, 0x53, -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, -0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x1c, 0x30, -0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x13, 0x49, 0x6e, 0x74, -0x65, 0x72, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x53, -0x75, 0x62, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x30, -0x31, 0x30, 0x31, 0x31, 0x32, 0x31, 0x35, 0x33, 0x32, 0x36, 0x5a, -0x17, 0x0d, 0x33, 0x36, 0x30, 0x31, 0x31, 0x35, 0x32, 0x31, 0x35, -0x33, 0x32, 0x36, 0x5a, 0x30, 0x81, 0x8c, 0x31, 0x0b, 0x30, 0x09, -0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, -0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x43, 0x61, -0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, -0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x4d, 0x6f, 0x75, -0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x56, 0x69, 0x65, 0x77, 0x31, -0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x69, -0x47, 0x77, 0x61, 0x72, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, -0x1d, 0x30, 0x1b, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x14, 0x41, -0x67, 0x65, 0x6e, 0x74, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, -0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x1b, 0x30, -0x19, 0x06, 0x03, 0x55, 0x04, 0x03, 0x14, 0x12, 0x4e, 0x69, 0x6e, -0x74, 0x65, 0x6e, 0x64, 0x6f, 0x5f, 0x45, 0x43, 0x49, 0x5f, 0x61, -0x67, 0x65, 0x6e, 0x74, 0x30, 0x81, 0x9f, 0x30, 0x0d, 0x06, 0x09, -0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, -0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, -0xee, 0x37, 0xef, 0xbb, 0x29, 0x54, 0x42, 0x3b, 0x21, 0x08, 0xe3, -0x77, 0x82, 0x12, 0x85, 0xc7, 0x3b, 0x58, 0x6f, 0x72, 0x6f, 0x3f, -0x11, 0x13, 0x49, 0x40, 0xac, 0xe2, 0x26, 0x71, 0xf2, 0xd2, 0xa4, -0xa6, 0x92, 0xfb, 0xcb, 0xc9, 0x6c, 0x45, 0xe4, 0xff, 0xbe, 0xd6, -0x65, 0xd9, 0x71, 0x7a, 0x21, 0x4b, 0x12, 0xf5, 0xa1, 0x11, 0xe0, -0x32, 0xd9, 0x42, 0x92, 0x39, 0x47, 0x36, 0x1a, 0x83, 0xc3, 0x62, -0xd5, 0xda, 0x7d, 0xc0, 0x10, 0xbd, 0x75, 0x43, 0x42, 0x04, 0x49, -0x72, 0x52, 0xaa, 0xc1, 0x72, 0x63, 0xbc, 0x16, 0x77, 0x76, 0x72, -0x86, 0x55, 0xac, 0x9a, 0x68, 0x15, 0x58, 0x51, 0xaf, 0xb2, 0xa0, -0xc8, 0x1b, 0xd1, 0x18, 0xad, 0x49, 0x6d, 0x16, 0x19, 0xa1, 0xfb, -0xee, 0x7c, 0x4c, 0x74, 0x7e, 0xc7, 0xfa, 0x08, 0x23, 0x80, 0xb9, -0xef, 0x2f, 0x6f, 0x3d, 0xaf, 0x96, 0xd1, 0x02, 0x03, 0x01, 0x00, -0x01, 0xa3, 0x81, 0xd6, 0x30, 0x81, 0xd3, 0x30, 0x1d, 0x06, 0x03, -0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x73, 0x9c, 0x63, 0x4b, -0x0b, 0xcc, 0x6c, 0x5b, 0xcc, 0x60, 0x3c, 0x51, 0x87, 0x4a, 0x41, -0x1c, 0x8a, 0x0b, 0x1a, 0x0f, 0x30, 0x81, 0xb1, 0x06, 0x03, 0x55, -0x1d, 0x23, 0x04, 0x81, 0xa9, 0x30, 0x81, 0xa6, 0x80, 0x14, 0xb1, -0x08, 0x84, 0xa7, 0xe2, 0xe6, 0xa8, 0x53, 0x0f, 0x4c, 0x50, 0x0f, -0xbb, 0x7d, 0x3e, 0x68, 0xa7, 0x98, 0x5c, 0x13, 0xa1, 0x81, 0x8a, -0xa4, 0x81, 0x87, 0x30, 0x81, 0x84, 0x31, 0x0b, 0x30, 0x09, 0x06, -0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, -0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x43, 0x61, 0x6c, -0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, 0x30, 0x14, -0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x4d, 0x6f, 0x75, 0x6e, -0x74, 0x61, 0x69, 0x6e, 0x20, 0x56, 0x69, 0x65, 0x77, 0x31, 0x14, -0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x0b, 0x69, 0x47, -0x77, 0x61, 0x72, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x1e, -0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x15, 0x43, 0x65, -0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, -0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, 0x12, 0x30, -0x10, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x09, 0x69, 0x47, 0x77, -0x61, 0x72, 0x65, 0x20, 0x43, 0x41, 0x82, 0x01, 0x0d, 0x30, 0x0d, -0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, -0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0xa8, 0x03, 0xa4, 0xa0, -0x91, 0x40, 0x4c, 0x08, 0xf1, 0x54, 0x01, 0x1c, 0xe3, 0x45, 0x3c, -0x79, 0xb9, 0x16, 0xf9, 0xc9, 0x58, 0x2d, 0xb3, 0x23, 0x26, 0x50, -0x18, 0x5f, 0x13, 0x56, 0xa9, 0x9f, 0x0e, 0xc1, 0xa9, 0xb9, 0x7c, -0xb1, 0xe9, 0x5d, 0x74, 0x60, 0x6c, 0x3b, 0x1c, 0xf6, 0x03, 0xc7, -0x5f, 0x08, 0x65, 0xc8, 0xcf, 0xf3, 0x71, 0xac, 0x96, 0xb2, 0xf2, -0x92, 0x44, 0xd4, 0x03, 0x80, 0x3c, 0x83, 0x52, 0x96, 0x90, 0x1c, -0x17, 0xa7, 0x9c, 0x05, 0xb2, 0x9e, 0xaa, 0xa7, 0x4a, 0xec, 0xf1, -0x3e, 0x8e, 0xc9, 0x7c, 0x7e, 0x81, 0x58, 0x88, 0x2e, 0x9c, 0x44, -0x04, 0xe7, 0x16, 0xf4, 0xa8, 0x00, 0xf1, 0xf3, 0x32, 0x11, 0x23, -0x57, 0x85, 0x65, 0xd0, 0x6c, 0x1d, 0x29, 0xb8, 0x4a, 0xeb, 0x22, -0xff, 0x11, 0x30, 0x92, 0x7a, 0xb1, 0x4b, 0x19, 0x71, 0xc4, 0xbb, -0xf8, 0x75, 0xaa, 0x54, 0xe7, 0xe9, 0x31, 0xfa, 0xad, 0xb1, 0xb6, -0x8c, 0xae, 0xbe, 0xb3, 0x7f, 0x9a, 0x8b, 0x0d, 0x3a, 0xef, 0x2d, -0xb6, 0xec, 0x9d, 0x3e, 0x7d, 0x3a, 0xb9, 0x76, 0xf0, 0x3c, 0x64, -0x4b, 0xa8, 0x48, 0x58, 0x89, 0x5a, 0x28, 0x36, 0x86, 0x75, 0xe3, -0x70, 0xb3, 0xd4, 0x5a, 0xff, 0x2e, 0xe5, 0xc6, 0x5c, 0xfd, 0xa8, -0xcf, 0x23, 0x5e, 0xa2, 0x96, 0x20, 0x18, 0xc4, 0x3e, 0x6e, 0x2d, -0xe1, 0xcb, 0x47, 0x3a, 0x67, 0x04, 0xd2, 0xb3, 0xbe, 0x38, 0x13, -0xf1, 0x88, 0x0e, 0x5c, 0x18, 0xd5, 0x22, 0xd7, 0x8d, 0x14, 0x3e, -0xa7, 0xcf, 0x20, 0x62, 0x28, 0x1f, 0x31, 0x62, 0x98, 0x8c, 0xe3, -0xb0, 0xdc, 0x47, 0xee, 0x80, 0x76, 0xa3, 0x23, 0x11, 0xba, 0xe3, -0x87, 0xac, 0x85, 0xdb, 0x25, 0xe8, 0x9a, 0x4e, 0x23, 0x0b, 0xe7, -0xe2, 0x51, 0xa0, 0x1d, 0x87, 0xf1, 0xe9, 0x13, 0x9f, 0x1d - #else - // TEST -0x42, 0x61, 0x67, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, -0x74, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x72, 0x69, -0x65, 0x6e, 0x64, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x20, -0x65, 0x63, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x0a, 0x20, 0x20, 0x20, -0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4b, 0x65, 0x79, 0x49, 0x44, -0x3a, 0x20, 0x46, 0x44, 0x20, 0x38, 0x41, 0x20, 0x39, 0x31, 0x20, -0x32, 0x41, 0x20, 0x43, 0x46, 0x20, 0x43, 0x41, 0x20, 0x36, 0x33, -0x20, 0x44, 0x45, 0x20, 0x31, 0x32, 0x20, 0x42, 0x32, 0x20, 0x31, -0x31, 0x20, 0x32, 0x35, 0x20, 0x46, 0x46, 0x20, 0x39, 0x31, 0x20, -0x38, 0x44, 0x20, 0x42, 0x34, 0x20, 0x35, 0x39, 0x20, 0x42, 0x35, -0x20, 0x42, 0x45, 0x20, 0x43, 0x34, 0x20, 0x0a, 0x73, 0x75, 0x62, -0x6a, 0x65, 0x63, 0x74, 0x3d, 0x2f, 0x43, 0x3d, 0x55, 0x53, 0x2f, -0x53, 0x54, 0x3d, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, -0x69, 0x61, 0x2f, 0x4c, 0x3d, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, -0x69, 0x6e, 0x20, 0x56, 0x69, 0x65, 0x77, 0x2f, 0x4f, 0x3d, 0x69, -0x47, 0x77, 0x61, 0x72, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x2f, -0x4f, 0x55, 0x3d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x20, 0x41, 0x75, -0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, -0x6e, 0x2f, 0x43, 0x4e, 0x3d, 0x4e, 0x69, 0x6e, 0x74, 0x65, 0x6e, -0x64, 0x6f, 0x5f, 0x45, 0x43, 0x49, 0x5f, 0x61, 0x67, 0x65, 0x6e, -0x74, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3d, 0x2f, 0x43, -0x3d, 0x55, 0x53, 0x2f, 0x53, 0x54, 0x3d, 0x43, 0x61, 0x6c, 0x69, -0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x2f, 0x4c, 0x3d, 0x4d, 0x6f, -0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x56, 0x69, 0x65, 0x77, -0x2f, 0x4f, 0x3d, 0x69, 0x47, 0x77, 0x61, 0x72, 0x65, 0x20, 0x49, -0x6e, 0x63, 0x2e, 0x2f, 0x4f, 0x55, 0x3d, 0x49, 0x6e, 0x74, 0x65, -0x72, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, 0x6f, -0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, -0x2f, 0x43, 0x4e, 0x3d, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x2d, 0x53, -0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x53, 0x75, 0x62, 0x20, 0x43, -0x41, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, -0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, -0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, -0x44, 0x37, 0x7a, 0x43, 0x43, 0x41, 0x74, 0x65, 0x67, 0x41, 0x77, -0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x6a, 0x41, 0x4e, 0x42, -0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, -0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x6b, 0x7a, 0x45, -0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, -0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x0a, 0x45, 0x7a, 0x41, 0x52, -0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x43, 0x6b, 0x4e, -0x68, 0x62, 0x47, 0x6c, 0x6d, 0x62, 0x33, 0x4a, 0x75, 0x61, 0x57, -0x45, 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, -0x41, 0x63, 0x54, 0x44, 0x55, 0x31, 0x76, 0x64, 0x57, 0x35, 0x30, -0x59, 0x57, 0x6c, 0x75, 0x49, 0x46, 0x5a, 0x70, 0x5a, 0x58, 0x63, -0x78, 0x46, 0x44, 0x41, 0x53, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, -0x41, 0x6f, 0x54, 0x43, 0x32, 0x6c, 0x48, 0x64, 0x32, 0x46, 0x79, -0x5a, 0x53, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x53, 0x4d, -0x77, 0x49, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, -0x70, 0x4a, 0x62, 0x6e, 0x52, 0x6c, 0x63, 0x69, 0x31, 0x54, 0x5a, -0x58, 0x4a, 0x32, 0x5a, 0x58, 0x49, 0x67, 0x51, 0x32, 0x39, 0x74, -0x62, 0x58, 0x56, 0x75, 0x0a, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, -0x6c, 0x76, 0x62, 0x6a, 0x45, 0x63, 0x4d, 0x42, 0x6f, 0x47, 0x41, -0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x54, 0x53, 0x57, 0x35, 0x30, -0x5a, 0x58, 0x49, 0x74, 0x55, 0x32, 0x56, 0x79, 0x64, 0x6d, 0x56, -0x79, 0x49, 0x46, 0x4e, 0x31, 0x59, 0x69, 0x42, 0x44, 0x51, 0x54, -0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x44, 0x45, 0x77, 0x4d, -0x54, 0x45, 0x79, 0x0a, 0x4d, 0x54, 0x55, 0x7a, 0x4d, 0x6a, 0x5a, -0x61, 0x46, 0x77, 0x30, 0x7a, 0x4e, 0x6a, 0x41, 0x78, 0x4d, 0x54, -0x55, 0x79, 0x4d, 0x54, 0x55, 0x7a, 0x4d, 0x6a, 0x5a, 0x61, 0x4d, -0x49, 0x47, 0x4d, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, -0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, -0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x42, -0x4d, 0x4b, 0x0a, 0x51, 0x32, 0x46, 0x73, 0x61, 0x57, 0x5a, 0x76, -0x63, 0x6d, 0x35, 0x70, 0x59, 0x54, 0x45, 0x57, 0x4d, 0x42, 0x51, -0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x4e, 0x54, 0x57, -0x39, 0x31, 0x62, 0x6e, 0x52, 0x68, 0x61, 0x57, 0x34, 0x67, 0x56, -0x6d, 0x6c, 0x6c, 0x64, 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, -0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4c, 0x61, 0x55, 0x64, -0x33, 0x0a, 0x59, 0x58, 0x4a, 0x6c, 0x49, 0x45, 0x6c, 0x75, 0x59, -0x79, 0x34, 0x78, 0x48, 0x54, 0x41, 0x62, 0x42, 0x67, 0x4e, 0x56, -0x42, 0x41, 0x73, 0x54, 0x46, 0x45, 0x46, 0x6e, 0x5a, 0x57, 0x35, -0x30, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x6c, 0x62, 0x6e, -0x52, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x4d, -0x52, 0x73, 0x77, 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, -0x0a, 0x46, 0x42, 0x4a, 0x4f, 0x61, 0x57, 0x35, 0x30, 0x5a, 0x57, -0x35, 0x6b, 0x62, 0x31, 0x39, 0x46, 0x51, 0x30, 0x6c, 0x66, 0x59, -0x57, 0x64, 0x6c, 0x62, 0x6e, 0x51, 0x77, 0x67, 0x5a, 0x38, 0x77, -0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, -0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x59, -0x30, 0x41, 0x4d, 0x49, 0x47, 0x4a, 0x41, 0x6f, 0x47, 0x42, 0x0a, -0x41, 0x4f, 0x34, 0x33, 0x37, 0x37, 0x73, 0x70, 0x56, 0x45, 0x49, -0x37, 0x49, 0x51, 0x6a, 0x6a, 0x64, 0x34, 0x49, 0x53, 0x68, 0x63, -0x63, 0x37, 0x57, 0x47, 0x39, 0x79, 0x62, 0x7a, 0x38, 0x52, 0x45, -0x30, 0x6c, 0x41, 0x72, 0x4f, 0x49, 0x6d, 0x63, 0x66, 0x4c, 0x53, -0x70, 0x4b, 0x61, 0x53, 0x2b, 0x38, 0x76, 0x4a, 0x62, 0x45, 0x58, -0x6b, 0x2f, 0x37, 0x37, 0x57, 0x5a, 0x64, 0x6c, 0x78, 0x0a, 0x65, -0x69, 0x46, 0x4c, 0x45, 0x76, 0x57, 0x68, 0x45, 0x65, 0x41, 0x79, -0x32, 0x55, 0x4b, 0x53, 0x4f, 0x55, 0x63, 0x32, 0x47, 0x6f, 0x50, -0x44, 0x59, 0x74, 0x58, 0x61, 0x66, 0x63, 0x41, 0x51, 0x76, 0x58, -0x56, 0x44, 0x51, 0x67, 0x52, 0x4a, 0x63, 0x6c, 0x4b, 0x71, 0x77, -0x58, 0x4a, 0x6a, 0x76, 0x42, 0x5a, 0x33, 0x64, 0x6e, 0x4b, 0x47, -0x56, 0x61, 0x79, 0x61, 0x61, 0x42, 0x56, 0x59, 0x0a, 0x55, 0x61, -0x2b, 0x79, 0x6f, 0x4d, 0x67, 0x62, 0x30, 0x52, 0x69, 0x74, 0x53, -0x57, 0x30, 0x57, 0x47, 0x61, 0x48, 0x37, 0x37, 0x6e, 0x78, 0x4d, -0x64, 0x48, 0x37, 0x48, 0x2b, 0x67, 0x67, 0x6a, 0x67, 0x4c, 0x6e, -0x76, 0x4c, 0x32, 0x38, 0x39, 0x72, 0x35, 0x62, 0x52, 0x41, 0x67, -0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x64, 0x59, 0x77, 0x67, -0x64, 0x4d, 0x77, 0x48, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, -0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x48, 0x4f, 0x63, 0x59, 0x30, -0x73, 0x4c, 0x7a, 0x47, 0x78, 0x62, 0x7a, 0x47, 0x41, 0x38, 0x55, -0x59, 0x64, 0x4b, 0x51, 0x52, 0x79, 0x4b, 0x43, 0x78, 0x6f, 0x50, -0x4d, 0x49, 0x47, 0x78, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, -0x45, 0x67, 0x61, 0x6b, 0x77, 0x67, 0x61, 0x61, 0x41, 0x46, 0x4c, -0x45, 0x49, 0x68, 0x4b, 0x66, 0x69, 0x0a, 0x35, 0x71, 0x68, 0x54, -0x44, 0x30, 0x78, 0x51, 0x44, 0x37, 0x74, 0x39, 0x50, 0x6d, 0x69, -0x6e, 0x6d, 0x46, 0x77, 0x54, 0x6f, 0x59, 0x47, 0x4b, 0x70, 0x49, -0x47, 0x48, 0x4d, 0x49, 0x47, 0x45, 0x4d, 0x51, 0x73, 0x77, 0x43, -0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, -0x55, 0x7a, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, -0x45, 0x43, 0x42, 0x4d, 0x4b, 0x0a, 0x51, 0x32, 0x46, 0x73, 0x61, -0x57, 0x5a, 0x76, 0x63, 0x6d, 0x35, 0x70, 0x59, 0x54, 0x45, 0x57, -0x4d, 0x42, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, -0x4e, 0x54, 0x57, 0x39, 0x31, 0x62, 0x6e, 0x52, 0x68, 0x61, 0x57, -0x34, 0x67, 0x56, 0x6d, 0x6c, 0x6c, 0x64, 0x7a, 0x45, 0x55, 0x4d, -0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4c, -0x61, 0x55, 0x64, 0x33, 0x0a, 0x59, 0x58, 0x4a, 0x6c, 0x49, 0x45, -0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x42, -0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x46, 0x55, 0x4e, 0x6c, -0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, -0x6c, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, -0x6c, 0x30, 0x65, 0x54, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, -0x31, 0x55, 0x45, 0x0a, 0x41, 0x78, 0x4d, 0x4a, 0x61, 0x55, 0x64, -0x33, 0x59, 0x58, 0x4a, 0x6c, 0x49, 0x45, 0x4e, 0x42, 0x67, 0x67, -0x45, 0x4e, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, -0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, -0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, 0x6f, 0x41, 0x36, 0x53, -0x67, 0x6b, 0x55, 0x42, 0x4d, 0x43, 0x50, 0x46, 0x55, 0x41, 0x52, -0x7a, 0x6a, 0x0a, 0x52, 0x54, 0x78, 0x35, 0x75, 0x52, 0x62, 0x35, -0x79, 0x56, 0x67, 0x74, 0x73, 0x79, 0x4d, 0x6d, 0x55, 0x42, 0x68, -0x66, 0x45, 0x31, 0x61, 0x70, 0x6e, 0x77, 0x37, 0x42, 0x71, 0x62, -0x6c, 0x38, 0x73, 0x65, 0x6c, 0x64, 0x64, 0x47, 0x42, 0x73, 0x4f, -0x78, 0x7a, 0x32, 0x41, 0x38, 0x64, 0x66, 0x43, 0x47, 0x58, 0x49, -0x7a, 0x2f, 0x4e, 0x78, 0x72, 0x4a, 0x61, 0x79, 0x38, 0x70, 0x4a, -0x45, 0x0a, 0x31, 0x41, 0x4f, 0x41, 0x50, 0x49, 0x4e, 0x53, 0x6c, -0x70, 0x41, 0x63, 0x46, 0x36, 0x65, 0x63, 0x42, 0x62, 0x4b, 0x65, -0x71, 0x71, 0x64, 0x4b, 0x37, 0x50, 0x45, 0x2b, 0x6a, 0x73, 0x6c, -0x38, 0x66, 0x6f, 0x46, 0x59, 0x69, 0x43, 0x36, 0x63, 0x52, 0x41, -0x54, 0x6e, 0x46, 0x76, 0x53, 0x6f, 0x41, 0x50, 0x48, 0x7a, 0x4d, -0x68, 0x45, 0x6a, 0x56, 0x34, 0x56, 0x6c, 0x30, 0x47, 0x77, 0x64, -0x0a, 0x4b, 0x62, 0x68, 0x4b, 0x36, 0x79, 0x4c, 0x2f, 0x45, 0x54, -0x43, 0x53, 0x65, 0x72, 0x46, 0x4c, 0x47, 0x58, 0x48, 0x45, 0x75, -0x2f, 0x68, 0x31, 0x71, 0x6c, 0x54, 0x6e, 0x36, 0x54, 0x48, 0x36, -0x72, 0x62, 0x47, 0x32, 0x6a, 0x4b, 0x36, 0x2b, 0x73, 0x33, 0x2b, -0x61, 0x69, 0x77, 0x30, 0x36, 0x37, 0x79, 0x32, 0x32, 0x37, 0x4a, -0x30, 0x2b, 0x66, 0x54, 0x71, 0x35, 0x64, 0x76, 0x41, 0x38, 0x0a, -0x5a, 0x45, 0x75, 0x6f, 0x53, 0x46, 0x69, 0x4a, 0x57, 0x69, 0x67, -0x32, 0x68, 0x6e, 0x58, 0x6a, 0x63, 0x4c, 0x50, 0x55, 0x57, 0x76, -0x38, 0x75, 0x35, 0x63, 0x5a, 0x63, 0x2f, 0x61, 0x6a, 0x50, 0x49, -0x31, 0x36, 0x69, 0x6c, 0x69, 0x41, 0x59, 0x78, 0x44, 0x35, 0x75, -0x4c, 0x65, 0x48, 0x4c, 0x52, 0x7a, 0x70, 0x6e, 0x42, 0x4e, 0x4b, -0x7a, 0x76, 0x6a, 0x67, 0x54, 0x38, 0x59, 0x67, 0x4f, 0x0a, 0x58, -0x42, 0x6a, 0x56, 0x49, 0x74, 0x65, 0x4e, 0x46, 0x44, 0x36, 0x6e, -0x7a, 0x79, 0x42, 0x69, 0x4b, 0x42, 0x38, 0x78, 0x59, 0x70, 0x69, -0x4d, 0x34, 0x37, 0x44, 0x63, 0x52, 0x2b, 0x36, 0x41, 0x64, 0x71, -0x4d, 0x6a, 0x45, 0x62, 0x72, 0x6a, 0x68, 0x36, 0x79, 0x46, 0x32, -0x79, 0x58, 0x6f, 0x6d, 0x6b, 0x34, 0x6a, 0x43, 0x2b, 0x66, 0x69, -0x55, 0x61, 0x41, 0x64, 0x68, 0x2f, 0x48, 0x70, 0x0a, 0x45, 0x35, -0x38, 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, -0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, -0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a - #endif -#else -// PROD -0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, -0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, -0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x37, -0x7a, 0x43, 0x43, 0x41, 0x74, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, -0x41, 0x67, 0x49, 0x42, 0x41, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, -0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, -0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x6b, 0x7a, 0x45, 0x4c, 0x4d, -0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, -0x56, 0x56, 0x4d, 0x78, 0x0a, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, -0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x43, 0x6b, 0x4e, 0x68, 0x62, -0x47, 0x6c, 0x6d, 0x62, 0x33, 0x4a, 0x75, 0x61, 0x57, 0x45, 0x78, -0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, -0x54, 0x44, 0x55, 0x31, 0x76, 0x64, 0x57, 0x35, 0x30, 0x59, 0x57, -0x6c, 0x75, 0x49, 0x46, 0x5a, 0x70, 0x5a, 0x58, 0x63, 0x78, 0x46, -0x44, 0x41, 0x53, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, -0x54, 0x43, 0x32, 0x6c, 0x48, 0x64, 0x32, 0x46, 0x79, 0x5a, 0x53, -0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x53, 0x4d, 0x77, 0x49, -0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x70, 0x4a, -0x62, 0x6e, 0x52, 0x6c, 0x63, 0x69, 0x31, 0x54, 0x5a, 0x58, 0x4a, -0x32, 0x5a, 0x58, 0x49, 0x67, 0x51, 0x32, 0x39, 0x74, 0x62, 0x58, -0x56, 0x75, 0x0a, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, -0x62, 0x6a, 0x45, 0x63, 0x4d, 0x42, 0x6f, 0x47, 0x41, 0x31, 0x55, -0x45, 0x41, 0x78, 0x4d, 0x54, 0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, -0x49, 0x74, 0x55, 0x32, 0x56, 0x79, 0x64, 0x6d, 0x56, 0x79, 0x49, -0x46, 0x4e, 0x31, 0x59, 0x69, 0x42, 0x44, 0x51, 0x54, 0x41, 0x65, -0x46, 0x77, 0x30, 0x78, 0x4d, 0x44, 0x45, 0x77, 0x4d, 0x54, 0x45, -0x79, 0x0a, 0x4d, 0x7a, 0x41, 0x79, 0x4d, 0x7a, 0x6c, 0x61, 0x46, -0x77, 0x30, 0x7a, 0x4e, 0x6a, 0x41, 0x78, 0x4d, 0x54, 0x55, 0x79, -0x4d, 0x7a, 0x41, 0x79, 0x4d, 0x7a, 0x6c, 0x61, 0x4d, 0x49, 0x47, -0x4d, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, -0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x54, 0x4d, -0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x42, 0x4d, 0x4b, -0x0a, 0x51, 0x32, 0x46, 0x73, 0x61, 0x57, 0x5a, 0x76, 0x63, 0x6d, -0x35, 0x70, 0x59, 0x54, 0x45, 0x57, 0x4d, 0x42, 0x51, 0x47, 0x41, -0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x4e, 0x54, 0x57, 0x39, 0x31, -0x62, 0x6e, 0x52, 0x68, 0x61, 0x57, 0x34, 0x67, 0x56, 0x6d, 0x6c, -0x6c, 0x64, 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, -0x55, 0x45, 0x43, 0x68, 0x4d, 0x4c, 0x61, 0x55, 0x64, 0x33, 0x0a, -0x59, 0x58, 0x4a, 0x6c, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, -0x78, 0x48, 0x54, 0x41, 0x62, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, -0x73, 0x54, 0x46, 0x45, 0x46, 0x6e, 0x5a, 0x57, 0x35, 0x30, 0x49, -0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x6c, 0x62, 0x6e, 0x52, 0x70, -0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x4d, 0x52, 0x73, -0x77, 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x0a, 0x46, -0x42, 0x4a, 0x4f, 0x61, 0x57, 0x35, 0x30, 0x5a, 0x57, 0x35, 0x6b, -0x62, 0x31, 0x39, 0x46, 0x51, 0x30, 0x6c, 0x66, 0x59, 0x57, 0x64, -0x6c, 0x62, 0x6e, 0x51, 0x77, 0x67, 0x5a, 0x38, 0x77, 0x44, 0x51, -0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, -0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x59, 0x30, 0x41, -0x4d, 0x49, 0x47, 0x4a, 0x41, 0x6f, 0x47, 0x42, 0x0a, 0x41, 0x4e, -0x4d, 0x39, 0x53, 0x6b, 0x31, 0x69, 0x47, 0x79, 0x6c, 0x79, 0x7a, -0x6e, 0x58, 0x37, 0x78, 0x7a, 0x59, 0x48, 0x46, 0x53, 0x61, 0x4f, -0x31, 0x67, 0x72, 0x43, 0x52, 0x2f, 0x36, 0x58, 0x46, 0x36, 0x58, -0x6a, 0x45, 0x79, 0x51, 0x67, 0x2b, 0x4f, 0x5a, 0x79, 0x72, 0x47, -0x4d, 0x57, 0x57, 0x57, 0x70, 0x56, 0x4c, 0x37, 0x65, 0x72, 0x72, -0x48, 0x66, 0x6d, 0x6c, 0x4d, 0x67, 0x64, 0x0a, 0x55, 0x6f, 0x61, -0x44, 0x4c, 0x72, 0x59, 0x71, 0x66, 0x46, 0x77, 0x30, 0x56, 0x39, -0x38, 0x7a, 0x6b, 0x55, 0x75, 0x45, 0x68, 0x51, 0x71, 0x79, 0x64, -0x51, 0x77, 0x62, 0x74, 0x31, 0x31, 0x44, 0x39, 0x57, 0x55, 0x4f, -0x32, 0x6a, 0x57, 0x6d, 0x30, 0x52, 0x55, 0x6e, 0x51, 0x43, 0x78, -0x2f, 0x36, 0x52, 0x6c, 0x54, 0x74, 0x75, 0x36, 0x58, 0x74, 0x57, -0x2f, 0x44, 0x7a, 0x6e, 0x52, 0x77, 0x0a, 0x38, 0x4d, 0x64, 0x74, -0x62, 0x4d, 0x6d, 0x6f, 0x70, 0x59, 0x5a, 0x76, 0x33, 0x6d, 0x33, -0x74, 0x65, 0x6c, 0x59, 0x4e, 0x72, 0x6f, 0x34, 0x5a, 0x75, 0x4b, -0x6c, 0x75, 0x52, 0x78, 0x58, 0x4f, 0x4f, 0x76, 0x6f, 0x69, 0x4a, -0x45, 0x6b, 0x32, 0x41, 0x2f, 0x38, 0x31, 0x41, 0x67, 0x4d, 0x42, -0x41, 0x41, 0x47, 0x6a, 0x67, 0x64, 0x59, 0x77, 0x67, 0x64, 0x4d, -0x77, 0x48, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, 0x4f, 0x42, -0x42, 0x59, 0x45, 0x46, 0x4f, 0x39, 0x63, 0x5a, 0x78, 0x45, 0x6e, -0x48, 0x4a, 0x4c, 0x53, 0x41, 0x35, 0x5a, 0x37, 0x67, 0x58, 0x4e, -0x49, 0x58, 0x73, 0x36, 0x69, 0x4e, 0x42, 0x4a, 0x2b, 0x4d, 0x49, -0x47, 0x78, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x67, -0x61, 0x6b, 0x77, 0x67, 0x61, 0x61, 0x41, 0x46, 0x4a, 0x35, 0x62, -0x31, 0x57, 0x6a, 0x6c, 0x0a, 0x42, 0x65, 0x53, 0x33, 0x73, 0x75, -0x76, 0x72, 0x4e, 0x6a, 0x41, 0x37, 0x41, 0x61, 0x74, 0x31, 0x6a, -0x76, 0x64, 0x53, 0x6f, 0x59, 0x47, 0x4b, 0x70, 0x49, 0x47, 0x48, -0x4d, 0x49, 0x47, 0x45, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, -0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, -0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, -0x42, 0x4d, 0x4b, 0x0a, 0x51, 0x32, 0x46, 0x73, 0x61, 0x57, 0x5a, -0x76, 0x63, 0x6d, 0x35, 0x70, 0x59, 0x54, 0x45, 0x57, 0x4d, 0x42, -0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x4e, 0x54, -0x57, 0x39, 0x31, 0x62, 0x6e, 0x52, 0x68, 0x61, 0x57, 0x34, 0x67, -0x56, 0x6d, 0x6c, 0x6c, 0x64, 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, -0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4c, 0x61, 0x55, -0x64, 0x33, 0x0a, 0x59, 0x58, 0x4a, 0x6c, 0x49, 0x45, 0x6c, 0x75, -0x59, 0x79, 0x34, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x42, 0x67, 0x4e, -0x56, 0x42, 0x41, 0x73, 0x54, 0x46, 0x55, 0x4e, 0x6c, 0x63, 0x6e, -0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, 0x49, -0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, -0x65, 0x54, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, -0x45, 0x0a, 0x41, 0x78, 0x4d, 0x4a, 0x61, 0x55, 0x64, 0x33, 0x59, -0x58, 0x4a, 0x6c, 0x49, 0x45, 0x4e, 0x42, 0x67, 0x67, 0x45, 0x4e, -0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, -0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, -0x49, 0x42, 0x41, 0x51, 0x42, 0x6b, 0x58, 0x50, 0x70, 0x44, 0x58, -0x55, 0x38, 0x57, 0x36, 0x51, 0x66, 0x52, 0x39, 0x78, 0x4b, 0x63, -0x0a, 0x63, 0x77, 0x63, 0x5a, 0x4b, 0x58, 0x2b, 0x6d, 0x41, 0x4f, -0x49, 0x43, 0x2f, 0x6e, 0x4f, 0x69, 0x5a, 0x43, 0x37, 0x36, 0x55, -0x4e, 0x36, 0x6d, 0x53, 0x55, 0x5a, 0x36, 0x64, 0x79, 0x72, 0x7a, -0x55, 0x55, 0x63, 0x72, 0x34, 0x2f, 0x5a, 0x68, 0x65, 0x52, 0x68, -0x62, 0x76, 0x58, 0x6b, 0x30, 0x6d, 0x6c, 0x41, 0x64, 0x37, 0x2f, -0x38, 0x55, 0x51, 0x36, 0x68, 0x6d, 0x72, 0x48, 0x57, 0x37, 0x0a, -0x61, 0x44, 0x4d, 0x59, 0x30, 0x68, 0x4b, 0x67, 0x38, 0x48, 0x62, -0x2b, 0x44, 0x45, 0x42, 0x75, 0x6d, 0x4f, 0x31, 0x71, 0x7a, 0x4d, -0x59, 0x53, 0x5a, 0x7a, 0x2b, 0x78, 0x34, 0x67, 0x2f, 0x2b, 0x4f, -0x37, 0x4f, 0x5a, 0x74, 0x6a, 0x47, 0x62, 0x64, 0x62, 0x34, 0x65, -0x58, 0x71, 0x51, 0x33, 0x45, 0x58, 0x78, 0x34, 0x35, 0x75, 0x33, -0x33, 0x42, 0x6f, 0x6f, 0x52, 0x61, 0x65, 0x63, 0x49, 0x0a, 0x32, -0x4b, 0x74, 0x70, 0x30, 0x64, 0x78, 0x79, 0x45, 0x4f, 0x70, 0x4c, -0x2f, 0x39, 0x39, 0x68, 0x43, 0x66, 0x7a, 0x61, 0x6b, 0x72, 0x4c, -0x61, 0x5a, 0x2b, 0x47, 0x6e, 0x57, 0x63, 0x65, 0x77, 0x79, 0x74, -0x43, 0x30, 0x74, 0x75, 0x69, 0x4b, 0x33, 0x4a, 0x39, 0x6c, 0x47, -0x61, 0x30, 0x69, 0x45, 0x4c, 0x65, 0x71, 0x75, 0x70, 0x4b, 0x53, -0x79, 0x73, 0x78, 0x50, 0x63, 0x6b, 0x48, 0x64, 0x0a, 0x58, 0x56, -0x4b, 0x36, 0x38, 0x53, 0x37, 0x2b, 0x31, 0x4d, 0x57, 0x6d, 0x66, -0x56, 0x43, 0x41, 0x46, 0x4c, 0x56, 0x34, 0x63, 0x32, 0x58, 0x2b, -0x69, 0x57, 0x55, 0x46, 0x4a, 0x58, 0x72, 0x4e, 0x38, 0x53, 0x32, -0x4c, 0x43, 0x79, 0x68, 0x74, 0x6e, 0x41, 0x72, 0x4e, 0x34, 0x61, -0x45, 0x43, 0x31, 0x30, 0x55, 0x58, 0x59, 0x73, 0x32, 0x6d, 0x75, -0x30, 0x76, 0x32, 0x64, 0x47, 0x6c, 0x68, 0x0a, 0x76, 0x75, 0x65, -0x6e, 0x42, 0x70, 0x7a, 0x36, 0x44, 0x42, 0x38, 0x79, 0x7a, 0x4b, -0x66, 0x41, 0x75, 0x64, 0x6c, 0x69, 0x65, 0x69, 0x35, 0x73, 0x56, -0x4e, 0x35, 0x4b, 0x38, 0x70, 0x32, 0x77, 0x63, 0x58, 0x38, 0x66, -0x75, 0x43, 0x76, 0x63, 0x41, 0x56, 0x6d, 0x45, 0x41, 0x4d, 0x6d, -0x72, 0x6a, 0x68, 0x46, 0x53, 0x74, 0x59, 0x4d, 0x6d, 0x48, 0x2f, -0x71, 0x46, 0x78, 0x48, 0x7a, 0x7a, 0x0a, 0x70, 0x59, 0x32, 0x57, -0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, -0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, -0x2d, 0x2d, 0x2d, 0x2d, 0x0a -#endif -}; - -// DEV6接続用秘密鍵 -u8 USER_ORIGIN_PRIVATE_KEY[] = -{ -#ifndef BUILD_FOR_PROD_BGS - #ifndef BUILD_FOR_TEST_BGS - // DEV6 -0x30, 0x82, 0x02, 0x5e, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, -0xee, 0x37, 0xef, 0xbb, 0x29, 0x54, 0x42, 0x3b, 0x21, 0x08, 0xe3, -0x77, 0x82, 0x12, 0x85, 0xc7, 0x3b, 0x58, 0x6f, 0x72, 0x6f, 0x3f, -0x11, 0x13, 0x49, 0x40, 0xac, 0xe2, 0x26, 0x71, 0xf2, 0xd2, 0xa4, -0xa6, 0x92, 0xfb, 0xcb, 0xc9, 0x6c, 0x45, 0xe4, 0xff, 0xbe, 0xd6, -0x65, 0xd9, 0x71, 0x7a, 0x21, 0x4b, 0x12, 0xf5, 0xa1, 0x11, 0xe0, -0x32, 0xd9, 0x42, 0x92, 0x39, 0x47, 0x36, 0x1a, 0x83, 0xc3, 0x62, -0xd5, 0xda, 0x7d, 0xc0, 0x10, 0xbd, 0x75, 0x43, 0x42, 0x04, 0x49, -0x72, 0x52, 0xaa, 0xc1, 0x72, 0x63, 0xbc, 0x16, 0x77, 0x76, 0x72, -0x86, 0x55, 0xac, 0x9a, 0x68, 0x15, 0x58, 0x51, 0xaf, 0xb2, 0xa0, -0xc8, 0x1b, 0xd1, 0x18, 0xad, 0x49, 0x6d, 0x16, 0x19, 0xa1, 0xfb, -0xee, 0x7c, 0x4c, 0x74, 0x7e, 0xc7, 0xfa, 0x08, 0x23, 0x80, 0xb9, -0xef, 0x2f, 0x6f, 0x3d, 0xaf, 0x96, 0xd1, 0x02, 0x03, 0x01, 0x00, -0x01, 0x02, 0x81, 0x81, 0x00, 0x98, 0x91, 0x00, 0x9b, 0x98, 0xd3, -0x9a, 0xfb, 0x6d, 0xa3, 0xd8, 0xb2, 0xf0, 0x7e, 0x56, 0x69, 0x8c, -0x0b, 0x8e, 0x8c, 0xf6, 0xcc, 0xa8, 0x6d, 0xf6, 0xab, 0x52, 0x4e, -0x20, 0x9b, 0x38, 0x0e, 0x4a, 0x5f, 0x58, 0xa1, 0xa5, 0x19, 0xa2, -0x9b, 0x7d, 0x17, 0x82, 0x2c, 0xa3, 0xdc, 0x48, 0x7e, 0x14, 0x96, -0x95, 0x54, 0xf5, 0x4c, 0x92, 0x8f, 0x5e, 0x6f, 0xf1, 0x60, 0x77, -0xc8, 0x21, 0xdf, 0xe7, 0x45, 0x3c, 0x22, 0x22, 0xc7, 0xf8, 0x59, -0x88, 0x63, 0xf8, 0x46, 0xf8, 0xe4, 0x69, 0xa0, 0xa8, 0x36, 0xeb, -0x29, 0xbe, 0x39, 0x89, 0x57, 0x7d, 0x72, 0x6d, 0xd6, 0x42, 0x48, -0xde, 0x5a, 0xd5, 0xb8, 0xaa, 0x4e, 0xe0, 0xad, 0x25, 0x7e, 0xdd, -0xef, 0x5d, 0xad, 0xa5, 0x2c, 0x2f, 0xd8, 0x07, 0x85, 0x38, 0x82, -0x5b, 0xf6, 0xf1, 0xf2, 0xbe, 0x75, 0xc6, 0xcd, 0xdf, 0xf5, 0x07, -0x31, 0x02, 0x41, 0x00, 0xfa, 0xfc, 0x8f, 0xfb, 0x7a, 0x98, 0x88, -0x61, 0x90, 0x68, 0xda, 0x12, 0x09, 0x8f, 0xd3, 0x62, 0x56, 0x95, -0xc6, 0xc0, 0xd2, 0x50, 0xd5, 0x6d, 0xc6, 0x51, 0x9f, 0x1e, 0x5b, -0x10, 0x19, 0x07, 0xeb, 0x3c, 0xd8, 0xdc, 0xfc, 0x93, 0xbd, 0xd3, -0x6c, 0x02, 0x48, 0x79, 0xd5, 0xc7, 0xd7, 0x0e, 0xd4, 0x86, 0x5f, -0x8d, 0x33, 0xe1, 0x27, 0x12, 0xeb, 0x38, 0xe0, 0x1e, 0xff, 0xfb, -0x3d, 0xbd, 0x02, 0x41, 0x00, 0xf2, 0xfa, 0x15, 0x66, 0x1b, 0xf5, -0x84, 0xcc, 0xd2, 0x4b, 0xe3, 0x96, 0xbb, 0x0a, 0xf0, 0x03, 0x61, -0xcb, 0x7f, 0x25, 0x80, 0x22, 0x69, 0x37, 0x99, 0x9c, 0x23, 0xba, -0xe8, 0x76, 0x1b, 0xb6, 0xac, 0x6d, 0x24, 0xf3, 0xa2, 0xf4, 0xfb, -0x31, 0x16, 0x1b, 0x82, 0xaa, 0x5c, 0xc1, 0x2b, 0xca, 0x98, 0x24, -0xf7, 0x27, 0x92, 0x2c, 0x63, 0xf3, 0xac, 0xe8, 0x4d, 0x92, 0x3a, -0xb2, 0xbc, 0xa5, 0x02, 0x41, 0x00, 0x94, 0x16, 0x28, 0xad, 0xec, -0x6b, 0xcb, 0x2c, 0x25, 0x94, 0x77, 0xf6, 0x64, 0x85, 0xe3, 0xe7, -0x05, 0xc7, 0x61, 0x79, 0xab, 0x9d, 0xde, 0x0f, 0xe3, 0x0f, 0x8d, -0x9e, 0xcf, 0x83, 0xf4, 0x00, 0xe4, 0x1f, 0x06, 0xa5, 0x7c, 0xb1, -0x7f, 0x33, 0x1b, 0x6b, 0x4d, 0x6f, 0xf5, 0x5e, 0xef, 0xd8, 0xe4, -0x34, 0x54, 0x74, 0x6f, 0xc3, 0xcc, 0xd6, 0x30, 0xcb, 0x62, 0x11, -0x68, 0x5f, 0xc8, 0xd1, 0x02, 0x41, 0x00, 0xac, 0x46, 0x7a, 0xd3, -0xaa, 0x31, 0x3b, 0x56, 0x8a, 0x28, 0xba, 0x96, 0x4d, 0xca, 0x24, -0x81, 0x11, 0x5e, 0xda, 0xa8, 0xb9, 0x20, 0x2c, 0xdf, 0xfa, 0x2f, -0x05, 0xfa, 0x69, 0x06, 0x0d, 0x02, 0x49, 0x61, 0x1d, 0x99, 0x0d, -0x4a, 0x8b, 0xab, 0xb3, 0x14, 0x10, 0x62, 0x40, 0x5f, 0xca, 0x6f, -0xdb, 0xce, 0x21, 0xdb, 0x51, 0xbd, 0xdd, 0xa4, 0x91, 0x4d, 0x28, -0x6a, 0xec, 0xe9, 0x7b, 0xed, 0x02, 0x40, 0x62, 0xdb, 0x1b, 0x6a, -0x32, 0x30, 0x7b, 0xe8, 0xcf, 0xe7, 0xf8, 0x31, 0xab, 0x54, 0x57, -0x84, 0x27, 0x93, 0xcd, 0x02, 0xf5, 0x89, 0x61, 0xb6, 0x35, 0x87, -0x76, 0xb1, 0xa4, 0x11, 0x25, 0x4b, 0x4c, 0x5a, 0xc8, 0xae, 0x51, -0x94, 0x16, 0xec, 0x75, 0x7f, 0x77, 0xea, 0xad, 0x4d, 0xb9, 0x0b, -0x77, 0xc3, 0x18, 0xd7, 0xc7, 0x3a, 0xc8, 0x66, 0x6b, 0x3c, 0x61, -0xde, 0x23, 0xd8, 0xf0, 0x91 - #else - // TEST -0x42, 0x61, 0x67, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, -0x74, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x72, 0x69, -0x65, 0x6e, 0x64, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x20, -0x65, 0x63, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x0a, 0x20, 0x20, 0x20, -0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4b, 0x65, 0x79, 0x49, 0x44, -0x3a, 0x20, 0x46, 0x44, 0x20, 0x38, 0x41, 0x20, 0x39, 0x31, 0x20, -0x32, 0x41, 0x20, 0x43, 0x46, 0x20, 0x43, 0x41, 0x20, 0x36, 0x33, -0x20, 0x44, 0x45, 0x20, 0x31, 0x32, 0x20, 0x42, 0x32, 0x20, 0x31, -0x31, 0x20, 0x32, 0x35, 0x20, 0x46, 0x46, 0x20, 0x39, 0x31, 0x20, -0x38, 0x44, 0x20, 0x42, 0x34, 0x20, 0x35, 0x39, 0x20, 0x42, 0x35, -0x20, 0x42, 0x45, 0x20, 0x43, 0x34, 0x20, 0x0a, 0x4b, 0x65, 0x79, -0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, -0x3a, 0x20, 0x3c, 0x4e, 0x6f, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, -0x62, 0x75, 0x74, 0x65, 0x73, 0x3e, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, -0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x52, 0x53, 0x41, 0x20, -0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, 0x59, -0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x58, -0x67, 0x49, 0x42, 0x41, 0x41, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x75, -0x4e, 0x2b, 0x2b, 0x37, 0x4b, 0x56, 0x52, 0x43, 0x4f, 0x79, 0x45, -0x49, 0x34, 0x33, 0x65, 0x43, 0x45, 0x6f, 0x58, 0x48, 0x4f, 0x31, -0x68, 0x76, 0x63, 0x6d, 0x38, 0x2f, 0x45, 0x52, 0x4e, 0x4a, 0x51, -0x4b, 0x7a, 0x69, 0x4a, 0x6e, 0x48, 0x79, 0x30, 0x71, 0x53, 0x6d, -0x6b, 0x76, 0x76, 0x4c, 0x0a, 0x79, 0x57, 0x78, 0x46, 0x35, 0x50, -0x2b, 0x2b, 0x31, 0x6d, 0x58, 0x5a, 0x63, 0x58, 0x6f, 0x68, 0x53, -0x78, 0x4c, 0x31, 0x6f, 0x52, 0x48, 0x67, 0x4d, 0x74, 0x6c, 0x43, -0x6b, 0x6a, 0x6c, 0x48, 0x4e, 0x68, 0x71, 0x44, 0x77, 0x32, 0x4c, -0x56, 0x32, 0x6e, 0x33, 0x41, 0x45, 0x4c, 0x31, 0x31, 0x51, 0x30, -0x49, 0x45, 0x53, 0x58, 0x4a, 0x53, 0x71, 0x73, 0x46, 0x79, 0x59, -0x37, 0x77, 0x57, 0x0a, 0x64, 0x33, 0x5a, 0x79, 0x68, 0x6c, 0x57, -0x73, 0x6d, 0x6d, 0x67, 0x56, 0x57, 0x46, 0x47, 0x76, 0x73, 0x71, -0x44, 0x49, 0x47, 0x39, 0x45, 0x59, 0x72, 0x55, 0x6c, 0x74, 0x46, -0x68, 0x6d, 0x68, 0x2b, 0x2b, 0x35, 0x38, 0x54, 0x48, 0x52, 0x2b, -0x78, 0x2f, 0x6f, 0x49, 0x49, 0x34, 0x43, 0x35, 0x37, 0x79, 0x39, -0x76, 0x50, 0x61, 0x2b, 0x57, 0x30, 0x51, 0x49, 0x44, 0x41, 0x51, -0x41, 0x42, 0x0a, 0x41, 0x6f, 0x47, 0x42, 0x41, 0x4a, 0x69, 0x52, -0x41, 0x4a, 0x75, 0x59, 0x30, 0x35, 0x72, 0x37, 0x62, 0x61, 0x50, -0x59, 0x73, 0x76, 0x42, 0x2b, 0x56, 0x6d, 0x6d, 0x4d, 0x43, 0x34, -0x36, 0x4d, 0x39, 0x73, 0x79, 0x6f, 0x62, 0x66, 0x61, 0x72, 0x55, -0x6b, 0x34, 0x67, 0x6d, 0x7a, 0x67, 0x4f, 0x53, 0x6c, 0x39, 0x59, -0x6f, 0x61, 0x55, 0x5a, 0x6f, 0x70, 0x74, 0x39, 0x46, 0x34, 0x49, -0x73, 0x0a, 0x6f, 0x39, 0x78, 0x49, 0x66, 0x68, 0x53, 0x57, 0x6c, -0x56, 0x54, 0x31, 0x54, 0x4a, 0x4b, 0x50, 0x58, 0x6d, 0x2f, 0x78, -0x59, 0x48, 0x66, 0x49, 0x49, 0x64, 0x2f, 0x6e, 0x52, 0x54, 0x77, -0x69, 0x49, 0x73, 0x66, 0x34, 0x57, 0x59, 0x68, 0x6a, 0x2b, 0x45, -0x62, 0x34, 0x35, 0x47, 0x6d, 0x67, 0x71, 0x44, 0x62, 0x72, 0x4b, -0x62, 0x34, 0x35, 0x69, 0x56, 0x64, 0x39, 0x63, 0x6d, 0x33, 0x57, -0x0a, 0x51, 0x6b, 0x6a, 0x65, 0x57, 0x74, 0x57, 0x34, 0x71, 0x6b, -0x37, 0x67, 0x72, 0x53, 0x56, 0x2b, 0x33, 0x65, 0x39, 0x64, 0x72, -0x61, 0x55, 0x73, 0x4c, 0x39, 0x67, 0x48, 0x68, 0x54, 0x69, 0x43, -0x57, 0x2f, 0x62, 0x78, 0x38, 0x72, 0x35, 0x31, 0x78, 0x73, 0x33, -0x66, 0x39, 0x51, 0x63, 0x78, 0x41, 0x6b, 0x45, 0x41, 0x2b, 0x76, -0x79, 0x50, 0x2b, 0x33, 0x71, 0x59, 0x69, 0x47, 0x47, 0x51, 0x0a, -0x61, 0x4e, 0x6f, 0x53, 0x43, 0x59, 0x2f, 0x54, 0x59, 0x6c, 0x61, -0x56, 0x78, 0x73, 0x44, 0x53, 0x55, 0x4e, 0x56, 0x74, 0x78, 0x6c, -0x47, 0x66, 0x48, 0x6c, 0x73, 0x51, 0x47, 0x51, 0x66, 0x72, 0x50, -0x4e, 0x6a, 0x63, 0x2f, 0x4a, 0x4f, 0x39, 0x30, 0x32, 0x77, 0x43, -0x53, 0x48, 0x6e, 0x56, 0x78, 0x39, 0x63, 0x4f, 0x31, 0x49, 0x5a, -0x66, 0x6a, 0x54, 0x50, 0x68, 0x4a, 0x78, 0x4c, 0x72, 0x0a, 0x4f, -0x4f, 0x41, 0x65, 0x2f, 0x2f, 0x73, 0x39, 0x76, 0x51, 0x4a, 0x42, -0x41, 0x50, 0x4c, 0x36, 0x46, 0x57, 0x59, 0x62, 0x39, 0x59, 0x54, -0x4d, 0x30, 0x6b, 0x76, 0x6a, 0x6c, 0x72, 0x73, 0x4b, 0x38, 0x41, -0x4e, 0x68, 0x79, 0x33, 0x38, 0x6c, 0x67, 0x43, 0x4a, 0x70, 0x4e, -0x35, 0x6d, 0x63, 0x49, 0x37, 0x72, 0x6f, 0x64, 0x68, 0x75, 0x32, -0x72, 0x47, 0x30, 0x6b, 0x38, 0x36, 0x4c, 0x30, 0x0a, 0x2b, 0x7a, -0x45, 0x57, 0x47, 0x34, 0x4b, 0x71, 0x58, 0x4d, 0x45, 0x72, 0x79, -0x70, 0x67, 0x6b, 0x39, 0x79, 0x65, 0x53, 0x4c, 0x47, 0x50, 0x7a, -0x72, 0x4f, 0x68, 0x4e, 0x6b, 0x6a, 0x71, 0x79, 0x76, 0x4b, 0x55, -0x43, 0x51, 0x51, 0x43, 0x55, 0x46, 0x69, 0x69, 0x74, 0x37, 0x47, -0x76, 0x4c, 0x4c, 0x43, 0x57, 0x55, 0x64, 0x2f, 0x5a, 0x6b, 0x68, -0x65, 0x50, 0x6e, 0x42, 0x63, 0x64, 0x68, 0x0a, 0x65, 0x61, 0x75, -0x64, 0x33, 0x67, 0x2f, 0x6a, 0x44, 0x34, 0x32, 0x65, 0x7a, 0x34, -0x50, 0x30, 0x41, 0x4f, 0x51, 0x66, 0x42, 0x71, 0x56, 0x38, 0x73, -0x58, 0x38, 0x7a, 0x47, 0x32, 0x74, 0x4e, 0x62, 0x2f, 0x56, 0x65, -0x37, 0x39, 0x6a, 0x6b, 0x4e, 0x46, 0x52, 0x30, 0x62, 0x38, 0x50, -0x4d, 0x31, 0x6a, 0x44, 0x4c, 0x59, 0x68, 0x46, 0x6f, 0x58, 0x38, -0x6a, 0x52, 0x41, 0x6b, 0x45, 0x41, 0x0a, 0x72, 0x45, 0x5a, 0x36, -0x30, 0x36, 0x6f, 0x78, 0x4f, 0x31, 0x61, 0x4b, 0x4b, 0x4c, 0x71, -0x57, 0x54, 0x63, 0x6f, 0x6b, 0x67, 0x52, 0x46, 0x65, 0x32, 0x71, -0x69, 0x35, 0x49, 0x43, 0x7a, 0x66, 0x2b, 0x69, 0x38, 0x46, 0x2b, -0x6d, 0x6b, 0x47, 0x44, 0x51, 0x4a, 0x4a, 0x59, 0x52, 0x32, 0x5a, -0x44, 0x55, 0x71, 0x4c, 0x71, 0x37, 0x4d, 0x55, 0x45, 0x47, 0x4a, -0x41, 0x58, 0x38, 0x70, 0x76, 0x0a, 0x32, 0x38, 0x34, 0x68, 0x32, -0x31, 0x47, 0x39, 0x33, 0x61, 0x53, 0x52, 0x54, 0x53, 0x68, 0x71, -0x37, 0x4f, 0x6c, 0x37, 0x37, 0x51, 0x4a, 0x41, 0x59, 0x74, 0x73, -0x62, 0x61, 0x6a, 0x49, 0x77, 0x65, 0x2b, 0x6a, 0x50, 0x35, 0x2f, -0x67, 0x78, 0x71, 0x31, 0x52, 0x58, 0x68, 0x43, 0x65, 0x54, 0x7a, -0x51, 0x4c, 0x31, 0x69, 0x57, 0x47, 0x32, 0x4e, 0x59, 0x64, 0x32, -0x73, 0x61, 0x51, 0x52, 0x0a, 0x4a, 0x55, 0x74, 0x4d, 0x57, 0x73, -0x69, 0x75, 0x55, 0x5a, 0x51, 0x57, 0x37, 0x48, 0x56, 0x2f, 0x64, -0x2b, 0x71, 0x74, 0x54, 0x62, 0x6b, 0x4c, 0x64, 0x38, 0x4d, 0x59, -0x31, 0x38, 0x63, 0x36, 0x79, 0x47, 0x5a, 0x72, 0x50, 0x47, 0x48, -0x65, 0x49, 0x39, 0x6a, 0x77, 0x6b, 0x51, 0x3d, 0x3d, 0x0a, 0x2d, -0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x52, 0x53, 0x41, -0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45, -0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a - #endif -#else -// PROD -0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, -0x52, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, -0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, -0x49, 0x49, 0x43, 0x58, 0x67, 0x49, 0x42, 0x41, 0x41, 0x4b, 0x42, -0x67, 0x51, 0x44, 0x54, 0x50, 0x55, 0x70, 0x4e, 0x59, 0x68, 0x73, -0x70, 0x63, 0x73, 0x35, 0x31, 0x2b, 0x38, 0x63, 0x32, 0x42, 0x78, -0x55, 0x6d, 0x6a, 0x74, 0x59, 0x4b, 0x77, 0x6b, 0x66, 0x2b, 0x6c, -0x78, 0x65, 0x6c, 0x34, 0x78, 0x4d, 0x6b, 0x49, 0x50, 0x6a, 0x6d, -0x63, 0x71, 0x78, 0x6a, 0x46, 0x6c, 0x6c, 0x71, 0x0a, 0x56, 0x53, -0x2b, 0x33, 0x71, 0x36, 0x78, 0x33, 0x35, 0x70, 0x54, 0x49, 0x48, -0x56, 0x4b, 0x47, 0x67, 0x79, 0x36, 0x32, 0x4b, 0x6e, 0x78, 0x63, -0x4e, 0x46, 0x66, 0x66, 0x4d, 0x35, 0x46, 0x4c, 0x68, 0x49, 0x55, -0x4b, 0x73, 0x6e, 0x55, 0x4d, 0x47, 0x37, 0x64, 0x64, 0x51, 0x2f, -0x56, 0x6c, 0x44, 0x74, 0x6f, 0x31, 0x70, 0x74, 0x45, 0x56, 0x4a, -0x30, 0x41, 0x73, 0x66, 0x2b, 0x6b, 0x5a, 0x0a, 0x55, 0x37, 0x62, -0x75, 0x6c, 0x37, 0x56, 0x76, 0x77, 0x38, 0x35, 0x30, 0x63, 0x50, -0x44, 0x48, 0x62, 0x57, 0x7a, 0x4a, 0x71, 0x4b, 0x57, 0x47, 0x62, -0x39, 0x35, 0x74, 0x37, 0x58, 0x70, 0x57, 0x44, 0x61, 0x36, 0x4f, -0x47, 0x62, 0x69, 0x70, 0x62, 0x6b, 0x63, 0x56, 0x7a, 0x6a, 0x72, -0x36, 0x49, 0x69, 0x52, 0x4a, 0x4e, 0x67, 0x50, 0x2f, 0x4e, 0x51, -0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x0a, 0x41, 0x6f, 0x47, 0x42, -0x41, 0x4c, 0x32, 0x35, 0x65, 0x4c, 0x6a, 0x54, 0x2b, 0x71, 0x31, -0x5a, 0x6a, 0x68, 0x48, 0x74, 0x31, 0x31, 0x69, 0x78, 0x4e, 0x38, -0x2f, 0x76, 0x7a, 0x6c, 0x4c, 0x50, 0x65, 0x44, 0x59, 0x7a, 0x6f, -0x6d, 0x75, 0x39, 0x37, 0x58, 0x30, 0x76, 0x6d, 0x42, 0x33, 0x79, -0x74, 0x4e, 0x34, 0x79, 0x50, 0x70, 0x45, 0x41, 0x66, 0x65, 0x45, -0x72, 0x63, 0x62, 0x59, 0x6e, 0x0a, 0x42, 0x55, 0x35, 0x4f, 0x39, -0x38, 0x59, 0x55, 0x6f, 0x4b, 0x6e, 0x41, 0x73, 0x76, 0x31, 0x6c, -0x6a, 0x64, 0x37, 0x4d, 0x78, 0x42, 0x7a, 0x64, 0x6f, 0x31, 0x62, -0x37, 0x34, 0x51, 0x45, 0x4d, 0x66, 0x4f, 0x55, 0x33, 0x53, 0x74, -0x77, 0x45, 0x4e, 0x65, 0x56, 0x2b, 0x53, 0x7a, 0x51, 0x56, 0x67, -0x7a, 0x32, 0x38, 0x61, 0x6e, 0x4b, 0x64, 0x57, 0x70, 0x69, 0x31, -0x46, 0x6f, 0x65, 0x2b, 0x0a, 0x37, 0x50, 0x36, 0x63, 0x41, 0x5a, -0x55, 0x44, 0x48, 0x6b, 0x36, 0x5a, 0x47, 0x6e, 0x39, 0x30, 0x43, -0x55, 0x59, 0x6a, 0x75, 0x4e, 0x4d, 0x65, 0x4d, 0x57, 0x58, 0x5a, -0x67, 0x6a, 0x41, 0x34, 0x61, 0x73, 0x78, 0x6a, 0x61, 0x6d, 0x5a, -0x4c, 0x45, 0x4c, 0x51, 0x4e, 0x72, 0x56, 0x30, 0x42, 0x41, 0x6b, -0x45, 0x41, 0x39, 0x62, 0x6c, 0x52, 0x54, 0x53, 0x4d, 0x51, 0x69, -0x69, 0x71, 0x75, 0x0a, 0x49, 0x33, 0x52, 0x64, 0x46, 0x69, 0x4c, -0x79, 0x36, 0x44, 0x56, 0x57, 0x71, 0x67, 0x62, 0x58, 0x70, 0x69, -0x5a, 0x57, 0x2f, 0x75, 0x31, 0x58, 0x49, 0x44, 0x69, 0x59, 0x44, -0x61, 0x68, 0x62, 0x4a, 0x46, 0x38, 0x6b, 0x57, 0x6d, 0x2f, 0x67, -0x50, 0x7a, 0x66, 0x39, 0x6a, 0x69, 0x4f, 0x74, 0x6c, 0x66, 0x35, -0x74, 0x4d, 0x7a, 0x50, 0x71, 0x62, 0x4d, 0x55, 0x35, 0x48, 0x57, -0x31, 0x79, 0x0a, 0x6d, 0x77, 0x2b, 0x6d, 0x57, 0x34, 0x6d, 0x33, -0x34, 0x51, 0x4a, 0x42, 0x41, 0x4e, 0x77, 0x53, 0x79, 0x58, 0x33, -0x74, 0x78, 0x5a, 0x61, 0x46, 0x46, 0x6d, 0x6e, 0x6a, 0x6d, 0x55, -0x61, 0x42, 0x74, 0x62, 0x6b, 0x58, 0x58, 0x54, 0x65, 0x74, 0x6d, -0x65, 0x66, 0x6a, 0x38, 0x71, 0x53, 0x31, 0x31, 0x2f, 0x4f, 0x34, -0x50, 0x31, 0x46, 0x73, 0x70, 0x39, 0x32, 0x68, 0x30, 0x70, 0x76, -0x66, 0x0a, 0x50, 0x4e, 0x77, 0x67, 0x49, 0x4b, 0x67, 0x68, 0x5a, -0x30, 0x4b, 0x30, 0x54, 0x2b, 0x32, 0x6b, 0x62, 0x54, 0x49, 0x56, -0x4f, 0x62, 0x45, 0x71, 0x4c, 0x53, 0x65, 0x50, 0x59, 0x2f, 0x72, -0x36, 0x49, 0x64, 0x55, 0x43, 0x51, 0x51, 0x43, 0x78, 0x44, 0x63, -0x54, 0x4e, 0x4a, 0x66, 0x54, 0x6d, 0x2b, 0x58, 0x58, 0x63, 0x53, -0x68, 0x35, 0x41, 0x73, 0x78, 0x48, 0x2f, 0x79, 0x31, 0x38, 0x55, -0x0a, 0x79, 0x44, 0x56, 0x65, 0x6e, 0x4d, 0x57, 0x57, 0x6a, 0x6f, -0x46, 0x32, 0x30, 0x42, 0x43, 0x50, 0x31, 0x72, 0x31, 0x46, 0x61, -0x65, 0x43, 0x52, 0x34, 0x59, 0x62, 0x64, 0x52, 0x6f, 0x54, 0x47, -0x68, 0x47, 0x4b, 0x78, 0x62, 0x31, 0x42, 0x54, 0x30, 0x70, 0x61, -0x5a, 0x70, 0x55, 0x70, 0x51, 0x4c, 0x2b, 0x71, 0x69, 0x58, 0x42, -0x5a, 0x73, 0x59, 0x73, 0x46, 0x42, 0x41, 0x6b, 0x41, 0x73, 0x0a, -0x73, 0x73, 0x67, 0x6f, 0x41, 0x71, 0x59, 0x79, 0x4a, 0x7a, 0x2f, -0x68, 0x4b, 0x2f, 0x41, 0x53, 0x79, 0x50, 0x2b, 0x65, 0x34, 0x32, -0x62, 0x30, 0x69, 0x78, 0x63, 0x4b, 0x61, 0x56, 0x72, 0x38, 0x4a, -0x30, 0x38, 0x41, 0x57, 0x6e, 0x6a, 0x4a, 0x30, 0x66, 0x62, 0x61, -0x5a, 0x69, 0x61, 0x2f, 0x72, 0x2f, 0x7a, 0x4e, 0x66, 0x4e, 0x30, -0x46, 0x4b, 0x52, 0x75, 0x76, 0x43, 0x61, 0x35, 0x2b, 0x0a, 0x52, -0x76, 0x70, 0x43, 0x78, 0x4e, 0x72, 0x64, 0x36, 0x41, 0x49, 0x5a, -0x32, 0x64, 0x37, 0x6c, 0x74, 0x2b, 0x34, 0x74, 0x41, 0x6b, 0x45, -0x41, 0x6f, 0x33, 0x65, 0x46, 0x2f, 0x36, 0x65, 0x69, 0x38, 0x44, -0x44, 0x70, 0x6e, 0x47, 0x4d, 0x68, 0x45, 0x69, 0x54, 0x58, 0x6f, -0x5a, 0x6a, 0x36, 0x35, 0x48, 0x6f, 0x73, 0x4a, 0x71, 0x61, 0x79, -0x42, 0x4c, 0x57, 0x47, 0x7a, 0x58, 0x69, 0x5a, 0x0a, 0x4f, 0x6c, -0x7a, 0x45, 0x54, 0x65, 0x48, 0x32, 0x79, 0x64, 0x6c, 0x57, 0x68, -0x48, 0x58, 0x47, 0x37, 0x50, 0x30, 0x68, 0x57, 0x51, 0x72, 0x57, -0x31, 0x6c, 0x42, 0x32, 0x65, 0x78, 0x4e, 0x76, 0x52, 0x75, 0x55, -0x4f, 0x30, 0x6d, 0x4d, 0x47, 0x33, 0x71, 0x54, 0x4d, 0x67, 0x77, -0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, -0x20, 0x52, 0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, -0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a -#endif -}; - -} - -BgsCommunicator::BgsCommunicator() : m_Result(nn::ResultSuccess()) -{ -} - -BgsCommunicator::~BgsCommunicator() -{ - // TODO Auto-generated destructor stub -} - -bool BgsCommunicator::Execute(const void* buf, size_t size) -{ - if(!nn::ac::IsConnected()) - { - m_Result = common::InitializeNetwork(); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - } - - /* ------------------------------------------------------------------------ - ライブラリの初期化(HTTPライブラリ使用前に、各プロセスで一度だけ実行する。) - ------------------------------------------------------------------------ */ - m_Result = nn::http::Initialize(reinterpret_cast(s_PostBuffer), sizeof(s_PostBuffer)); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - /* ------------------------------------------------------------------------ - 通信準備 - ------------------------------------------------------------------------ */ - - //通信先の設定 - //<>URLの先頭文字はhttpsとなります -#ifndef BUILD_FOR_PROD_BGS - #ifndef BUILD_FOR_TEST_BGS - // DEV6 - m_Result = m_HttpCon.Initialize("https://10.12.3.73/bgs/services/BusinessGatewaySOAP", nn::http::REQUEST_METHOD_POST); - #else - // TEST - m_Result = m_HttpCon.Initialize("https://10.12.3.77/bgs/services/BusinessGatewaySOAP", nn::http::REQUEST_METHOD_POST); - #endif -#else -// PROD - // TODO:PROD用URL -#endif - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - m_Result = m_HttpCon.AddHeaderField("Accept-Encoding", "identity"); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - m_Result = m_HttpCon.AddHeaderField("SOAPAction", "urn:bgs.wsapi.broadon.com/GetPreInstalledInfo"); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - m_Result = m_HttpCon.AddHeaderField("Content-Type", "text/xml; charset=utf-8"); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - // POSTデータの設定 - m_Result = m_HttpCon.AddPostDataRaw(buf, size); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - /* ------------------------------------------------------------------------ - <>SSL処理用設定 - ------------------------------------------------------------------------ */ - //ルート証明書の設定 - m_Result = m_HttpCon.SetRootCa(NNSSL_CACERT_PUBLIC_CA_1); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED( m_Result); - m_Result = m_HttpCon.SetRootCa(NNSSL_CACERT_PUBLIC_CA_2); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED( m_Result); - m_Result = m_HttpCon.SetRootCa(NNSSL_CACERT_PUBLIC_CA_3); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED( m_Result); - m_Result = m_HttpCon.SetRootCa(NNSSL_CACERT_PUBLIC_CA_4); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - m_Result = m_HttpCon.SetClientCert(USER_ORIGIN_CLIENT_CERT_DATA, sizeof(USER_ORIGIN_CLIENT_CERT_DATA), - USER_ORIGIN_PRIVATE_KEY, sizeof(USER_ORIGIN_PRIVATE_KEY)); //クライアント証明書を設定する。 - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - - // 証明書が適当?なので検証項目を減らす - m_Result = m_HttpCon.DisableVerifyOptionForDebug( - nn::ssl::VERIFY_COMMON_NAME | nn::ssl::VERIFY_SUBJECT_ALT_NAME | nn::ssl::VERIFY_ROOT_CA); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - /* ------------------------------------------------------------------------ - 通信実行 - ------------------------------------------------------------------------ */ - //通信の開始 - m_Result = m_HttpCon.Connect(); //リクエストの送信を開始する。機器が同時実行可能な最大個数のHTTP通信がすでに実行中の場合は、空きができるまでブロック - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - - return true; -} - -bool BgsCommunicator::GetBodySize(size_t* size) -{ - //HTTPヘッダの情報読み出し - s32 statusCode = 0; - m_Result = m_HttpCon.GetStatusCode(&statusCode); //Statusコードの取得 - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - NN_LOG("---HTTP ResultCode = %d---\n", statusCode); - - char headerFields[1024]; - std::memset(headerFields, 0, sizeof(headerFields)); - u32 fieldLen = sizeof(headerFields); - m_Result = m_HttpCon.GetHeaderField("Content-Length", headerFields, fieldLen, &fieldLen); //特定のヘッダフィールドをラベルから取得 - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - *size = std::strtol(headerFields, NULL, 10); - NN_LOG("---HTTP Content-Length = %d---\n", *size); - - return true; -} - -bool BgsCommunicator::GetBody(u8 *buf, size_t size) -{ - //HTTPレスポンスの取得 - std::memset(buf, 0, size); - m_Result = m_HttpCon.Read(buf, size); //読み取りが完了するまでブロック。Bodyの最後までの読み込みが成功した場合は、Successを表すResultが返る。バッファサイズが足りない場合は、エラー(Description==ER_RES_BODYBUF_SHORTAGEのResult)が返る*/ - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - return true; -} - -bool BgsCommunicator::Finalize() -{ - m_Result = m_HttpCon.Finalize(); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - m_Result = nn::http::Finalize(); - COMMON_LOGGER_RETURN_FALSE_IF_FAILED(m_Result); - return true; -} - -nn::Result BgsCommunicator::GetLastResult() -{ - return m_Result; -} - -} /* namespace ConsoleRestore */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.h deleted file mode 100644 index ba054ad..0000000 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/BgsCommunicator.h +++ /dev/null @@ -1,56 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: BgsCommunicator.h - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#ifndef BGSCOMMUNICATOR_H_ -#define BGSCOMMUNICATOR_H_ - -#include -#include -namespace ConsoleRestore -{ - -class BgsCommunicator -{ -public: - BgsCommunicator(); - virtual ~BgsCommunicator(); - - //! @brief 構築したXMLを使ってBGSと通信します - //! @param[in] buf XMLデータへのポインタ - //! @param[in] size XMLデータのサイズ - bool Execute(const void* buf, size_t size); - - //! @brief 通信結果のサイズを取得します - //! @param[out] 通信結果を取得するのに必要なバッファサイズ - bool GetBodySize(size_t* size); - - //! @brief 通信結果をバッファに書き込みます。正しく結果を取得するには GetBodySizeで取得したサイズのバッファが必要です。 - //! @param[out] buf 通信結果を書き込むバッファ - //! @param[in] size バッファサイズ - bool GetBody(u8* buf, size_t size); - - bool Finalize(); - - nn::Result GetLastResult(); - -private: - nn::Result m_Result; - - //Connectionインスタンス - nn::http::Connection m_HttpCon; -}; - -} /* namespace ConsoleRestore */ -#endif /* BGSCOMMUNICATOR_H_ */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp index 366fc92..86d9be3 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp @@ -1638,10 +1638,7 @@ void ControlState(common::HardwareStateManager& manager, common::OperationMessag { COMMON_LOGGER("Checking User's SD Card\n"); s_ExecutePreparePreinstallTitleDownload = true; - bit64 deviceId = manager.GetDeviceId() + 0x400000000; - u8 serial[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN]; - manager.GetSerialNumberWithoutCD(serial); - StartPreparePreinstallTitleDownload(deviceId, serial, s_ForceDownloadPreinstall); + StartPreparePreinstallTitleDownload(s_ForceDownloadPreinstall); } // 動いていることを表示 diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile b/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile index 1c3d87f..6d0c50d 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/OMakefile @@ -31,9 +31,6 @@ SOURCES[] = TitleDownloader.cpp Shop.cpp RegionIdModifier.cpp - SimpleXmlPreprocessor.cpp - XmlCreator.cpp - BgsCommunicator.cpp PreinstallImporter.cpp ../common/Util.cpp ../common/DrawSystemState.cpp diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.cpp index 04febe4..ed8a2af 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.cpp @@ -16,9 +16,6 @@ #include "CommonLogger.h" #include "HeapManager.h" #include "PreinstallImporter.h" -#include "XmlCreator.h" -#include "SimpleXmlPreprocessor.h" -#include #include #include @@ -59,26 +56,6 @@ nn::Result PreinstallImporter::SetupSd(bool* isAlreadyAvailable, bool forcePrein return nn::ResultSuccess(); } -nn::Result PreinstallImporter::ListTitles(nn::ProgramId* list, size_t* num, bit64 deviceId, u8* serialNo) -{ - // 送信用のXMLデータを構築する - XmlCreator sendXml; - sendXml.Exec(deviceId, serialNo); - - // 構築したXMLデータを使ってBGSと通信する - BgsCommunicator comm; - if(!comm.Execute(sendXml.GetData().c_str(), sendXml.GetData().size())) - { - return comm.GetLastResult(); - } - - // 通信結果をパースしてタイトルリストを作成する - COMMON_LOGGER_RETURN_RESULT_IF_FAILED( - GetHtmlBodyAndParseXmlData(comm, list, num) - ); - return nn::ResultSuccess(); -} - nn::Result PreinstallImporter::ListTitlesBasedOnTickets(nn::ProgramId* list, size_t* num) { s32 personalizedTicketNum; @@ -97,155 +74,4 @@ nn::Result PreinstallImporter::ListTitlesBasedOnTickets(nn::ProgramId* list, siz return nn::ResultSuccess(); } -nn::Result PreinstallImporter::GetHtmlBodyAndParseXmlData(BgsCommunicator& comm, nn::ProgramId* list, size_t* num) -{ - // 通信結果を取得する - size_t bodySize; - if(!comm.GetBodySize(&bodySize)) - { - return comm.GetLastResult(); - } - if(common::GetAllocatableSize() < bodySize + 1) - { - // 巨大な通信結果のためFATAL。1回で受信しきれるはず - return nn::Result(nn::Result::LEVEL_FATAL, nn::Result::SUMMARY_OUT_OF_RESOURCE, nn::Result::MODULE_COMMON, - nn::Result::DESCRIPTION_OUT_OF_MEMORY); - } - common::HeapManager heap(bodySize + 1); - void* buf = heap.GetAddr(); - if(!comm.GetBody(reinterpret_cast(buf), bodySize + 1)) - { - return comm.GetLastResult(); - } - // NULL終端する - reinterpret_cast(buf)[bodySize] = '\0'; - - if(!comm.Finalize()) - { - return comm.GetLastResult(); - } - - // XMLを解析してタイトルリストを設定する - COMMON_LOGGER_RETURN_RESULT_IF_FAILED(ParseXmlData(buf, list, num)); - - return nn::ResultSuccess(); -} - -nn::Result PreinstallImporter::ParseXmlData(void* buf, nn::ProgramId* list, size_t* num) -{ - // 通信結果をパースする - // SimpleXmlParserに食わせるために変換する - SimpleXmlPreprocessor pp; - // システムヒープ(8MB)を超えたら正常に動かない - std::string xmlResult(reinterpret_cast(buf)); - pp.Canonicalize(xmlResult); - - // XMLをパースしてタイトルリストを取得する - nn::fnd::IAllocator* pAllocator = nn::init::GetAllocator(); - nn::xml::simple::SimpleXmlParser simpleXmlParser(pAllocator); - const nn::xml::simple::SimpleXmlParser::Node* pTaskIdNode; - - COMMON_LOGGER_RETURN_RESULT_IF_FAILED( - SetNodetoTitleIds(simpleXmlParser, xmlResult, &pTaskIdNode) - ); - - *num = 0; - // プリインストールタイトルが無ければ終了 - if(!pTaskIdNode) - { - return nn::MakePermanentResult(nn::Result::SUMMARY_NOT_FOUND, nn::Result::MODULE_APPLICATION, - nn::Result::DESCRIPTION_NOT_FOUND); - } - - // タイトルIDリストをコピーする - common::HeapManager xmlHeap(pTaskIdNode->contentSize); - void* titleIdBuffer = xmlHeap.GetAddr(); - std::memcpy(titleIdBuffer, pTaskIdNode->content, pTaskIdNode->contentSize); - - SplitTextAndSetupList(list, num, reinterpret_cast(titleIdBuffer)); - return nn::ResultSuccess(); -} - -nn::Result PreinstallImporter::SetNodetoTitleIds(nn::xml::simple::SimpleXmlParser& parser, std::string& xmlData, const nn::xml::simple::SimpleXmlParser::Node** pNode) -{ - /* - * SimpleXmlPreprocessorを通したXMLデータはこんな形になっている - - - - - - - 1326939225587 - 0 - 1 - - 17179924184 - EJA20305940 - JPN - 1324339327000 - 000400000FEEB400,000400000FEEB000 - - - - - - */ - - parser.parse(reinterpret_cast(const_cast(xmlData.c_str())), xmlData.size()); - - if(parser.isError()) - { - COMMON_LOGGER("invalid xml Data\n"); - return nn::Result(nn::Result::LEVEL_STATUS, nn::Result::SUMMARY_INVALID_STATE, nn::Result::MODULE_COMMON, - nn::Result::DESCRIPTION_INVALID_RESULT_VALUE); - } - - // 欲しい情報がある場所まで階層を掘り下げる - const nn::xml::simple::SimpleXmlParser::Node* pRootNode = parser.getRootNode(); - const nn::xml::simple::SimpleXmlParser::Node* pTargetNode = pRootNode->firstChild; - const nn::xml::simple::SimpleXmlParser::Node* pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode( - pTargetNode, "Body"); - pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, - "GetPreInstalledInfoResponse"); - pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, - "GetPreInstalledInfoResponse"); - pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, "PreinstalledInfo"); - // テーブルを移行して空になっていた場合 - if(pPriorityNode == NULL) - { - *pNode = NULL; - return nn::ResultSuccess(); - } - - *pNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, "TitleIds"); - - return nn::ResultSuccess(); -} - -void PreinstallImporter::SplitTextAndSetupList(nn::ProgramId* list, size_t* num, char* text) -{ - const char* token = ","; - char* cutout; - - cutout = std::strtok(text, token); - if(!cutout) - { - return; - } - - list[*num] = std::strtoll(cutout, NULL, 16); - (*num)++; - - while( cutout ) - { - cutout = std::strtok(NULL, token); - if(cutout) - { - list[*num] = std::strtoll(cutout, NULL, 16); - (*num)++; - } - } -} - } /* namespace ConsoleRestore */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.h index a7469e9..8156e05 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.h +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/PreinstallImporter.h @@ -18,7 +18,6 @@ #include #include -#include "BgsCommunicator.h" namespace ConsoleRestore { @@ -35,30 +34,8 @@ public: //! @param[in] forcePreinstall    SDカードが初期化済みでもプリインストールを書き込むかどうか nn::Result SetupSd(bool* isAlreadyAvailable, bool forcePreinstall); - //! @brief ダウンロードするプリインストールタイトルをBGS経由でリストアップする - //! @param[out] list    プリインストールタイトルの配列。十分に大きいものを渡すこと。 - //! @param[out] num プリインストールタイトルの数 - //! @param[in] deviceId デバイスID - //! @param[in] serialNo シリアルナンバー - nn::Result ListTitles(nn::ProgramId* list, size_t* num, bit64 deviceId, u8* serialNo); - //!@ brief プリインストールタイトルをeTicketに基づいてリストアップする nn::Result ListTitlesBasedOnTickets(nn::ProgramId* list, size_t* num); - -private: - //! @brief HTMLレスポンスを受信してXMLデータを解析します - nn::Result GetHtmlBodyAndParseXmlData(BgsCommunicator& comm, nn::ProgramId* list, size_t* num); - - //! @brief 受信したXMLデータを解析してタイトルIDリストを設定します - //! @return プリインストールアプリが存在しない場合、(Level=Status, Summary=NotFound, Module=Application, Description=NotFound)
- //! のResultを返します - nn::Result ParseXmlData(void* buf, nn::ProgramId* list, size_t* num); - - //! @brief SimpleXmlパーサの解析をTitleIdノードまで進めます - nn::Result SetNodetoTitleIds(nn::xml::simple::SimpleXmlParser& parser, std::string& xmlData, const nn::xml::simple::SimpleXmlParser::Node** pNode); - - //! @brief カンマ区切りのプログラムIDのリストを分割して出力用のリストに設定します - void SplitTextAndSetupList(nn::ProgramId* list, size_t* num, char* text); }; } /* namespace ConsoleRestore */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp deleted file mode 100644 index 25f3d43..0000000 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: SimpleXmlPreprocessor.cpp - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#include "SimpleXmlPreprocessor.h" -#if defined(__ARMCC_VERSION) -#include -#else -#include "test_common.h" -#endif - -namespace ConsoleRestore -{ - -bool SimpleXmlPreprocessor::Canonicalize(std::string& str) -{ - if(!EraseXmlDeclaration(str)) - { - NN_LOG("invalid xml!\n"); - return false; - } - - if(!EraseEmptyTag(str)) - { - NN_LOG("can't erase empty tag"); - return false; - } - - if(!EraseAttribute(str)) - { - NN_LOG("can't erase attribute\n"); - return false; - } - - if(!EraseNsTagEnd(str)) - { - NN_LOG("can't erase ns end\n"); - return false; - } - - if(!EraseNsTagStart(str)) - { - NN_LOG("can't erase ns start\n"); - return false; - } - - return true; -} - -bool SimpleXmlPreprocessor::EraseXmlDeclaration(std::string& str) -{ - std::string::size_type start = str.find(""); - if (end == std::string::npos) - { - return false; - } - - str.erase(start, end + 1 - start); - - return true; -} - -bool SimpleXmlPreprocessor::EraseEmptyTag(std::string& str) -{ - // XMLとしては正しい前提 - std::string::size_type end = str.find("/>"); - if (end == std::string::npos) - { - return true; - } - - std::string::size_type start = str.rfind("<", end); - if (start == std::string::npos) - { - return false; - } - - str.erase(start, end + 2 - start); - - return true; -} - -bool SimpleXmlPreprocessor::EraseNsTagEnd(std::string& str) -{ - std::string::size_type start = str.rfind("", start); - if (end == std::string::npos) - { - // 不正なXML - return false; - } - - std::string::size_type colon = str.substr(start, end - start).find(":"); - if (colon == std::string::npos) - { - // 名前空間無し - start = str.rfind("", start); - if (end == std::string::npos) - { - // 不正なXML - return false; - } - - std::string::size_type colon = str.substr(start, end - start).find(":"); - if (colon == std::string::npos) - { - // 名前空間無し - start = str.find("<", end); - continue; - } - - str.erase(start + 1, colon); - start = str.find("<", end - colon); - } - - return true; -} - -bool SimpleXmlPreprocessor::EraseAttribute(std::string& str) -{ - std::string::size_type start = str.find("<"); - while (start != std::string::npos) - { - std::string::size_type end = str.find(">", start); - if (end == std::string::npos) - { - // 不正なXML - return false; - } - - std::string::size_type space = str.substr(start, end - start).find(" "); - if (space == std::string::npos) - { - // 属性なし - start = str.find("<", end); - continue; - } - - str.erase(start + space, end - (start + space)); - start = str.find("<", start + space); - } - - return true; -} - -} /* namespace ConsoleRestore */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.h deleted file mode 100644 index 7cf549b..0000000 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/SimpleXmlPreprocessor.h +++ /dev/null @@ -1,52 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: SimpleXmlPreprocessor.h - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#ifndef SIMPLEXMLPREPROCESSOR_H_ -#define SIMPLEXMLPREPROCESSOR_H_ - -#include - -namespace ConsoleRestore -{ - -class SimpleXmlPreprocessor -{ -public: - SimpleXmlPreprocessor() {}; - ~SimpleXmlPreprocessor() {}; - - // SimpleXmlParserで読めるように変換します - static bool Canonicalize(std::string& str); - -private: - // の除去 - static bool EraseXmlDeclaration(std::string& str); - - // 空タグの除去 - static bool EraseEmptyTag(std::string& str); - - // 属性の削除 - static bool EraseAttribute(std::string& str); - - // 終了タグの名前空間の削除 - static bool EraseNsTagEnd(std::string& str); - - // 開始タグの名前空間の削除 - static bool EraseNsTagStart(std::string& str); - -}; - -} /* namespace ConsoleRestore */ -#endif /* SIMPLEXMLPREPROCESSOR_H_ */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp index 08b5c10..3d0239f 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.cpp @@ -197,11 +197,9 @@ void PreparePreinstallTitleDownloadThreadFunc(PreinstallListupParam param) } -void StartPreparePreinstallTitleDownload(bit64 deviceId, u8* serialNo, bool forcePreinstall) +void StartPreparePreinstallTitleDownload(bool forcePreinstall) { PreinstallListupParam param; - param.deviceId = deviceId; - std::memcpy(param.serialNo, serialNo, nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN); param.forcePreinstall = forcePreinstall; s_TitleDownloaderThread.Start(PreparePreinstallTitleDownloadThreadFunc, param, s_TitleDownloaderThreadStack); diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h index bb13cb5..b283d03 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/TitleDownloader.h @@ -26,11 +26,9 @@ void StartTwlTitleDownload(); //! @brief プリインストールタイトルをSDカードにインポート可能かどうかサイズを確認し、
//! 可能であればSDカードをインポート可能状態にします -//! @param[in] deviceId デバイスID -//! @param[in] serialNo シリアルナンバー //! @param[in] serialNo 強制的にプリインストールを書き込むかどうか //! @return 正常に初期化できたかどうか -void StartPreparePreinstallTitleDownload(bit64 deviceId, u8* serialNo, bool forcePreinstall); +void StartPreparePreinstallTitleDownload(bool forcePreinstall); //! @brief 新たにスレッドを立て、プリインストールタイトルのダウンロードを開始します
//! SDカードはインポート可能な状態にしておく必要があります。 @@ -40,8 +38,6 @@ void StartPreinstallTitleDownload(); // プリインストール情報取得に必要なパラメータをまとめた構造体 struct PreinstallListupParam { - bit64 deviceId; - u8 serialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN]; bool forcePreinstall; }; diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/XmlCreator.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/XmlCreator.cpp deleted file mode 100644 index 61721f0..0000000 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/XmlCreator.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: XmlCreator.cpp - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#include "XmlCreator.h" - -#include -#include - -namespace ConsoleRestore -{ - -namespace -{ -const char xmlDataPrefix[] = \ -"\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n"; -const char xmlDeviceIdPrefix[] = \ -" "; -const char xmlDeviceIdSuffix[] = "\n"; -const char xmlSerialNoPrefix[] = \ -" "; -const char xmlSerialNoSuffix[] = "\n"; -const char xmlDataSuffix[] = \ -" \n\ - \n\ - \n\ -"; - -} - - -XmlCreator::XmlCreator() -{ - // TODO 自動生成されたコンストラクター・スタブ - -} - -XmlCreator::~XmlCreator() -{ - // TODO Auto-generated destructor stub -} - -void XmlCreator::Exec(bit64 deviceId, u8* serialNo) -{ - m_Xml.append(xmlDataPrefix); - - m_Xml.append(xmlDeviceIdPrefix); - std::ostringstream oss; - oss << std::dec; - oss << deviceId; - m_Xml.append(oss.str()); - m_Xml.append(xmlDeviceIdSuffix); - - m_Xml.append(xmlSerialNoPrefix); - m_Xml.append(reinterpret_cast(serialNo)); - m_Xml.append(xmlSerialNoSuffix); - - m_Xml.append(xmlDataSuffix); -} - -std::string XmlCreator::GetData() -{ - return m_Xml; -} - -} /* namespace ConsoleRestore */ diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/XmlCreator.h b/trunk/ConsoleDataMigration/sources/ConsoleRestore/XmlCreator.h deleted file mode 100644 index 9649def..0000000 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/XmlCreator.h +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: XmlCreator.h - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#ifndef XMLCREATOR_H_ -#define XMLCREATOR_H_ - -#include - -#if defined(__ARMCC_VERSION) -#include -#else -#include "test_common.h" -#endif - - -namespace ConsoleRestore -{ - -class XmlCreator -{ -public: - XmlCreator(); - virtual ~XmlCreator(); - - //! @brief プリインストール情報を取得するためのXMLを構築します - //! @param[in] deviceId デバイスID - //! @param[in] serialNo シリアルNo. - void Exec(bit64 deviceId, u8* serialNo); - - //! @brief 構築したXMLデータを取得します - std::string GetData(); - -private: - std::string m_Xml; - -}; - -} /* namespace ConsoleRestore */ -#endif /* XMLCREATOR_H_ */ diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/BgsCommunicator/OMakefile b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/BgsCommunicator/OMakefile deleted file mode 100644 index 15541a4..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/BgsCommunicator/OMakefile +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env omake -#---------------------------------------------------------------------------- -# Project: Horizon -# File: OMakefile -# -# Copyright (C)2009 Nintendo Co., Ltd. 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. -# -# $Rev$ -#---------------------------------------------------------------------------- -SUPPORTED_TARGETS = CTR-*.Process.MPCore.* - -include $(makePlatformDefsPath tests) - -SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/SampleDemos/common/include) -INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \ - ../../../common \ - ../../../ConsoleRestore \ - - - -TEST_COMMON_SOURCES[] = - ../../../ConsoleRestore/Shop.cpp - ../../../ConsoleRestore/XmlCreator.cpp - ../../../ConsoleRestore/SimpleXmlPreprocessor.cpp - ../../../ConsoleRestore/BgsCommunicator.cpp - ../../../common/Util.cpp - ../../../common/HeapManager.cpp - ../../../common/SdLogger.cpp - ../../../common/LogConsole.cpp - ../../../common/CommonLogger.cpp - ../../../common/SdMountManager.cpp - ../../../common/VersionDetect.cpp - ../../../common/HardwareStateManager.cpp - ../../../common/FileTransfer.cpp - ../../../common/SdReaderWriter.cpp - -CCFLAGS += -DCOMMON_LOGGER_DETAIL_ENABLE -include $(ROOT)/common/BuildSwitch.om - -SOURCES_TEST[] = test_BgsCommunicator.cpp - -ROMFS_ROOT = ../../../common/romfiles - -TEST_ENVIRONMENT_PROCESSLIST = true -TEST_ENVIRONMENT_EMUMEM = true - -LIBS += libnn_test \ - libnn_mcu \ - libnn_ps \ - libnn_am \ - lib_demo \ - libnn_nim \ - libnn_xml_simple \ - -ROM_SPEC_FILE = ../../../ConsoleRestore/ConsoleRestore.rsf -DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/private/RepairTool.desc - - -DEPEND_PROCESSES[] = - test_BgsCommunicator>$(GetProcessCdiPathList http) - - -include $(makePlatformDefsPath build.tests) - - -tests: $(TEST_TARGETS) diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/BgsCommunicator/test_BgsCommunicator.cpp b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/BgsCommunicator/test_BgsCommunicator.cpp deleted file mode 100644 index ec8e13d..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/BgsCommunicator/test_BgsCommunicator.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: test_BgsCommunicator.cpp - - Copyright (C)2012 Nintendo Co., Ltd. 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. - - $Rev$ - *---------------------------------------------------------------------------*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "demo.h" - -#include "common_Types.h" -#include "CommonLogger.h" -#include "HeapManager.h" -#include "XmlCreator.h" -#include "BgsCommunicator.h" -#include "SimpleXmlPreprocessor.h" - -using namespace nn::test; - -class BgsCommunicatorTest : public Suite { -public: - virtual bool InitializeSuite(); - virtual void FinalizeSuite(); - - BgsCommunicatorTest() { - TEST_ADD(BgsCommunicatorTest::Exec); - } -private: - void Exec(); -}; - -namespace -{ -void PutString(std::string str) -{ - if (str.size() > 254) - { - for (size_t pos = 0; pos < str.size(); pos += 254) - { - NN_LOG("%s", str.substr(pos, nn::math::Min(static_cast(254), str.size() - pos)).c_str()); - } - } - else - { - NN_LOG("%s\n", str.c_str()); - } -} - -const size_t s_GxHeapSize = 0x800000; - -} - -//------------------------------------------------------------------ -// Initialize/Finalize -//------------------------------------------------------------------ - -bool BgsCommunicatorTest::InitializeSuite() -{ - // os の初期化 - nn::os::Initialize(); - - nn::fs::Initialize(); - - // amの初期化 - nn::am::InitializeForLocalImporter(); - - // cfgの初期化 - nn::cfg::init::Initialize(); - nn::cfg::system::Initialize(); - - // ヒープの確保 - common::InitializeHeap(); - common::HeapManager gxHeap(s_GxHeapSize); - - // RenderSystem の準備 - uptr heapForGx = reinterpret_cast(gxHeap.GetAddr()); - demo::RenderSystemDrawing renderSystem; - renderSystem.Initialize(heapForGx, s_GxHeapSize); - - // ログ描画の初期化 - common::Logger::GetLoggerInstance()->Initialize(common::CONSOLE_WIDTH, common::CONSOLE_HEIGHT, - common::CONSOLE_MAX_LINE, &renderSystem); - - return true; - -} - -void BgsCommunicatorTest::FinalizeSuite() -{ -} - -//------------------------------------------------------------------ -// Test Util -//------------------------------------------------------------------ - - -//------------------------------------------------------------------ -// Test Functions -//------------------------------------------------------------------ - -void BgsCommunicatorTest::Exec() -{ - NN_LOG("BgsCommunicator Exec\n"); - ConsoleRestore::BgsCommunicator comm; - - ConsoleRestore::XmlCreator xml; - xml.Exec(17179924184, reinterpret_cast(const_cast("EJA20305940"))); - - comm.Execute(xml.GetData().c_str(), xml.GetData().size()); - size_t bufSize; - comm.GetBodySize(&bufSize); - common::HeapManager heap(bufSize + 1); - void* buf = heap.GetAddr(); - comm.GetBody(reinterpret_cast(buf), bufSize + 1); - comm.Finalize(); - - // NULL終端する - reinterpret_cast(buf)[bufSize] = '\0'; - - // 変換前 - std::string before(reinterpret_cast(buf)); - PutString(before); - - // simpleXMLに変換します - ConsoleRestore::SimpleXmlPreprocessor pp; - std::string xmlData(reinterpret_cast(buf)); - pp.Canonicalize(xmlData); - - PutString(xmlData); -} - -NN_TEST_DEFINE_MAIN(BgsCommunicatorTest) - -/*---------------------------------------------------------------------------* - End of file - *---------------------------------------------------------------------------*/ diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/OMakefile b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/OMakefile index 9968bf5..ca31e96 100644 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/OMakefile +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/OMakefile @@ -26,9 +26,6 @@ INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \ TEST_COMMON_SOURCES[] = ../../../ConsoleRestore/Shop.cpp - ../../../ConsoleRestore/XmlCreator.cpp - ../../../ConsoleRestore/SimpleXmlPreprocessor.cpp - ../../../ConsoleRestore/BgsCommunicator.cpp ../../../ConsoleRestore/PreinstallImporter.cpp ../../../common/Util.cpp ../../../common/HeapManager.cpp diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/test_PreinstallImporter.cpp b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/test_PreinstallImporter.cpp index b00c5ad..40149ef 100644 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/test_PreinstallImporter.cpp +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/PreinstallImporter/test_PreinstallImporter.cpp @@ -26,9 +26,6 @@ #include "common_Types.h" #include "CommonLogger.h" #include "HeapManager.h" -#include "XmlCreator.h" -#include "BgsCommunicator.h" -#include "SimpleXmlPreprocessor.h" #include "PreinstallImporter.h" using namespace nn::test; @@ -39,12 +36,10 @@ public: virtual void FinalizeSuite(); PreinstallImporterTest() { - TEST_ADD(PreinstallImporterTest::ListUp); TEST_ADD(PreinstallImporterTest::SetupSd); TEST_ADD(PreinstallImporterTest::ListUpBasedOnTicket); } private: - void ListUp(); void SetupSd(); void ListUpBasedOnTicket(); }; @@ -99,31 +94,6 @@ void PreinstallImporterTest::FinalizeSuite() // Test Functions //------------------------------------------------------------------ -void PreinstallImporterTest::ListUp() -{ - ConsoleRestore::PreinstallImporter importer; - - size_t num; - nn::ProgramId list[256]; - nn::Result result; - result = importer.ListTitles(list, &num, 17179924184, reinterpret_cast(const_cast("EJA20305940"))); - - if(result == nn::MakePermanentResult(nn::Result::SUMMARY_NOT_FOUND, - nn::Result::MODULE_APPLICATION, nn::Result::DESCRIPTION_NOT_FOUND)) - { - NN_LOG("No PreInstalled Application found\n"); - NN_TEST_ASSERT(num == 0); - } - else - { - NN_LOG("Preinstalled num = %d\n", num); - for (u32 i = 0; i < num; i++) - { - NN_LOG("%016llx\n", list[i]); - } - } -} - void PreinstallImporterTest::SetupSd() { ConsoleRestore::PreinstallImporter importer; diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/SimpleXmlParser/OMakefile b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/SimpleXmlParser/OMakefile deleted file mode 100644 index 3b704c6..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/SimpleXmlParser/OMakefile +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env omake -#---------------------------------------------------------------------------- -# Project: Horizon -# File: OMakefile -# -# Copyright (C)2009 Nintendo Co., Ltd. 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. -# -# $Rev$ -#---------------------------------------------------------------------------- -SUPPORTED_TARGETS = CTR-*.Process.MPCore.* - -include $(makePlatformDefsPath tests) - -SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/SampleDemos/common/include) -INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \ - ../../../common \ - ../../../ConsoleRestore \ - - - -TEST_COMMON_SOURCES[] = - ../../../ConsoleRestore/SimpleXmlPreprocessor.cpp - -CCFLAGS += -DCOMMON_LOGGER_DETAIL_ENABLE -include $(ROOT)/common/BuildSwitch.om - -SOURCES_TEST[] = test_SimpleXmlParser.cpp - -ROMFS_ROOT = ../../../common/romfiles - -TEST_ENVIRONMENT_PROCESSLIST = true -TEST_ENVIRONMENT_EMUMEM = true - -LIBS += libnn_test \ - libnn_xml_simple \ - -ROM_SPEC_FILE = ../../../ConsoleRestore/ConsoleRestore.rsf -DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/private/RepairTool.desc - -include $(makePlatformDefsPath build.tests) - - -tests: $(TEST_TARGETS) diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/SimpleXmlParser/test_SimpleXmlParser.cpp b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/SimpleXmlParser/test_SimpleXmlParser.cpp deleted file mode 100644 index 6a46918..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/SimpleXmlParser/test_SimpleXmlParser.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: test_SimpleXmlParser.cpp - - Copyright (C)2011 Nintendo Co., Ltd. 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "demo.h" - -#include "common_Types.h" -#include "CommonLogger.h" -#include "HeapManager.h" -#include "XmlCreator.h" -#include "SimpleXmlPreprocessor.h" - -using namespace nn::test; - -class SimpleXmlParserTest : public Suite { -public: - SimpleXmlParserTest() { - TEST_ADD(SimpleXmlParserTest::Find); - TEST_ADD(SimpleXmlParserTest::NotFound); - } -private: - void Find(); - void NotFound(); -}; - -namespace -{ - -class SimpleXmlParserGetter -{ -public: - static const char* GetName(const nn::xml::simple::SimpleXmlParser::Node* pNode); - static const char* GetContent(const nn::xml::simple::SimpleXmlParser::Node* pNode); - - static const size_t BUF_SIZE = 1024; - -private: - static char m_Buf[BUF_SIZE]; - -}; - -const char* SimpleXmlParserGetter::GetName(const nn::xml::simple::SimpleXmlParser::Node* pNode) -{ - if(!pNode) - { - return NULL; - } - std::memset(m_Buf, 0, sizeof(m_Buf)); - std::memcpy(m_Buf, pNode->name, pNode->nameSize); - return m_Buf; -} - -const char* SimpleXmlParserGetter::GetContent(const nn::xml::simple::SimpleXmlParser::Node* pNode) -{ - if(!pNode) - { - return NULL; - } - std::memset(m_Buf, 0, sizeof(m_Buf)); - std::memcpy(m_Buf, pNode->content, pNode->contentSize); - return m_Buf; -} - -char SimpleXmlParserGetter::m_Buf[SimpleXmlParserGetter::BUF_SIZE]; - -nn::Result SetNodetoPreinstalledInfo(nn::xml::simple::SimpleXmlParser& parser, std::string& xmlData, const nn::xml::simple::SimpleXmlParser::Node** pNode) -{ - parser.parse(reinterpret_cast(const_cast(xmlData.c_str())), xmlData.size()); - - NN_TEST_ASSERT(!parser.isError()); - const nn::xml::simple::SimpleXmlParser::Node* pRootNode = parser.getRootNode(); - const nn::xml::simple::SimpleXmlParser::Node* pTargetNode = pRootNode->firstChild; - // 欲しい情報がある場所まで階層を掘り下げる - const nn::xml::simple::SimpleXmlParser::Node* pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode( - pTargetNode, "Body"); - pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, - "GetPreInstalledInfoResponse"); - pPriorityNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, - "GetPreInstalledInfoResponse"); - *pNode = nn::xml::simple::SimpleXmlParser::FindNextNode(pPriorityNode->firstChild, "PreinstalledInfo"); - - return nn::ResultSuccess(); -} - -} - -//------------------------------------------------------------------ -// Test Functions -//------------------------------------------------------------------ - -void SimpleXmlParserTest::Find() -{ -const char testText[] = "\ -\ -\ -\ -\ -\ -\ -1326939225587\ -0\ -1\ -\ -17179924184\ -EJA20305940\ -JPN\ -1324339327000\ -000400000FEEB400,000400000FEEB000\ -\ -\ -\ -\ -\ -"; - - nn::fnd::IAllocator* pAllocator = nn::init::GetAllocator(); - nn::xml::simple::SimpleXmlParser simpleXmlParser(pAllocator); - const nn::xml::simple::SimpleXmlParser::Node* pPriorityNode; - std::string xmlData(testText); - SetNodetoPreinstalledInfo(simpleXmlParser, xmlData, &pPriorityNode); - - { - const nn::xml::simple::SimpleXmlParser::Node* pTaskIdNode = nn::xml::simple::SimpleXmlParser::FindNextNode( - pPriorityNode->firstChild, "DeviceId"); - NN_TEST_ASSERT(pTaskIdNode); - NN_TEST_ASSERT_EQUAL(std::strcmp("DeviceId", SimpleXmlParserGetter::GetName(pTaskIdNode)), 0); - NN_TEST_ASSERT_EQUAL(std::strcmp("17179924184", SimpleXmlParserGetter::GetContent(pTaskIdNode)), 0); - } - - { - const nn::xml::simple::SimpleXmlParser::Node* pTaskIdNode = nn::xml::simple::SimpleXmlParser::FindNextNode( - pPriorityNode->firstChild, "SerialNo"); - NN_TEST_ASSERT(pTaskIdNode); - NN_TEST_ASSERT_EQUAL(std::strcmp("SerialNo", SimpleXmlParserGetter::GetName(pTaskIdNode)), 0); - NN_TEST_ASSERT_EQUAL(std::strcmp("EJA20305940", SimpleXmlParserGetter::GetContent(pTaskIdNode)), 0); - } - - { - const nn::xml::simple::SimpleXmlParser::Node* pTaskIdNode = nn::xml::simple::SimpleXmlParser::FindNextNode( - pPriorityNode->firstChild, "TitleIds"); - NN_TEST_ASSERT(pTaskIdNode); - NN_TEST_ASSERT_EQUAL(std::strcmp("TitleIds", SimpleXmlParserGetter::GetName(pTaskIdNode)), 0); - NN_TEST_ASSERT_EQUAL(std::strcmp("000400000FEEB400,000400000FEEB000", SimpleXmlParserGetter::GetContent(pTaskIdNode)), 0); - } - -} - -void SimpleXmlParserTest::NotFound() -{ -const char testText[] = \ -"\ -\ -\ -\ -\ -\ -1327551124393\ -0\ -1\ -\ -17179924184\ -EJA20305940\ -JPN\ -1327545997000\ -\ -\ -\ -\ -"; - - nn::fnd::IAllocator* pAllocator = nn::init::GetAllocator(); - nn::xml::simple::SimpleXmlParser simpleXmlParser(pAllocator); - const nn::xml::simple::SimpleXmlParser::Node* pPriorityNode; - std::string xmlData(testText); - SetNodetoPreinstalledInfo(simpleXmlParser, xmlData, &pPriorityNode); - - { - const nn::xml::simple::SimpleXmlParser::Node* pTaskIdNode = nn::xml::simple::SimpleXmlParser::FindNextNode( - pPriorityNode->firstChild, "TitleIds"); - NN_TEST_ASSERT(!pTaskIdNode); - } -} - -NN_TEST_DEFINE_MAIN(SimpleXmlParserTest) - -/*---------------------------------------------------------------------------* - End of file - *---------------------------------------------------------------------------*/ diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/OMakefile b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/OMakefile index e8961ca..be42b06 100644 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/OMakefile +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/OMakefile @@ -27,9 +27,6 @@ INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \ TEST_COMMON_SOURCES[] = ../../../ConsoleRestore/TitleDownloader.cpp ../../../ConsoleRestore/Shop.cpp - ../../../ConsoleRestore/BgsCommunicator.cpp - ../../../ConsoleRestore/SimpleXmlPreprocessor.cpp - ../../../ConsoleRestore/XmlCreator.cpp ../../../ConsoleRestore/PreinstallImporter.cpp ../../../common/Util.cpp ../../../common/HeapManager.cpp diff --git a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/test_TitleDownloader.cpp b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/test_TitleDownloader.cpp index 649acc9..851b0e8 100644 --- a/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/test_TitleDownloader.cpp +++ b/trunk/ConsoleDataMigration/sources/tests/ConsoleRestore/TitleDownloader/test_TitleDownloader.cpp @@ -116,7 +116,7 @@ void TitleDownloaderTest::ListUp() void TitleDownloaderTest::DownloadPreinstall() { - ConsoleRestore::StartPreparePreinstallTitleDownload(17179924184, reinterpret_cast(const_cast("EJA20305940")), false); + ConsoleRestore::StartPreparePreinstallTitleDownload(false); while(!ConsoleRestore::IsDownloadTitleFinished()) { diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile deleted file mode 100644 index 5e43c31..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/OMakefile +++ /dev/null @@ -1,22 +0,0 @@ -INCLUDES[] += - ./ - ../common - ../../../ConsoleRestore - -TARGET = testSimpleXmlPreprocessor -TEST_TARGET = SimpleXmlPreprocessor - -SRC_FILES[] = - testSimpleXmlPreprocessor - SimpleXmlPreprocessor - -# テスト独自のスタブを使用する場合に定義する -CXXFLAGS += -DPCTEST_USE_STUB - -# テストディレクトリ外にあるので独自ルールでビルド -$(TEST_TARGET)$(EXT_OBJ): ../../../ConsoleRestore/$(TEST_TARGET).cpp - $(CXX) $(CXXFLAGS) $(PREFIXED_INCLUDES) -c $< - -.DEFAULT: $(TEST_TARGET)$(EXT_OBJ) $(TARGET)$(EXE) - -include $(COMMON_BUILD) \ No newline at end of file diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h deleted file mode 100644 index f364cfc..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/stub.h +++ /dev/null @@ -1,21 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: stub.h - - Copyright 2009-2011 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#ifndef STUB_H_ -#define STUB_H_ - -#define NN_LOG(...) (void)0 - -#endif /* STUB_H_ */ diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp b/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp deleted file mode 100644 index 8c27146..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/googletest/SimpleXmlPreprocessor/testSimpleXmlPreprocessor.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -#include "SimpleXmlPreprocessor.h" - -using namespace ConsoleRestore; - -namespace -{ - -const char testStr[] = "13269392255870117179924184EJA20305940JPN1324339327000000400000FEEB400,000400000FEEB000"; -const char resultStr[] = "13269392255870117179924184EJA20305940JPN1324339327000000400000FEEB400,000400000FEEB000"; - -} - -TEST(testSimpleXmlPreprocessor, Canonicalize) -{ - SimpleXmlPreprocessor pp; - - std::string str(testStr); - pp.Canonicalize(str); - ASSERT_STREQ(resultStr, str.c_str()); -} diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/XmlCreator/OMakefile b/trunk/ConsoleDataMigration/sources/tests/googletest/XmlCreator/OMakefile deleted file mode 100644 index 8d94881..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/googletest/XmlCreator/OMakefile +++ /dev/null @@ -1,19 +0,0 @@ -INCLUDES[] += - ./ - ../common - ../../../ConsoleRestore - -TARGET = testXmlCreator -TEST_TARGET = XmlCreator - -SRC_FILES[] = - testXmlCreator - XmlCreator - -# テストディレクトリ外にあるので独自ルールでビルド -$(TEST_TARGET)$(EXT_OBJ): ../../../ConsoleRestore/$(TEST_TARGET).cpp - $(CXX) $(CXXFLAGS) $(PREFIXED_INCLUDES) -c $< - -.DEFAULT: $(TEST_TARGET)$(EXT_OBJ) $(TARGET)$(EXE) - -include $(COMMON_BUILD) \ No newline at end of file diff --git a/trunk/ConsoleDataMigration/sources/tests/googletest/XmlCreator/testXmlCreator.cpp b/trunk/ConsoleDataMigration/sources/tests/googletest/XmlCreator/testXmlCreator.cpp deleted file mode 100644 index 2c422b4..0000000 --- a/trunk/ConsoleDataMigration/sources/tests/googletest/XmlCreator/testXmlCreator.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -#include "XmlCreator.h" - -using namespace ConsoleRestore; - -namespace -{ - -const char testStr[] = \ -"\n\ -\n\ - \n\ - \n\ - \n\ - \n\ - \n\ - \n\ - 17179924184\n\ - EJA20305940\n\ - \n\ - \n\ - \n\ -"; -} - -TEST(testXmlCreator, Exec) -{ - XmlCreator xml; - xml.Exec(17179924184, reinterpret_cast(const_cast("EJA20305940"))); - ASSERT_STREQ(testStr, xml.GetData().c_str()); -} diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/AutoBoot.bsf b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/AutoBoot.bsf deleted file mode 100644 index 104a94d..0000000 Binary files a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/AutoBoot.bsf and /dev/null differ diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/OMakefile b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/OMakefile deleted file mode 100644 index 4119934..0000000 --- a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/OMakefile +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env omake -#---------------------------------------------------------------------------- -# Project: Horizon -# File: OMakefile -# -# Copyright (C)2009 Nintendo Co., Ltd. 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. -# -# $Rev$ -#---------------------------------------------------------------------------- -SUPPORTED_TARGETS = CTR-T*.Process.MPCore.* -CTR_APPTYPE = BOTH -CTR_MAKE_DEVELOPMENT_IMAGE = true - -TARGET_PROGRAM = PreinstallListUp - -SAMPLED_DEMOS_COMMON_INCLUDE_DIR = $(dir $(HORIZON_ROOT)/../CTR/SampleDemos/common/include) -INCLUDES += $(SAMPLED_DEMOS_COMMON_INCLUDE_DIR) \ - ../../common - -SOURCES[] = - main.cpp - ../../common/Util.cpp - ../../common/FileTransfer.cpp - ../../common/FileChecker.cpp - ../../common/SdReaderWriter.cpp - ../../common/HeapManager.cpp - ../../common/SdLogger.cpp - ../../common/wave.cpp - ../../common/SimplePlayer.cpp - ../../common/LogConsole.cpp - ../../common/CommonLogger.cpp - ../../common/SdMountManager.cpp - ../../common/configLoader.cpp - ../../common/VersionDetect.cpp - ../../ConsoleRestore/PreinstallImporter.cpp - ../../ConsoleRestore/SimpleXmlPreprocessor.cpp - ../../ConsoleRestore/XmlCreator.cpp - ../../ConsoleRestore/BgsCommunicator.cpp - - -CTR_BANNER_SPEC = AutoBoot.bsf - -ROMFS_ROOT = ../../common/romfiles - -LIBS += libnn_cfg \ - libnn_crypto \ - libnn_mcu \ - libnn_ps \ - lib_demo \ - libnn_nwm \ - libnn_friends \ - libnn_ns \ - libnn_am \ - libnn_nim \ - libnn_xml_simple \ - -INSTALL_SDK_TOOL = true - -ROM_SPEC_FILE = $(TARGET_PROGRAM).rsf -DESCRIPTOR = $(HORIZON_ROOT)/resources/specfiles/private/RepairTool.desc - -include $(ROOT_OMAKE)/modulerules - -build: $(DEFAULT_TARGETS) diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/PreinstallListUp.rsf b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/PreinstallListUp.rsf deleted file mode 100644 index 7da6be3..0000000 --- a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/PreinstallListUp.rsf +++ /dev/null @@ -1,47 +0,0 @@ -BasicInfo: - Title : PreinstallListUp - ProductCode: PreinstallListUp - BackupMemoryType: None - -TitleInfo: - Use: Evaluation - Category: Application - UniqueId: 0xf8021 - Version: 0 - -SystemControlInfo: - AppType : Application - StackSize : 0x4000 - Dependency : - - codec - - hid - - gsp - - friends - - nim - - ac - - ndm - -AccessControlInfo: - Priority : 16 - DisableDebug : true - - FileSystemAccess: - - DirectSdmc - - Debug - - Core - - CategoryFileSystemTool - - IoAccessControl: - - FsMountCardSpi - - FsMountNand - - FsMountTwln - -Option: - FreeProductCode: true - -CardInfo: - CardDevice: None - -Rom: - # ROM に含めるファイルシステムのルートパスを指定します。 - HostRoot: "$(ROMFS_ROOT)" \ No newline at end of file diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/model.cbmd b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/model.cbmd deleted file mode 100644 index f1c7b62..0000000 Binary files a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/model.cbmd and /dev/null differ diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/sound.cbsd b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/sound.cbsd deleted file mode 100644 index f1c7b62..0000000 Binary files a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/sound.cbsd and /dev/null differ diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/unknown24x24.ctpk b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/unknown24x24.ctpk deleted file mode 100644 index 794b136..0000000 --- a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/unknown24x24.ctpk +++ /dev/null @@ -1 +0,0 @@ -888yyYyYyyyYyyYyyyyYyYy8 \ No newline at end of file diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/unknown48x48.ctpk b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/unknown48x48.ctpk deleted file mode 100644 index 8c7da16..0000000 --- a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/banner/unknown48x48.ctpk +++ /dev/null @@ -1 +0,0 @@ -Y8888ƺ8888YYyyYYޚ޺yY8YyYYޚyY8ޚ8 \ No newline at end of file diff --git a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp b/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp deleted file mode 100644 index 8fbb6a8..0000000 --- a/trunk/ConsoleDataMigration/sources/tools/PreinstallListUp/main.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: Horizon - File: main.cpp - - Copyright (C)2011 Nintendo Co., Ltd. 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. - - $Rev$ - *---------------------------------------------------------------------------*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Aes_define.h" -#include "FileTransfer.h" -#include "CommonLogger.h" - -#include "demo.h" - -#include -#include - -#include "DrawSystemState.h" -#include "FileName.h" -#include "SimplePlayer.h" -#include "CommonLogger.h" -#include "SDMountManager.h" -#include "HeapManager.h" -#include "common_Types.h" -#include "VersionDetect.h" -#include "Util.h" -#include "CommonLogger.h" -#include "SdReaderWriter.h" -#include "../ConsoleRestore/PreinstallImporter.h" - -namespace -{ - -// グラフィックスに割り当てるメモリ -const size_t s_GxHeapSize = 0x800000; - -const u32 CONSOLE_WIDTH = 38; -const u32 CONSOLE_HEIGHT = 24; -const u32 CONSOLE_MAX_LINE = 1000; - -const size_t THREAD_STACK_SIZE = 0x2000; -nn::os::Thread s_Thread; -nn::os::StackBuffer s_ThreadStack; -demo::RenderSystemDrawing s_RenderSystem; - -} - -namespace PreinstallListUp -{ - -void ThreadFunc() -{ - COMMON_LOGGER("GetPreinstalledInfo\n"); - nn::Result result; - - // シリアルナンバーの取得 - u8 serialNo[nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN]; - std::memset(serialNo, '\0', - nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN); - result = nn::cfg::CTR::system::GetSerialNo(serialNo); - COMMON_LOGGER_RETURN_VOID_IF_FAILED(result); - - // デバイスIDの取得 - bit32 deviceId; - result = nn::ps::CTR::GetDeviceId(&deviceId); - COMMON_LOGGER_RETURN_VOID_IF_FAILED(result); - const bit64 infraDeviceId = deviceId + common::INFRA_DEVICE_ID_OFFSET; - - ConsoleRestore::PreinstallImporter importer; - - size_t num; - nn::ProgramId list[256]; - result = importer.ListTitles(list, &num, infraDeviceId, serialNo); - if(result == nn::MakePermanentResult(nn::Result::SUMMARY_NOT_FOUND, - nn::Result::MODULE_APPLICATION, nn::Result::DESCRIPTION_NOT_FOUND)) - { - COMMON_LOGGER("No PreInstalled Application found\n"); - } - else - { - COMMON_LOGGER("Preinstalled num = %d\n", num); - for (u32 i = 0; i < num; i++) - { - COMMON_LOGGER("%016llx\n", list[i]); - } - } - COMMON_LOGGER_RETURN_VOID_IF_FAILED(result); -} - -void FinalizeAll() -{ - common::Logger::GetLoggerInstance()->Finalize(); - // アンマウント - nn::fs::Unmount("nand:"); - nn::fs::Unmount("sdmc:"); - s_RenderSystem.Finalize(); - - nn::ps::Finalize(); - nn::cfg::CTR::system::Finalize(); - nn::cfg::CTR::init::Finalize(); - nn::hid::Finalize(); - nn::fs::Finalize(); - - nn::applet::PrepareToCloseApplication(); - nn::applet::CloseApplication(); -} - -extern "C" void nninitSetupDaemons(void) -{ -} - - -extern "C" void nnMain(void) -{ - nn::Result result; - - // os の初期化 - nn::os::Initialize(); - - // fs の初期化 - nn::fs::Initialize(); - - // appletの初期化 - nn::applet::Enable( false ); - - // cfgの初期化 - nn::cfg::CTR::init::Initialize(); - nn::cfg::CTR::system::Initialize(); - - // hid の初期化 - result = nn::hid::Initialize(); - NN_ERR_THROW_FATAL_IF_FATAL_ONLY(result); - - // ps の初期化 - nn::ps::Initialize(); - - // ヒープの確保 - common::InitializeHeap(); - - // RenderSystem の準備 - common::HeapManager gxHeap(s_GxHeapSize); - uptr heapForGx = reinterpret_cast(gxHeap.GetAddr()); - s_RenderSystem.Initialize(heapForGx, s_GxHeapSize); - - // ログ描画の初期化 - common::Logger::GetLoggerInstance()->Initialize(CONSOLE_WIDTH, CONSOLE_HEIGHT, CONSOLE_MAX_LINE, &s_RenderSystem); - - // RenderSystemを作ってからログが出せる - common::Logger::InitializeEjectThread(); - - s_Thread.Start(ThreadFunc, s_ThreadStack); - - // ボタン入力 - nn::hid::PadReader s_PadReader; - nn::hid::PadStatus padStatus; - - for(;;) - { - s_PadReader.ReadLatest(&padStatus); - - // コンソールスクロール - if(padStatus.hold & nn::hid::BUTTON_UP) - { - common::Logger::GetLoggerInstance()->ScrollUp(); - } - - // コンソールスクロール - if(padStatus.hold & nn::hid::BUTTON_DOWN) - { - common::Logger::GetLoggerInstance()->ScrollDown(); - } - - if(padStatus.hold & nn::hid::BUTTON_LEFT) - { - common::Logger::GetLoggerInstance()->ScrollToBegin(); - } - - if(padStatus.hold & nn::hid::BUTTON_RIGHT) - { - common::Logger::GetLoggerInstance()->ScrollToEnd(); - } - - s_RenderSystem.SetRenderTarget(NN_GX_DISPLAY0); - s_RenderSystem.Clear(); - s_RenderSystem.SetColor(1.f, 1.f, 1.f); - - common::Logger::GetLoggerInstance()->DrawConsole(); - s_RenderSystem.SwapBuffers(); - - s_RenderSystem.WaitVsync(NN_GX_DISPLAY_BOTH); - - // 電源長押しで終了 - if ( nn::applet::IsExpectedToCloseApplication()) - { - FinalizeAll(); - } - - } -} - -}