Add Approved Patch Allowlist for Achievements

Prototype of a system to whitelist known game patches that are allowed to be used while RetroAchievements Hardcore mode is active. ApprovedInis.txt contains known hashes for the ini files as they appear in the repo, and can be compared to the local versions of these files to ensure they have not been edited locally by the player. ApprovedInis.txt is hashed and verified similarly first, with its hash residing as a const string within AchievementManager.h, ensuring ApprovedInis and the hashes within cannot be modified without editing Dolphin's source code and recompiling completely.
This commit is contained in:
LillyJadeKatrin
2024-06-21 23:44:21 -04:00
parent 6ddfdc1483
commit 0c14b0c8a7
84 changed files with 662 additions and 4 deletions

View File

@ -182,6 +182,13 @@ void LoadPatches()
LoadPatchSection("OnFrame", &s_on_frame, globalIni, localIni);
#ifdef USE_RETRO_ACHIEVEMENTS
{
std::lock_guard lg{AchievementManager::GetInstance().GetLock()};
AchievementManager::GetInstance().FilterApprovedPatches(s_on_frame, sconfig.GetGameID());
}
#endif // USE_RETRO_ACHIEVEMENTS
// Check if I'm syncing Codes
if (Config::Get(Config::SESSION_CODE_SYNC_OVERRIDE))
{
@ -197,9 +204,6 @@ void LoadPatches()
static void ApplyPatches(const Core::CPUThreadGuard& guard, const std::vector<Patch>& patches)
{
if (AchievementManager::GetInstance().IsHardcoreModeActive())
return;
for (const Patch& patch : patches)
{
if (patch.enabled)