mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
書き込み時のサイズ計算でヘッダ、パディングを加算しないように
nimのセーブデータはファイルリストに出力しないように git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@156 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
2f6bdd55ac
commit
4305dc4c6e
@ -320,7 +320,6 @@ bool CopyDirectory(ImportDataList* fileList, const wchar_t * from_path, const wc
|
||||
ret_value = false;
|
||||
continue;
|
||||
}
|
||||
s_FinishedFileSize += sizeof(header);
|
||||
swAesCtrContext.Decrypt(&dec, &header, sizeof(header));
|
||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||
fileSizeWithoutHeaderAndFooter = dec.size;
|
||||
@ -436,7 +435,6 @@ bool CopyDirectory(ImportDataList* fileList, const wchar_t * from_path, const wc
|
||||
{
|
||||
readsize -= totalReadSize - fileSizeWithoutHeaderAndFooter;
|
||||
readDone = true;
|
||||
s_FinishedFileSize += totalReadSize - fileSizeWithoutHeaderAndFooter;
|
||||
}
|
||||
|
||||
result = to_file.TryWrite(&writesize, reinterpret_cast<bit8*> (buf) + bufSize / 2,
|
||||
@ -659,6 +657,14 @@ void AddPkcsPadding(u8* paddingSize, void* buf, size_t bufSize, s32* readSize)
|
||||
}
|
||||
}
|
||||
|
||||
//! @brief パスにnimのセーブデータディレクトリが含まれているかどうかを返します
|
||||
//! @param[in] str パス
|
||||
//! @return パスにnimのセーブデータディレクトリが含まれているか
|
||||
bool ContainsNimSaveDataDir(const wchar_t* str)
|
||||
{
|
||||
return std::wcsstr(str, common::NIM_SAVEDATA_DIRECTORY_NAME) != NULL;
|
||||
}
|
||||
|
||||
//! @brief ファイルに文字列とサイズをカンマ区切り、改行付きで追加します
|
||||
//! @param[in] file 文字列を出力したいファイル
|
||||
//! @param[in] str 入力文字列
|
||||
@ -670,6 +676,11 @@ void AddPathNameAndUpdateContext(nn::fs::FileOutputStream* file, const wchar_t *
|
||||
nn::Result result;
|
||||
s32 writeSize;
|
||||
|
||||
if(ContainsNimSaveDataDir(str))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::string output(GetCharStr(str));
|
||||
result = file->TryWrite(&writeSize, output.c_str(), output.size(), true);
|
||||
context->Update(output.c_str(), output.size());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user