enderalse/source/Enderal DLL/src/Patches/AchievementFix.h

23 lines
535 B
C
Raw Normal View History

#pragma once
namespace AchievementFix
{
void Install()
{
REL::Relocation<std::uintptr_t> target;
2024-02-16 07:41:32 +00:00
if (REL::Module::IsVR()) {
target = REL::Offset(0x17FB90);
} else if (REL::Module::get().version() >= REL::Version(1, 6, 1130, 0)) {
// Checked: 1.6.1130, 1.6.1170, 1.6.1179
target = REL::ID(441528);
} else {
2023-12-21 11:41:08 +00:00
// Checked: 1.5.97, 1.6.640, 1.6.659
target = REL::RelocationID(13647, 13755);
}
2023-12-21 11:41:08 +00:00
std::uint8_t code[] = { 0xB0, 0x00, 0xC3, REL::NOP };
REL::safe_write(target.address(), code, sizeof(code));
}
}