1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00
rpcs3/Utilities/bin_patch.h
2017-03-30 12:04:59 +03:00

38 lines
475 B
C++

#pragma once
#include "BEType.h"
#include <vector>
#include <string>
#include <unordered_map>
enum class patch_type
{
byte,
le16,
le32,
le64,
be16,
be32,
be64,
};
class patch_engine
{
struct patch
{
patch_type type;
u32 offset;
u64 value;
};
// Database
std::unordered_map<std::string, std::vector<patch>> m_map;
public:
// Load from file
void append(const std::string& path);
// Apply patch
void apply(const std::string& name, u8* dst) const;
};