From 6282e439beff1311842b711e32e14acf494fc987 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Tue, 7 Sep 2021 03:22:52 +0200 Subject: [PATCH] Verify version --- src/client/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/client/main.cpp b/src/client/main.cpp index faf34028..6fee7ef4 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -90,6 +90,15 @@ void remove_crash_file() utils::io::remove_file("__h2Exe"); } +void verify_version() +{ + const auto value = *reinterpret_cast(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() { const utils::nt::library user32{"user32.dll"}; @@ -178,6 +187,7 @@ int main() } game::base_address = base_address; + verify_version(); if (!component_loader::post_load()) {