diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-03-26 21:38:15 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-03-26 21:38:15 +0100 |
commit | 7658321752585beb05668257628bc2ec3ddc17ef (patch) | |
tree | 67aca50eaa093a462269eabb7c91ac9e8d14f228 /aoe2hd/include/CodePatcher.h | |
parent | 65686da6fc1f91e3a831347703c758ea3ca97c3e (diff) |
replaced age2hd cheat with a actually working one.. or at least worked
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'aoe2hd/include/CodePatcher.h')
-rwxr-xr-x | aoe2hd/include/CodePatcher.h | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/aoe2hd/include/CodePatcher.h b/aoe2hd/include/CodePatcher.h deleted file mode 100755 index 1713b21..0000000 --- a/aoe2hd/include/CodePatcher.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef CODEPATCHER_H -#define CODEPATCHER_H - -#include <vector> -#include <map> - -extern "C" { -#include "native.h" -} - - -typedef struct code_patch -{ - unsigned long addr; - std::vector<unsigned char> old_code; - std::vector<unsigned char> new_code; - long new_offset; - long suspend; -} code_patch; - -class CodePatcher -{ -public: - CodePatcher(const native_data& nd); - virtual ~CodePatcher(); - bool addPatch(const std::string& name, - unsigned long addr, - const std::vector<unsigned char>& old_code, - const std::vector<unsigned char>& new_code, - long new_offset = 0); - void setPatchSuspend(const std::string& name, long doSuspend); - bool doPatch(const std::string& name, int doUnPatch); - bool autoPatch(const std::string& name); - std::string toString(); -private: - const native_data& nd; - std::map<std::string, code_patch> patch_map; - bool codePatchExists(const std::string& name) - { - return patch_map.find(name) != patch_map.end(); - } - bool codeCmp(unsigned long addr, std::vector<unsigned char> code); -}; - -#endif // CODEPATCHER_H |