2023-12-11 00:43:01 +00:00
|
|
|
#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)) {
|
2024-02-29 21:24:50 +00:00
|
|
|
// Checked: 1.6.1130, 1.6.1170, 1.6.1179
|
2023-12-11 00:43:01 +00:00
|
|
|
target = REL::ID(441528);
|
|
|
|
} else {
|
2023-12-21 11:41:08 +00:00
|
|
|
// Checked: 1.5.97, 1.6.640, 1.6.659
|
2023-12-11 00:43:01 +00:00
|
|
|
target = REL::RelocationID(13647, 13755);
|
|
|
|
}
|
|
|
|
|
2023-12-21 11:41:08 +00:00
|
|
|
std::uint8_t code[] = { 0xB0, 0x00, 0xC3, REL::NOP };
|
2023-12-18 13:04:00 +00:00
|
|
|
REL::safe_write(target.address(), code, sizeof(code));
|
2023-12-11 00:43:01 +00:00
|
|
|
}
|
|
|
|
}
|