From fd792845ade11316c9aa5609391834c15d02deb2 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sat, 18 Feb 2023 10:57:14 +0100 Subject: [PATCH] Assert game is not running from a network share --- src/client/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/client/main.cpp b/src/client/main.cpp index 7527ca7f..e0669e2a 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -238,6 +238,18 @@ namespace static_cast((data.size() + 1u) * 2)); } + void validate_non_network_share() + { + const auto self = utils::nt::library::get_by_address(&validate_non_network_share); + const auto path = self.get_path().make_preferred(); + const auto wpath = path.wstring(); + if (wpath.size() >= 2 && wpath[0] == L'\\' && wpath[1] == L'\\') + { + throw std::runtime_error( + "You seem to be using a network share:\n\n" + path.string() + "\n\nNetwork shares are not supported!"); + } + } + int main() { if (handle_process_runner()) @@ -262,6 +274,7 @@ namespace try { + validate_non_network_share(); remove_crash_file(); const auto client_binary = "BlackOps3.exe"s;