mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@411 385bec56-5757-e545-9c3a-d8741f4650f1
181 lines
5.0 KiB
C++
181 lines
5.0 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: SavedataChecker.h
|
|
|
|
Copyright 2009 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 SAVEDATACHECKER_H_
|
|
#define SAVEDATACHECKER_H_
|
|
|
|
#include <string>
|
|
|
|
#include <nn.h>
|
|
#include <nn/fs/fs_ParametersForSystem.h>
|
|
|
|
namespace ConsoleBackup
|
|
{
|
|
|
|
struct SystemSaveDataCouple
|
|
{
|
|
std::wstring name;
|
|
nn::fs::SystemSaveDataId id;
|
|
};
|
|
|
|
const SystemSaveDataCouple SYSTEM_SAVEDATA_COUPLE_LIST[] =
|
|
{
|
|
{ L"fill_data", 0x00010000 },
|
|
{ L"cfg", 0x00010017 },
|
|
{ L"ptm", 0x00010022 },
|
|
{ L"cecd", 0x00010026 },
|
|
{ L"nim", 0x0001002C },
|
|
{ L"friends", 0x00010032 },
|
|
{ L"boss", 0x00010034 },
|
|
{ L"news", 0x00010035 },
|
|
|
|
{ L"PLOG_JP", 0x00020202 },
|
|
{ L"PLOG_US", 0x00020212 },
|
|
{ L"PLOG_EU", 0x00020222 },
|
|
|
|
{ L"EDIT_JP", 0x00020207 },
|
|
{ L"EDIT_US", 0x00020217 },
|
|
{ L"EDIT_EU", 0x00020227 },
|
|
|
|
{ L"PNOTE_JP", 0x00020204 },
|
|
{ L"PNOTE_US", 0x00020214 },
|
|
{ L"PNOTE_EU", 0x00020224 },
|
|
|
|
{ L"SNOTE_JP", 0x00020205 },
|
|
{ L"SNOTE_US", 0x00020215 },
|
|
{ L"SNOTE_EU", 0x00020225 },
|
|
|
|
{ L"TIGER_JP", 0x00020209 },
|
|
{ L"TIGER_US", 0x00020219 },
|
|
{ L"TIGER_EU", 0x00020229 },
|
|
|
|
{ L"MARS_JP", 0x0002020b },
|
|
{ L"MARS_US", 0x0002021b },
|
|
{ L"MARS_EU", 0x0002022b },
|
|
|
|
{ L"CARDBOARD_JP", 0x0002020a },
|
|
{ L"CARDBOARD_US", 0x0002021a },
|
|
{ L"CARDBOARD_EU", 0x0002022a },
|
|
|
|
{ L"FRUIT_JP", 0x0002020c },
|
|
{ L"FRUIT_US", 0x0002021c },
|
|
{ L"FRUIT_EU", 0x0002022c },
|
|
|
|
{ L"MEET_JP", 0x00020208 },
|
|
{ L"MEET_US", 0x00020218 },
|
|
{ L"MEET_EU", 0x00020228 },
|
|
|
|
{ L"CPLAY_HAL_JP", 0x0002020d },
|
|
{ L"CPLAY_HAL_US", 0x0002021d },
|
|
{ L"CPLAY_HAL_EU", 0x0002022d },
|
|
|
|
{ L"CPLAY_NCL_JP", 0x0002020e },
|
|
{ L"CPLAY_NCL_US", 0x0002021e },
|
|
{ L"CPLAY_NCL_EU", 0x0002022e },
|
|
|
|
{ L"MMEN_JP", 0x00020081 },
|
|
{ L"MMEN_US", 0x0002008f },
|
|
{ L"MMEN_EU", 0x00020098 },
|
|
|
|
{ L"friend_JP", 0x0002008d },
|
|
{ L"friend_US", 0x00020096 },
|
|
{ L"friend_EU", 0x0002009f },
|
|
|
|
{ L"SPIDER_JP", 0x00020088 },
|
|
{ L"SPIDER_US", 0x0002009d },
|
|
{ L"SPIDER_EU", 0x00020094 },
|
|
|
|
{ L"EBIRD_JP", 0x00020086 },
|
|
{ L"EBIRD_US", 0x00020092 },
|
|
{ L"EBIRD_EU", 0x0002009b },
|
|
|
|
{ L"CHERRY_JP", 0x00020087 },
|
|
{ L"CHERRY_US", 0x00020093 },
|
|
{ L"CHERRY_EU", 0x0002009c },
|
|
|
|
{ L"error", 0x000200c5 }
|
|
|
|
};
|
|
|
|
const char* const SYSTEM_SAVEDATA_ARCHIVE_NAME = "ssave:";
|
|
|
|
const size_t SYSTEM_SAVE_DATA_NUM = sizeof(SYSTEM_SAVEDATA_COUPLE_LIST)/sizeof(SYSTEM_SAVEDATA_COUPLE_LIST[0]);
|
|
|
|
//! @brief システムセーブデータをチェックするためのクラス
|
|
class SystemSavedataChecker
|
|
{
|
|
public:
|
|
SystemSavedataChecker();
|
|
SystemSavedataChecker(void* buf, size_t size);
|
|
~SystemSavedataChecker();
|
|
|
|
//! @brief システムセーブデータを調べて問題があるファイルを削除する
|
|
nn::Result CleanUp();
|
|
|
|
private:
|
|
//! @brief システムセーブデータアーカイブ内のファイルを調べて問題があるファイルを削除する
|
|
nn::Result CleanUpFilesRecursively(bool* modified, std::wstring currentDirectory);
|
|
|
|
//! バッファ
|
|
void* m_Buf;
|
|
|
|
//! バッファサイズ
|
|
size_t m_Bufsize;
|
|
};
|
|
|
|
//! @brief 共有拡張セーブデータをチェックするためのクラス
|
|
class SharedExtSavedataChecker
|
|
{
|
|
public:
|
|
SharedExtSavedataChecker();
|
|
SharedExtSavedataChecker(void* buf, size_t size);
|
|
~SharedExtSavedataChecker();
|
|
|
|
//! @brief 共有拡張セーブデータを調べて問題があるファイルを削除する
|
|
nn::Result CleanUp();
|
|
|
|
private:
|
|
//! @brief 共有拡張セーブデータアーカイブ内のファイルを調べて問題があるファイルを削除する
|
|
nn::Result CleanUpFilesRecursively(bool* modified, std::wstring currentDirectory);
|
|
|
|
//! バッファ
|
|
void* m_Buf;
|
|
|
|
//! バッファサイズ
|
|
size_t m_Bufsize;
|
|
|
|
};
|
|
|
|
|
|
class SavedataChecker
|
|
{
|
|
public:
|
|
SavedataChecker();
|
|
SavedataChecker(void* buf, size_t size);
|
|
~SavedataChecker();
|
|
|
|
nn::Result CleanUp();
|
|
|
|
private:
|
|
//! バッファ
|
|
void* m_Buf;
|
|
|
|
//! バッファサイズ
|
|
size_t m_Bufsize;
|
|
};
|
|
|
|
} /* namespace ConsoleBackup */
|
|
#endif /* SAVEDATACHECKER_H_ */
|