2021-10-09 00:58:55 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright (C) 2016-2021 Maschell
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "DefaultNUSDataProcessor.h"
|
|
|
|
#include "DiscReaderDiscDrive.h"
|
2022-07-26 08:16:27 +02:00
|
|
|
#include "NUSDataProcessor.h"
|
2021-10-09 00:58:55 +02:00
|
|
|
#include "NUSDataProviderWUD.h"
|
2022-07-26 08:16:27 +02:00
|
|
|
#include "NUSDecryption.h"
|
|
|
|
#include "Ticket.h"
|
2022-07-26 09:24:06 +02:00
|
|
|
#include "utils/StringTools.h"
|
2022-07-26 08:16:27 +02:00
|
|
|
#include <WUD/NUSDataProvider.h>
|
|
|
|
#include <WUD/content/partitions/WiiUGMPartition.h>
|
|
|
|
#include <WUD/entities/TMD/TitleMetaData.h>
|
2022-07-26 09:24:06 +02:00
|
|
|
#include <nn/acp/title.h>
|
2021-10-09 00:58:55 +02:00
|
|
|
|
|
|
|
class NUSTitle {
|
|
|
|
|
|
|
|
public:
|
|
|
|
~NUSTitle();
|
|
|
|
|
2022-07-26 09:24:06 +02:00
|
|
|
std::unique_ptr<NUSDataProcessor> dataProcessor;
|
|
|
|
std::unique_ptr<TitleMetaData> tmd;
|
|
|
|
std::unique_ptr<Ticket> ticket;
|
2021-10-11 22:02:35 +02:00
|
|
|
std::shared_ptr<FST> fst;
|
|
|
|
std::shared_ptr<NUSDecryption> decryption;
|
|
|
|
std::shared_ptr<NUSDataProvider> dataProvider;
|
|
|
|
|
2022-07-26 09:24:06 +02:00
|
|
|
static std::optional<std::unique_ptr<NUSTitle>> loadTitleFromGMPartition(
|
|
|
|
std::shared_ptr<WiiUGMPartition> pPartition,
|
|
|
|
std::shared_ptr<DiscReader> pDiscReader,
|
2021-10-11 22:02:35 +02:00
|
|
|
const std::array<uint8_t, 16> &commonKey);
|
2021-10-09 00:58:55 +02:00
|
|
|
|
2022-07-26 09:24:06 +02:00
|
|
|
std::string getLongnameEn();
|
|
|
|
|
|
|
|
std::string getShortnameEn();
|
|
|
|
|
2021-10-09 00:58:55 +02:00
|
|
|
private:
|
2022-07-26 09:24:06 +02:00
|
|
|
std::optional<std::string> longname_en;
|
|
|
|
std::optional<std::string> shortname_en;
|
|
|
|
|
|
|
|
static std::optional<std::unique_ptr<NUSTitle>> make_unique(std::unique_ptr<NUSDataProvider> dataProvider, const std::array<uint8_t, 16> &commonKey);
|
2021-10-11 22:02:35 +02:00
|
|
|
|
2022-07-26 09:24:06 +02:00
|
|
|
NUSTitle(std::unique_ptr<TitleMetaData> pTMD,
|
|
|
|
std::unique_ptr<NUSDataProcessor> pProcessor,
|
2021-10-11 22:02:35 +02:00
|
|
|
std::shared_ptr<NUSDataProvider> pDataProvider,
|
|
|
|
std::shared_ptr<NUSDecryption> pDecryption,
|
2022-07-26 09:24:06 +02:00
|
|
|
std::unique_ptr<Ticket> pTicket,
|
2021-10-11 22:02:35 +02:00
|
|
|
std::shared_ptr<FST> pFST);
|
2021-10-09 00:58:55 +02:00
|
|
|
};
|