#pragma once #include "BEType.h" #include #include #include enum class patch_type { load, byte, le16, le32, le64, lef32, lef64, be16, be32, be64, bef32, bef64, }; class patch_engine { struct patch { patch_type type; u32 offset; u64 value; template T& value_as() { return *reinterpret_cast(reinterpret_cast(&value)); } }; // Database std::unordered_map> m_map; public: // Load from file void append(const std::string& path); // Apply patch (returns the number of entries applied) std::size_t apply(const std::string& name, u8* dst) const; };