mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Re-implement FixCommonKeyIndex for WAD files
The old implementation of this was not able to distinguish between a title that had the common key index set to 1 because it actually was Korean and a title that had the common key index set to 1 due to fakesigning. This new implementation solves the problem by decrypting a content with each possible common key and checking which result matches the provided SHA-1 hash. The problem that the old implementation causes has only been reported to affect a certain pirated WAD of Chronos Twins DX (WC6EUP), but it's possible that the problem would start affecting more WADs if we add support for the vWii common key (which uses index 2). Adding support for the vWii common key would also prevent us from using the simpler solution of always forcing the index to 0 if the title is not Korean.
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
#include <mbedtls/sha1.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/IOS/ES/Formats.h"
|
||||
#include "DiscIO/DiscScrubber.h"
|
||||
#include "DiscIO/Volume.h"
|
||||
|
||||
@ -29,12 +30,6 @@
|
||||
//
|
||||
// GetResult() can be called before the processing is finished, but the result will be incomplete.
|
||||
|
||||
namespace IOS::ES
|
||||
{
|
||||
struct Content;
|
||||
class SignedBlobReader;
|
||||
} // namespace IOS::ES
|
||||
|
||||
namespace DiscIO
|
||||
{
|
||||
class FileInfo;
|
||||
@ -103,7 +98,6 @@ private:
|
||||
u64 GetBiggestUsedOffset(const FileInfo& file_info) const;
|
||||
void CheckMisc();
|
||||
void SetUpHashing();
|
||||
bool CheckContentIntegrity(const IOS::ES::Content& content);
|
||||
|
||||
void AddProblem(Severity severity, std::string text);
|
||||
|
||||
@ -120,6 +114,7 @@ private:
|
||||
mbedtls_sha1_context m_sha1_context;
|
||||
|
||||
DiscScrubber m_scrubber;
|
||||
IOS::ES::TicketReader m_ticket;
|
||||
std::vector<u64> m_content_offsets;
|
||||
u16 m_content_index = 0;
|
||||
std::vector<BlockToVerify> m_blocks;
|
||||
|
Reference in New Issue
Block a user