From 165a692ddd6523a96eda6890c2ddf79a6c166f34 Mon Sep 17 00:00:00 2001 From: N2614 Date: Fri, 11 Mar 2011 08:08:53 +0000 Subject: [PATCH] =?UTF-8?q?AesCmac=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81=E3=82=92=E3=83=9E=E3=83=BC?= =?UTF-8?q?=E3=82=B8=20SdReaderWriter=E3=81=AE=E7=94=9F=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E8=AA=AD=E3=81=BF=E6=9B=B8=E3=81=8D=E3=82=92private?= =?UTF-8?q?=E3=81=AB=20SdReaderWriter=E7=B5=8C=E7=94=B1=E3=81=A7=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E6=9B=B8=E3=81=8D=E3=81=99=E3=82=8B=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=ABAecCmac=E3=82=92=E4=BB=98=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=80=81=E6=A4=9C=E8=A8=BC=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@112 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../ConsoleBackup/Exporter.cpp | 16 +-- .../ConsoleRestore/Importer.cpp | 56 +++++--- .../ConsoleDataMigration/common/Aes_define.h | 10 +- .../common/PlayHistoryManager.cpp | 9 +- .../common/SdReaderWriter.cpp | 128 ++++++++++++++++-- .../common/SdReaderWriter.h | 24 +++- 6 files changed, 199 insertions(+), 44 deletions(-) diff --git a/trunk/ConsoleDataMigration/ConsoleBackup/Exporter.cpp b/trunk/ConsoleDataMigration/ConsoleBackup/Exporter.cpp index b074d75..99208cf 100644 --- a/trunk/ConsoleDataMigration/ConsoleBackup/Exporter.cpp +++ b/trunk/ConsoleDataMigration/ConsoleBackup/Exporter.cpp @@ -154,7 +154,7 @@ void WriteRegionData() nn::cfg::CTR::CfgRegionCode region; region = nn::cfg::CTR::GetRegion(); - s_SdWriter.WriteBuf(common::REGION_DATA_PATHNAME, ®ion, sizeof(nn::cfg::CTR::CfgRegionCode)); + s_SdWriter.WriteBufWithCmac(common::REGION_DATA_PATHNAME, ®ion, sizeof(nn::cfg::CTR::CfgRegionCode)); } void WriteCountryLanguageData() @@ -172,7 +172,7 @@ void WriteCountryLanguageData() // 言語設定 s_CountryLanguage.language = nn::cfg::CTR::GetLanguage(); - s_SdWriter.WriteBuf(common::COUNTRY_SETTING_PATHNAME, &s_CountryLanguage, sizeof(s_CountryLanguage)); + s_SdWriter.WriteBufWithCmac(common::COUNTRY_SETTING_PATHNAME, &s_CountryLanguage, sizeof(s_CountryLanguage)); } } @@ -198,7 +198,7 @@ void WriteNorData() result = nn::cfg::nor::CTR::ReadNtrWifiSetting(0, s_NtrNorData.NtrWiFiSetting, common::NTR_WIFI_SETTING_SIZE); COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); - s_SdWriter.WriteBuf(common::NOR_PATHNAME, &s_NtrNorData, sizeof(common::NtrNorData)); + s_SdWriter.WriteBufWithCmac(common::NOR_PATHNAME, &s_NtrNorData, sizeof(common::NtrNorData)); } void WriteSerialNumber() @@ -209,7 +209,7 @@ void WriteSerialNumber() size_t size; GetSerialNumber(&serial, &size); - s_SdWriter.WriteBuf(common::SERIAL_PATHNAME, serial, size); + s_SdWriter.WriteBufWithCmac(common::SERIAL_PATHNAME, serial, size); } void WriteDeviceId() @@ -218,7 +218,7 @@ void WriteDeviceId() bit32 deviceId = GetDeviceId(); - s_SdWriter.WriteBuf(common::DEVICE_ID_PATHNAME, &deviceId, sizeof(deviceId)); + s_SdWriter.WriteBufWithCmac(common::DEVICE_ID_PATHNAME, &deviceId, sizeof(deviceId)); } void WriteIvs() @@ -248,7 +248,7 @@ void WriteIvs() swAesCtrContest.Initialize(iv, common::key, sizeof(common::key)); swAesCtrContest.Encrypt(enc, ivs, size); - s_SdWriter.WriteBuf(common::IVS_PATHNAME, enc, size); + s_SdWriter.WriteBufWithCmac(common::IVS_PATHNAME, enc, size); common::HeapManager::GetHeap()->Free(enc); } @@ -394,7 +394,7 @@ void WriteMcuRtcData() NN_LOG("RTC = 20%02d/%02d/%02d %02d:%02d:%02d\n", rtc.m_Year, rtc.m_Month, rtc.m_Day, rtc.m_Hour, rtc.m_Minute, rtc.m_Second); COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); - s_SdWriter.WriteBuf(common::MCU_RTC_PATHNAME, &rtc, sizeof(rtc)); + s_SdWriter.WriteBufWithCmac(common::MCU_RTC_PATHNAME, &rtc, sizeof(rtc)); } else { @@ -483,7 +483,7 @@ void WriteVersionData() common::VerDef versionData; GetVersionData(&versionData); - s_SdWriter.WriteBuf(common::VERSION_DATA_PATHNAME, &versionData, sizeof(common::VerDef)); + s_SdWriter.WriteBufWithCmac(common::VERSION_DATA_PATHNAME, &versionData, sizeof(common::VerDef)); } void WritePlayHistory() diff --git a/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp b/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp index 6b1d440..f646adf 100644 --- a/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp +++ b/trunk/ConsoleDataMigration/ConsoleRestore/Importer.cpp @@ -207,6 +207,8 @@ bool CreateEmptyFile(const wchar_t* path) u8* ReadSerialNumber() { + nn::Result result; + if(s_ReadSerialNumber) { return s_SerialNo; @@ -214,11 +216,20 @@ u8* ReadSerialNumber() COMMON_LOGGER("Read Serial Number in SD.\n"); - size_t size; - + size_t readSize; common::SdReaderWriter sdReader; - sdReader.ReadBuf(common::SERIAL_PATHNAME, s_SerialNo, nn::cfg::CTR::CFG_SECURE_INFO_SERIAL_NO_LEN, &size); + size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); + if(buf != NULL) + { + result = sdReader.ReadBufWithCmac(common::SERIAL_PATHNAME, buf, bufSize, &readSize); + if(result.IsSuccess()) + { + std::memcpy(s_SerialNo, buf, sizeof(s_SerialNo)); s_ReadSerialNumber = true; + } + common::HeapManager::GetHeap()->Free(buf); + } return s_SerialNo; } @@ -237,7 +248,7 @@ bool EqualsDeviceIdFileandDeviceId() bit32 sdDeviceId; common::SdReaderWriter sdReader; size_t totalSize; - result = sdReader.ReadBuf(common::DEVICE_ID_PATHNAME, &sdDeviceId, sizeof(sdDeviceId), &totalSize); + result = sdReader.ReadBufWithCmac(common::DEVICE_ID_PATHNAME, &sdDeviceId, sizeof(sdDeviceId), &totalSize); s_CheckedEqualsDeviceIdFileandDeviceId = true; if(result.IsSuccess()) { @@ -268,20 +279,33 @@ bool EqualsRegionDataandRegion() nn::cfg::CTR::CfgRegionCode sdRegion; common::SdReaderWriter sdReader; - size_t dummy; - - result = sdReader.ReadBuf(common::REGION_DATA_PATHNAME, &sdRegion, sizeof(sdRegion), &dummy); + size_t readSize; + size_t bufSize = common::HeapManager::GetHeap()->GetAllocatableSize(); + void* buf = common::HeapManager::GetHeap()->Allocate(bufSize); + if (buf != NULL) + { + result = sdReader.ReadBufWithCmac(common::REGION_DATA_PATHNAME, buf, bufSize, &readSize); + if (result.IsSuccess()) + { + std::memcpy(&sdRegion, buf, sizeof(sdRegion)); s_CheckedEqualsRegionDataandRegion = true; if(result.IsSuccess()) { retval = (region == sdRegion); - return retval; } else { retval = false; - return retval; } + } + else + { + retval = false; + } + common::HeapManager::GetHeap()->Free(buf); + } + + return retval; } void SetCountry(nn::cfg::CTR::CfgCountryCode countryCode) @@ -335,7 +359,7 @@ void ImportCountryLanguageData() common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::COUNTRY_SETTING_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::COUNTRY_SETTING_PATHNAME, buf, bufSize, &readSize); if (result.IsSuccess()) { // SDから読み出し成功 @@ -431,7 +455,7 @@ void ImportMcuRtc() common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::MCU_RTC_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::MCU_RTC_PATHNAME, buf, bufSize, &readSize); if (result.IsSuccess()) { // mcuを使ってセットする @@ -553,7 +577,7 @@ void ImportIvs() common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::IVS_PATHNAME, enc, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::IVS_PATHNAME, enc, bufSize, &readSize); if(result.IsSuccess()) { // SDから読み出し成功 @@ -678,7 +702,7 @@ void ImportNorData() common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::NOR_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::NOR_PATHNAME, buf, bufSize, &readSize); if(result.IsSuccess()) { // cfgを使ってセットする @@ -726,7 +750,7 @@ void ReadVersionData() common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::VERSION_DATA_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::VERSION_DATA_PATHNAME, buf, bufSize, &readSize); if(result.IsSuccess()) { // バージョン情報を保持する @@ -1364,7 +1388,7 @@ void ExportCalData() GET_CFG_KEY(NN_CFG_MCU, NN_CFG_MCU_SLIDE_VOLUME)); COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); - sdWriter.WriteBuf(common::CFG_CALIBRATION_PATHNAME, &cfgCalData, sizeof(cfgCalData)); + sdWriter.WriteBufWithCmac(common::CFG_CALIBRATION_PATHNAME, &cfgCalData, sizeof(cfgCalData)); common::SdMountManager::Unmount(); } @@ -1387,7 +1411,7 @@ bool ImportCalData(common::CfgCalData *data) common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::CFG_CALIBRATION_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::CFG_CALIBRATION_PATHNAME, buf, bufSize, &readSize); if(result.IsSuccess()) { // SDから読み出し成功 diff --git a/trunk/ConsoleDataMigration/common/Aes_define.h b/trunk/ConsoleDataMigration/common/Aes_define.h index 34436ec..e79fe3e 100644 --- a/trunk/ConsoleDataMigration/common/Aes_define.h +++ b/trunk/ConsoleDataMigration/common/Aes_define.h @@ -16,13 +16,21 @@ #ifndef AES_DEFINE_H_ #define AES_DEFINE_H_ +#include + namespace common { - bit8 key[AES_KEY_SIZE] = + const bit8 key[AES_KEY_SIZE] = { 0x81, 0x35, 0xc6, 0x54, 0x19, 0x1a, 0x47, 0x2a, 0x6b, 0x78, 0xbe, 0x25, 0x90, 0xf6, 0xee, 0x74 }; + + const bit8 cmacKey[AES_KEY_SIZE] = + { + 0x87, 0xdd, 0xc6, 0xd6, 0xf2, 0xe0, 0x2c, 0xa6, + 0x04, 0x21, 0x9c, 0x5e, 0x33, 0x8c, 0x3d, 0xaa + }; } #endif /* AES_DEFINE_H_ */ diff --git a/trunk/ConsoleDataMigration/common/PlayHistoryManager.cpp b/trunk/ConsoleDataMigration/common/PlayHistoryManager.cpp index 32c8f7e..bb8607e 100644 --- a/trunk/ConsoleDataMigration/common/PlayHistoryManager.cpp +++ b/trunk/ConsoleDataMigration/common/PlayHistoryManager.cpp @@ -52,7 +52,7 @@ void PlayHistoryManager::Export() } // SDに書き込む - result = sd.WriteBuf(common::PLAYHISTORY_COUNT_PATHNAME, reinterpret_cast(&historyNum), + result = sd.WriteBufWithCmac(common::PLAYHISTORY_COUNT_PATHNAME, reinterpret_cast(&historyNum), sizeof(historyNum)); COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); @@ -69,7 +69,7 @@ void PlayHistoryManager::Export() nn::pl::CTR::GetPlayHistory(pEvent, 0, historyNum); // SDに書き込む - result = sd.WriteBuf(common::PLAYHISTORY_PATHNAME, reinterpret_cast(pEvent), + result = sd.WriteBufWithCmac(common::PLAYHISTORY_PATHNAME, reinterpret_cast(pEvent), sizeof(nn::pl::CTR::PlayEvent) * historyNum); COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); @@ -89,11 +89,12 @@ void PlayHistoryManager::GetPlayHistoryNums(size_t* nums) common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::PLAYHISTORY_COUNT_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::PLAYHISTORY_COUNT_PATHNAME, buf, bufSize, &readSize); if (result.IsSuccess()) { *nums = *reinterpret_cast (buf); } + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); } HeapManager::GetHeap()->Free(buf); } @@ -124,7 +125,7 @@ void PlayHistoryManager::Import() common::SdReaderWriter sdReader; size_t readSize; - result = sdReader.ReadBuf(common::PLAYHISTORY_PATHNAME, buf, bufSize, &readSize); + result = sdReader.ReadBufWithCmac(common::PLAYHISTORY_PATHNAME, buf, bufSize, &readSize); if(result.IsSuccess()) { nn::pl::CTR::PlayEvent* pEvent = reinterpret_cast(buf); diff --git a/trunk/ConsoleDataMigration/common/SdReaderWriter.cpp b/trunk/ConsoleDataMigration/common/SdReaderWriter.cpp index 8164695..583a46f 100644 --- a/trunk/ConsoleDataMigration/common/SdReaderWriter.cpp +++ b/trunk/ConsoleDataMigration/common/SdReaderWriter.cpp @@ -16,10 +16,31 @@ #include "SdReaderWriter.h" #include "SdMountManager.h" #include "CommonLogger.h" +#include "Aes_define.h" + +#include +#include +#include +#include namespace common { +bool Compare(const bit8* p0, const bit8* p1, size_t size) +{ + s32 i; + bool result = true; + for (i = 0; i < size; ++i) + { + if (*(p0 + i) != *(p1 + i)) + { + result = false; + } + } + return result; +} // Compare + + nn::Result SdReaderWriter::Initialize() { nn::Result result; @@ -52,28 +73,23 @@ nn::Result SdReaderWriter::Finalize() return result; } -nn::Result SdReaderWriter::WriteBuf(const wchar_t* path, void* buf, size_t size) +nn::Result SdReaderWriter::WriteBufCore(const wchar_t* path, void* buf, size_t size) { NN_ASSERT(path != NULL); NN_ASSERT(size > 0); - nn::Result result; - result = Initialize(); + nn::Result result = Initialize(); COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); result = file.TryInitialize(path, nn::fs::OPEN_MODE_WRITE | nn::fs::OPEN_MODE_CREATE); + if (result.IsSuccess()) { s32 writeSize; - result = file.TryWrite(&writeSize, buf, size, true); + result = file.TryWrite(&writeSize, buf, size, false); if (result.IsSuccess()) { - result = file.TryFlush(); - if (result.IsFailure()) - { - NN_LOG("SD TryFlush failed\n"); - COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); - } + // 何もしない } else { @@ -87,6 +103,18 @@ nn::Result SdReaderWriter::WriteBuf(const wchar_t* path, void* buf, size_t size) COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); } + return result; +} + +nn::Result SdReaderWriter::WriteBuf(const wchar_t* path, void* buf, size_t size) +{ + nn::Result result; + + result = WriteBufCore(path, buf, size); + NN_UTIL_RETURN_IF_FAILED(result); + + result = file.TryFlush(); + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); file.Finalize(); result = Finalize(); @@ -95,12 +123,44 @@ nn::Result SdReaderWriter::WriteBuf(const wchar_t* path, void* buf, size_t size) return result; } -nn::Result SdReaderWriter::ReadBuf(const wchar_t* path, void* buf, size_t size, size_t* totalSize) +nn::Result SdReaderWriter::WriteBufWithCmac(const wchar_t* path, void* buf, size_t size) +{ + nn::Result result; + + result = WriteBufCore(path, buf, size); + NN_UTIL_RETURN_IF_FAILED(result); + + nn::crypto::Initialize(); + bit8 sha256Hash[nn::crypto::Sha256Context::HASH_SIZE]; + nn::crypto::CalculateSha256(sha256Hash, buf, size); + + bit8 cmac[nn::crypto::AES_CMAC_MAC_SIZE]; + result = nn::crypto::CalculateAesCmacSw(cmac, sha256Hash, nn::crypto::Sha256Context::HASH_SIZE, common::cmacKey); + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); + + s32 writeSize; + result = file.TryWrite(&writeSize, cmac, sizeof(cmac), false); + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); + + result = file.TryFlush(); + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); + + file.Finalize(); + + result = Finalize(); + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); + + return result; + +} + +nn::Result SdReaderWriter::ReadBufCore(const wchar_t* path, void* buf, size_t size, size_t* totalSize) { NN_ASSERT(path != NULL); NN_ASSERT(size > 0); nn::Result result; + if(!m_IsInitialized) { Initialize(); @@ -128,10 +188,56 @@ nn::Result SdReaderWriter::ReadBuf(const wchar_t* path, void* buf, size_t size, COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); } + return result; +} + +nn::Result SdReaderWriter::ReadBuf(const wchar_t* path, void* buf, size_t size, size_t* totalSize) +{ + nn::Result result; + + result = ReadBufCore(path, buf, size, totalSize); + NN_UTIL_RETURN_IF_FAILED(result); + file.Finalize(); return result; } +nn::Result SdReaderWriter::ReadBufWithCmac(const wchar_t* path, void* buf, size_t size, size_t* totalSize) +{ + nn::Result result; + + NN_ASSERT(size > nn::crypto::AES_CMAC_MAC_SIZE); + + result = ReadBufCore(path, buf, size, totalSize); + NN_UTIL_RETURN_IF_FAILED(result); + + file.Finalize(); + // ハッシュが付加されていない + if(*totalSize < nn::crypto::AES_CMAC_MAC_SIZE) + { + return nn::fs::ResultVerificationFailed(); + } + *totalSize -= nn::crypto::AES_CMAC_MAC_SIZE; + + // CMACの検証を行う + nn::crypto::Initialize(); + bit8 sha256Hash[nn::crypto::Sha256Context::HASH_SIZE]; + nn::crypto::CalculateSha256(sha256Hash, buf, *totalSize); + + bit8 cmac[nn::crypto::AES_CMAC_MAC_SIZE]; + result = nn::crypto::CalculateAesCmacSw(cmac, sha256Hash, nn::crypto::Sha256Context::HASH_SIZE, common::cmacKey); + COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result); + + if(!Compare(reinterpret_cast(buf) + *totalSize, cmac, sizeof(cmac))) + { + // 無効なファイル + COMMON_LOGGER("Verification Failed\n"); + return nn::fs::ResultVerificationFailed(); + } + + return result; +} + void SdReaderWriter::CreateDirectory(const wchar_t* path) { nn::Result result; diff --git a/trunk/ConsoleDataMigration/common/SdReaderWriter.h b/trunk/ConsoleDataMigration/common/SdReaderWriter.h index dbb2772..81a10d7 100644 --- a/trunk/ConsoleDataMigration/common/SdReaderWriter.h +++ b/trunk/ConsoleDataMigration/common/SdReaderWriter.h @@ -28,12 +28,31 @@ public : SdReaderWriter() : m_IsInitialized(false) {}; ~SdReaderWriter() {}; + //! @brief 渡されたバッファからsizeバイト指定されたパス名で書きこみます。CMACが付加されます。 + //! @param[in] path sdmc:で始まる出力パス名。予めディレクトリを作っておく必要があります。 + //! @param[in] buf 入力データへのポインタ + //! @param[in] size 入力データのサイズ + nn::Result WriteBufWithCmac(const wchar_t* path, void* buf, size_t size); + + //! @brief 渡されたバッファへ(size - CMAC)バイト指定されたパス名から読み込みます + //! @param[in] path sdmc:で始まるCMAC付きの入力パス名 + //! @param[in] buf 出力バッファへのポインタ + //! @param[in] size バッファサイズ + //! @param[out] totalSize 読み込んだデータ - CMAC のサイズ + nn::Result ReadBufWithCmac(const wchar_t* path, void* buf, size_t size, size_t* totalSize); + + //! @brief 渡されたディレクトリ名のディレクトリを作成します + void CreateDirectory(const wchar_t* path); + +private: //! @brief 渡されたバッファからサイズ分指定されたパス名で書きこみます //! @param[in] path sdmc:で始まる出力パス名。予めディレクトリを作っておく必要があります。 //! @param[in] buf 入力データへのポインタ //! @param[in] size 入力データのサイズ nn::Result WriteBuf(const wchar_t* path, void* buf, size_t size); + nn::Result WriteBufCore(const wchar_t*path, void* buf, size_t size); + //! @brief 渡されたバッファへサイズ分指定されたパス名から読み込みます //! @param[in] path sdmc:で始まる入力パス名 //! @param[in] buf 出力バッファへのポインタ @@ -41,11 +60,8 @@ public : //! @param[out] totalSize 読み込んだデータのサイズ nn::Result ReadBuf(const wchar_t* path, void* buf, size_t size, size_t* totalSize); + nn::Result ReadBufCore(const wchar_t* path, void* buf, size_t size, size_t* totalSize); - //! @brief 渡されたディレクトリ名のディレクトリを作成します - void CreateDirectory(const wchar_t* path); - -private: //! @brief 初期化します。 nn::Result Initialize();