2020-11-27 09:09:48 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2023-11-02 08:53:46 +01:00
|
|
|
|
|
|
|
#include <wolv/utils/expected.hpp>
|
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-11-02 08:53:46 +01:00
|
|
|
wolv::util::Expected<std::vector<u8>, IPSError> generateIPSPatch(const Patches &patches);
|
|
|
|
wolv::util::Expected<std::vector<u8>, IPSError> generateIPS32Patch(const Patches &patches);
|
2023-01-25 10:38:04 +01:00
|
|
|
|
2023-11-02 08:53:46 +01:00
|
|
|
wolv::util::Expected<Patches, IPSError> loadIPSPatch(const std::vector<u8> &ipsPatch);
|
|
|
|
wolv::util::Expected<Patches, IPSError> loadIPS32Patch(const std::vector<u8> &ipsPatch);
|
2020-11-27 09:09:48 +01:00
|
|
|
}
|