Verify version

This commit is contained in:
Federico Cecchetto 2021-09-07 03:22:52 +02:00
parent d7a873c13d
commit 6282e439be

View File

@ -90,6 +90,15 @@ void remove_crash_file()
utils::io::remove_file("__h2Exe"); utils::io::remove_file("__h2Exe");
} }
void verify_version()
{
const auto value = *reinterpret_cast<DWORD*>(game::base_address + 0x123456);
if (value != 0xE465E151)
{
throw std::runtime_error("Unsupported Call of Duty: Modern Warfare 2 Campaign Remastered version");
}
}
void enable_dpi_awareness() void enable_dpi_awareness()
{ {
const utils::nt::library user32{"user32.dll"}; const utils::nt::library user32{"user32.dll"};
@ -178,6 +187,7 @@ int main()
} }
game::base_address = base_address; game::base_address = base_address;
verify_version();
if (!component_loader::post_load()) if (!component_loader::post_load())
{ {