2020-11-27 09:09:48 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2023-01-25 10:38:04 +01:00
|
|
|
#include <expected>
|
2020-11-27 09:09:48 +01:00
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
using Patches = std::map<u64, u8>;
|
|
|
|
|
2023-01-25 10:38:04 +01:00
|
|
|
enum class IPSError {
|
|
|
|
AddressOutOfRange,
|
|
|
|
PatchTooLarge,
|
|
|
|
InvalidPatchHeader,
|
|
|
|
InvalidPatchFormat,
|
|
|
|
MissingEOF
|
|
|
|
};
|
2020-11-27 09:09:48 +01:00
|
|
|
|
2023-01-25 10:38:04 +01:00
|
|
|
std::expected<std::vector<u8>, IPSError> generateIPSPatch(const Patches &patches);
|
|
|
|
std::expected<std::vector<u8>, IPSError> generateIPS32Patch(const Patches &patches);
|
|
|
|
|
|
|
|
std::expected<Patches, IPSError> loadIPSPatch(const std::vector<u8> &ipsPatch);
|
|
|
|
std::expected<Patches, IPSError> loadIPS32Patch(const std::vector<u8> &ipsPatch);
|
2020-11-27 09:09:48 +01:00
|
|
|
}
|