summaryrefslogtreecommitdiff
path: root/aoe2hd/include/CodeGenerator.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-03-26 21:38:15 +0100
committerToni Uhlig <matzeton@googlemail.com>2020-03-26 21:38:15 +0100
commit7658321752585beb05668257628bc2ec3ddc17ef (patch)
tree67aca50eaa093a462269eabb7c91ac9e8d14f228 /aoe2hd/include/CodeGenerator.h
parent65686da6fc1f91e3a831347703c758ea3ca97c3e (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/CodeGenerator.h')
-rwxr-xr-xaoe2hd/include/CodeGenerator.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/aoe2hd/include/CodeGenerator.h b/aoe2hd/include/CodeGenerator.h
deleted file mode 100755
index 2d97d86..0000000
--- a/aoe2hd/include/CodeGenerator.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef CODEGENERATOR_H
-#define CODEGENERATOR_H
-
-#include <string>
-#include <vector>
-
-#include "CodeInjector.h"
-
-
-std::vector<unsigned char> x86_relJump(unsigned long dst,
- unsigned long src);
-
-class CodeGenerator
-{
-public:
- CodeGenerator(const native_data& nd);
- virtual ~CodeGenerator();
- void clear()
- {
- codes.clear();
- }
- bool hasCode(int index);
- CodeGenerator& addCode(const std::vector<unsigned char>& code);
- CodeGenerator& addCode(const std::string& code);
- CodeGenerator& setCode(int index, const std::vector<unsigned char>& code);
- CodeGenerator& setCodeSized(int index, const std::vector<unsigned char>& code);
- CodeGenerator& setRel32JMP(int index, unsigned long dst, unsigned long src, bool reversed = false);
- std::vector<unsigned char>::size_type buildSize(int maxCodes = -1);
- std::vector<unsigned char> build();
- std::vector<unsigned char> buildAndClear();
- std::string toString();
-private:
- const native_data& nd;
- std::vector<std::vector<unsigned char>> codes;
- unsigned long diffRel32JMP(bool reversed, int index = -1)
- {
- return (!reversed ? buildSize(index) - 0x5 : buildSize(index));
- }
-};
-
-#endif // CODEGENERATOR_H