diff options
Diffstat (limited to 'src/tools/connection_patcher/Patcher.hpp')
| -rw-r--r-- | src/tools/connection_patcher/Patcher.hpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/tools/connection_patcher/Patcher.hpp b/src/tools/connection_patcher/Patcher.hpp index 7bf29b30ca7..3ce0fdc94b0 100644 --- a/src/tools/connection_patcher/Patcher.hpp +++ b/src/tools/connection_patcher/Patcher.hpp @@ -19,24 +19,33 @@ #ifndef CONNECTION_PATCHER_PATCHER_HPP #define CONNECTION_PATCHER_PATCHER_HPP -#include "Constants/BinaryTypes.hpp" +#include "Helper.hpp" -#include <boost/filesystem.hpp> - -#include <vector> -#include <string> +#include <fstream> +#include <iostream> +#include <iterator> namespace Connection_Patcher { - struct Patcher + class Patcher { + public: + Patcher(boost::filesystem::path file); + + void Patch(std::vector<unsigned char> const& bytes, std::vector<unsigned char> const& pattern); + void Finish(boost::filesystem::path out); + Constants::BinaryTypes GetType() const { return binaryType; } + std::vector<unsigned char> const& GetBinary() const { return binary; } + + private: + void ReadFile(); + void WriteFile(boost::filesystem::path const& path); + + boost::filesystem::path filePath; std::vector<unsigned char> binary; - Constants::BinaryTypes Type; + Constants::BinaryTypes binaryType; - Patcher (boost::filesystem::path file); - void Patch(std::vector<unsigned char> const& bytes, std::vector<unsigned char> const& pattern); - void Finish (boost::filesystem::path out); }; } |
