Preprocess cheats to get rid of hacks that try to modify the cheat engine, add support for C2 cheat opcode

This commit is contained in:
Gericom
2026-03-14 12:27:35 +01:00
parent 8c8f36f5c6
commit d0f25a51d9
5 changed files with 142 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
#pragma once
#include "../../include/picoLoader7.h"
/// @brief Class for preprocessing cheats to get rid of hacks that try to modify the cheat engine.
class CheatPreprocessor
{
public:
/// @brief Preprocesses the given \p cheat.
/// @param cheat The cheat to preprocess.
void PreprocessCheat(pload_cheat_t* cheat) const;
private:
void PatchD4Hack(pload_cheat_t* cheat, u64 hackPattern, u8 patchedInstructionFlag) const;
void PatchDBFix(pload_cheat_t* cheat) const;
void PatchAsmHack(pload_cheat_t* cheat) const;
};