diff --git a/branches/work/VerificationFailed/sources/ConsoleBackup/Exporter.cpp b/branches/work/VerificationFailed/sources/ConsoleBackup/Exporter.cpp index 3fc9a1a..7fcd152 100644 --- a/branches/work/VerificationFailed/sources/ConsoleBackup/Exporter.cpp +++ b/branches/work/VerificationFailed/sources/ConsoleBackup/Exporter.cpp @@ -758,7 +758,7 @@ nn::Result WriteMcuRtcData(common::HardwareStateManager& manager) return nn::ResultSuccess(); } -void ExportThreadFunc() +void ExportThreadFunc(std::wstring saveRoot) { nn::Result result; s_IsExportSucceeded = true; @@ -781,7 +781,7 @@ void ExportThreadFunc() { NN_LOG("HeapCheck Start : %lld\n", nn::os::Tick::GetSystemCurrent().ToTimeSpan().GetMilliSeconds()); HeapChecker heapChecker; - result = heapChecker.Check(buf, bufSize); + result = heapChecker.Check(saveRoot, buf, bufSize); if(result.IsFailure()) { s_IsExportSucceeded = false; @@ -861,7 +861,11 @@ nn::Result WriteSaveData(::std::string& sysSaveRoot) COMMON_LOGGER("Export NAND Data Start...\n"); // SDにコピーするためのスレッドの作成 - s_ExportThread.Start(ExportThreadFunc, s_ExportThreadStack); + s_ExportThread.Start( + ExportThreadFunc, + ::std::wstring(common::NAND_DATA_ROOT_PATHNAME_WITH_SLASH) + ::std::wstring(s_RootName) + + ::std::wstring(L"/"), s_ExportThreadStack + ); return result; } diff --git a/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.cpp b/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.cpp index 754fe6c..adbb211 100644 --- a/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.cpp +++ b/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.cpp @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------* +/*---------------------------------------------------------------------------* Project: Horizon File: HeapChecker.cpp @@ -33,7 +33,7 @@ HeapChecker::~HeapChecker() // TODO Auto-generated destructor stub } -nn::Result HeapChecker::Check(void* buf, size_t& bufSize) +nn::Result HeapChecker::Check(std::wstring saveRoot, void* buf, size_t& bufSize) { nn::Result result; common::SdReaderWriter sdReaderWriter; @@ -47,6 +47,15 @@ nn::Result HeapChecker::Check(void* buf, size_t& bufSize) COMMON_LOGGER_RETURN_RESULT_IF_FAILED(result); } + // NANDから読み込む + nn::fs::FileInputStream file; + result = file.TryInitialize(std::wstring(saveRoot + std::wstring(L"sysdata/00010026/00000000")).c_str()); + COMMON_LOGGER_RETURN_RESULT_IF_FAILED(result); + + s32 readSize; + result = file.TryRead(&readSize, buf, bufSize); + COMMON_LOGGER_RETURN_RESULT_IF_FAILED(result); + result = sdReaderWriter.WriteBufWithCmac(HEAP_CHECKER_FILE, buf, bufSize - nn::crypto::SwAesCtrContext::AES_BLOCK_LENGTH); COMMON_LOGGER_RETURN_RESULT_IF_FAILED(result); diff --git a/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.h b/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.h index eafccf6..dd0e983 100644 --- a/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.h +++ b/branches/work/VerificationFailed/sources/ConsoleBackup/HeapChecker.h @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------* +/*---------------------------------------------------------------------------* Project: Horizon File: HeapChecker.h @@ -16,6 +16,8 @@ #ifndef HEAPCHECKER_H_ #define HEAPCHECKER_H_ +#include + #include namespace ConsoleBackup @@ -38,6 +40,7 @@ public: データが正しく書き込めていない場合、バッファサイズを半分にして繰り返しチェックします。 正しく書き込めた最大のbufSizeが設定されます。 + @param[in] saveRoot NANDセーブデータのルートディレクトリのパス @param[in] buf バッファ @param[inout] buSize バッファサイズ @@ -45,7 +48,7 @@ public: @return ResultSuccess 上記以外 */ - nn::Result Check(void* buf, size_t& bufSize); + nn::Result Check(std::wstring saveRoot, void* buf, size_t& bufSize); }; } /* namespace ConsoleBackup */