mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
Copydirectoryに渡すバッファはAES_BLOCK_SIZE * 2に
ヒープのサイズ取得じにアラインメントを考慮するように git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@363 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
9c6fde0460
commit
f8de4cefaf
@ -154,6 +154,7 @@ nn::Result DeleteTrash(std::wstring currentDirectory)
|
|||||||
|
|
||||||
nn::Result WriteTwlTitleList(std::vector<std::wstring>& programIdList)
|
nn::Result WriteTwlTitleList(std::vector<std::wstring>& programIdList)
|
||||||
{
|
{
|
||||||
|
nn::Result result;
|
||||||
COMMON_LOGGER("Export TwlTitle List.\n");
|
COMMON_LOGGER("Export TwlTitle List.\n");
|
||||||
|
|
||||||
size_t heapSize = common::GetAllocatableSize();
|
size_t heapSize = common::GetAllocatableSize();
|
||||||
@ -169,10 +170,14 @@ nn::Result WriteTwlTitleList(std::vector<std::wstring>& programIdList)
|
|||||||
NN_LOG("%ls\n", it->c_str());
|
NN_LOG("%ls\n", it->c_str());
|
||||||
writeSize += it->size() + sizeof('\n');
|
writeSize += it->size() + sizeof('\n');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
nn::Result result = s_SdWriter.WriteBufWithCmac(common::TWL_TITLELIST_PATHNAME, titleListBuf, writeSize);
|
return s_SdWriter.WriteBufWithCmac(common::TWL_TITLELIST_PATHNAME, titleListBuf, writeSize);
|
||||||
return result;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nn::Result(nn::Result::LEVEL_FATAL, nn::Result::SUMMARY_OUT_OF_RESOURCE, nn::Result::MODULE_COMMON,
|
||||||
|
nn::Result::DESCRIPTION_OUT_OF_MEMORY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -468,9 +473,6 @@ void WriteTwlData(enum common::TWL_PATH_INDEX path)
|
|||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsExportSucceeded);
|
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsExportSucceeded);
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
|
||||||
NN_LOG("AllocatableSize = %d\n", bufSize);
|
|
||||||
|
|
||||||
u32 fileNum = 0;
|
u32 fileNum = 0;
|
||||||
s64 fileSize = 0;
|
s64 fileSize = 0;
|
||||||
result = common::CalculateFileNum(::std::wstring(common::NAND_TWL_ROOT_PATHNAME_WITH_SLASH_TABLE[path]), fileNum, fileSize);
|
result = common::CalculateFileNum(::std::wstring(common::NAND_TWL_ROOT_PATHNAME_WITH_SLASH_TABLE[path]), fileNum, fileSize);
|
||||||
@ -484,7 +486,10 @@ void WriteTwlData(enum common::TWL_PATH_INDEX path)
|
|||||||
// 進捗表示用
|
// 進捗表示用
|
||||||
common::InitializeTransferProgress(fileSize);
|
common::InitializeTransferProgress(fileSize);
|
||||||
|
|
||||||
common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE);
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
|
NN_LOG("AllocatableSize = %d\n", bufSize);
|
||||||
|
|
||||||
|
common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = writeHeap.GetAddr();
|
void* buf = writeHeap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
@ -605,10 +610,10 @@ void WriteTwlSaveData()
|
|||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsExportSucceeded);
|
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsExportSucceeded);
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
NN_LOG("AllocatableSize = %d\n", bufSize);
|
NN_LOG("AllocatableSize = %d\n", bufSize);
|
||||||
|
|
||||||
common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE);
|
common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = writeHeap.GetAddr();
|
void* buf = writeHeap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
@ -751,10 +756,10 @@ void ExportThreadFunc()
|
|||||||
|
|
||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
NN_LOG("AllocatableSize = %d\n", bufSize);
|
NN_LOG("AllocatableSize = %d\n", bufSize);
|
||||||
|
|
||||||
common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE);
|
common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = writeHeap.GetAddr();
|
void* buf = writeHeap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -706,10 +706,10 @@ void ImportThreadFunc()
|
|||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded);
|
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded);
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
NN_LOG("AllocatableSize = %d\n", bufSize);
|
NN_LOG("AllocatableSize = %d\n", bufSize);
|
||||||
|
|
||||||
common::HeapManager heap(bufSize);
|
common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = heap.GetAddr();
|
void* buf = heap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
@ -1481,13 +1481,13 @@ void ImportTwlData(enum common::TWL_PATH_INDEX path, s64 fileSize)
|
|||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded);
|
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded);
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
NN_LOG("AllocatableSize = %d\n", bufSize);
|
NN_LOG("AllocatableSize = %d\n", bufSize);
|
||||||
|
|
||||||
// ファイルサイズ設定
|
// ファイルサイズ設定
|
||||||
common::InitializeTransferProgress(fileSize);
|
common::InitializeTransferProgress(fileSize);
|
||||||
|
|
||||||
common::HeapManager heap(bufSize, AES_BLOCK_SIZE);
|
common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = heap.GetAddr();
|
void* buf = heap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
@ -1522,13 +1522,13 @@ void ImportTwlTitleSaveData(s64 fileSize)
|
|||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded);
|
COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded);
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
NN_LOG("AllocatableSize = %d\n", bufSize);
|
NN_LOG("AllocatableSize = %d\n", bufSize);
|
||||||
|
|
||||||
// ファイルサイズ設定
|
// ファイルサイズ設定
|
||||||
common::InitializeTransferProgress(fileSize);
|
common::InitializeTransferProgress(fileSize);
|
||||||
|
|
||||||
common::HeapManager heap(bufSize, AES_BLOCK_SIZE);
|
common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = heap.GetAddr();
|
void* buf = heap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -362,9 +362,9 @@ void VerifyThreadFunc()
|
|||||||
|
|
||||||
result = common::SdMountManager::Mount();
|
result = common::SdMountManager::Mount();
|
||||||
|
|
||||||
size_t bufSize = common::GetAllocatableSize();
|
size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2);
|
||||||
|
|
||||||
common::HeapManager heap(bufSize, AES_BLOCK_SIZE);
|
common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2);
|
||||||
void* buf = heap.GetAddr();
|
void* buf = heap.GetAddr();
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user