From 1d5d371aa943ab9c77e94267cf71a997371d297c Mon Sep 17 00:00:00 2001 From: hotline1337 Date: Wed, 13 Dec 2023 11:14:55 +0100 Subject: [PATCH] Fix WebClient Errors For Chinese Region --- R3nzSkin_Injector/Injector.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/R3nzSkin_Injector/Injector.cpp b/R3nzSkin_Injector/Injector.cpp index 46d781ca..c2a99ba1 100644 --- a/R3nzSkin_Injector/Injector.cpp +++ b/R3nzSkin_Injector/Injector.cpp @@ -147,6 +147,24 @@ void WINAPI Injector::enableDebugPrivilege() noexcept void Injector::autoUpdate() { + /* do not even bother if we are from Chinese regions */ + auto whitelisted_regions = gcnew array { + xor_clrstr_w(L"zh-CN"), + xor_clrstr_w(L"zh-TW"), + xor_clrstr_w(L"zh-HK"), + xor_clrstr_w(L"zh-MO"), + xor_clrstr_w(L"zh-SG") + }; + auto current_culture = CultureInfo::CurrentCulture; + auto region = current_culture->Name; + for each (auto whitelisted_region in whitelisted_regions) + { + if (region->Equals(whitelisted_region, StringComparison::OrdinalIgnoreCase)) + { + return; + } + } + auto client = gcnew WebClient(); ServicePointManager::Expect100Continue = true; ServicePointManager::SecurityProtocol = SecurityProtocolType::Tls12;